JarOutputStream creating a 'bad' jar - jar

http://pastebin.com/qrSCZw3y
I made that so I can create jars whenever I want by doing:
Builder jarBuilder = new Builder("jarname.jar");
jarBuilder.createNewFile();
But, whenever I do that, it creates a jar, and when I click on the jar, I get this message:
http://i.imgur.com/SvPZcZv.png
I want the generated jar to say something like "Hello world" or whatever I define.
Please help me, as I've searched all across the internet, but there were no video tutorials, and the documentations that I found online didn't help me much either.
Thank you,

I know how to create a .jar file, but I don't know how to make it have custom settings user defined from my jframe.

Related

Azeroth core, move custom spell to correct class/spec tab of the spell book rather than general

I'm fairly new. I've created a new spell in stoneharry exported both dbc and patch successfully. I want to move this spell under the correct class/spec section of the spellbook rather than the general tab.
I've tried adding a line to skilllineability.dbc with spell and correct flags for what I want but I can't get it to change in game. I've exported the dbc into my folder for the server and also tried exporting the mpq into the client files (Using WDBX), nothing ever changes. Can someone point me in the right direction or maybe a tutorial how to accomplish this?

KDE Taskbar Progress

I am trying to show a progress in the taskbar of the plasma desktop using the KDE Frameworks. In short, it want to do the same thing as dolphin, when it copies files:
I'm kinda stuck, because I don't even know where to get started. The only thing I found that could be useful is KStatusBarJobTracker, but I don't know how to use it. I could not find any tutorials or examples how to do this.
So, after digging around, and thanks to the help of #leinir, I was able to find out the following:
Since Plasma 5.6 KDE supports the Unitiy DBus Launcher-API, which can be used, for example, to show progress
I found a post on AskUbuntu that explains how to use the API with Qt
The real problem is: This only works, if you have a valid desktop file in one of the standard locations! You need to pass the file as parameter of the DBus message to make it work.
Based on this information, I figured out how to use it and created a GitHub repository, that supports cross platform taskbar progress, and uses this API for the linux implementation.
However, here is how to do it anyways. It should work for KDE Plasma and the Unity desktop, maybe more (haven't tried any others):
Create a .desktop file for your application. For test purpose, this can be a "dummy" file, that could look like this:
[Desktop Entry]
Type=Application
Version=1.1
Name=MyApp
Exec=<path_to>/MyApp
Copy that file to ~/.local/share/applications/ (or wherever user specific desktop files go on your system)
In your code, all you need to do is execute the following code, to update the taskbar state:
auto message = QDBusMessage::createSignal(QStringLiteral("/com/example/MyApp"),
QStringLiteral("com.canonical.Unity.LauncherEntry"),
QStringLiteral("Update"));
//you don't always have to specify all parameters, just the ones you want to update
QVariantMap properties;
properties.insert(QStringLiteral("progress-visible"), true);// enable the progress
properties.insert(QStringLiteral("progress"), 0.5);// set the progress value (from 0.0 to 1.0)
properties.insert(QStringLiteral("count-visible"), true);// display the "counter badge"
properties.insert(QStringLiteral("count"), 42);// set the counter value
message << QStringLiteral("application://myapp.desktop") //assuming you named the desktop file "myapp.desktop"
<< properties;
QDBusConnection::sessionBus().send(message);
Compile and run your application. You don't have to start it via the desktop file, at least I did not need to. If you want to be sure your application is "connected" to that desktop file, just set a custom icon for the file. Your application should show that icon in the taskbar.
And thats basically it. Note: The system remembers the last state when restarting the application. Thus, you should reset all those parameters once when starting the application.
Right, so as it turns out you are right, there is not currently a tutorial for this. This reviewboard request, however, shows how it was implemented in KDevelop, and it should be possible for you to work it out through that :) https://git.reviewboard.kde.org/r/127050/
ps: that there is no tutorial now might be a nice way for you to hop in and help out, by writing a small, self contained tutorial for it... something i'm sure would be very much welcomed :)

Prevent Atom Editor from auto creating files

