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;}  

Mysql clone id with trigger -


I have two tables:

  If a user does not exist (` (`Id`), Unique key 'Username' (` username ')) ENNITE = (8) tap AUTACNCRMant, username' varchar (45) null, password 'varchar (200) faucet, primary ID (`id `) MySQL default charset = latin1 AUTO_INCREMENT = 1; Make the table if the 'users_info' (`id`int (8) does not tap,` name 'varchar (35) no tap,' address' varchar (35) no primary key (`id`), engine = mice default charset = Latin1;  

I want that when a user is inserted in the table users , to automatically insert a new line in the table, users_info The same ID as the ID column in the form of a user table. When I incorporate myself, then I do them like this: include the user (username, password) values ​​('user1', 'pass1');

I believe that I should take a look at MySQL trigger I took a look but I do not know how to get key ID from the user table for every last line, which is inserted Assuming that other rows can be inserted in parallel to other threads.

If you create after INSERT trigger, You can use:

  After the user_info (item idid) value (new iid) on the users for each user, create the trigger as an 'ETInser' user; End;  

php - Calling a static parent method while instantiating child class -


I am changing my class structure to store common database methods in a class. Then spread it to a child's classroom, it should be cut on the code, but when I need it, I also get permission to overwrite the basic methods.

I did the following, for this example I have simplified the basics compared to the original code, there are more classes.

  class parent_object {private $ table_name; Public function all_records () {$ sql = "SELECT * FROM". $ This- & gt; Table_name; Return $ the-> gt; Execute_sql ($ sql); }} Class increases child_object parent_object {protected static $ table_name = "tbl_name"; Public function __ composition () {origin: __ build (self: $ table_name); }}  

I want to call all_records () to protect myself to create new objects all the time.

I am stuck to instant my child and then call the basic method

  $ child = new child_object (); $ All = $ child- & gt; All_records ();  

I really want to be able to call the original method:

  $ all = child_object :: all_records ();  

I understand that I can not do it with my code, but in some way it would like that the child first inserts and then uses the original method.

I can write All_records () method to instantiate myself in child_object and parents call all_records (), but in this way the code and the same method of cutting my child's class Eliminating the purpose of expansion.

I am sure its very simple or some high level upper function can do this.

Thank you for your help. The answer is relatively simple, you can change all your properties in static properties, and then Can use auto :: instead of static :: .

>

Although solving this problem is considered a bad practice in this way. Best wishes


javascript - On click fade out div then fade back in -


I have implemented a toggle idea page, where you can toggle between the toggle states between the animation list and the grid. Ugly (toggle using the two links at the top of the meaning I see):

To solve this problem I want to apply a setTimeout function to the toggle button I am trying to first, I can fade the parent div #lotest list To make changes and layout and then # post-list fade back. When I expel it, but there is no change in layout:

Can anyone find out why this is happening? Here is snippet of JS:

  function init () {optionSwitch.forEach (function (L, I) {el.addEventListener ('click', function ) {$ ('# -list-list') AddClass ('go'); // setteimeout fadeout (function () {_switch (this); // update layout; switch refers to another function}, 500 ); SetTimeout (function () {$ ('# post-list') .removeClass ('go'); // federate back to the new layout}, 1000);}, false);}); }  

You are using jquery, you are not actually using jquery Jquery comes with a fadeIn and fadeOut animation that you can use.

  var $ pl = $ ('# -post-list'); $ Pl.fadeOut ('slower', function) (// When the animation is done back / call here / you can apply the layout change pl.fadeIn $ ('slow', function) (// call back when fade Animation is done / / do other stuff here});});  

is a basic example.

You should also change your code in jquery equivalent.

Let me know that this is what you were looking for.


c# - Retrieve Dynamic class name from JSON.NET? -


I am getting a message on the network using JSON.NET. The message format is somewhat dynamic, For example: MessageName: "MessageType2", other data: "some data", more data: "and also", Amb: 25}

The problem I have is in JSON.NET, I do not know Is that How to find the name of the class (NameType1 / MessageType2 / etc), to remove it as an example of a square without repeating it twice. I have suggested some options; What I am currently using is to use a container class in which the name of the message and the actual JSON message is sorted for the string, but it is useless.

Another method I believe is deserializing in string / string dictionary and then executing the population of the class on their own, which seems to be messy and unnecessary to consider Jason.Net. I can do this for ... as long as I know the class for the first time.

I'm really hoping that message is an easy way to detect the name of an JSON.NET class by checking the property and after checking it, continue to populate a square. Property.

Thanks for the help! JSON can deserialize in a well known class only you specify data layout (i.e. class / type)

There are two options:

1.) Go deeper at one level. To read tokens from your JSON stream using JSON Talk Parser and to work on the basis of the tokens you received.

2.) As you suggested: Use a class layout to catch all your possible differences. Key / value dictionary


Using python on RPi to start gpicview & display Image -


I am using Raspberry B + with raspberry to get this reference to use GPicView () Afterwards, I managed to get a JPG image to display using LXTerminal with a 'sudo python jukebox.py -g' command, but the following errors appeared on LXTerminal:

(Gpicview: 3125): GLib-GObject-Warning **: Try adding GtkSettings to property: gtk-scrolled-window- Placement Class Left Was started

(gpicview: 3125): GLib-GObject-WARNING **: Try adding property GtkSettings: gtk-button-images was started after class

< P> (gpicview: 3125): GLib-GObject-WARNING **: Attempt to add property GtkSettings: Gtk-label-select-on-focus was started after class

Python Code:

oxmp = popen (['gpicview', 'media /fond.jpg'])

I used 'oxmp' Because I have to show a video using omxplayer without any error Was used.

GPicView is completely open but I think that there is a way to ensure that happens.

I am a newbie in Python but an amateur in programming & amp; Want to use the GPIO to control the "Q & A" screen display. The idea is that the RPI & amp; After the screen is rebooted, the main screen is switched on, the initial image will remain on the screen until a visitor clicks a button for any question. The images are & amp; Based on the answer, videos related to each question After the inactivity of 30 the initial image will be displayed.

I believe that I can control performance on Python but appreciate the indicator:

  1. The correct command for gpicview is displayed in full screen without errors;
  2. After boot, an initial command has ended that will trigger the Python program to start & amp; Display the opening image - I have just seen a link that I will try;
  3. A recharging system for a small battery so that, when the switch turns off, the RPI will be automatically shut down. I've seen PiPresent-on the next, but stuck.

    Thanks, Advance, Walter for any help


java - JSP Fragment Tag causing error -


I am trying to use piece tags in my JSP file. The code in the tag file (base tag) is as follows:

  & lt;% @ tag description = "full page template" page encoding = "UTF-8"%> & Lt;% @ attribute name = "nav" fragment = "true"%> & Lt;% @ attribute name = "css" piece = "true"%> & Lt;% @ attribute name = "js" fragment = "true"%> & Lt ;! DOCTYPE html & gt; & Lt; Html & gt; & Lt; Top & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Jsp: invitation piece = "css" /> & Lt; Jsp: invitation piece = "navy" /> & Lt; Jsp: doBody / & gt; & Lt; Jsp: invitation piece = "js" /> & Lt; / Body & gt; & Lt; / Html & gt;  

8859-1 "page encoding =" UTF-8 "%> & Lt;% @ Page Import = "java.util.ArrayList"% & gt; & Lt;% @ taglib prefix = "T" tagder = "/ web-ANF / tag"% " & Lt; T: Base & gt; & Lt; Jsp: attribute name = "nav" & gt; & Lt; Jsp: include page = "nav.jsp" /> & Lt; / Jsp: attribute & gt; & Lt; Jsp: body & gt; & Lt; P & gt; Hi & lt; / P & gt; & Lt; / Jsp: body & gt; & Lt; Jsp: attribute name = "js" & gt; & Lt; P & gt; Hi & lt; / P & gt; & Lt; / Jsp: attribute & gt; & Lt; / T: base & gt;

If I extract my code, then my code works fine - otherwise I am not finished ": base" error I am using tonkat 7.x if any Other information is also required, so I will also post it here. But as I am new to Tomcat / JSP / Servlets, I am very helpless.

Yo needs to define all first attributes:

  & lt;% @ page language = "java" contentType = "text / html; Charset = ISO-885 9-1 "page encoding =" UTF-8 "%> gt; page @ import =" java.util.ArrayList "%> <% @ taglib prefix =" t "Tag" = "/ Web-ANF / Tag"%> gt; & lt; base & gt; & lt; jsp: attribute name = "js" & gt; & lt; p & gt; high & lt; / P & gt; & lt; / jsp: attribute & gt; & lt; jsp: attribute name = "nav" & gt; & lt; jsp: include page = "nav.jsp" /> & lt; / jsp : Specialty & gt; & lt; jsp: body & gt; & lt; p & gt; Hi & lt; / p & gt; & lt; / jsp: body & gt; & lt; / t: Base & gt;  

javascript - Ajax call halting on some browsers -


According to the console, to post it with Firefox on some pc in a business environment Ajax does not call (240 similar establishment ). If I remove the location .reload (); Then Ajax Post is just fine. However, the browser does not lose the point of using Ajax.

Am I doing something wrong? Select

 : Function (start, end, end, js, event) {if (user id) {var start = moment (start). Format ('YYYY-MM-DD') var end = start; $ Ajax ({type: "post", cache: incorrect, url: 'http: //intakecalendar/adddate.php', data: 'userID =' + userID + '& amp; start =' + end // + '& Amp; End = '+ End & Lieutenant; - Provides true end date; } // end if location.reload (); } // end  

This is the position of a race, you are making an http call And reloading the page. Only one win and modern day browsers, Page Navigation has opened the HP requests.

Reload the success / full operators. Choose

 : function (start, end, allday, jsEvent, see) {if (userID) {var start = moment (start). Format ('YYYY-MM-DD') var end = start; $ Ajax ({type: "post", cache: incorrect, url: 'http: //intakecalendar/adddate.php', data: 'userID =' + userID + '& amp; start =' + end, // + ' & Amp; end = '+ end & lt; - By providing a real end date, it completes the wrong day: function () {window.location.reload ();}}); } And {window.location.reload (); }}  

python - django-admin.py New Project Import Error -


मेरा Django त्रुटि दे रहा है जब मैं

  django-  

त्रुटि कहती है

  ट्रेसबैक (सबसे हाल ही में कॉल अंतिम): फ़ाइल "/ usr / local / bin / django-admin Py ", पंक्ति 5, & lt; मॉड्यूल & gt; management.execute_from_command_line () फाइल "/usr/local/lib/python2.7/site संकुल / Django / कोर / प्रबंधन / __ init__.py", लाइन 385, execute_from_command_line utility.execute में () फ़ाइल "/ usr / स्थानीय / lib /python2.7/site- संकुल / Django / कोर / प्रबंधन / __ init__.py ", लाइन 354, में निष्पादित django.setup () फाइल" /usr/local/lib/python2.7/site-packages/django/__init__ .py ", लाइन 18, django.utils.log आयात से configure configure_logging फ़ाइल" /usr/local/lib/python2.7/site-packages/django/utils/log.py ", पंक्ति 13, में & lt; मॉड्यूल & gt ; django.views.debug आयात ExceptionReporter से, get_exception_reporter_filter फ़ाइल "/usr/local/lib/python2.7/site-packages/django/views/debug.py", रेखा 10, & lt; मॉड्यूल & gt; django.http आयात से (HttpResponse, HttpResponseServerError, फ़ाइल "/usr/local/Cellar/python/2.7.7_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hmac.py", लाइन 8, में & Lt; मॉड्यूल & gt; ऑपरेटर से import_compare_digest import_digest आयात के रूप में आयात करें: नाम _compare_digest  

आदि आयात नहीं कर सकता .. यहाँ है

मैंने लगभग सब कुछ करने की कोशिश की है - यहाँ मेरा SYSPATH है :

  /Library/Frameworks/Python.framework/Versions/3.4/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/Library/Frameworks/Python.framework/ संस्करण / 2.7 / बिन:। /Library/Frameworks/Python.framework/Versions/2 7 / बिन: /Library/Frameworks/Python.framework/Versions/2.7/bin: / opt / स्थानीय / बिन: / opt / स्थानीय / sbin: /Library/Frameworks/Python.framework/Versions/2.7/bin: /Library/Frameworks/Python.framework/Versions/2.7/bin: / usr / स्थानीय / बिन: / opt / स्थानीय / बिन: / opt / स्थानीय /sbin:/opt/local/bin:/opt/local/sbin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/ sbin: / sb में: / opt / X11 / bin: / usr / local / git / bin  

यह पहले से काम करता था, लेकिन मैंने कुछ पथ या कुछ और बदल कर के बाद काम करना बंद कर दिया और मैं इसे ठीक करें, तो इस मुद्दे पर मदद की बहुत सराहना की जाएगी।

क्या आपने डीजां को अनइंस्टॉल और फिर से स्थापित करने के लिए पीप का इस्तेमाल करने की कोशिश की है?

 < कोड> पाइप अनइंस्टॉल करें डीजेंगो पीआईपी स्थापित डीजेन्गो  

यह निश्चित रूप से एक के अंदर किया जाना चाहिए, लेकिन इसके बारे में चिंता न करें, अगर यह मामला नहीं है।


Having trouble querying by dates using the Java Cassandra Spark SQL Connector -


I'm trying to use a SPARC SQL to query a table from a date range. For example, I am trying to run a SQL statement such as: SELECT * FROM trip WHERE utc_startdate> '' 2015-01-01 '' and UTC_startDate & lt; = '2015-12-31' and Depression_ID = 1 and Device_id = 1, when I run the query, no error is thrown, but when I have some expectations then I can not find any results without querying the query. Time is getting results back to I SetAppName ("SparkTest"). Set ("spark.executor.memory", "1g") .set ("" spark ". (" Spark.cassandra.connection.native.port "," 9042 ") .set (" spark.cassandra.connection.rpc JavaSparkContext Reference = New JavaSparkContext (sparkConf); JavaCasandra SQL Context sqlContext = New JavaCandra SQL Contex (reference); sqlContext.sqlContext () setKeyspace ("mykeyspace"); string sql = "SELECT * excursion" From WHERE utc_startdate> = '2015-01-01' and utc_startdate & lt; '2015-12-31' and deployment_id = 1 and device_id = 1 "; JavaSchemaRDD rdd = sqlContext.sql (SQL); & lt ; Line & gt; line = rdd.collect (); // rows.size () is zero when I expect it to be in E lines should be

schema:

  create table tour (device_id bigint, deployment_id bigint, utc_startdate timestamp, other column .... primary key ( Device_id, deployment_id), Utc_startdate));  

Any help would be appreciated by clustering order (utc_startdate asc).

What's your look like table schema (specifically, your primary key definition)? Without even seeing this, I am quite sure that you are seeing this behavior because you are not qualifying your query with the partition key. The rows will be filtered by date using the allow directive (assuming your clustering key is), but this is a large cluster or a large dataset Not a good solution.

Let's say you are asking users in a specific geographical area. If you use the area as a partition key, you can run this query, and this will work:

  Select * From users where the area = 'California' And date & gt; = '2015-01- 01' and date & lt; = '2015-12-31';  

Let's read Patrick McFaddin's article. There are some good examples that can help you.


c# - How to enable Application Server role programattically on Windows 2008 R2 and Windows 7 -


As part of an installation process, I need to enable application server role. To achieve this I need to do this. I am able to easily execute dism.exe from a C # application and can easily do it on Windows Server 2012. Here is the order that is executed.

  dism / online / enable-feature / feature_name: application-server / featurename: as-nET-framework / featureName: as-ent-services / featureName: AS-DIST-transaction / feature- N: AS-incoming-trance / feature-nm: AS-outgoing-trans  

But when I try to do this on Windows 2008 R2 server or Windows 7, it shows that DISM does not recognize these features. If I run commands to list the features on these machines then they are not actually available. Even if I manually enable the application server role by using the role manager and lists the features available in the DISM, then they are not listed under a different name or nothing that the application server Represent the roll.

How can I activate the program on a Windows Server 2008 R2 Server and Windows 7 application server role using C #? The solution does not have to use the DISM. I'm looking for any option.

So it turns out that even if the server manager gets annihilated in Windows 2008, you still have roles I can use it to enable the command here I used to enable it:

  ServerManagerCmd -installAnti-ServicesAs-District-Transaction as Application-Server AS-incoming-trans AS-outgoing-trans  

You will get the following warning but it works .

The servermates prefer CMD.exe, and are not guaranteed to be supported in the future release of Windows. We recommend that you use the Windows PowerShell cmdlets that are available for server managers.

How do you enable it in Windows 7? You can not do this because these clients are operating systems and these roles are not present. But eventually to establish this role was to establish and configure distributed transactions. Turns on Windows 7 that a distributed transaction coordinator is already available and you have to configure it.


Spring jdbchdfs job - -


वर्तमान में jdbchdfs नौकरी में विभाजन पथ < / Strong> आउटपुट निर्देशिका के लिए, जैसे hdfs सिंक ऐसा करने का सुझाव क्या है? मैं इसके लिए किसी भी जीआईआरए भी नहीं देखता हूं, भविष्य में इस तरह के किसी भी योजना के लिए कोई योजना तैयार की जा सकती है?

मैंने इसे एक विचार दिया और निष्कर्ष निकाला है कि वह कई निष्पादन करने वाले विभाजनों के लिए कई फाइलें बना सकता है। हालांकि बड़े डेटा सेट लोड के लिए, हम अपने आउटपुट को डेटा में मानों के आधार पर कई निर्देशिकाओं में तोड़ना चाहते हैं।

अगर मैं ऐसी नौकरी बनाना चाहता हूं, तो मैं बॉक्स के बाहर कैसे पुन: उपयोग कर सकता हूं विभाजन रणनीति जो एचडीएफएस सिंक में उपयोग की जाती है? किसी भी संकेतक की सराहना की जाएगी।

वर्तमान jdbchdfs नौकरी एक बहुत सरल मदर्राफ्टर कार्यान्वयन का उपयोग करता है। यह एक वसंत Hadoop DataWriter कार्यान्वयन का उपयोग करने के लिए बदलना चाहिए और सुधार करने के लिए सीधे दिखाई देता है। मैं कार्यान्वयन के दृष्टिकोण पर एक टिप के साथ इस सुसंगत कार्यक्षमता का ट्रैक रखने के लिए जीआईआरए बनाया। यदि आप इसे बाहर की कोशिश कर सकते हैं और एक जनसंपर्क जारी कर सकते हैं जो बहुत सराहना की जाएगी।

चीयर्स, मार्क


Subscription Profiles not supported by Recurring Payment APIs while updating plan price -


I am using PayPal API for recurring billing. I want to update the plan price using PayPal API, I am using

  $ curl = curl_init (); Curl_setopt ($ curl, CURLOPT_RETURNTRANSFER, true); Curl_setopt ($ curl, CURLOPT_SSL_VERIFYPEER, incorrect); Curl_setopt ($ curl, CURLOPT_POST, true); Curl_setopt ($ curl, CURLOPT_URL, 'https://api-3t.sandbox.paypal.com/nvp'); = 'Gtc: mediawidth =' gtc:, 'VERSION' = & gt; '108', 'PROFILEID' => 'I-FYYMDB55ADSH', 'Note' = & gt; 'Uma Nota Oceanic, Explanation O Inspiration The Moodana', 'AMT' => 120, CURRENCYCODE '=> BRL '))); $ Response = curl_xax ($ curl); Curl_close ($ curl); $ Nvp = Array (); If (preg_match_all ('/ (? & Lt; name & gt; [^ \ =] +) \ = (? & Lt; value & gt; [^ & amp;; +] & amp;? /', $ Reaction , $ Matches)) {foreach $ matches [$ name] $ offset = offset = & gt; $} match with {$ nvp [$ name] = urldecode ($ ['value'] [$ offset] Account); }} Print_r ($ nvp);  

But I'm getting this error Membership profiles are not supported by the recurring payment API This is my error

   Pre & gt; Array ([PROFILEID] = & gt; I-FYYMDB55ADSH [TIMESTAMP] => 2015-03-16T15: 48: 07Z [CORRELATIONID] => 33216e1739dde [ACK] => Failure [version] => ; 76.0 [BUILD] = & gt; 15735246 [L_ERRORCODE0] = & gt; 11592 [L_SHORTMESSAGE0] => Membership Profile Not Supported [L_LONGMESSAGE0] => Membership Profile Payment Not Supported by API Recurring [L_SEVERITYCODE0] = & Gt; Error)  

Please tell me what I have done.

as answered

by PayPal_Frank Admin Answers : 04-02-2012 11:08 AM

...
Basic Membership Button Profile IDs are not Supported by GetRecurringPaymentsProfileDetails API This API Express was created through Checkout through the CreateRecurringPaymentsProfile API Our API based checkout solution which will work for membership or recurring payment profile. Website Payment Pro is not required to use Express Checkout. I may have this disappointment and our advice is that merchants collect basic membership information through IPN to store information in their own databases or to see information about their PayPal account. This has also been presented as a feature request by our Merchant Technical Services team.
...

...


logical operators - VHDL unexpected behaviour of XNOR for std_logic_vector -


In my structural VHDL code I have a series of 25 64bit studs_lallis_witers. It should always be the same and I want to check if there is a flaw that flips a bit, my code looks like this:

  outx < = Mt1_op XNOR mr2_op Xnor mt3_op XNOR .... XNR MT 25_p;  

It does not give me any errors and is properly synthesized, but when I simulate it in ISIM, the XNRR operation does not work. I hope all 1s or sometimes 0 if there is a mistake, but the final output signal, outx, is just the same value as all the input signals. I will not bother telling the whole 64 bit vector, but as an unsigned difference it resolves 7776. All the Ventures are 7776 - and when I add them all together, I get an answer of 7776.

I suspect that the problem can be applied once by XNOR operations, i.e.

  outx < = (Mt1_op XNOR mt2_op XNOR (mt3_op XNOR (mt4_op XNOR (. ....))))))))))));  

