Saturday, 15 June 2013

java - Trouble with Swing components -


I'm getting a bunch of errors in Java, I do not know where to start from I'm new to GUI programming And you will appreciate any help you can provide or even press any tube in the right direction.

Here is my current code:

  // DebugFourteen2 // Displays a list of payment options // - using credit card, check or cash / each Shows charges for - 5%, 2% or 0% import javax.swing. *; Import java.awt. *; Import java.awt.event. *; Public class Debug Forbah 2 applies to Juffrum Item Listener {Flow Layout Flow = New Flow Layout (); JComboBox payMethod = New JComboBox (); JAlabel Peleste = new JLABEL ("pay list"); JTextField totFees = new JTextField (25); String pctMsg = new string ("percent will be added to your bill"); Int [] Fees = {5, 2, 0}; Int FPTT = 0; String output; Int fee = 0; Public Zero DebugFourteen2 () {super ("pay list"); SetDefaultCloseOperation (JFrame.EXIT_ON_CLOSE); SetLayout (flow); PayMethod.addItemListener (); Adding (payList); Add (payMethod); Pamthip.editem ("credit card"); PayMethod.addItem ("check"); PayMethod.addItem ("cash"); (TotFees); } Public static zero main (string [] argument) {JFrame cframe = new DebugFourteen2 (); Cframe.setSize (350, 150); Cframe.setVisible (true); } Public Zero ItemState Changel (Object Extension List) {Object Source = list.getSource (); If (source = payment) int fees = paythipat Selected Index (); FeePCT = fees [x]; Output = feature + + + + + pctMsg; TotFees.setText (production); }}  

There you go, it compiles and you can run it (Use my code below): OUTPUT:

Enter image details here < / P>

You are so many mistakes .. (This is probably a homework that asks you to fix this code which does not compile):

1) ">` ` In line, no Java code can compile this line

2)

  payMethod.addItemListener ();  

to < Code > PayMethod.addItemListener (this); or the listener has not worked in Java.

3) FePTty = fees [x]; should be converted to feePct = fees [fees]; because your code is not easily x .

4) < Strong> ` on the last line .. Any Java program will ever run at the end of any class of this class ...

5) @ Tom has mentioned in his comment, Incorrect and unnecessary int fee = pa YMethod.getSelectedIndex (); You int charges = 0; have already been declared (and can not do this because it is a mistake) Reclaim it as int fee = payMethod.getSelectedIndex (); .. just fee = pay-mathidet Selected Index (); is sufficient

  // debugoforin 2 // display list payment option // - shows the charge for the use of each credit card, check or cash / - 5%, 2 % Or 0% import javax.swing *; Import java.awt. *; Import java.awt.event. *; Public Class Debug Forbah 2 applies to Juffrum Item Listener {Flow Layout Flow = New Flow Layout (); JComboBox payMethod = New JComboBox (); JAlabel Peleste = new JLABEL ("pay list"); JTextField totFees = new JTextField (25); String pctMsg = new string ("percent will be added to your bill"); Int [] Fees = {5,2,0}; Int FPTT = 0; String output; Int fee = 0; Public debugging 2 () {// super ("pay list"); SetDefaultCloseOperation (JFrame.EXIT_ON_CLOSE); SetLayout (flow); PayMethod.addItemListener (this); Adding (payList); Add (payMethod); Pamthip.editem ("credit card"); PayMethod.addItem ("check"); PayMethod.addItem ("cash"); (TotFees); } Public static zero main (string [] argument) {JFrame cframe = new DebugFourteen2 (); Cframe.setSize (350, 150); Cframe.setVisible (true); } Public Zero ItemState Changel (Object Extension List) {Object Source = list.getSource (); If (source == pay-meth) fee = pemthipant Sejeted Index (); FeePCT = fee [fee]; Output = feature + + + + + pctMsg; TotFees.setText (production); }}  

c++ - What guarantees that a weak relaxed uncontended CAS loop terminates? -


निम्न उदाहरण कोड (paraphrased snippet) देता है:

  जबकि (! Head.compare_exchange_weak (New_node- & gt; अगला, new_node, std :: memory_order_release, std :: memory_order_relaxed)); // रिक्त बॉडी  

मान लीजिए कि आप इसे थ्रेड ए पर एक बार चलाते हैं, और थ्रेड बी पर एक बार। कुछ भी नहीं head को छू रहा है या इसके संबंधित डेटा थ्रेड बी की आवाज़ A के होने के बाद शुरू होती है (वास्तविक समय में), लेकिन ए के परिवर्तन अभी CPU चलाने वाले थ्रेड बी के कैश के लिए प्रचारित नहीं हुए हैं।

बी को प्राप्त करने के लिए ए के परिवर्तन क्या हैं? इसका अर्थ यह है कि, निष्पादन जहां बी की कमजोर तुलना करें विनिमय आसानी से अनिश्चित काल में विफल हो जाता है और CPU कैश के बावजूद अभी भी बाध्य नहीं है? या क्या इसकी अनुमति है?

ऐसा लगता है कि सीपीयू चलने वाली बी को ए के द्वारा किए गए परिवर्तनों में बाहर जाने और समन्वयित करने के लिए मजबूर नहीं किया जा रहा है, क्योंकि विफलता स्मृति क्रम सुगम है। तो हार्डवेयर कभी ऐसा क्यों करता है? क्या यह सी ++ कल्पना, या हार्डवेयर की एक गहन गारंटी है, या एक मानक दस्तावेज गारंटी वाली सीमा-स्टेलिनेस की गारंटी है?

अच्छा सवाल! यह वास्तव में विशेष रूप से सी ++ 11 मानक के §1.10 में धारा 25 द्वारा संबोधित है:

एक कार्यान्वयन को यह सुनिश्चित करना चाहिए कि एक परमाणु या सिंक्रनाइज़ेशन ऑपरेशन द्वारा नियत अंतिम मूल्य (संशोधन क्रम में)

तो उत्तर हां है, अंततः दूसरे धागे से प्रचार करने की गारंटी दी जाती है, यहां तक ​​कि आराम मेमोरी क्रम के साथ भी।


Construct SAS dataset based on file containing metadata -


I have two text files that have no headers and some other column names and length raw data. I want to use these two files to create the same SAS dataset, which will include data from one file to another column name and length.

The file containing the data is a fixed-width text file. That is, each column of data is aligned with a special column of the text file, which has a pad with spaces to ensure alignment.

datafile.txt:

  John has a 37 favorite books via children, Sally 29 is an astronaut bill 60 drink coffee  
< P> The file containing the metadata is tab-delimited with two columns: one in the data file with the name of the column and the length of the character of that column. Names are listed in the order in which they appear in the data file.

/ P>
  names | Age Comments ------- + ------ + ----------------- John | 45 Will kill two children. 37 | Selection of books Sally | 29 | Is an astronaut bill 60 | Drink coffee  

I have to keep the every column as a character with the length specified in the metadata file.

A better way should be to create a length statement and an input statement by using imported metadata from my inexperienced approach such as: < / P>

  / * import metadata * / data meta; Length colname $ 50 collen 8; Infile 'C: \ Metadata .txt' DSD DLM = '09 'x; Input column $ collen; Run; / * Create LENGTH and INPUT statements / data_null_; Length lenstmt inptstmt $ 1000; Linstat aptmt "collart 1; Set meta end = eof; Call catux ('', lenestat, column, '$', colen); Call catx ('', apststmt, cats ('@', callstart), column, '$ & amp;'); Colstart + collen; If eof then; Call Simples ('Lenestat', Lenestat); Call Simples ('ApptSTMT', APTSTMT); End; Run; / * Import data file * / data datafile; Length and lensstat; Infile 'c: \ datafile.txt' dsd DLM = '09 'x; Input & amp; Inptstmt; Run;  

This should be what I need, but should be a clean way. With this approach if there is an insufficient space allocated to the variable that is length and input statements, or if the length of the statement is greater than the maximum macro variable length There may be trouble. / P>

Any thoughts?

There is a general standard way of doing what you are doing. Yes, you can see things a little more carefully; I assign $ 32767 for two statements, for example, just be careful.

There are some ways that you can improve it, however, this may remove some of your worries.

First of all, a common solution is to use proc sql to create a macro variable at the line level (as you do) and then create the macro variable. It has a maximum maximum limit as compared to the data phase method (data phase method maximum $ 32767 if you do not use multiple variables, SQL is at 64kib).

  proc sql; Select cats ('', column, '$', colen): separating lenstmt from '' meta; * And similar to inputstmt; leave;  

Second, you can exceed the 64k limit by typing the file instead of the macro variable, take your data step, and instead of caching and then using call simpt Using, write each line in a temp file (or two). Then instead of using Macro variables in these input datesteps, you can % include - yes, you can do this in the middle of a datastop in % include .

There are other methods, but these are both the most common and should work for most use cases. In some other methods, the command to open the file to work directly with call execution , run_macro , or the file is used Generally, they are either more complex Or two are less useful than most, although they are certainly acceptable solutions and are not uncommon for viewing in practice.


opengl - Rendering to texture hides the front face,something's wrong with the z buffer? -


I want to render my view in a texture and apply the blur shader for this texture. The problem is that when I come back

I have to make my texture Face faces of cubes can be invisible </ p> <p> Enter image details here

with superSapling

* Ignore the opaque thing around the cube in both photos. I repeat the cube once with less alpha and more scale, I disabled it, but I have the same problem.

For some reasons, I am using z and z as y, so the face in front of the cube is less than the face (instead of P), I think that There is something wrong with the buffer.

Render Text Code:

  Public Class RenderOnTtexture {Personal Float m_fboScaler = 1f; Private boolean m_fboEnabled = true; Private framebuffer m_fbo = null; Private texture region m_fboRegion = null; Public RenderOnTechs (float scale) {int width = (int) (gdx graphics .getWidth () * scale); Int height = (int) (gdx graphics.gethite () * scale); M_fbo = New frame buffer (format. RGB565, (int) (width * m_fboScaler), (int) (height * m_fboScaler, false); M_fboRegion = new texture (m_fbo.getColorBufferTexture ()); M_fboRegion.flip (false, false); } Public Zero Start () {if (m_fboEnabled) {m_fbo.begin (); Gdx.gl.glClearColor (0, 0,0,0); Gdx.gl.glClear (GL20.GL_COLOR_BUFFER_BIT); }} Public Texture Silk End () {if (m_fbo! = Null) {m_fbo.end (); Return m_fboRegion; } Return tap; Boolean logic in framebuffer enables a depth buffer attachment. I & rsquo;;}  

And should clean the depth buffer with color buffer.


angularjs - Angular doesn't bind data from controller with bindToController -


I am struggling with this issue for a long time. AngularJS does not just bind data if I bind it in the controller context. And if I try to convert it to a simple binding through the $ radius - everything works

It moves along the line which assigns the load to the load Comments - Strangely, if I remove it, then everything works.

Kang's version is 1.4.0-beta.5.

Here's my code:

  Angular. Modules ('mine-app'). 'Mycomments' guided, - & gt; Director = Restricted: 'E' Area: Correct Controller: 'NotiController' Controller: 'ctrl' bindToController: Correct Template: 'comments.html' Replaces: True Controller 'Comments Controller', () - & gt; This.name = 'comments' this.loadComments = - & gt; // template here section header header ng-bind = 'ctrl.name'  

Thanks!

Really got the answer - you have to get it back clearly at the end of the controller. , But it seems that the framework decides whether to add it to the radius, or not

, depending on the return result.

netbeans - System.getProperty("java.classpath") = null? -


Hi guys, I wander around here and I need you to help me.

I posted it:

After some time, I decided to make a decision that it can not compile any report in iReport 5.6.0 .

This console in NetBeans:

  System.out.println (System.getProperty ("java.classpath"));  

I get blank

In this case, the Windows of the Java code version is incorrect?

What can I do? Nobody can help me.

property name is incorrect, this is java.class.path

  System.out.println (System.getProperty ("java.class.path"));  

html - Positioning scrolling divs -


I have come to you once again for a question. I found a logo with three elements: text | Logo | Lesson The logo part is stable. It should always be horizontally + vertical centered. I've completed it with the background need to be able to scroll up and down two text parts and when it leaves the page from the top of the page, then a new version should come up from the bottom of the page and stop at this point

I have to work entirely on my desktop which is a 1920 * 1080 resolution However, I have padded this tray and pixel

#logo {background: none; Padding-top: 411px; } # Logo 2 {background: none; Padded-top: 958px; } # Logo 3 {Background: none; Padding-top: 962px; }

Obviously this is not the way to go after alignment completely after any other resolution.

I have created a JSFiddle:

Since Fell shows output in a small screen, you already see my problem. I am pretty sure there is something missing here. Is there anybody who can point me in the right direction how to pull it?

Kind regards, please

Try one for this:

I set the height of the 100% viewport ( html , body , and .container-fluid from # section after setting it to 100% height). Again I made every #logo with an upper height of up to 50% (about) half the height of the image offset from the top. I made some funky adjustments to set the last #logo to the viewport height, so the scrollbar closes at the bottom of the window on three three. Here's CSS (slightly reorganized):

  html {height: 100%; } Body {Background: URL fixed (http://i.imgur.com/5rFLWpS.png) repetitive center center; -WebKit-Background-Size: Cover; -MOZ-BACKGROUND-SHAPE: COVER; -o-background-shape: cover; Background size: cover; Height: 100%; }. Container-Fluid (height: 100%; width: 100%;} #sectionone, #sectiontwo, #sectionthree {height: 100%; width: 100%;} #lolo {background: none; position: full; top: 50%; margin-top: -72px;} # logo 2 {background: none; position: full; top: 150%; margin-top: -72px;} # logo 3 {background: none; position: Full; top: 250%; margin-top: -72px; bottom: 300%; margin-down: -72px;}