at the moment I try to experiment a little bit with Atom for writing an API documentation with RAML. Everything works fine but one damn thing:
Everytime I type some file paths (e.g. !include schemas/file.schema Atom auto creates the file when I'm not quick enough with typing. So, in some cases I have a hole bunch of file-zombies in my schema folder. That's kind of annoying.
My setup is standard Atom on MacBook, with api-workbench plugin, which includes linter as well. I already had a look at all those settings concerning auto completion - nothing found there. Also, Google doesn't show any hints. Any Tips?
Best regards,
Chris
It looks like this is a defect in the api-workbench package:
Api workbench creates new schemas, while i type their paths. For example below, i can see two-three files created while i type full name:
E.g:
schemas:
- myschema: !include schemas/myschema.json
Will create following files:
schemas/my
schemas/mysche
schemas/myschema
schemas/myschemas.json - this file is existing, i've created it before. all other files are redudant and i have to delete them.
Bug is not reproduced with examples, which i can also include in my document. Having issues while edition RAML 0.8 files.
If you want to help the package maintainers fix the defect, can I suggest you put together a minimal but complete example that reproduces the issue, this will make it easier for them to identify and resolve the issue.

Android : importing ShowcaseView with gradle but can't import its library as module

Hello my teacher and masters, I appreciate your time for reading this known issue, I really do.
I respect Google by Android and everthing. This gradle thing, instead, all of problem coming back to gradle. Anyway, since we are not allowed to ask in other question and since I did a lot of search in this 3 days with no success for now by Showcase View. Here is my problem:
First I found out this solution (answer by AndyGable), and tried to follow his tutorial, but here is my problem:
First question is, what exact folder of Showcase library (I want the name) should I put in which folder of project? I assume that the destination folder is app\lib of my project. Here are the pictures.
Second question:
How can I add showcase library to my project? Unfortunately, all tutorial was not brief and explained for amateurs, even one above. I want to know the steps like you give it to dummy for android studio 0.8.xx.
full version picture for detail (just in case) here
I tried these steps:
Open project structure > hit dependency > hit + .. and here is stuck. In the above picture I show how my project, setting.gradle, and other things are.
And one other thing:
I decided to avoid "2 - Add the showcase directory as a module to your project." step and followed others :
"3 Change your app's build.gradle file to include:
dependencies {
compile project(':libraries:showcase')
}
and so on and now I have showcase library included in my dependency but getting the error shown in the picture above: configuration with name 'default' not found!!!
I am really tired and this transparent activity is inevitable for me. Appreciate all of you as my brothers teachers and real masters. I just want to use this library in my project.
after asking and researching every nook and cranny TheLiTTle my good frend in xda-developer (BILLyTheLiTTle nick name in github ) give me a showcase that works like a charm now without any problem .. thanks to "amlcurran "for awesome free source saved me .
if someone want implement showcase on android studio and can't import it to gradle build system here i found fully working showcaseview , i was so confused and sad before i found this and now i really feels happy , hope it help you my friend reading my post .
you can download it here and open it with studio Gradle build system .
https://github.com/amlcurran/ShowcaseView
also again great thank to billytheLittle , there is more detail of showcaseview working . his work and all code is available to you guy need to see codes in detail , you can fork it if you like for sure :
https://github.com/BILLyTheLiTTle/Sepals/commit/056dc80dc0bcc3e235a46fd7dd6253487d676a04

Drupal: getting attached files from nid and field name

In Drupal 7.x, given a nid and a file field name, I'm trying to get the files (as $fid or objects) which have been uploaded as file attachments to that node.
Drupal will populate the uploaded files only when they are set as "displayed" but I need to do this for all the files of that field, no matters how they display setting is.
I've spent quite some time investigating into this but the new d7 file api looks pretty obscure from a documentation and code point of view. IMHO, too much "drupal magic" happening there for a fast understanding.
Any pointer to good documentation and/or suggestion on the solution greatly appreciated.
Thanks.
Although your question seems a little unclear to me, but according to me:
you want to get all the files attached to a node. Just do $node = node_load($nid); and then check your $node->field_name['LANGUAGE_NONE'/lang code]
This will give you an array of files uploaded using that filefield.
Thanks

Resources