will not give the desired behavior

Do anyone have the idea that how can I get the behavior I want? That is, if all 25 vectors are equal, then give me all 1s or have differences, give me 0.

Thanks

Tom

This is working fine Is:

  '0' XNOR '0' Xnor ... XNOR '0' = '0 - 25 XNOR' 0 '' 1 'XnOR' 1 'XNOR ... XNOR' 1 Expression logic vector will return for '=' 1 '- 25 for XNOR' 1's  

if the same vector is given 25 times for XNOR is.

To check that all the vectors are the same you can:

  or_all & lt; = Mt1_op or mt2_op or ... or mt25_op; And _ all & lt; = Mt1_op and mt2_op and ... and mt25_op; Similar & lt; = Or_all = and_all;  

as the type of boolean and std_logic

  identical_st_logic for the resulting type & lt; = '1' when (and_all) = or_now) Other '0';  

vba - How to select specific form control checkboxes in Excel? -


I am working in Excel 2010.

I have set up 10 form control checkboxes in my worksheet, and I want to choose a certain group of check boxes automatically. All previous posts which I have seen on this topic, choose all those checkboxes or deselect all checkboxes.

To cancel the selection of all checkboxes, the VBA code from the previous post is here:

  to work as sub clearcheck () in each chess letter in chess Restart the error for the next sh.CheckBoxes.Value = error on the error GoTo 0 Next sh end sub  

Here is the updated code based on this series, but it is still a sentence- With the related problem, running in an unknown sub:

  sub-highengagedonline () Fixed CB checkboxes worth Rs. In the form of sht-like worksheet set sht = worksheet ("article") sht.CheckBoxes for each CB if cb.Name = "check box 35" or _ cb.Name = "check box 36" or _ cb.Name = " Check box 37 "or _ cb.Name =" check box 38 "or _ cb.Name =" check box 39 "then cb.Value = 1 other: cb.Value = 0 ends if the next cb end sub   

Try something with that line:

  sub clear Clear () as the DIB CB checkbox, the sht worksheet set sht = worksheets ("Sheet 1" ) In sht.CheckBoxes, cb.Name = "check box 1" for every CB then cb.Value = 1 Else if cb.Name = "check box 2" then cb.Value = 0 termination if the next CB termination sub  

c# - AngularJS nested ng-repeat of classes -


I have a repeater that shows grades of a class and in my repeater, I have a filter that will give each grade only Shows once. And now I want to show those sections which are in that particular category. For example if I have 2 classes in Class A and Class B Grade 1. I want to show that there are 2 classes in grade I A and B. How do I do this?

As of now the code shows only 1 class in that specific category, not both. How do I create it, only show classes that are mentioned in that class?

EmployeeCtrl.info is an array containing

  0: object $$ hashKey:" object: 6 "grade: 1Id:" AA6C05F9-98DF-4A8D-B055- 10DB07557F0D "name:" 1C "TeacherId:" 1E51E989-8ED5-4988-B929-4FBCD8A7977D "__ proto__: Object1: object $$ hashKey:" object 10 "grade: 1Id:" C07D54D9-01B0-4CC8-A8CC-0FDD47EAFE5C " name: "1B" TeacherId: "1E51E989-8ED5-4988-B929-4FBCD8A7977D" __ proto__: Object2: object $$ hashKey: "object: 7" grades: 2Id: "15218673-874B-41C1-9910-AD4F185F5730" Name: "2C" TeacherId: "1E51E989-8ED5-4988-B9 29-4FBCD8A7977D "__ proto__: Object3: Object $$ hashKey:" Object 11 "Grade: 2Id:" 4711EEEE-4B56-4FD8-9A15-648CE00090A3 "Name:" 2A "TeacherId:" Html / repeater code:  

snippet "data-lang =" js "Data-hide =" wrong ">

  & lt; Div class = "col-md-4 grade select" ng-click = "EmployeeCtrl.ClassClick ()" ng-repeat = "g employee employee_tutorial.info | unique: 'grade' '& gt; & lt; h1 & gt ; Årskurs {{g.Grade}}  
/ Div>

Filter code:

  .filter ('unique', function) {return function (archive, keyname) {var output = [ ], Key = []; angular (for collection, function) {var key = item [keyname]; if (keys.indexOf (key) === -1) {keys.push (key); Output push (item);}} return output;};})  
And if I To add another criminal, it shows everyone classes in all grades.

