Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
R

RossouwDB

@RossouwDB
About
Posts
28
Topics
9
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • java.lang.UnsatisfiedLinkError [modified]
    R RossouwDB

    Richard MacCutchan wrote:

    I don't see how this statement holds true;

    Your quite right. TestVC_OmniIDE was done using VC++, thus giving the pragma and namespaces.

    Richard MacCutchan wrote:

    it belongs to class TestProgram

    This seems to have been the problem. I have found a fix, thanks to your help. This is what I had done that resulted in the error I created this "TestProgam" to test everything out, and have immediately put the code into my big application (which is not TestProgram). This explained the error that I have received. After reading what you said above, I ran TestProgram.java and it worked. Now, I will convert this "TestProgram" to a class (or maybe a separate .jar) and use this within my big application, which should work. Thanks again for your help, it is much appreciated! Kind regards, Rossouw

    Java c++ java help announcement

  • java.lang.UnsatisfiedLinkError [modified]
    R RossouwDB

    I have included point 2 in my question (I accidentally omitted this when I was writing the question), but thanks for pointing that out. I should add that I used VC++ to create the header, which would explain the namespace and the pragma. Also, I have numerous packages inside this application, and I have read that you should make the package of the wrapper to be the same as your package, which is a bit confusing, since I have quite a lot of packages. PS, I have just now removed the System namespace, and still gives the same error as described in the question.

    Java c++ java help announcement

  • Analytics
    R RossouwDB

    To start of, write down: - What is it that needs to be analysed? - How/where will this information come from? - How does it need to be displayed, i.e., do you need graphs or charts, or is a simple spreadsheet sufficient - Who needs the information, this will indicate the level of analyses required, i.e., for a high level person, the information needs to be well analysed and formatted, if it is for auditing purposes, then you might not want to analyse the data at all (rather pass it on to the auditors and let them take care of it) - Is there a schedule required, or is it only once off? - How should the results be accessed, from the web, emailed, posted, etc. (You should probably dump the results in a pdf format, in which case you can have a look a iTextSharp - I love this library!!! - After you have received the results, does the person reading the results require it to be modified, i.e, If I change this value, what would the effects be in 5 years time? - How important is speed? This will be determined by when the analyses should be done, if it is a nightly batch job, then speed is not that important, anything else, speed is important. - The program itself, is a console application sufficient, or should it look pretty? If prettiness is a factor, look at WPF or Silverlight (depending on whether it is web-based, or standalone). This will also indicate the speed/performance. - Do you need additional hardware, such as a more powerful server that can take the processing punch This is all I can think of, but based on what you provided, this would be a good place to start. Based on your assessment - or, requirements analysis - you should then look at technology.

    Java tutorial java help

  • How to lock a folder
    R RossouwDB

    If you mean to lock a folder in such a way that nobody can gain access to the folder, then you need to look at JNI, since folder locking is handled by the operating system, and not by java explicitly. Think of it as setting up access rights to a folder F1 for person A, but not person B. So is B now attempts to open F1, a nice message and loud boom will announce that access is denied. This is done by the operating system. Have a look at JNI: Java Native Interface[^] Java Native Interface Tips[^] Java Native Interface: Programmer's Guide and Specification[^] Otherwise, if you meant "how to lock a file during editing", have a look at this: How can I lock a file using java (if possible)[^]

    Java java help tutorial

  • java.lang.UnsatisfiedLinkError [modified]
    R RossouwDB

    Good day, I am trying to get a third party DLL to work in java (FWIW, I am using Netbeans 7.0). I am aware that getting third party DLLS to work (especially if it's not a C/C++ type DLL), is not an easy feat, and that you should use JNI to accomplish this. Like you guys know, following the JNI path will result in a wrapper for your DLL, which is exactly what I need. I will provide my code for both the C++ section as well as the Java section, and then the error message I receive will follow that. Please do note: I used javah to create the header file (see below) for the java file below. TestVC_OmniIDE

    #include <windows.h>;
    #include <stdio.h>;
    #include "TestProgram.h"

    #pragma once

    using namespace System;

    namespace TestVC_OmniIDE {

    	BOOL WINAPI TestVC\_OmniIDEMain(HANDLE hHandle, DWORD dwReason, LPVOID lpReserved)
    	{
    		return TRUE;
    	}
    
    	JNIEXPORT void JNICALL Java\_TestProgram\_UpdateTextFile(JNIEnv \*, jclass)
    	{
    		printf("Hello world from VC++ DLL");
    	}
    

    }

    TestProgram.h

    /* DO NOT EDIT THIS FILE - it is machine generated */
    #include <jni.h>
    /* Header for class TestProgram */

    #ifndef _Included_TestProgram
    #define _Included_TestProgram
    #ifdef __cplusplus
    extern "C" {
    #endif
    /*
    * Class: TestProgram
    * Method: UpdateTextFile
    * Signature: ()V
    */
    JNIEXPORT void JNICALL Java_TestProgram_UpdateTextFile
    (JNIEnv *, jclass);

    #ifdef __cplusplus
    }
    #endif
    #endif

    TestProgram.java

    class TestProgram
    {
    public static native void UpdateTextFile();
    public static void main(String args[])
    {
    System.out.println("Hallo from main");
    }
    }

    Java Code to Call JNI Wrapper

    public class OmniText {
    static
    {
    System.loadLibrary("TestVC_OmniIDE");
    }

    public native void UpdateTextFile();
    

    }

    Here is where I call the native method

    OmniText omni = new OmniText();
    omni.UpdateTextFile();

    As you can see, this is only a test, but as soon as this will be successful, I will create a production version taking parameters and returning a value. I know that the wrapper can be found, because, if I change the name of the wrapper file, it tells me that the file cannot be found. Now for the error (which can be identified from the post subject):

    Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkErro

    Java c++ java help announcement

  • Could not find main class [modified]
    R RossouwDB

    TorstenH. wrote:

    This is no simple Java homework

    It's NOT HOMEWORK. It's a project I am working on...

    TorstenH. wrote:

    Netbeans should provide a functionality to export your project in a proper way.

    Clearly it's not always working so well, but I would still use NetBeans.

    TorstenH. wrote:

    There is no need to build some strange stuff

    Why not??? What isn't strange in live? Clearly you are.... So am I!

    TorstenH. wrote:

    That's time waisted

    No, actually it's not! I have learned something from this entire experience, so I would not say it's time wasted! **Note:**If you don't want to help people, and you want to attack them for some strange and peculiar reason, rather keep quiet! (Go read the guidelines: Insults, slap-downs and sarcasm aren't welcome. Let's work to help developers!)

    Java help csharp java sharepoint visual-studio

  • Could not find main class [modified]
    R RossouwDB

    Wait, what???? Dude, you ok? Did I say this is homework?????

    Java help csharp java sharepoint visual-studio

  • Could not find main class [modified]
    R RossouwDB

    I don't know how and why, but now everything is working!! I was typing away, and doing a clean + build like I normally do,and when I tried to run it again, it bombarded me with error messages indicating that a lot of my packages could not be found! Stumped, I cleaned and built it a couple of times, but failed miserably when I want to run it (really odd, since it was running successfully a couple of seconds ago.) So, I located the "broken" package, and renamed it to the package NetBeans expected. Cleaned and built it, ran it - it worked. So i though I might give executing the application a shot, and it worked! It's really odd though, since NetBeans should have complained right from the start, but for some reason, it didn't.:confused: Anyway, thanks for your help.

    Java help csharp java sharepoint visual-studio

  • Could not find main class [modified]
    R RossouwDB

    Richard MacCutchan wrote:

    running the command jar -tvf against the jar file that contains (or should contain) your main class

    Confirms that com. is not needed, and that my main class is contained within the OmniIDE.jar file.

    Richard MacCutchan wrote:

    Or you could execute the .jar file directly

    Does not work.

    Java help csharp java sharepoint visual-studio

  • Could not find main class [modified]
    R RossouwDB

    I have tried omitting it, but still doesn't work.

    Java help csharp java sharepoint visual-studio

  • Could not find main class [modified]
    R RossouwDB

    Richard MacCutchan wrote:

    -cp option followed by a list of .jar files is your classpath

    crud, I knew but forgot that! Now I follow :-O The omniide is my "main" package, and the omniIDEApp is the entrypoint of my application. Everything is spelled correctly since I have even copied it as is from my Manifest file, but to no avail. Here is the actual code for my entrypoint class:

    /*
    * OmniIDEApp.java
    */

    package omniide;

    import org.jdesktop.application.Application;
    import org.jdesktop.application.SingleFrameApplication;

    /**
    * The main class of the application.
    */
    public class OmniIDEApp extends SingleFrameApplication {

    /\*\*
     \* At startup create and show the main frame of the application.
     \*/
    @Override protected void startup() {
        show(new OmniIDEView(this));
    }
    
    /\*\*
     \* This method is to initialize the specified window by injecting resources.
     \* Windows shown in our application come fully initialized from the GUI
     \* builder, so this additional configuration is not needed.
     \*/
    @Override protected void configureWindow(java.awt.Window root) {
    }
    
    /\*\*
     \* A convenient static getter for the application instance.
     \* @return the instance of OmniIDEApp
     \*/
    public static OmniIDEApp getApplication() {
        return Application.getInstance(OmniIDEApp.class);
    }
    
    /\*\*
     \* Main method launching the application.
     \*/
    public static void main(String\[\] args) {
        launch(OmniIDEApp.class, args);
    }
    

    }

    This code is generated by NetBeans when the project is created. I am stumped as to the cause of this error! :wtf:

    Java help csharp java sharepoint visual-studio

  • Could not find main class [modified]
    R RossouwDB

    I'm not sure I am following... (Java isn't my strongpoint.) I don't set any environment variables myself, and I don't set any classpath myself either. I figured that the jar file (with the manifest and build file), would handle that for me.

    Java help csharp java sharepoint visual-studio

  • Could not find main class [modified]
    R RossouwDB

    Gerben Jongerius wrote:

    java -cp myjar.jar;mylib1.jar;mylib2.jar com.classpackage.MyClass

    Unfortunately this did not work. Here is my directory structure: -dist --OmniIDE.jar --lib ---AbsoluteLayout ---appframework-1.0.3.jar ---beansbinding-1.2.1.jar ---swing-layout-1.0.4.jar ---swing-worker-1.1.jar So I CMDd the following:

    java -cp OmniIDE.jar;lib\AbsoluteLayout.jar;lib\appframework-1.0.3.jar;lib\beansbinding-1.2.1.jar;lib\swing-layout-1.0.4.jar;lib\swing-worker-1.1.jar com.omniide.OmniIDEApp

    And the exception (all continuous):

    Exception in thread "main" java.lang.NoClassDefFoundError: com/omniide/OmniIDEApp

    TorstenH. wrote:

    Netbeans should have some "Extract Project" option.

    Unfortunately, no. There are two extract options: -Extract Interface -Extract Superclass Converting from NetBeans to Eclipse would not be an option though... Thanks, Rossouw

    Java help csharp java sharepoint visual-studio

  • Could not find main class [modified]
    R RossouwDB

    Good day, I have been battling with this for a while now, and have been at previous forums regarding this problem, all leading to non-working solutions. Note: I am using NetBeans IDE 7.0 and java 1.6.0_25 on a Windows XP SP 3 machine. I want to run the application without using the command line, although using the commandline gives me exactly the same error. I have tried numerous other forums, even consulting the java forums, but all to no avail. Most of the forums make mention about editing the build file, but not being a java guru (c# is more my thing), I have no idea what to do! (I am including my build.xml as well as the manifest.mf file which is contained within the .jar file for anybody who wants to have a peek at it.) When I run the application from within NetBeans, everything works fine. I thought that maybe something went wrong with my java installation, but (fortunately?) I had a BSOD, so I was forced to format my system, which then received a very fresh installation of NetBeans as well as java, but the error still remains. If you could help me, it would be much appreciated! Just ask if you need additional files or information, Kind regards, Rossouw EDIT: When I run the application from within NetBeans, it informs me that it cannot find some of my packages, but when I first build and clean it, and then run it, it runs fine. build.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <!-- You may freely edit this file. See commented blocks below for -->
    <!-- some examples of how to customize the build. -->
    <!-- (If you delete it and reopen the project it will be recreated.) -->
    <!-- By default, only the Clean and Build commands use this build script. -->
    <!-- Commands such as Run, Debug, and Test only use this build script if -->
    <!-- the Compile on Save feature is turned off for the project. -->
    <!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
    <!-- in the project's Project Properties dialog box.-->
    <project name="OmniIDE" default="default" basedir=".">
    <description>Builds, tests, and runs the project OmniIDE.</description>
    <import file="nbproject/build-impl.xml"/>
    <!--

    There exist several targets which are by default empty and which can be 
    used for execution of your tasks. These targets are usually executed 
    before and after some main targets. They are: 
    
      -pre-init:                 called befo
    
    Java help csharp java sharepoint visual-studio

  • programming
    R RossouwDB

    Recognition comes with experience: The more you do, the more you know, the more you know, the more opinionated you become, the more opinionated you become, the more knowledgeable you become, and then after that, you become recognized. In South Africa - if everything works out perfectly - you can become a doctor at the age of 26: - Start studying at 18 - Finish your BSc degree at 21 (3 year course) - Finish your Hons degree at 22 (1 year course) - Finish your Masters degree at 24 (2 years) - Finish your PhD degree at 26 (2 year course - if everything goes perfectly) But, you still won't get recognition until you have gained the sufficient amount of experience, which might take between 10 and 20 years. I'm at university, studying BSc IT, a nice course since they teach you not only computer science, but also a bit of math and business aspects, which gives a well rounded IT degree. I must admit, about 80 - 90% of what I know about programming is self taught, the rest comes from university. A waste of money? No, it gives you good exposure of what happens in the IT industry and *forces* you to do some research in the field. I wrote a couple of stuff throughout my years (my first programming done in Pascal way back in 2003), but I know that I still have a lot more to learn. When you start with your first big project - like the one I am busy with now as part of the course I am studying, you learn a lot of stuff very quickly, since time is not a lot, and your fighting to pass and get distinctions. If I were you, I would find a school that would keep me motivated and interested. Worried about the money? Don't be, get a loan - I'm speaking with SA knowledge - and study. Luckily IT is a well paying field, so you will pay of you debt in about 2 to 3 years.

    The Lounge com game-dev help question announcement

  • Joining columns from two tables into one column
    R RossouwDB

    Puurrrrrrfect! :thumbsup: Thanks a lot! (Note, column1 should have been column2), but nevertheless, it works beautifully! :-D :-D :-D Enjoy the rest of the day Rossouw

    Database database

  • Joining columns from two tables into one column
    R RossouwDB

    Good Day, I wonder if it is possible to joins two columns from two tables (ie column 1 from table A and column 2 from table B) into one column. Here are my tables (note that the columns from both the tables have the same names) TableA

    ----------------------
    |Column1 | Column2 |

    | aaaa | 12345 |

    | bbbp | 12245 |

    | ccc | 12245 |

    TableB

    ----------------------
    |Column1 | Column2 |

    | asd | 12245 |

    | bbb | 12245 |

    | ddd | 12245 |

    The first part of my SQL statement combines the two columns of each table into one column in each table, thus TableA

    ------------------
    |Column3 |

    | aaa : 12345 |

    | bbbp : 12245 |

    | ccc : 12245 |

    TableB

    ------------------
    |Column4 |

    | asd : 12245 |

    | bbb : 12245 |

    | ddd : 12245 |

    Now, what I want to do is to combine these two columns into one column. The SQL statement below gives me the following result Result :sigh:

    ------------------------------
    | Column 1 | Column2 |

    | bbbp : 12245 | asd : 12245 |

    | bbbp : 12245 | bbb : 12245 |

    | bbbp : 12245 | ddd : 12245 |

    | ccc: 12245 | asd : 12245 |

    | ccc: 12245 | bbb : 12245 |

    | ccc: 12245 | ddd : 12245 |

    What I want is this : :confused:

    ----------------
    | Column1 |

    | bbbp : 12245 |

    | ccc: 12245 |

    | asd : 12245 |

    | bbb : 12245 |

    | ddd : 12245 |

    Here is my SQL statementSELECT TableA.Column1 + ' : ' + TableA.Column1 AS Column3, TableB.Column1 + ' : ' + TableB.Column2 AS Column4 FROM TableA FULL OUTER JOIN TableB ON TableA.Column1 = TableB.Column1 WHERE (TableA.Column1 IN (SELECT Column1 FROM TableA WHERE (Column2 = '12245'))) AND (TableB.Column1 IN

    Database database

  • Visual Studio 2010 WPF and ListBoxes
    R RossouwDB

    Good day, I wan't to ask something that is obvious to do in VS 2005 and VS 2008 (WPF), but for some reason, I am struggling my but of in VS 2010 (WPF). :wtf: I want to dynamically load items into a ListBox, but for some reason it does not want to show up in the ListBox, they are there (I perform a count on the ListBox, and it shows the expected number). Here is how I do it: First of, I add an item like this: this.lstItems.Items.Add(OtherStackPanel(temp));, where OtherStackPanel is a function that returns a populated stackpanel, with the following items: 1 x Label, 1 x TextBox, 1 x ComboBox, 3 x Seperator, 1 x Slider, which look as follows

    __________________________________________________________________________
    | | | | | | | |
    |ComboBox | Seperator | Label | Seperator | TextBox | Seperator | Slider |
    |__________|___________|_______|___________|_________|___________|________|

    This would then be added to the ListBox, all the items in the StackPanel are set to be visible, and they have a parent since they are added to the StackPanel. After I have added the StackPanel, I call the LayoutUpdated event of the ListBox, to make sure that they are contained in the ListBox, but I also add two addisional items from within this eventhandler, as follows:

    private void listBox1_LayoutUpdated(object sender, EventArgs e)
    {
    if (sender != null)
    {
    ListBoxItem l = new ListBoxItem();
    l.Content = "S";
    ListBoxItem n = new ListBoxItem();
    n.Content = "A";
    ((ListBox)sender).Items.Add(l);
    this.lstItems.Items.Add(n);
    MessageBox.Show(((ListBox)sender).Name);
    MessageBox.Show(Convert.ToString(((ListBox)sender).Items.Count));
    }
    }

    ((ListBox)sender).Name returns ListBox, which is correct, since the item passed to this event is that listbox, and ((ListBox)sender).Items.Count returns 3, which is correct, since I have added the StackPanel, "S" and "A", but for some odd reason, I cannot see the items in the ListBox. I have tried this.lstList.Items.Insert(0, "S"), but to no avail! If you could provide a possible solution, I would really appreciate it (I don't know why it is so much different than VS 2008 WPF). :confused: I am using Windows 7 Ulitmate. Kind Regards, Rossouw :)

    WPF csharp visual-studio wpf

  • Error 1053 with subversion and windows XP service
    R RossouwDB

    Good day, I am trying to set up a subversion and windows service, but I keep on getting an 1053 error (along the line of "cannot start the service in a timely fashion"). I have tried the approaches on the net, but I get the same error, regardless of all my efforts. Below are the approaches that I took: I have tried: sc create snservice binpath= "C:\Program Files\subversion\bin\svnserve.exe --service --root C:\Documents and Settings\User\Desktop\Repository" displayname= "Subversion" depends= tcpip start= auto And: sc create snservice binpath= "\"C:\Program Files\subversion\bin\svnserve.exe" --service --root C:\Documents and Settings\User\Desktop\Repository" displayname= "Subversion" depends= tcpip start= auto And: sc create snservice binpath= "C:\Program Files\subversion\bin\svnserve.exe --service --r C:\Documents and Settings\User\Desktop\Repository" displayname= "Subversion" depends= tcpip start= auto And: sc create snservice binpath= "C:\Program Files\subversion\bin\svnserve.exe --service C:\Documents and Settings\User\Desktop\Repository" displayname= "Subversion" depends= tcpip start= auto And: sc create snservice binpath= "C:\Program Files\subversion\bin\svnserve.exe --daemon--root C:\Documents and Settings\User\Desktop\Repository" displayname= "Subversion" depends= tcpip start= auto And: sc create snservice binpath= "C:\Program Files\subversion\bin\svnserve.exe --daemon --r C:\Documents and Settings\User\Desktop\Repository" displayname= "Subversion" depends= tcpip start= auto And: sc create snservice binpath= "C:\Program Files\subversion\bin\svnserve.exe --daemon C:\Documents and Settings\User\Desktop\Repository" displayname= "Subversion" depends= tcpip start= auto Since the repository and the svnserve.exe are on the same drive, the --root or -r option is not necessary. - I am using tortoiseSVN and tigres subversion. - C:\Documents and Settings\User\Desktop\Repository is where my repository is located. - I have been told to use the command prompt environment, and not the GUI environment, but if you could help me to set up the subversion using the GUI, I would appreciate it. Otherwise, if you could help me to set up the subversion using the command prompt environment, I would highly appreciate it, as I struggle to find a solution to the 1053 error. I am using windows XP SP2, and I am not supporting the idea of installing SP3, as I have already done so, leading me to repair my laptop, as it completely buggered up my laptop. Kind regards, Rossouw :)

    IT & Infrastructure help workspace

  • MS Word and VB Webservices
    R RossouwDB

    Good day all, I currently have a VB Webservice that opens, edits and saves an MS Word 2003 document via impersonation (my code is below, for those searching for impersonation techniques). Everything works fine, what I would like to know is if there is a better way of manipulating an MS Word 2003 document without using impersonation? Due to security reasons, I am hoping to find a better way of approaching this. I would highly appreciate it if you could help me out on this (if it is even possible!) Thanks a lot Rossouw de Bruin Code: ' Values used by the LogonUser function's logonType parameter Public Enum LogonType LOGON32_LOGON_INTERACTIVE = 2 LOGON32_LOGON_NETWORK = 3 LOGON32_LOGON_BATCH = 4 LOGON32_LOGON_SERVICE = 5 LOGON32_LOGON_UNLOCK = 7 LOGON32_LOGON_NETWORK_CLEARTEXT = 8 LOGON32_LOGON_NEW_CREDENTIALS = 9 End Enum ' Values used by the LogonUser function's logonProvider parameter Public Enum LogonProvider LOGON32_PROVIDER_DEFAULT = 0 LOGON32_PROVIDER_WINNT35 = 1 LOGON32_PROVIDER_WINNT40 = 2 LOGON32_PROVIDER_WINNT50 = 3 End Enum Declare Function LogonUser Lib "advapi32.dll" Alias "LogonUserA" ( _ ByVal username As String, _ ByVal domain As String, _ ByVal password As String, _ ByVal logonType As LogonType, _ ByVal logonProvider As LogonProvider, _ ByRef token As IntPtr _ ) As Integer Public Sub LetterTemplate() Dim username As String = "username" Dim domain As String = "domain" Dim password As String = "password" ' A handle to the user who will be impersonated Dim token As IntPtr ' Log the user into Windows. Dim bLogonSuccessful As Boolean = Convert.ToBoolean( _ LogonUser( _ username, domain, password, _ LogonType.LOGON32_LOGON_NETWORK, _ LogonProvider.LOGON32_PROVIDER_DEFAULT, token)) If Not bLogonSuccessful Then "Return someth

    Visual Basic algorithms security help question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups