Wednesday, 15 June 2011

java - Get netbeans to run my project with sudo? -


I am working on a project in Netbeen for which the running project requires root privilege.

I want every time that I push the "Run Project" (F6), my project is run as root, so with the equivalent of "Geckado Javac Maine" Because there is a GUI in it.

One option is to start with NetNeans with root privileges, easily by editing the shortcut "Gaxdo Netbeen". But as I have many projects in Netbeen, this means that for every project I should run Netbeen with basic rights, this is not what I need.

Another option, of course, just open my project, but it is not ideal either.

I think these projects are possible by changing the build.xml file, but I am having trouble finding out how

after some research it would seem that this An Apache ant question is, I have access to build.xml, which I can modify so that I need to know how ant can sudo / gksudo your project However, I can not understand how to do this or if it is possible.

It is believed that a "Java SE" project (such as a web app or Ruby First, stop compiling on Save as a compilation in Project Properties

Second, add build.xml to:

  Lt; Target name = "-init-macrodef-java" & gt; & Lt; Macrodef name = "java" uri = "http://www.netbeans.org/ns/j2se-project/1" & gt; & Lt; Attribute default = "$ {main.class}" name = "classname" /> & Lt; Attribute default = "$ {run.classpath}" name = "classpath" /> & Lt; Element name = "customize" option = "true" /> & Lt; Sequential & gt; & Lt; Exec executable = "gksudo" failonerror = "true" & gt; & Lt; Arg value = "-" /> & Lt; Arg value = "java" /> & Lt; Arg value = "- classpath" /> & Lt; Arg path = "@ {classpath}" /> & Lt; Arg line = "$ {run.jvmargs}" /> & Lt; Arg value = "@ {classname}" /> & Lt; / Executive & gt; & Lt; / Sequential & gt; & Lt; / Macrodef> & Lt; / Target & gt;  

There are other things that you can fix but you should be enough to get it started.


Trouble using CollectionViewSource in Silverlight -


I'm having some trouble executing collection ViewSource in SilverView. I'm new to this topic, so basically I Want to search through the web? Even I am trying to do this.

I am creating collection ViewSource in the resource tag:

  & lt; UserControl.Resources & gt; & Lt; CollectionWeasource x: key = "testcvs" & gt; & Lt; CollectionViewSource.SortDescriptions & gt; & Lt; Scm: sorted descriptions property name = "value" direction = "ascend" /> & Lt; /CollectionViewSource.SortDescriptions> & Lt; / CollectionViewSource & gt; & Lt; /UserControl.Resources>  

Then I am binding my TestCVS in a HierarchicalDataTemplate:

   & Lt; Roadfinition /> & Lt; /Grid.RowDefinitions> & Lt; Grid.ColumnDefinitions & gt; & Lt; Column width = "Auto" /> & Lt; Column width = "*" /> & Lt; /Grid.ColumnDefinitions> & Lt; StackPanel Orientation = "Horizontal" Horizontal Alignment = "Left" & gt; & Lt; TextBlock TextWrapping = "Wrap" text = "{MyClassField binding}" /> & Lt; / StackPanel & gt; & Lt; / Grid & gt; & Lt; / Border & gt; & Lt; / Common: HierarchicalDataTemplate & gt; & Lt; / Common: HierarchicalDataTemplate.ItemTemplate & gt; & Lt; / Common: HierarchicalDataTemplate & gt;  

Now, in the back code, I am specifying the source of test CVS in an asset such as:

  Private Observation Collection & lt; MyClass & gt; _my class; Public Supervision Collection & lt; MyClass & gt; MyCalus {_MyClass;} set {var testCVS = (this is the "Resource [" testcvs "] collection as a collection); if (testCVS! = Tap) testCVS.Source = value;}}  

After checking it, I realize that the information is not being displayed on the screen and I do not really know how anyone can help me in this matter?

Hope Thank you in advance!

I do not think you want to reset the source You need to use it.TestCVS = CollectionsViewerGet default view (my collection); Add a completed event and then add and remove it from myCollection You get notification of free changes with the freezingclass. Has not been fully tested, but should work in principle.

EDIT: It has been found that GetDefaultView is not present in Silverlight Only WPF I have used PagingCollectionView (myCOllection) successfully for grouping.


python - Can I find all of a certain base model in App Engine? -


Looking at a class-like relationship:

  Class A (DB model): Pass Class B (A): Pass  

Can I get all the base classes? Query:

  models.A.all (). Fetch (1)  

returns an empty list.

Datastore has not supported this kind of polymorphism - but you can use it to do this You can. Instead of the model, the successor from Polymodel and things will behave as much or less as you would expect.


version control - heroku using git branch is confusing! -


OK, so I have a big github project that I do not want to merge my small stasa branch. However, it appears that Heroku only takes the Master forward seriously. It seems that I pushed my branch, but for example if I have a branch, then it works like there is no code on the server. I can not be established since my gem My file is in my branch.

Actually I do not even want to know Heroko that there is a master. I just want to use my exam Stacia branch but it is ignoring my local branch. Is there any way of doing it? And again, I do not want to write anything on the main Github repository (EEK!), But it is okay if I had my branch on both the master and my branch and merged them there.

I am a total GIT newbie (not less on windows) so please stand by me.

The first step is to make sure that you have leased your local branch to the top of your master (value Take that it is in your repo 'Main Guitars')

  git fetch mainGitHubRepo master git checkout -b mainGitHubMaster mainGitHubRepo / master  

then return to your branch Go back and play it again at the top of the Main GlitzHost:

  git checkout Stacia git rebase mainGitHubMaster  

As mentioned in the comment, Branch do not need to make major Githbstr : You can rebase directly on top of fetching branch.

  git checkout Stacia git rebase mingithubreppo / master  

After that, you push your C, and then make one.

To proceed with a local branch in an established branch, you just need to use:
git push REMOTENAME BRANCHNAME .
If you do not want to use the same name on the remote branch, you can use it:
git push REMOTENAME LOCALBRANCHNAME: REMOTEBRANCHNAME .

(which is outlined in: git has pushed its OQ Branch: Master ) NOTE: If you have GitHub If you have your thorn, you can work directly on 'Master' for this fork, which means that your bridge request will have to come from the 'Master' branch, which enhances your possibilities.
But the above process remains valid: for your bridge request, which will integrate your changes, there should be trivial merge, so the rebase phase is created locally.


java ee - Some questions for j2me -


I have some questions that always make me very confused.

(1) Why do we install J2me, first we have to install jdk? [For my understanding, they are free 2 versions, one is embedded, another is for desktop application)

(2) How to install J2 AME environment in phone or embedded device? Do we need to first install JDC? (It seems that JDK can not be installed on the phone and embedded device).

(3) What is the relationship between J2ME, J9, Phonema, JMVM? When using them in an embedded device, the pre-requirements also are JDK? (Do you have to first install JDK?)

Thank you very much!

A very raw profile ...

  1. You need JDK to compile Java code - J2mm provides an API for your app, but no compiler.

  2. Your target device will come with a JVM and J2ME environment, so there is no need to worry about this directly as a developer.

  3. I think you have two questions here: you do not need JDK on target device; Only when your app compiles but see 1. - You need JDK to compile your app.

and VMs I'm not familiar with; Hopefully others will also have chip.

Especially. (Especially.) Also see related questions on the right side of this page.


actionscript 3 - high performance encryption in adobe air / flash -


project while searching for class / function related to encryption in Action Script / Air / Flash.

This provides an option v. Good choice, but I'm a little worried about what it means to present numbers when they are used to decrypt a local media file when it is chosen about the choice.

I'm looking for security vs. performance balance

For video / music , decode it faster So that the player uses Run it easily - which is depending on the format , but in all cases delay waiting to decode the whole file is less than.

The hardest part comes from using it for flash apps also because afaik do not wait to do anything Unless this assumption is incorrect, this is the place where as3crypto page looks the best performance algorithm in the list very slow i.e. 1.5 MB x seconds, to understand the meaning of 20 seconds 30 MB flash app for .

The main question is with me:

  • Is there any other other libraries with high performance? Can anything happen in Adobe Air?
  • For videos / songs , what would be a good number of MB x seconds for to be playable
  • Totally waiting until a flash app is loaded before it runs anything?

I'm curious what encryption you are using symmetric or asymmetric crypto? In the case of asymmetrics, try switching to symmetrical.

In the case of symmetry, use a stream cipher (RC4, or other flavor, Google for the name only), as the name indicates that you can encrypt / decrypt in streams This caters to your needs, as far as I am reminded that the RC 4 gives the best performance of most stream ciphers (still used in WEP and WPA1)

Another option In ECB (Electronic Code Book) mode Using Odk is used to encrypt each block of I 64/128/192/256 bits / decrypt, so it makes you able to partially encrypt / decrypt. Note that ECB mode is less secure than normal CBC (chain block cipher) mode, but here you can completely encrypt / decrypt content.

BTW, note that I can not give you any information on the performance of these algorithms, but I think you can benchmark it.


Instruct WCF Service to return JSon -


I want to know that the WCF Web services return JSON data by default. And if any JSON can not back I can configure the most simple WCF web service.

Thanks in advance.

The easiest way I know is that the VS with WCF "AJX-enabled WCF service" template . In service (I VS 2008). This will give you boilerplate code for JSON-enabled WCF service.

Objects that take the form of logic and returns should be marked with the [datacentrite] attribute, and each property that you want to include in the JSON serialization marked with [datamember] And should have a waiter and setter (even if the setter does nothing).