Changed HTML / Repeater Code:

  & div; div class = "col-md-4 grade select" NG-Click = "EmployeeCtrl.ClassClick ()" ng-repeat = "g Employees. unique 'grades'' & gt; & lt; h1 & gt; Årskurs {{G.Grade}} & lt; / h1 & gt; & lt; a ng-repeat = "g in EmployeeCtrl.info" & gt; {{g.Name}} & lt; / a & gt; & lt How can I show the names of classes in the same category? / Div>  Div> 

Try this, the second time you will not actually use the filtered results

  & div; div class = "Select-grade-md-4" ng-click = "amplicacheraleal Click on class ("NG-Repeat =" j) Filtrated Grids = (Employer CTNENVEO | Unique: 'Grade') "& gt; & lt; h1 & gt; {{G.Name}} & lt; / a & Gt; & lt; / div & gt;   / pre> 


excel - If the combobox text is equal to text in a column list, then follow hyperlink in cell to the right -


is consistent with the drop-down list in a blanket that I have a list of file details on a sheet. That's when the user selects any item in this drop down list, matches the text in the code column, and for the subsequent description, the link in the cell, thus I want to do a code like this Are there.

This is the code I have so far:

  select Private Sub Open_Button_Click () Case OI_FileName Case = OI_FileName.Value = Sheets ( "File_Paths") range ( "Details") with the value .. Open_Button each cell ( "Border Description") (Selection.OI_FileName = Cell.Value) re exit ActiveCell.Offset (0 for, 1) .Select Selection.Hyperlinks (1) .Follow new window: = False , AddHistory: = Compile Error ::. Without ending with  

Any end of help you choose End Sub

I'm sure this is because VBA displays is working properly this is not true with'm back end would be greatly appreciated offer

I was Nk it What are you looking for The statement was unnecessary.

  private sub Open_Button_Click () Dim StrFilePaths string dim as the CurrFileName string CurrFileName = OI_FileName.Value cell border each cell ( "Statement") StrFilePaths = Cell.Value so CurrFileName in = For StrFilePaths Offset (0, 1) .Select Selection.Hyperlinks (1) .Follow new window: = False, AddHistory: = True End If Next cell End Sub  

php - Translating texts, that appear only in one language -


I have a double language (English and Polish) application that is written in Yii 1.x. The base language is English ( sourceLangage ) and the current language ( language ) is controlled by the user.

How should I translate Yii:: T , string, which is not used in English but should be visible in Polish? I Yii: t ('app', ''); , not correct

I use it as something like" full paragraph "in English Not classified wire "which are relevant only in one language or another; For example, you may need an additional explanatory paragraph for a concept, which is" foreign "in a culture, but the other Is natural in, or you have some legal phrasing in a country It may need to be done, but no one else.In these cases, it is not actually a "translation", but there is conditional content, such as a if statement based on the current language The natural way, or the equivalent equivalent (such as "legal. $ Lang.html" .).

A typical date format , in comments The specific example you mentioned is just a classical case of localization, of which Regular translation functions will work properly:

resonance date (Yii: T ('DFY'));

This date format string < Code> DFY in Polish d FY \ r. may need to be localized. Note that you should be able to localize date not if possible, you should use the class, and generally you want to type "type" of date formats Constants, such as IntlDateFormatter :: MEDIUM (January 12, 1952), IntlDateFormatter :: SHORT (12/13/52) etc. Otherwise, locale is capable of formatting a space based on hooks and dates in the system. I do not know how to tie specifically in Yii either.


regex - Match number 1 and not 10 or 11 using grep or other way -


मेरे पास निम्न सामग्री वाली फाइल है:

  image_0001.jpg 0 image_1212.jpg 0 image_1324.jpg 1 image_1784.jpg 1 image_7867.jpg 10 image_1919.jpg 11  

और मैं दूसरे कॉलम में नंबर से मेल करने के लिए केवल लाइन प्राप्त करने का एक रास्ता खोजना चाहता हूं: < / P>

यदि मैं "0" के लिए पूछता हूं तो केवल प्राप्त करें:

  image_0001.jpg image_1212.jpg  

अगर मैं "1 "तो केवल प्राप्त करें:

  image_1324.jpg image_1784.jpg  

क्या यह grep या awk का उपयोग करने का एक तरीका है? जब तक मैं "1" के लिए grep 10 और 11 से लाइन मिल रहा हूं

आप awk का उपयोग कर सकते हैं ।

  $ awk '$ 2 == "1" {प्रिंट $ 1}' फ़ाइल image_1324.jpg image_1784.jpg  

यह कॉलम के मान को प्रिंट करेगा 1 केवल अगर कॉलम 2 का मान बिल्कुल 1 है।

OR

  $ awk -v var = "1" '$ 2 == var {print $ 1}' फ़ाइल image_1324.jpg image_1784.jpg  

आप उस मूल्य को पास कर सकते हैं जिसे आप -v से जांचना चाहते हैं पैरामीटर।


git - Modify old release on Github for pushing out a patch -


I have different tags / releases, 1.0, 1.0.1, 1.0.2, 1.0.3. At present, the preparation of the Master Branch 1.1.0 is bleeding.

Now I realized that I needed to push a small patch, 1.0.4.

Make the best way to do patch based on 1.0.3, press it on the gitub, tag it as 1.0.4, but still keep the master branch on the bleeding edge and Prepare for 1.1.0?

Edit: The question in the store (note, it actually v1.0.5 -> v1.0.6):

You check the commit you want to make your patch on the base. Make whatever you need, make your command, tag the result and push them to bring them to your main line, you can choose either cherry or choose those commands or merge them into the branch.

Now, it can be a bit weird if the new tag is not in a branch. I have certainly never seen a branch which is accessible only by one tag. Therefore, my personal recommendation will be to merge the branch back.

Be a little more solid:

  $ git checkout -b v1.0.5_fixes v1.0.5 # create a bugfix branch # ... do some work .. # ... commits ... $ git tag v1.0.6 $ git checkout master $ git merge v1.0.5_fixes # merge back merge merge tribs, if any $ git branch-v v1.0.5_fixes # branch Delete, no longer required  

objective c - ObjC AES128 Encryption with binary key -


I'm trying to encrypt data with AES128, I have the right to be treated as a key text string production meets, but only to treat the key as trying binary trash

implementation I'm using it:

  - (NSData *) AES128EncryptWithKey :. (NSString *) key {four keyPtr [kCCKeySizeAES256 + 1]; Berboo (keypets, keyboards); [Key getCString: keyPtr maxLength: sizeof (keyPtr) encoding: NSUTF8StringEncoding]; NSUntiger DataLong = [Self length]; Size_t BufferSecurity = DataLanguage + KCCBlockSizeAES128; Zero * buffer = molok (buffer size); NSLog (@ "keyPtr:% s", keyPtr); Size_t numBytesEncrypted = 0; CCCryptorStatus cryptStatus = CCCrypt (kCCEncrypt, kCCAlgorithmAES128, 0x00, keyPtr, kCCKeySizeAES256, zero, [self-bytes], dataLength, buffer, bufferSize, & amp; numBytesEncrypted); If (cryptStatus == kCCSuccess) {return [NSData dataWithBytesNoCopy: buffer length: numBytesEncrypted]; } Free (buffer); Return zero; }  

Encryption is actually what I need.

With my implementation I get a right encryption for the same plane key but I do not find a way to treat the key as the hex is not working as the NSData key To get the code tried to modify the code above but, I get garbage only after encryption. Of

I have searched and not found an answer on this specific topic, I hope I was right, TIA :)

I do not think you mean" hex ", which is a string representation. I think that you mean "binary", then just provide the key as NSData :

  - (NSData *) AES128EncryptWithKey: (NSData *) Key {NSAssert ([key length]> = kCCKeySizeAES256, @ "key is too short"); NSUntiger DataLong = [Self length]; Size_t BufferSecurity = DataLanguage + KCCBlockSizeAES128; NSMutableData * Encrypted = [NSMutableData dataWithCapacity: Buffer Size]; Size_t numBytesEncrypted = 0; CCCryptorStatus cryptStatus = CCCrypt (kCCEncrypt, kCCAlgorithmAES128, 0x00, [key bytes], kCCKeySizeAES256, zero, [self bytes], dataLength, [encrypted mutableBytes], bufferSize, & amp; numBytesEncrypted; If (cryptStatus == kCCSuccess) {[encrypted setLength: numBytesEncrypted]; Encrypted return; } Return zero; }  

Note:. Your code contained a memory leak and I think you were not returning encrpypted data properly


css - Double margin when padding images in HTML email with vspace/hspace -


I'm coding an HTML email (eug!) And because padding / margin / borders are not respected on Outlook images I'm using vsspace and hspace instead. In the question, the image can optionally be removed from the template, so I need the text that is ready to keep its own margin. To achieve this, I have not applied padding in the box, but a margin for H2 and P tags that follow the image.

Although in Outlook 2007 and 2010 I end up with a double margin in Outlook 2013 everything is a fine one.

This is my inline code from Outlook 2010:

  & lt; Td class = "box" width = "50%" style = "border-fall: collapse; margin-top: 0; margin-bottom: 0; margin-right: 0; margin-left: 0; padding-top: 0; Padding-down: 0; padding-right: 0; padding-left: 0; background color: # F8F8F8; vertical-align: top; "& Gt; & Lt; Img src = "http://placehold.it/110x110" width = "110" align = "left" hspace = "10" vspace = "10" style = "outline-style: none; text-decoration: none ; MS-interpolation mode: bicubic, "/ & gt; & Lt; H2 style = "color: # 254485! Important; margin-top: 10px; margin-down: 0; margin-right: 10px; margin-left: 10px; padding-top: 0; padding-down: 0; padding -OK Is: 0; padding-left: 0; font-size: 18px; line-height: general, "& gt; Dialer Bibendum Mallis & lt; / H2 & gt; & Lt; P style = "line-height: general; margin-top: 10px; margin-bottom: 10px; margin-right: 10px; margin-left: 10px;" & Gt; Fuse can be used as dipibes, conveyors and consultants, which can be used for noodles. For any time, you are not aware of either the marriage or the hairdressing new hairstyles for hair loss to break or break, it is not that they can be used easily, nor can they be used as a portraitist , Has been selected for the East Lescenia Audios. Nullam ID id id IDs with colleagues and those working extensively, enough drive to use as AIT. & Lt; / P & gt; & Lt; / TD & gt;  

And as a result, I'm getting Outlook 2007 and 2010:

Note the double margin on the left side of the image, it appears that applies to hspace, but then inheritors of applied margins on H2 and P tag also received Are there. Instead of using verbspace and HSPS, wrap the image in the table and apply padding in the table:

:

  & lt; Table & gt; & Lt; Tr & gt; & Lt; Td square = "box" width = "50%" style = "border-fall: collapse; margin head: 0; margin-bottom: 0; margin-right: 0; margin-left: 0; paddle-top: 10px; Padding-bottom: 10px; padding-right: 10px; padding-left: 10px; background color: # F8F8F8; vertical-align: top; "& Gt; & Lt; Table cell area = "0" cell padding = "0" border = "0" align = "left"> gt; & Lt; Tr & gt; & Lt; Td valign = "top" style = "padding: 0 10px 10px 0" & gt; ; Img src = "http://placehold.it/110x110" width = "110" align = "left" style = "outline-style: none; text-decoration: none; -ms-interpolation-mode: bicubic;" / & Gt; & Lt; / TD & gt; & Lt; / TR & gt; & Lt; / Table & gt; & Lt; H2 style = "color: # 254485! Important; margin-top: 0; margin-bottom: 0; margin-right: 10px; margin-left: 0; padding-top: 0; padding-down: 0; padding right: 0; padding-left: 0; font-size: 18px; line-height: normal; boundary-left: 10px solid # f8f8f8 "& gt; Dialer Bibendum Moulis & lt; / H2 & gt; & Lt; P style = "line-height: general; margin-top: 10px; margin-bottom: 0; margin-right: 10px; margin-left: 0;" & Gt; Fuse can be used as dipibes, conveyors and consultants, which can be used for noodles. For any time, you are not aware of either the marriage or the hairdressing new hairstyles for hair loss to break or break, it is not that they can be used easily, nor can they be used as a portraitist , Has been selected for the East Lescenia Audios. Sapphire ID Delivery ID and LT as ID Elite with those working with colleagues and those who work extensively. / P & gt; & Lt; / Td> & Lt; / Tr & gt; & Lt; / Table & gt;  

r - Filter data frame based on multiple conditions in another data frame -


मेरे पास दो डेटा फ़्रेम हैं:

  • df जहां के लिए एकल x एकाधिक मान हैं y
  • matchDf जो कि परिभाषित करता है कि मैं फिल्टर को df का उपयोग करना चाहूंगा

मैं केवल उन पंक्तियों को फ़िल्टर करना चाहूंगा जहां y कम या बराबर max_y दिया जाता है x अंतराल में गिरता है & lt; x_from, x_to)

क्या यह आर में करने के लिए कोई तरीका है (बिना एसक्यूएल मैं उपयोग किया है)?

  df & lt; - read.table (हेडर = TRUE, text = 'xy 100 0.1 100 0.2 100 0.3 250 0.2 250 0.3 250 0.4 375 0.2 375 0.25 375 0.35 420 0.15 420 0.16 420 0.17 500 0.23 500 0.55') MatchDf & lt; - read.table (हेडर = TRUE, text = 'x_from x_to max_y 0 300 .2 300 500 .3 500 99 999 .5') लाइब्रेरी (sqldf) sqldf ('डीएफ में शामिल होने से एक। (कुल्हाड़ी & gt; = बी.एक्स_फ्रेम और कुल्हाड़ी & lt; b.x_to और एआई & lt; = b.max_y) ')  

इसे आज़माएं:

<प्री> df [df $ y & lt; = matchDf $ max_y [कट (df $ x, c (0, matchDf $ x_to))],] xy 1 100 0.10 2 100 0.20 4 250 0.20 7 375 0.20 8 375 0.25 10 420 0.15 11 420 0.16 12 420 0.17 13 500 0.23

यहाँ क्या हो रहा है कि कट आपको matchDf < / कोड> df में प्रत्येक अवलोकन होना चाहिए। उसके बाद, आप इसे केवल एक स्थितीय पंक्ति निष्कर्षण वेक्टर के रूप में उपयोग करते हैं, और y के लिए सशर्त रिश्ते को और lt का उपयोग करते हैं। ; =

यह देखने के लिए कि कैसे कट काम करता है, बस इसे अभिव्यक्ति से हटाएं:

  & gt; कट (डीएफ $ x, सी (0, मैचडीएफ $ x_ टू)) [1] (0,300) (0,300) (0,300) (0,300) (0,300) (0,300) (300,500) (300,500) (300,500) (300,500) (300,500 ] (300,500) (300,500) (300,500) स्तर: (0,300) (300,500) (500,1e + 05)  

स्तर लेबल अप्रासंगिक हैं, क्योंकि [ निकालने के लिए अंतर्निहित पूर्णांक मानों का उपयोग करता है।


java - How to get PrivateKey from keystore.pkcs12 file -


I'm trying to get a private key from the keystore file,

  keyStore Load (KeyStoreinputStream, "keystorepass" .toCharArray ()); Private key key = (Personal) keystore. Gateke (aka, new characters [0]);  

New four [0] -> I have not given a password for the private key at the time of generation.

Reduce exception:

  java.security.UnrecoverableKeyException: get key failed: last block on java.security properly Pad is not given. KASTOR.GETKE (Keystore.Java: 792) by: javax.crypto.BadPaddingException: com.sun.crypto.provider.CipherCore.doFinal (CipherCore.java:811) com.sun.crypto.provider at the last block. CipherCore.doFinal (CipherCore.java:676) has not been properly padded on com.sun. 

The new four [0] is not correct if there is no key password, then use null.


sql server - Deleting a stored procedure in the database -


While examining temptation (and then deleting), I'm using the same format on it:

  If object_id ('my_sp', 'U') is not a tap drop process enter my_sp process as dbo.my_sp (@ kwori varchar (100), @ search varchar (100)) [ Table] (Considering the examples of MSDN, this approach should work I / O>  

However, this is not:

first in the database Is a 'my_sp' item from itself.

An alternative approach would be something like

  from SELECTs OBJECT_NAME (my_sp) to sys.sql_modules as defined by '%' + 'mySP' + '%'  < / Div> 

in the object_id ('my_sp', 'u') Specifies that the name is a user table , for a process or P Use: object_id ( 'my_sp', 'p')


Fixing wrong branch creation in Perforce -



Fixing wrong branch creation in Perforce -

i inherited project used perforce version control. although product has many versions branches done in copy-paste style.

the result can't view file history or utilize time lapse view.

is there way retroactively bind separated branches , tell perforce branch 2.x branch 1.x ?

i've been in similar situation 1 time before, , did integrate branch 1.x branch 2.x, "accept target" when resolving files. not sure if you're looking for, @ to the lowest degree found integration history if there ever future updates 1.x branch you'd integrate 2.x.

perforce

SQL - select the penultimate date -



SQL - select the penultimate date -

i have table has [archivedate] column this:

archivedate 2014-10-06 2014-10-06 2014-10-06 2014-10-01 2014-10-01 2014-10-01 2014-10-01 2014-05-22 2014-05-22

i want select penultimate date, when use:

select max([archivedate]) -1 'previousweek' [pipelinearchive]

i 2014-10-05 (which doesn't exist in column), rather 2014-10-01.

i can't figure out how code select "last one"; help much appreciated!

thank you.

you need sort on archivedate in descending order, skip 1 record, , take next one. example, in sql server 2012 way:

select distinct [archivedate] [pipelinearchive] order [archivedate] desc offset (1) rows fetch next (1) rows

demo.

sql

git - Should I worry about repeating commit logs following rebase upstream/master? -



git - Should I worry about repeating commit logs following rebase upstream/master? -

i'm git newbie, , can't find reply issue elsewhere. apologies if it's rather basic question.

so: i've forked project, , cloned fork. i've set remotes have upstream (originalproject/sitename.git) , origin (myfork/sitename.git). i've created branch local master , i've been working in branch. in meantime, there have been updates on upstream.

so checked branch local master and: (master)$ git fetch upstream (master)$ git rebase upstream/master

however, when git log check i've got latest upstream commits, lists same git commits tens of times on - lists commit logs 6 weeks ago now, semi-colon, lists commit logs 7 weeks ago now, semi-colon, lists commits logs 8 weeks ago now, , on.

my question this: should worried these repeating commit logs? if shouldn't worried, branch i'd been working in date, 'git checkout branchname' , 'git rebase master'?

any help much appreciated.

many thanks

git github git-rebase git-log

javascript - Jqgrid subgrid json data not showing -



javascript - Jqgrid subgrid json data not showing -

the main grid loads info fine, subgrid info not displayed.

this json info returned java controller subgrid:

{"alltrackingnrs":null,"page":1, "records":[{"reference":"dgl1008","shipunittype":"carton","totalofcartons":1,"trackingnr":"slc160759060"},{"reference":"dgl-1008","shipunittype":"carton","totalofcartons":1,"trackingnr":"slc160759060"},{"reference":"dgl-1008","shipunittype":"carton","totalofcartons":1,"trackingnr":"slc160759060"},{"reference":"dgl1008","shipunittype":"carton","totalofcartons":1,"trackingnr":"slc160759060"}], "recordstotal":4,"rows":4,"sidx":null,"sord":"asc","total":1,"trackingnr":"slc160759060","truckid":null,"truckshipmentcomponent":{}}

this javascript code

<script type="text/javascript"> jquery().ready(function () { var grid = jquery("#shipment_grid"); var maingridprefix = "s_"; grid.jqgrid({ url: '${pagecontext.request.contextpath}/gettruckshipmentjsonaction?truckid=' + <c:out value="${truckid}" />, datatype: "json", mtype: 'get', colnames: ['lead tracking #'], colmodel: [ {name: 'trackingnr', width: 100} ], rownum: 10, height: "auto", width: 850, idprefix: maingridprefix, autoheight: true, rowlist: [10, 20, 30], pager: jquery('#shipment_grid_pager'), sortname: 'trackingnr', emptyrecords: 'no shipments found selected filter(s)', sortorder: "desc", jsonreader: { root: "records", page: "page", total: "total", records: "rows", repeatitems: false }, viewrecords: true, altrows: false, gridview: true, multiselect:true, hidegrid: false, shrinktofit: true, forcefit: true, idprefix: maingridprefix, caption: "shipments overview", subgrid: true, loadcomplete: function(data) { grid.jqgrid('setcolprop', 'trackingnr',{ searchoptions: { clearsearch: true, attr: {style: "align:'left'; width:150px;margin-top:1px;"}, sopt:['cn'], datainit: function(elem) { $(elem).autocomplete({ source:data.alltrackingnrs, delay:0, minlength:2 }); } } }); grid.jqgrid('filtertoolbar', {autosearch: true}); // cut down font size of autocomplete input $(".ui-autocomplete.ui-widget").css({fontsize: "11px"}); }, subgridrowexpanded: function (subgriddivid, rowid) { var rowdata = grid.getrowdata(rowid); var seltrackingnr= rowdata['trackingnr']; var $subgrid = $("<table id='" + subgriddivid + "_t'></table>"); // purerowid = $.jgrid.strippref(maingridprefix, rowid), // subgrids = $(this).jqgrid("getgridparam", "userdata"); $subgrid.appendto("#" + $.jgrid.jqid(subgriddivid)); $subgrid.jqgrid({ data: "json", mtype: 'get', url: '${pagecontext.request.contextpath}/gettruckshipmentjsonaction?trackingnr=' + seltrackingnr, colnames: ['ship type (pallet / carton)', 'ship unit (pallet id / cone #)', 'total cartons'], colmodel: [ { name: "shipunittype"}, { name: "reference", sorttype: "integer" }, { name: "totalofcartons", sorttype: "integer" } ], cmtemplate: { align: "center" }, jsonreader: { root: "records", repeatitems: false }, sortname: "reference", sortorder: "desc", height: "100%", rownum: 10, autowidth: true, autoencode: true, gridview: true, idprefix: rowid + "_" }); } }).navgrid('#shipment_grid_pager', {edit: false, add: false, del: false, search: false, refresh: true}) .jqgrid("setlabel", "trackingnr", "", {"text-align": "left"}); //align 'lead tracking #' column header left; }); </script>

how can subgrid info displayed?

i have fixed problem, typo error. wrote data: "json", instead of datatype: "json" in subgridrowexpanded: function (subgriddivid, rowid) {....} function

javascript json jqgrid subgrid

groovy - SQL Query result not displaying in Grails view -



groovy - SQL Query result not displaying in Grails view -

i have followed several examples, can't seem final part of displaying query work. not getting errors, not displaying though query works in sql , know valid. can't figure out i'm missing. help appreciated.

my controller -

import groovy.sql.sql class v1controller { def datasource def index() { def namelist = { def db = new sql(datasource) def results = db.rows("select name table") //results.each{row -> log.debug .name} [results:results] } } }

my view -

<p> results: <g:each in="${results}"> <tr>row - <td>${results.name}</td></tr> </g:each> </p>

thanks responses, have tried these 2 ways , still not getting results in view.

<g:each in="${results}"> <tr>${it.name}</tr> </g:each> <g:each in="${results}" var="r"> <tr>name - ${r.'name'}</tr> </g:each>

thanks joshua! used recommendation on view, , had comment out other action name 'namelist', think realized trying create nested action , didn't need it. works now!

def index() { //def namelist = { def db = new sql(datasource) def results = db.rows("select name mit_test_name") //results.each{row -> log.debug .name} homecoming [results:results] db.close() //} }

there 2 issues here. first aren't using <g:each> tag correctly, , secondly property name isn't right according sql statement.

<g:each in="${results"} var="r"> <tr> <td>${r.'name'}</td> </tr> </g:each>

as can see above have give tag variable name (in case) knows how address individual element in scope of loop. picked r example. secondly, notice when access column name it's in single quotes , matches case of column returned in sql statement.

this should resolve issues.

grails groovy

eclipse - Android Emulator Stops Unexpectedly before it loads my app -



eclipse - Android Emulator Stops Unexpectedly before it loads my app -

my android emulator used work fine (emulating 10.1in tablet api level 15) launches repeatedly messages phone has stopped unexpectedly, ui has stopped unexpectedly, calendar has stopped unexpectedly, etc, etc, , cannot load app. have reduced sd capacity 10m , ram 512 cannot emulator load more demanding 4 inch phone running api level 10. not app stopping, emulator. suggestions appreciated. should/can reload arm scheme image in eclipse instance? if select image in sdk manager warns me if remove bundle cannot undone.

android eclipse android-emulator

java - Equivalent of "android.library=true" in Android Studio -



java - Equivalent of "android.library=true" in Android Studio -

i new android studio , intellij idea, previous eclipse user.

the module i'd add together dependency module doesn't show in list of dependencies available add together project.

in eclipse, inserting android.library=true in project.properties enable added dependency. how 1 create show in available dependency module list in android studio?

thanks.

in build.gradle file:

change apply plugin: 'android' apply plugin: 'android-library'

http://tools.android.com/tech-docs/new-build-system/user-guide#toc-library-projects

java android eclipse intellij-idea android-studio

c# - Populate ViewModel with data returned from Entity Framework query -



c# - Populate ViewModel with data returned from Entity Framework query -

i'm new entity framework please bare me.

i have next view model

public class vmperson { public person person { get; set; } public personaddress personaddress { get; set; } public personemploymenthistory personemploymenthistory { get; set; } }

i create phone call function , pass in personid, seek populate person class follows , pass viewmodel (there other queries in here populate address , employment history)

public vmperson loadpersonbyid(int personid) { var vmperson = new vmperson(); using (var context = new context()) { var r = (from p in context.person bring together in context.personaddress on p.personid equals a.personid bring together e in context.personemployment on p.personid equals e.personid p.personid == personid select new { vmperson.person.personfirstname = p.personfirstname, vmperson.person.personsurname = p.personsurname, vmperson.person.personemail= p.personemail, vmperson.person.age = p.age }); } homecoming vmperson; }

but error on statements within select new{} is

anonymous type projection initializer, should simple name or fellow member access expression

again i'm new entity framework help highly appreciated.

thanks

public vmperson loadpersonbyid(int personid) { using (var context = new context()) { var r = (from p in context.person bring together in context.personaddress on p.personid equals a.personid bring together e in context.personemployment on p.personid equals e.personid p.personid == personid select new vmperson { person = p, personaddress = a, personemploymenthistory = e }).firstordefault(); homecoming r; } }

c# entity-framework-6

android - Listen for URL fragment id change in WebView -



android - Listen for URL fragment id change in WebView -

it seems webviewclient methods such shouldinterceptrequest(), onpagestarted(), , shouldoverrideurlloading() hear url changes cause webview load new page. there way observe url changes fragment ids, i.e. index.html#fragment_id, on webview?

i know old question found out solution isn't available anywhere in stack overflow. jpetitto's reply works messes javascript if utilize hash alter routing or other such features.

i found out overriding method doupdatevisitedhistory in webviewclient can grab url's on hash change. see below snippet example.

mwebview.setwebviewclient(new webviewclient() { @override public void doupdatevisitedhistory(webview view, string url, boolean isreload) { super.doupdatevisitedhistory(view, url, isreload); // somecode run on hash change. } }

note: method fired on hash alter , url change.

android android-webview webviewclient

javascript - Raise click event on an element from another template -



javascript - Raise click event on an element from another template -

i made view saving , showing models. has events this,

events: -> "click li": "addentry" "click .remove": "destroyentry" addentry: (e) -> movie_title = $(e.target).text() @collection.create title: movie_title appendentry: (entry) -> view = new movieseat.views.entry(model: entry) $('#entries').append(view.render().el) destroyentry: (e) -> thisid = @$(e.currenttarget).closest('div').data('id') @collection.get(thisid).destroy()

now if set li element in template , click on addentry event gets triggerd , saves model rails database. destroyentry event works remove models. , appendentry function gets triggered when model gets added collection.

but i'm using different view show collection of movies in list. want connect click li event li on different template. possible? if so, how?

in other view, can utilize same source of data. in case collection of movies. since it's backbone, , views representation of info models, utilize info render or trigger changes in views.

in other view, watch changes on collection beingness manipulated. no need delegate events when care info beingness changed.

otherview = backbone.view.extend initialize: (params) -> # model, i'm not sure how have configured @listento params.movieseats, "change", @updatemovies updatemovies: -> # manage view here

javascript jquery ruby-on-rails backbone.js

tsql - In SSMS is there a way to export a list of job steps in a SQL Server Agent job? -



tsql - In SSMS is there a way to export a list of job steps in a SQL Server Agent job? -

in ssms there way export list of job steps in sql server agent job?

the reason i'm asking i've been asked organize long list of job steps placed in 3 different jobs. i'd share team in excel document can create notes, demonstrate grouping , sorting ideas, argue it, etc.

is there way can export list, or @ to the lowest degree print it? screenshot, except list extends past screen? i'm not looking forwards keying hand excel.

thank ideas.

you can query server;

select job.name, steps.step_id, steps.step_name, steps.command msdb.dbo.sysjobs job inner bring together msdb.dbo.sysjobsteps steps on steps.job_id = job.job_id job.enabled = 1 order 1, 2

tsql ssms

python - Proportional rounding error -



python - Proportional rounding error -

i have snippet of code takes big info set , turns proportional smaller info set allow me explain:

lets have 20 bluish marbles , 10 reddish marbles, if wanted represent info 3 marbles utilize 2 bluish , 1 reddish marble.

i don't mind if not exact illustration representing 17 bluish , 16 reddish 4 marbles. closest way proportionally represent 2 bluish , 2 reddish , that's okay

this code in python :

from random import randrange data_set = [randrange(100, 1000) x in range(5)] required_amount = 20 special_number = required_amount / sum(data_set) proportional_data_set = [round(x * special_number) x in data_set] print(data_set) print(required_amount) print(proportional_data_set) print(sum(proportional_data_set))

the problem required sample 20 proportional info set give me 21 or 19 total. i'm assuming it's because of rounding error know improve way solve problem?

a sample output working correctly :

[832, 325, 415, 385, 745] 20 [6, 2, 3, 3, 6] 20

a sample working incorrectly :

[414, 918, 860, 978, 438] 20 [2, 5, 5, 5, 2] 19

if knows of similar methods great.

here's 1 way solve problem. calculate special_number number of units in data_set per "marble". utilize divmod() calculate both proportional amount , remainder. since divmod() returns integer quotient, sum(proportional_data_set) less required_amount in cases.

finally, utilize loop find highest remainder , increment proportional_data_set until sum(proportional_data_set) = required_amount.

from random import randrange data_set = [randrange(100, 1000) x in range(5)] required_amount = 20 special_number = sum(data_set) // required_amount print("data set:") print(data_set) print("special number:") print(special_number) # divmod() returns pair of numbers, split them quotients , remainders pairs = [divmod(x, special_number) x in data_set] proportional_data_set = [x[0] x in pairs] remainder = [x[1] x in pairs] print print("proportional info set before adjusting:") print(proportional_data_set), "=", sum(proportional_data_set) print("remainders:") print(remainder) while sum(proportional_data_set) < required_amount: = remainder.index(max(remainder)) # index of highest remainder proportional_data_set[i] += 1 # add together marble index remainder[i] = -1 # don't utilize remainder 1 time again print print("proportional info set after adjusting:") print(proportional_data_set), "=", sum(proportional_data_set) print("remainders:") print(remainder)

the output looks like:

data set: [546, 895, 257, 226, 975] special number: 144 proportional info set before adjusting: [3, 6, 1, 1, 6] = 17 remainders: [114, 31, 113, 82, 111] proportional info set after adjusting: [4, 6, 2, 1, 7] = 20 remainders: [-1, 31, -1, 82, -1]

the highest remainders used increment proportional info set , set -1.

python dataset rounding

performance - Given two buckets each containing an identical set of balls, each ball with two colored numbers, does a certain matching algorithm scale as N^2? -



performance - Given two buckets each containing an identical set of balls, each ball with two colored numbers, does a certain matching algorithm scale as N^2? -

for client, have scaling problem have boiled downwards next fundamental combinatorics problem.

suppose there bucket containing n balls, each ball random reddish number , random bluish number written on it. (assume numbers positive integers.)

suppose there sec bucket identical set of balls (i.e., has n balls , balls correspond balls in first bucket, in terms of numbers written on balls.)

the question i'd reply client efficiently possible big n in computer programme following:

consider every possible pairing of balls between 2 buckets (i.e., 1 ball first bucket , 1 ball sec bucket). how many such pairs satisfy status product of 2 reddish numbers in pair same product of 2 bluish numbers in pair?

the question here stackoverflow is: efficient possible algorithm solve problem o(n^2)? think so, cannot prove it.

thanks!

nope. have o(n) solution, involving hashtable on (reduced) ratio of red_value/blue_value 1 of buckets. filling hashtable o(n). matching blue_value/red_value other bucket against table o(n), since each lookup o(1).

it's hashtable, not hashset, because there can multiple balls same ratio.

one can utilize trie o(1) lookups.

performance math combinations scaling combinatorics

wamp - VPS and WAMPSERVER -



wamp - VPS and WAMPSERVER -

i have vps server, installed wamp server on when access

http://localhost/

it looks this: see image

when access public ip address looks this: see image

when access private ip address on vps looks this: see image

and when access private ip address on pc looks this: see image

my question need create access wamp pc or outer vps?

wampserver designed developers tool used on developers desktop pc.

for reason comes configured in way designed protect newbie , hence apache configured take connections pc running apache, obvious security reasons.

if want allow access other locations have alter apache configuration.

the quick , simple, , of course of study most dangerous method utilize put online menu alternative on wampmanager menu.

wampmanager -> set online

that alter apache config ( httpd.conf ) allow access ip adddress in universe. that may not want do alternatively can manually edit httpd.conf file ( utilize wampmanager menus )

wampmanager->apache->httpd.conf

find section of file

# onlineoffline tag - don't remove require local

it may have done put online

# onlineoffline tag - don't remove require granted

and alter allow specific ip address's or address ranges system

a specific ip ( pc lets ) while developing, add together line

require 111.222.333.444

you , friend

require 111.222.333.444 222.333.444.555

a whole subnet

require 111.222.333

remember, not adding internal ip address, 192.168.?.? using routers wamp ip.

basically should read part of apache manual

wamp hosting vps

c# - Custom conditions Parallel.For -



c# - Custom conditions Parallel.For -

i know th next line

system.threading.tasks.parallel.for(0, 5, (j, u) => {});

equals

for (int j = 0; j < 5; j++){}

but what's parallel code for

for (int = 0; (i < x + y && < z); i++)

it sounds want parallel.while construct, doesn't exist. can approximate functionality using this:

public static void while( paralleloptions paralleloptions, func<bool> condition, action<parallelloopstate> body) { parallel.foreach(new infinitepartitioner(), paralleloptions, (ignored, loopstate) => { if (condition()) body(loopstate)); else loopstate.stop(); }); }

stephen toub has blog on msdn

edit: throw out option, can utilize loopstate break out of parallel loop based on our condition. (psuedo code here:

parallel.for(0, n, (i, loopstate) => {

// ...

if (!(i < x + y && > < z)) {

loopstate.break(); return;

} });

c# for-loop parallel-processing

javascript - Redirect Jquery mobile to new page with triggering of functions in this page? -



javascript - Redirect Jquery mobile to new page with triggering of functions in this page? -

i building mobile app, using jquery mobile, , in front end page let's phone call page-1 contains navigation buttons different pages let's phone call 1 of them page-2

below page-1

$(document).ready(function () { $("body").pagecontainer({ defaults: true }); $("#page-2").click(function () { $("body").pagecontainer("change", "page-2.html", { reload: true }); $(document).ready(function () { function_in_page - 2.init(); }); });

page-2 has next

var function_in_page = { init: function () { alert('first-1'); $("#button-1").click(function () { alert('second-1'); }); });

so happening alert of "first-1" when click button id (button-1) nil happens , advise?

first of all, .pagecontainer() auto-initialized default settings, don't need initialize it.

secondly, refrain using .ready() add together listeners in jquery mobile , stick pagecontainer events instead. latter events fired whenever jqm framework loads page and/or navigates via ajax, in single page model. unlike .ready() fires 1 time when framework initialized.

there many methods command webapp using jquery mobile in single page model using pagecontainer events. safest way give each page unique id in order determine event omitted on page. note, need know no matter how many external pages have, 2 pages remain in dom; homepage , external page have navigated homepage.

to add together listeners, utilize pagecreate event, equivalent .ready() , can delegated specific pages.

class="lang-html prettyprint-override"><div data-role="page" id="home"> class="lang-js prettyprint-override">$(document).on("pagecreate", "#home", function () { $(".selector").on("click", function () { /* run code */ }); });

that event fire 1 time per page, note fire 1 time again on external page loaded via ajax. therefore, should remove previous bindings before adding new ones, using .off(). otherwise, attached listeners multiple whenever load external page via ajax.

class="lang-html prettyprint-override"><div data-role="page" id="second"> class="lang-js prettyprint-override">$(document).on("pagecreate", "#second", function () { $(".selector").off("click").on("click", function () { /* run code */ }); });

keep custom js code in head of pages, although code loaded 1 time in first run. jquery mobile loads first page div of each external page, outside div exclusively neglected.

back code above, here how should like. give each page id, , utilize them add together click listeners. let's assume home homepage , second page-2.html.

class="lang-js prettyprint-override">$(document).on("pagecreate", "#home", function () { $("#btn").on("click", function () { $.mobile.pagecontainer.pagecontainer("change", "page-2.html"); }); });

now, page-2.html visible. add together click listener button-1.

class="lang-js prettyprint-override">$(document).on("pagecreate", "#second", function () { $("#button-1").off("click").on("click", function () { alert("page 2"); }); });

demo

read more pagecontainer events.

javascript jquery jquery-mobile

objective c - Changing different views in Xcode 6 os x application using Storyboards -



objective c - Changing different views in Xcode 6 os x application using Storyboards -

i'm checking out new xcode 6 storyboards os x application

i want same when doing force segue in ios side.

but new xcode storyboards os x application doesn't have force segue.

so can see there no push. how achive same functionality?

i haven't tested it, i've used similar approach on ipad app. needs tailoring cocoa:

-(void) perform { uiview *source = ((uiviewcontroller *)self.sourceviewcontroller).view; uiview *destination = ((uiviewcontroller *)self.destinationviewcontroller).view; uiwindow *window = [[[uiapplication sharedapplication] delegate] window]; destination.center = cgpointmake(source.center.x + source.frame.size.width, destination.center.y); [window insertsubview:destination abovesubview:source]; [uiview animatewithduration:0.4 animations:^{ destination.center = cgpointmake(source.center.x, destination.center.y); source.center = cgpointmake(0- source.center.x, destination.center.y);} completion:^(bool finished){ [source removefromsuperview]; window.rootviewcontroller = self.destinationviewcontroller; }]; }

let me know if works.

objective-c xcode cocoa swift xcode6

c# - ASP.NET is not authorized to access the requested resource when accessing temp folder -



c# - ASP.NET is not authorized to access the requested resource when accessing temp folder -

my application have created using asp.net , c# uses temporary path store document whilst read, , deletes after:

string path = string.concat((server.mappath("~/temp/" + fileupload1.filename))); array.foreach(directory.getfiles((server.mappath("~/temp/"))), file.delete);

thankyou help. stockcontrol document illustration , imported multiple computers on network. based on error message looks file not beingness uploaded , saved temp directory...

local path when debugging (works):

c:\users\user\documents\visual studio 2013\projects\webapplication5\webapplication5\temp

the application deployed when attach file , press "import", displayed error message: access path 'c:\inetpub\wwwroot\stockcontrol\temp\book1.xls' denied.

description: unhandled exception occurred during execution of current web request. please review stack trace more info error , originated in code.

exception details: system.unauthorizedaccessexception: access path 'c:\inetpub\wwwroot\stockcontrol\temp\book1.xls' denied.

asp.net not authorized access requested resource. consider granting access rights resource asp.net request identity. asp.net has base of operations process identity (typically {machine}\aspnet on iis 5 or network service on iis 6 , iis 7, , configured application pool identity on iis 7.5) used if application not impersonating. if application impersonating via , identity anonymous user (typically iusr_machinename) or authenticated request user.

to grant asp.net access file, right-click file in file explorer, take "properties" , select security tab. click "add" add together appropriate user or group. highlight asp.net account, , check boxes desired access.

source error:

an unhandled exception generated during execution of current web request. info regarding origin , location of exception can identified using exception stack trace below.

a simple prepare solve issue, in iis had right click on application pools , set .net framework v4 integrated rather classic/

another solution set specific folder beingness accessed read/write users required it, can done unique users or within organization, grouping of users

c# asp.net iis

java - embedding and extracting data in an image -



java - embedding and extracting data in an image -

i wrote code embeds , extracts text in image. despite best attempts not able understand wrong in code due extraction not successful.looking help on same. here code

public class embedandextract { //embedding sequence bufferedimage embed(bufferedimage img, string s) { int pixel[] = img.getrgb(0, 0, img.getwidth(), img.getheight(), null, 0, img.getwidth()); //the manipulated pixels saved in newpixel[] int[] newpixel = arrays.copyof(pixel, pixel.length); int len = s.length(); int q = 0; //each string embedded prefixed 4 chars contain length of string // string "abc" s1="0003abc" //here first 4 chars show length of string (int = 0; < 4; i++) { if (len % 10 == 0) { break; } else { len = len / 10; q++; } } string s1 = ""; (int = 0; < 4 - q; i++) { s1 += 0; } s1 += s.length(); s1 += s; // convert s1 byte array byte[] b = s1.getbytes(); (int = 0; < b.length; i++) { system.out.println("" + (char) b[i]); } //change value of newpixel[] per string int count = 0; (int = 0; < b.length; i++) { byte current_byte = b[i]; (int j = 7; j >= 0; j--) { int lsb = (current_byte >> j) & 1; newpixel[count] = (pixel[count] & 0xfffffffe) + lsb; system.out.println(lsb + ":(" + pixel[count] + "," + newpixel[count] + ")"); count++; } } //add newpixel[] bufferedimage , homecoming bufferedimage nimg = new bufferedimage(img.getwidth(), img.getheight(), bufferedimage.type_4byte_abgr); nimg.setrgb(0, 0, nimg.getwidth(), nimg.getheight(), newpixel, 0, nimg.getwidth()); homecoming nimg; } //extraction sequence string extract(bufferedimage img) { //read pixel of image int newpixel[] = img.getrgb(0, 0, img.getwidth(), img.getheight(), null, 0, img.getwidth()); //extract length first 32 pixel values i.e constitute 4 bytes string qw = ""; (int = 0; < 32; i++) { qw += (newpixel[i] & 0x00000001); } //convert length integer , save in total int n1, n2, n3, n4, total; n1 = integer.parseint(qw.substring(0, 8), 2) - 48; n2 = integer.parseint(qw.substring(8, 16), 2) - 48; n3 = integer.parseint(qw.substring(16, 24), 2) - 48; n4 = integer.parseint(qw.substring(24, 32), 2) - 48; total = n1 * 1000 + n2 * 100 + n3 * 10 + n4; system.out.println("" + total); //extract string image , reurn string string secret = ""; int bit = 0; (int = 0; < 4 + total; i++) { int ascii = 0; (int j = 7; j >= 0; j--) { ascii += (newpixel[bit] & 1) << j; bit++; } secret += (char) ascii; } homecoming secret; } }

the first 32 pixel values contains length of info in embedding sequence , extracting sequence coming different don't know how. if 1 can resolve errors wouldbe grateful.

java rgb bufferedimage steganography