Sunday 15 April 2012

sql server - find the duplicate and write it in log file -


I have a code that reads AC no, RTN, name and AMT in the record file and reads the stores in stores. After this I have created SQL which stores RecordSet data in the SQL Server 2005 table.

The problem is that the exono column has the primary key but in my text file I have some duplicate exxno while adding the record set in the database, if it looks like a duplicate esenano, then it is stopping there and that duplicate The column is not inserting a row after.

Now what I want to do is if there is a duplicate column, then I want to store that column in the log file and leave that column and put the remaining column in the dash. I do not know how to do this. Can anybody help me. Check out how to duplicate columns and leave that and prefer to insert the rest. Record the database to frmDNELoad.lblStatus.Caption = "Data Loading Database in ......" dim lngRecCount as long lngRecCount cmdCommand with = 0 .ActiveConnection = objConn .CommandText = 'And the "rcdDNE" ("RTN") and "t_DATA_DneFrc (RTN, AccountNbr, First, MiddleName, Last Name, Zodiac) values ​​(" "', '' and rcdDNE rcdDNE.MoveFirst (" AccountNbr ") and" '' And rcdDNE ("first") and "'," "and rcdDNE (" MiddleName ") and"', "" and rcdDNE ("last name") and "'," and RcdDNE ("zodiac") and "')" .CommandType = adCmdText end set rcddnefrc = New ADODB.Recordset with rcddnefrc .ActiveConnection = objConn. Source = "Select * FROM T_DATA_DNEFRC" .CursorType = adO PenDynamic .CursorLocation = adUseClient .LockType = AdLockOptimistic.Until rcdDNE.EOF lngRecCount = lngRecCount + 1 frmDNELoad.lblStatus.Caption = "Adding a record" & lngRecCount & "of" & rcdDNE.RecordCount and "in database." FrmDNELoad.Refresh DoEvents Call CommitNew rcdDNE.MoveNext Loop frmDNELoad.lblStatus.Caption = "DNE Processing Complete." FrmDNELoad.Refresh termination function Sub CommitNew () 'rcddnefrc .Requery. AddNew. Add records on DneFrc table with fields! [RTN] = rcdDNE.Fields! [RTN] .Fields! [AccountNbr] = rcdDNE.Fields! [AccountNBR]. Fields! [First] = rcdDNE.Fields! [First] .Fields! [MiddleName] = rcdDNE.Fields! [MiddleName] .Fields! [Last name] = rcdDNE.Fields! [LASTNAME] .Fields! [Zodiac] = rcdDNE Fields! [Zodiac] .Update with End End Sub

to add to the maintenance of my suggestion error Will be commissions new to see if the row will insert the primary key infringed, and if it is, then handling the other.

example:

  sub-comment new) '' error on gotit Niv_Error DaveFrc #Add record on table rcddnefrc .Requery .addNew with Fields! [RTN] = rcdDNE.Fields! [RTN] .Fields! [AccountNbr] = rcdDNE.Fields! [AccountNbr] .Fields! [First] = rcdDNE.Fields! [First] .Fields! [MiddleName] = rcdDNE.Fields! [MiddleName] .Fields! [Last name] = rcdDNE.Fields! [LASTNAME] .Fields! [Zodiac] = rcdDNE. Feilds! [Zodiac] .Update with subdue sub end '# # If there is no error, then run out routine. CommitNew_Error: If Err.Number = -2147217873 then 'Since you handled' # here the code will only execute if the barrier is infringed call WriteDuplicateAccountToFile () Err.Clear () '' #This clears the error, else '' # Do not do other things with errors "# # If you are not sure, at least show what error its giving, so much MsgBox" had encountered the following error, when the new record was saved: "& amp; ; _VbNewLine & amp; CSRT (error number) & amp; "-" & amp; Error. Description & amp; VbNewLine & amp; _ "New record not saved.", VbOkOnly + vbCritical, "Error" end then End Sub  

For-Each and Pointers in Java -


इस सवाल का पहले से ही एक उत्तर है: < / P>

  • 7 जवाब

ठीक है, तो मैं हूँ एक ArrayList के माध्यम से पुनरावृत्त करने के लिए tyring और एक specefic तत्व को हटा दें। हालांकि, मुझे हर तरह की संरचना का उपयोग करने में कुछ परेशानी हो रही है। जब मैं निम्न कोड चलाता हूं:

  अर्रे लिस्ट & lt; स्ट्रिंग & gt; Arr = नया अर्रेलिस्ट & lt; स्ट्रिंग & gt; (); // ... कुछ मानों के साथ भरें (वास्तव में कोई बात नहीं है) (स्ट्रिंग टी: arr) {t = "कुछ अन्य मान"; // उम्मीद कर रहा है कि यह वास्तविक सरणी} को बदल देगा (स्ट्रिंग टी: arr) {System.out.println (t); // हालांकि, मुझे अभी भी समान सरणी मिलती है}  

मेरे प्रश्न में, मैं 'arr' को एक संकेतक कैसे बना सकता हूँ ताकि मैं मूल्यों को बदल सकूं प्रत्येक लूप के लिए एक? मुझे पता है कि मैं एक अलग संरचना का उपयोग करके ArrayList के माध्यम से लूप कर सकता हूं, लेकिन यह एक बहुत साफ और पठनीय दिखता है, यह 'टी' सूचक बनाने में सक्षम होना अच्छा होगा।

सभी टिप्पणियों की सराहना की जाती है! यहां तक ​​कि अगर आप कहते हैं कि मैं इसे सिर्फ चूसना चाहिए और एक अलग निर्माण का उपयोग करना चाहिए।

मुझे लगता है कि सबसे अच्छा तरीका लूप का उपयोग करने के लिए हो सकता है।

  ArrayList & lt; स्ट्रिंग & gt; Arr = नया अर्रेलिस्ट & lt; स्ट्रिंग & gt; (); के लिए (int i = 0; i & lt; arr.size (); i ++) {स्ट्रिंग टी = arr.get (i); अगर (// आपकी स्थिति पूरी हुई है) {arr.set (i, "आपका नया मान"); }}  

php - image position and clipping -


Someone knows how to place an image in the webpage, but both positions and clipping (maybe resizing too) are done by interactive Does the user go? I need this for my registration page, I have done some clipping and resizing from CSS and Javascript, and it does not really solve the problem, if it can be done by PHP, then it will be right! Thx

Here's a brief summary:

  • Validate the photo as correct type and dimension using PHP's image functions.

  • / li>

  • Show the user with a dragged DRAG in the browser, which they can resize and move can do. This is the crop area.

  • When you click on "Next", you transmit the server to x, y, width, height DIV or either AJX By or in the form of a hidden field.

  • Again, use the PHP image functions to crop the image, and then resize it.

  • Save it to a permanent place.

Post a comment for further specific answers.


python - Finding the joy of Javascript or searching for another UI-focused languages? -


I am a GUI designer / interactive musician who is keen to improve my programming chops. I know basic (variable, loops, arrays, if / some, some logic) already, but I want to learn in a structured way. I have seen some great books / tips on python and processing (and even flash) which is to teach the fundamentals of programming in fun and accessible. I have salvaged these books and have often considered learning Python, but to be honest, I do not know that these professionals can be useful to me on professional terms. I need something directly related to interactive interface scripting / programming and JS is my best bet (I'm trying AS3 but OOP stuff has made something difficult for me).

I know that JS can be fun (is jazzery). But I have not only found sources of learning which are as strong as the above material. I all get tutorials and books that read web development topics, such as farm verification and AJAX I have tried to find out the framework of the JS game, but all of them have been made for experienced developers and Duke Station or Bijnor There is no shortage of tutorials.

So, any instructions to get happiness in JS? Perhaps there are suggestions on other UI-focused languages? Thanks for reading this long question.

Have you seen? I think there is a programming tutorial which is not available for the best python, it is to say that, Python - it also works with web programming (while not a python based book), but why is this additional information Bad talk?


modal dialog - How do you create a sequence of modalViewControllers? -


I have fought and now I should see it in action. I have a notification button on the title page (UIViewController) and I want to display a scene along with the 'Dismiss' button on the left and want to 'expose the detail to the right'. If a 'wide disclosure' is pressed, it brings the privacy statement view with a single button. If a 'wide disclosure' is pressurized, it will bring a credit-view. I should be able to continue this for additional legal, etc.

Apple will dismiss the entire sequence according to one of the doctors, even if there is no where at that time.

I have been able to get ideas to show I, but they will not reject themselves. This leads me to think that I am not using a favorite approach, but I have a Developed the approach, which leaves me with a false framework.

Any suggestions? My thoughts are, but I only have one level two deep and the dismissal does not work! :( I have a total dead end and have to exit the app to get back to the actual app view.

< P> I got it! Actually, the code is concretized with the 'workflow' view controllers. I prepared a style where most of the tech class is done by the management tool and I keep the book and leave it with the content. I'll need some memory management Review, as I think my current code is probably leaking up the controllers above and below the path. Also, the fact is that I can come back and forth, I think I really have ideas There is neither pile nor model view. I will post the code shortly after the end of the week.


Variable assignment in JavaScript -


I have a JS function

I want to specify a variable in a variable

My variable is in a forloop

I have two variables

i.e.

  var spcd_1 = "http: //www.colbridge com"; Var spcd_2 = "http://www.google.com";  

My JS function is

  function OpenNetwork (SPCD) {// Alert ("Hello"); Var tt = spcd; Warning (tt); Var i = 0; Var spcd_1 = "http://www.colbridge.com"; Var spcd_2 = "http://www.google.com"; (I = 1; i  

My problem is here

  var theurl = spcd_ + i; I  theurl  value to  spcd_1  and  spcd_2  

To properly assign a loop to how to change it,

  var theurl = spcd_ + i;  

Anyone can show me the right way.

Thank you

Looks like you add yourself a variable name Instead of trying, you want to index an array. Your code has been modified

  function OpenNewWondo (SPCD) {// Alert ("Hello"); Var tt = spcd; Warning (tt); Var i = 0; Var spcds = []; Spcds.push ("http://www.colbridge.com"); Spcds.push ("http://www.google.com"); (I = 0; i & lt; spcds.length; i ++) for {var theurl = spcds [i]; PopupWin = window.open (theurl, '_blank', 'menubar, toolbar, location, directory, status, scrollbar, resizable, dependent, width = 640, height = 480, left = 0, top = 0')}}  

Just for giggles, here's how you can use containment to get your variable name. Javascript can also contain objects, which means that you can use the ARA syntax to create and retrieve arbitrary properties

  var spcds = {}; SPCDDS ['SPCDD' '] = "http://www.colbridge.com"; Spcds ['spcd_2'] = "http://www.google.com"; // ... var theurl = spcds ['spcd_' + i];  

Algorithm for fitting 2D polygons in an area? -


Is there a standard for this? Algorithm name?

Say: I have 10 polygons of different sizes. I have an area of ​​specific size.

I want to know how to fill the most polygons in that area and how they fit.

Note: Polygon can be rotated on the basis of the restriction set.

One possible name is one. It is related. These problems need to be NP-hard, and many need rehearsals if you can limit the polygon and allowed forms of the area, then a more efficient algorithm may be present for your particular case.


language agnostic - beginning web programming -



WIX adding shortcut to a website or url location using wix and choose custom icon for that shortcut -


I want to add a shortcut to the Start menu group with the following specifications:

  1. You should talk to the website, say www.xyz.com
  2. It should have some custom icons
  3. I have to pass some parameters for it, like www.xyz.com? Lang = XXXX Where XXXX is a language code eg 1033, 1036, etc. And it depends on the language the user chooses for my application.

Please help.

If the website is always the same, then you have a shortcut inside your package for each package. You can try to include which you only support one and only support for that specific language on the disk. In this way you can also control the shortcut that is used for the .url file.


uitableview - How to realize the same effect like iPhone's homescreen -


I want to add some custom buttons and want to feel the effect as the iPhone's Home screen. What can I do to calculate the status of each button and add them to the scene? Are there any other ways to do this? Like a button in the app, add a button

I realized the scene similar to the thumbnail in the photo app In normal color-view, due to the spherical effect of the background color and the buttons using a custom cell (with 4 UIButton inside), it is different.

In my case, this is because I want to scroll And below, scroll down the table in your specific case There should be a way to "lock" by the way, for this reason, in the interface builder it can be easy to design a custom view, this type of scene is very quick to design, and then the UIButtons icons and To provide simple ways to assign tasks, create a custom controller dynamically.

You can also see already recommended three 20 libraries, it has already been implemented, Lake If you do this then the app will be easily rejected.


Send SMS using Skype from PHP -


Is there a real Skype API SMS gateway? I want to develop a very light customer for PHP in Skype.

I have got Skype 4 com but this is not very useful because the user can not send an SMS with the user name / password.

Thanks!

Forget the Skype API, send an SMS directly to the email address of the SMS, most / all carriers 2125551212 @ cingularme .com, or @ vtext.com (these two domains are AT & T and Verizon)


jquery - JavaScript: Trigger a function when two divs touch / overlap -


The title really tells how to do it? Both devices are of different sizes both divs are moving forward (I'm making a little Jquery game). If one kills each other, then I want to get stuff.

Thanks

There is no JavaScript event for overlapping, you can calculate this Whether to divide your overlapping by:

  var valueInRange = function (value, min, max) {return (value> = min)) and amp; Amp; (Value & lt; = max); } Var overlap = function (x1, y1, w1, h1, x2, y2, w2, h2) {xOverlap = valueInRange (x1, x2, x2 + w2) || Mannarange (X2, X1, X1 + W1); YOverlap = valueInRange (y1, y2, y2 + h2) || Mannarange (y2, y1, y1 + h1); Return x overlap & amp; Amp; YOverlap; }  

python - Is SOAPpy the same thing as SOAPy? -


I generally read the documentation to find out, but links from both websites are at source and both are 404. / P>

They are 2 separate projects

SAP Adam Elman (se.)

SOAPpy was originally written by Qasl Ulmann and Brian Matthews (from.)


powershell - Determine If Solution Compiles using MSBuild and PSake -


I put together a PSake (v2.0) build script, and set the script $ psake Used to be. Build_success as property true even thought that calls to MSBuild fails. Can someone advise me to change the script so that the $ psake.build_success property can correctly return the false when the MSBuild call fails?

My PSake build script is as follows:

  properties {$ solutionFile = 'SOLUTION_FILE' $ buildSuccessfulMessage = 'The solution was successfully created!' $ BuildFailureMessage = 'Failed to create solution!' $ Clean Message = 'Execute Clean!' } Work default - BuildSolution creates the work BuildSolution {msbuild $ solutionFile / t: clean, build ($ psake.build_success) {$ buildSuccessfulMessage} and {$ buildFailureMessage}}  

What is the use of PowerShell in the original $ lastExitCode (i.e., WIn32 ExitCode) reference? I guess the one built in is only relevant when you are bringing a CMDlet related to a semicam.

i.e., replace the check with

  (if $ Lastexitcode -eq 0) { 

Disclaimer: Experience only the podcast level of psake With: D


Regex with exception of particular words -


I have problems with regex; I need to create regex with the exception of a set of specified words, for example: Apple, orange, juice And these words are given, it will match everything except the above words apple (should not match) Applejus (match) Yamjis (match) delicious apple-juices (match) orange appellous (match) orange (should not match) juice (Match should not be) orange - apple-juice (match) apple-orange-apal (match) juice-juice-juice (match) orange-juice (match)

If you really want to do this with a regular expression, then you May seem helpful (especially negative attitudes in this example) Regenges written for Ruby (different syntax for some implementations are different):

  rx = / ^ (?! Apple $ | orange $ | juice $) /  

c++ - Swapping two variable value without using third variable -


One of the very difficult questions asked in an interview.

Swap values ​​of two variables like a = 10 and b = 15 .

To automatically swap two variable values, we need a 3G variable:

  temporary = a; A = b; B = temporary;  

Now it is necessary to swap values ​​of two variables without using 3 variables.

sql server - has ms sqlserver data vault feature? -


As far as I know that the Oracle has "data volt" feature. Is there a SQL Server for this? If it is, then I would like to stop the over-privileged users (DBA) from accessing an

  * application data * distinguishing duty * Who, when and where, application, data and database controls Providing can be accessed.  

and search for which specific security and auditing features are doing?

- Edit -

SQL Server has a super superstar, however, roles can be created with restricted administrative privileges.

From your link:

  • Provide control over who, when, how and how applications, data and databases can be accessed.

In case of ACL modeling I can not say anything about 'IO'. But when, where and what the model can be done.

Does anyone know that time can be represented in the ACL model?


ruby on rails - What CI server and Configuration Management tools I should use -


In order to actually develop development and maintenance, I should use the CI server and the configuration management tool.

Some assumptions:

• Code control version is OK - GIT (actual tool)

Test framework is fine - whatever (RSPC is my choice)
Code coverage and analysis is fine - whatever (metric-foo, for example)
server stack is fine - (for example travelers)
Issues tracker (redmine) <
•, ...

I want to run integrity and moonlight projects, it is good for me to start, right? ?

What do you do

Bruno

CI- I personally like Hudson, especially with the Gogle Hudson plugin Its user friendly and decent reporting metrics.

CM - git

Test Framework - Depending on the size, but I write our team unit test and Hudson has run the unit testing package code checkin.

Issue Tracker - Track But, I did not use redmine


interop - c# and excel automation - ending the running instance -


I have the same problem. I read the whole formula and tried the given examples. I added these lines to the sample code:

  xlRange = (Excel.Range) xlWorkSheet.get_Range ("B1", "C1"); XlRange.Merge (Type.Missing); XLR = (Excel.Range) xlWorkSheet.get_Range ("H5", "M5"); XlRange.Merge (Type.Missing); XLRange = (Excel Ranges) xlWorkSheet.get_Range ("N5", "V5"); XlRange.Merge (Type.Missing); XLRz = (Excel Ranges) xlWorkSheet.get_Range ("W5", "Z5"); XlRange.Merge (Type.Missing); // Everything looks good here / up to ////////////////////////////////////// ///////////////////// // If I add these lines below, the process is hanged up to 1/9 only. I manually xlRange = ( Excel.Range) xlWorkSheet.get_Range ("AA5", "AB5"); XlRange.Merge (Type.Missing); Xlborder.borders.ightight = Excel.XlBorderWeight.xlThin; //////////////////////////////////////////////// /////////  

Before adding the excelashate object, I also added: Marshal. Release Com Object (XLR);

Please tell me how I should go about this because I am giving it almost. Your answer is very much appreciated FYI, I am a newbie and I am waiting for your reply.

Thank you, George

Excel is a COM automation server.

Even if you call Application.Quit () and you release the context of the COM object, the XE itself will not end. You will still be able to see it in the Task Manager. Excel examples will exit soon after its application closes. Excel Example will exit after your application closes. Excel Example will exit after your application closes.

Ever "RPC server is not found / running" type COM errors? Now you know why.


c# - passing value from opener to popup and processing it server side, not client side. Cant use a GET -


I have an aspx web page (opener) which opens a popup window

popups Need to retrieve the value of the hidden area in the I Opener page in the window.

So it all goes straight by using Javascript.

However, here's the problem, I need the value hidden field to process the server side before loading the pop-up page

(basically, hidden) The field contains XML, which must be DSRerized to the server side and the data used to create the DOM of the popup page)

Then how do I hide the opener for getting the processed server side in the popup Data field How can I pass?

The data is too long to pass as Waaay GET i.e. in the quickstream of the popup page

What are the other options here?

  1. Retrieve it using a javascript in a popup, then make a postback to reload the page (very ugly)
  2. Post data when a popup is opened Are you Is it possible and I can pass other information through query string
  3. Any other ideas?

is a form like this

  & lt ; Form method = "POST" action = "action.php" onsubmit = "open_popup (this);" & Gt; & Lt; Input name = "really big field" type = "hidden" & gt; & Lt; / Form & gt;  

Also, javascript like this

  function open_popup (form) {window.open ('action.php', 'actionpopup', 'width = 400 , Height = 300 '); Form.target = 'actionpopup';  
  1. window.open () Open a popup as you want.

  2. Setting the goal of the form for an open popup will ensure that the form at that popup

  3. < P> You can process server-side data in action.php
  4. / Strong> (or in ASP.NET / VB file).


How do I create an excel macro that changes the rows spanned by a cell -


I am pasting the table in SAS where the first column has the number of rows spaced by the cell. It is to say that sometimes the first column is 3 merged cells, sometimes it is 6, etc. I will run a macro which converts the height of the cell into 10 merged cells, and space for it to insert the rows below.

How can I reach this problem, a little bit stumped about this, any assistance would be most appreciated.

Try to explain to me if I wanted the first column in all four rows, then I

  _________________ | _________________ | __________ | __________ | _________________ | __________ can start with  

and

  _________________ | __________ | __________ | _________________ | __________ | __________ | __________ | _________________ | Class = "post-text" itemprop = "text"> 

Ending with __________

Your first example, you show two merged cells with address ranges of A1: A2 and A3: A6 . In your second illustration, the address is A1: A4 and A5: A8 respectively .

"Change the height" for Excel (I'm using that phrase with loose) in the original merged cells at A1: A2 address, in fact the address range < Code> A1: A4 will create a new set-up merged cells. However, you will not be able to do this because the address A3: A6 is already a merged limit and it will overlap.

If you try to do this manually, you know that you have to unplug the following group, have to remade the top group, and have to rebuild the group below.

You can write a macro, which, when executed, an input box that pops up must be asked by the number of high cells in the merged cell. However, your code will need to analyze the original stack of the merging original cells, and then the program must be completely unplanned and reproduced to change the change. This is definitely possible, but it can be a real pain (but it is also a fun challenge :).

I ask myself, what exactly are you looking for, not exactly accurate behavior in Excel


My original post is below: Now since it has become obsolete, now I understand what the author is saying

You can use something like this:

  Rows ("1: 1"). RowHeight = 27.75  

However, I'm confused with your reference for merged cells. Are you just trying to change the height of a cell or do you merge the cell together Trying to do?


rest - RESTful URLs for a search service with an arbitrary number of filtering criteria -


I want to create a permanent web service that implements a search interface for the database of biological data

A specific search request can include a dozen or more features of the data. For example, search for the scientific name, preventing the depth of water below 100 meters. The first trend is to have all the attributes in the query string eg Search Type = Scam and Skin = Mile + Milea and McDaypt = 100 and DyenPath = 0

However, query strings are considered non-silk, see

As the discussions and I am still not clear at this point, my question:

Is there an acceptable standard or pattern for a blank URL for a search service, where a benchmark number can be a filtering value is?

In the rest of the web:

  • component recognizes a special resource.
  • The request-uri's query-string component identifies changes made during a specific filter or presentation
  • Accept The title identifies a particular content-type in which the given resource should be filtered as specified.
  • Acceptable-language header identifies a particular language in which the given resource, file must be presented as a specification.

Then to answer your question:

  GET / species? SearchType = sciname & amp; Scenemon = mola + mola & maxdepth = 100 & amp; Mindepth = 0  

is absolutely appropriate.


c# - How to check if a type is marked with an attribute? -


क्या इसे प्रतिबिंब की आवश्यकता है?

हां:

  विशेषता। आईएसडिफ़िनिड (yourType, attributeType);   को छोड़कर, जो  भी  हो सकता है  yourType.IsSerializable  (यदि आप जांचते हैं आईएल,  [सीरियलिज़ेबल]   नहीं   वास्तव में  एक विशेषता के रूप में लिखी जाने वाली - एक विशेष प्रकार के संशोधक हैं, या तो कोई भी तरीका ठीक काम करता है, हालांकि) । 


.net - C#: Synchronize Scroll Position of two RichTextBoxes? -


As my application, I have two RichTextBox objects both of the lines of text In the same number, I want to "synchronize" the vertical scrolling between the two, so that when the user changes the vertical scrolling position on one, how can I go about doing the same amount of other scrolls?

Some time ago I did a small project, and I found the simplest solution here

Create a new control by subclassing the rich textbox:

  Synchronize public class ScrollRichTextBox: System.Windows.Forms.RichTextBox {public event vScrollEventHandler vScroll; Public representative Zero vScrollEventHandler (System.Windows.Forms.Message Message); Public const int WM_VSCROLL = 0x115; Protected Override Zero WndProc (Ref System. Windows.Forms.Message Message) {if (msg.Msg == WM_VSCROLL) {if (vScroll! = Null) {vScroll (msg); }} Base.WandProc (Riff Message); } Public Zero PubWndProc (Ref System. Windows.Forms.Message msg) {base.WndProc (Riff Message); }}  

Add new control to your form and clearly inform other instances of control for each control that its vScroll status has changed. Something like this:

  Private Zero scrollSyncTxtBox1_vScroll (Message msg) {msg.HWnd = scrollSyncTxtBox2.Handle; ScrollSyncTxtBox2.PubWndProc (Riff Message); }  

I think there are problems in this code if all 'link' controls do not have the same number of displaylines.


algorithm - Multiple Constraint Knapsack Problem -


If there is more than one obstacle (for example, both a volume limit and a weight limit, where quantity and weight are each item Not related), we get problem of multiplied breakfast, problem of multi-dimensional lid, or m-dimensional lid.

How do I code this in the most customized fashion? Well, one of the greatest forces can develop a recursive solution. It may be that the branch is bound and binding. But essentially for a long time you do some kind of memonization or use dynamic programming which again take large amounts of memory, if not done well.

The problem I am the commonest thing is that

I have a napask (capacity, value, i) in exchange for the usual impotence (capacity, I) because I have them The upper limit of both is that someone can guide me with this? Or, to solve these problems, appropriate resources should be made available to a large extent n

or to provide appropriate resources for completing this NP?

Thanks

Combine constraints, refer to Chapter 1.3.1, in which the constraints Merge is said to be.

An example is that you have
variable, obstacle 1, obstacle 1, 43, 66
2, 65, 54
3, 34, 49
4, 99, 32
5, 2, 88

Multiply the first hurdle by some large number, then add it to the other obstacle.

Then you have
variable, mergence barrier1, 430066
2, 650054
3, 340049
4, 990032
5, 20088

Whatever algorithm you wanted to do with an obstacle from there. The main limiter, which takes into account how many points your variable can hold.


php - Doctrine ORM JOINS -


I have some simple classes, which are all extended principles.

Now I want to do a little bit more to join the inner complex of the complex query, not only to remove the table data.

I am using DQL, does it oblige me to manually define the relationship between two tables? Should I define this relation class or can I update better schema. IML and then reproduce the class code?

You can add links to your .yaml file and then re-generation your classes like this can do. Documentation of principles about relationships in Yamal files.

You will need to regenerate your DB so that the principles can add the right foreign key barriers on the basis of new relationships. It is relatively simple and believes that you do not care about losing your data. If you care about losing data, you should use the principle to manage your migration, but it is beyond the scope of your question. You can find more information about migration by looking at Frankel's answer.


sqlite3 icu extension -


I think sqlite3 is very easy software on many situations. But I need ICU support for the sort order. I have many documents on the internet Red I left for some time to use the squite, I removed my download but I should again sqlite what to make an extension for download is so difficult is? Where can I get ready to use the extension?


vb.net - DevExpress Xtra Report: How to display a label in group footer when the detail band does not have any data? -


itemprop = "text">

If someone is called a lube: lbl warning I would like to display it (visual = True) when no record in the extension band The label is not in the group footer.

This is related to the event report (in my example, its name is XtraReport1). GetCurrentRow () is a way XtraReportBase that returns current data from the primary data binding source if the data is not present, then it blank.

  Private Zero XtraReport1_BeforePrint (Object Sender, PrintEventArgs e) {bool noDataFound = GetCurrentRow () == Tap; Lbl warning: vijay = nodetafound; }  

The same handler in VB:

  MyBase handles as Private sub XtraReport1_BeforePrint (ByVal Sender as System.Object, ByVal E as PrintEventArgs). As the first print dim nodefound boolean = GetCurrentRow () nothing is LBL warning. Science = noded and end  

C# how to find a value in a List collection -


I have a collection of the following classes in this list

  public class MyFile {public String filename {get; Set; } Received public int status { Set; }}  

Then the definition of the list will appear as:

  Private list & lt; MyFile & gt; MyFiles = new list & lt; MyFile & gt; ();  

I can also search using this collection:

  MyFile tmpFile = MyFiles.Find (Rep (MyFile item) {return item.FileName == fileName;});  

So far it looks good, except what I would like to do is return the mimf which not only matches the file name but also the highest value in that field position.

So if the following items are in the list:

  myDocument.doc | 1 myDocument.doc | 2 myDocument.doc | 3 myPDF.pdf | 1 myPDF.pdf | 2 myPDF.pdf | 3  

and my search method has the value of fileName = "myDocument.doc", even then mydocument.doc | 3 I am missing the argument to return this item, because it is the highest value of the position

I have to have query in SQL

  Top 1 * from MyFiles Select, where filename = 'myDocument.doc' order based on the order;  

Thanks in advance

Can you use Linux ? If so, you should do a simple query like this:

  MyFile file = MyFiles Where (f = & gt; f.FileName == fileName). Order-Byescosing (f = & gt; f.position) .FirstOrDefault ();  

iis 7.5 - Deploying ASP.NET app on Windows 2008 R2 -


मेरे पास एक एएसपी.नेट वेब एप (। एनईटी 3.5 एसपी 1) है जो विंडोज एक्सपी एक्स 86 (32 बिट) बॉक्स पर संकलित है । ऐप वर्तमान में एक विंडोज़ 2003 (आईआईएस 6) सर्वर पर चलता है मैं एक विंडोज 2008 आर 2 (64 बिट) सर्वर पर आवेदन को स्थानांतरित करने की योजना बना रहा हूं मैं सोच रहा था कि किसी व्यक्ति को ऐसे प्रवासन के साथ कोई अनुभव है? क्या x 86 एएसपी.नेट वेब ऐप विंडोज 2008 आर 2 (आईआईएस 7.5) पर आउट-द-बॉक्स का काम करता है?

चीयर्स:)

रोवन

आपको कम से कम कार्य के साथ संक्रमण करने में सक्षम होना चाहिए। हमने इसे पहले किया था अगर आप चाहें तो हम ऑफलिस्ट बात कर सकते हैं, जान लें।


objective c - Property Refuses to Synthesize -


I'm going through a screencast to learn how to write table-based iPhone applications, and this is very much Running smoothly so far Currently I am half way through the third episode, and it is starting to make a stop.

To remove temporary hard-coding for the top layer of the table, the tutorial will show a NSMutableDicitonary for all entries and their data, and then just display the headings in the table cells Creates an NSArray by using the forKeys statement to get an array with / P>

The problem is that the array refuses to synthesize the array.

The abusive property defined in the AppDelegate.h file is as follows:

  @property (read only) NSArray * Recipes;  

Then it is codified and applied in the AppDelegate.m file as follows:

  @ synthesis recipes; - (NSArray *) Recipes {Return [data of all]; }  

I questioned the author of the screencast and gave the following suggestion for AppDelegate.h :

  @class Foo : NSABEZE {NSERRE * _ Russian; } @protecti (nontomic, raten) nsarey * recipes; @end  

and for AppDelegate.m :

  @implementation Foo @ synthesize recipes = _recipes; @end  

I tried this method, but more errors were made than before. Does this variable definition differ from any other @ property, and how can I treat it?

@ synthesis generates a simple method to use the property Since your accessor method is more complex, it can not be generated from @ synthesis .

  - (NSArray *) recipes {back to [all of the data]; }  

java - How do I pass in user inputed variables into a constructor? -


I need some help with this program. User ID, password, number of maximum attempts and amp; The maximum number of uses and they have to go to a constructor ... can someone pass me in the constructor? I'm using Java Thanks!

Import java.util.Scanner; Public class LoginPw {public static zero main (string [] args) // // TODO auto generated method stub scanner reader = new scanner (System.in); System.out.println ("Enter in your ID and password"); Int idnum = reader.nextInt (); Int password = reader.nextInt (); System.out.println ("Enter the maximum number of attempts"); Int maxtries = reader.nextInt (); System.out.println ("Enter Maximum Number of Uses"); Int maxuses = reader.nextInt (); PwLogin pwl = new PwLogin (idnum, password, maxtries, maxuses); }} Class PwLogin {public PwLogin (int id, int pw) {// maximum number tries to denote the value of 0 This (ID, PW, 0,0); // Call 4-Logic Maker w / MaxTries & amp; The maximum use denominated in the form of zero (infinite) public PwLogin (tries int id, int pw, int) {/ assuming that the maximum number of uses is infinite, denote the value of 0. This (ID, PW, Effort, 0); // Call the 4-Logic Constructor with the maximum defaults in the form of zero (infinite) public PwLogin (uses int id, int pw, int tries, int) {// Now 4 classes with pass-in arguments Set the variable. = ID; This.password = pw; This.maxtries = tries; Uses this.maxuses =; }}

You need to declare member variable in Java:

  class PwLogin {Private Int idnum; Personalized passwords; Private Industries Maxriss; Private Int Max; Public PwLogin (int id, int pw) {etc ...  

Is there any better way to add license/copyright header in Delphi .pas source file? -


There are such headings in each Delphi VCL source file:

  {* **** ********************************************************************************************** ****} {} {CodeGeer Delphi Runtime Library} {} {Copyright (c) 1995-2010 Ambercadera Technologies, Inc.}} Copyright and License Exceptions mentioned in the source {} {**********} *} ************************** Delphi IDE or model is any of the tools / methods available in the Macar code explorer that gives us this header graphic They Can make? 

I'll create a live template that lets you automatically fill all the data automatically.

You can find more information about creating live templates here:

Live templates are extremely powerful and flexible. You want them to do anything in the code editor.


Hide the Recent Documents List inside Ribbon Application Menu in Delphi 2010? -


I am using Delphi 2010 to implement an application menu for my ribbon control ... but one Recent document list (or at least its title) at its right hand ...

Is it possible to hide this list and do something else in return, like I'm thinking of a list of available jobs. .

Will this violate the duration of the use of the ribbon control?

Thank you very much.

Yes, you can change Tribbon.ApplicationMenu.Caption property to change the caption of that list, and You can also change tripbone. App menu Type command type "ctCommands" to provide a list of your favorite commands rather than recent documents.


wmi - Best method for gathering NTFS file access statistics? -


I would like to advise on choosing a method to gather file access data on NTFS volumes under Windows Vista and Windows 7; 64-bit) I want to count / create, delete, read / write files for every file

API hooking is out I need a system-wide count, and both 32 and Without leaving the 64-bit OS on top of the OS Besides, I do not think shell notifications will work.

I know that I can do this by installing a file system filter driver. Windows are DDK samples, and so does Marc Russianovich's fileman (Sisninernal) works.

I think I can also use WMI, but I'm not sure. This is a crazy messy API. But if Microsoft will collect statistics for me, then I will use it.

So the question is, this method will be the best; Why. Do I miss another possibility, and what will WMI do?

In Windows Vista you can try reliability and performance Monitor with user defined data collector set " New ", then go to Custom, Add System Counter for File Control Functions.


c++ - How to draw the graph in framebuffer using c language..? -


I'm new so linux framebuffer anyone guide me to draw graph line framebuffer. And I have the code to draw the graph in Turbo C but now in Linux. So please help me out

Thank you, Rahul

Use / dev (eg. / dev / fb0 ) in to the correct file, then map it into memory Manpages for these syscalls If you do not know how to use them, then

Then there are some in and some structures and constants; Linux / FB J & gt; . Like many kernel headers, you can learn a lot by just browsing the file.

Particularly interesting is with ioctl FBIOGET_VSCREENINFO struct fb_var_screeninfo . Note that there are xres , yres (resolution) and bits_per_pixel in it. Then there's the FBIOGET_FSCREENINFO and struct fb_fix_screeninfo which type and line_length .

For more information or so (x, y) is to be on a pixel mmap_base_address + x * bits_per_pixel / 8 + y * line_length . The exact form of pixels will depend on the structures you receive by ioctl;

It's been a while since I worked with it, so I'm a little blurred on more information ..

Here's a quick and dirty code sample just described To do this how it has been done ... I have not tested it.

  #include & lt; Sys / types.h & gt; # Include & lt; Sys / ioctl.h & gt; # Include & lt; Sys / mman.h & gt; #include & lt; Linux / fb.h & gt; # Include & lt; Unistd.h & gt; # Include & lt; Fcntl.h & gt; # Include & lt; Stdio.h & gt; Int main () {struct fb_var_screeninfo screen_info; Struct fb_fix_screeninfo fixed_info; Char * buffer = null; Size_t buflen; Int fd = -1; Int r = 1; FD = Open ("/ dev / fb0", O_RDWR); If (FD & gt; = 0) {if (ioctl (FD, FBIOGET_VSCREENINFO, & amp ;! screen_info) & amp; & amp ;! ioctl (FD,; fixed_info) FBIOGET_FSCREENINFO, & amp) {buflen = screen_info.yres_virtual * Fixed_info.line_length; Buffer = MMAP (faucet, buffron, PROT_READ | PROT_WRITE, MAP_SHARED, FD, 0); If (buffer! = MAP_FAILED) {/ * * TODO: here is something interesting * "buffer" is now pointing to the screen pixel * can be on each individual pixel: buffer + x * screen_info.bits_per_pixel / 8 * + y * Fixed_info.line_length * You can then type pixels at that place like * / R = 0; / * Indicate success * /} other {properties ("mmip"); }} And {property ("ioctl"); }} And {false ("open"); } / * * Clear * / if (buffer & buffer! = Mp_filld) munmap (buffer, buffron); If (FD> = 0) closed (FD); Return r; }  

linq - Nhibernate component with mapped class problem -


I am working with oracle and nhibernate; Icquer from an object list to the DB table (all the items in the table),

I can get the entire list in the query without any error, that's when I use where.

Query (query below and some information about the mapping document):

  select ID33_0_ as this_.ID, this_.BUNDLEID ..... .................... Where   "bundlemeam" class = "promissory notes.Sover data.bundle, promissory notes.serve.data" & Gt; & Lt; Property name = "id" column = "bundle" type = "decimal" & gt; & Lt; / Property & gt;  

In the Component "bundle" there is separate mapping in another XML document, I realized that, when I change the bundle class to another unfamiliar category, then it works . What is the solution as the bundle with mapped sections about the problem is the solution, any ideas?

Are you certain that it should actually be mapped as a component? Maybe it should be a lot of mapping?

Maybe something like this:

  & lt; Many-to-one names = "bundleitem" column = "bundle id" cascade = "save-update" />  

stream - java null pointer exception -


मुझे java.lang.NullPointerException पर प्राप्त हो रहा है जबकि ((len = in .read (buf, 0, buf.length)) & gt; = 0) निम्न विधि में:

  सार्वजनिक शून्य की प्रतिलिपि (स्ट्रिंग src, फ़ाइल डीएसटी) IOException फेंकता {InputStream in = GetClass ()। GetResourceAsStream (src); OutputStream आउट = नया FileOutputStream (डीएसटी); बाइट [] buf = नया बाइट [1012]; Int len; जबकि ((लेन = ईन रीड (बफ़, 0, बफ़। लांघ))> gt; = 0) {out.write (buf, 0, len); Buf = null; } In.close (); out.close (); }  

मुझे कॉज़ नहीं मिल रहा है। अगर मुझे समाधान मिलता है तो मैं आभारी रहूंगा। अग्रिम में धन्यवाद ... ..

आप सेट

  buf = null;  

पहले पुनरावृत्ति पर, दूसरे buf.length पर NullPointerException फेंकता है।


windows - Process memory increases much faster with gflags +ust -


I am stuck in a problem with gflags when trying to find a memory leak Be the windows app

When I turn on the Ust flag (to collect memory allocation stack traces) the memory of my application is very fast when the flag stops (this 10 minutes Of the IPO in the 800 MB, which is far from 50-100 MB / day when the flag closes.)

I have read that for 32 MB stack trace the max. So, I think it should not be a problem.

The computer is an 4x Intel (R) Xeon (R) CPU E5410 @ 2.33GHz .

If someone can give me some hint then I appreciate it.

Thank you!

Stack trace database does not have the sole effect ost flag it adds at least 32 bytes for each allocation So that its stack trace ID can be stored. This can explain the increase in your memory if there are too many small allocations. If you compile a debugger or process related to a debug target, then the Windows heap will be set in debug mode and the over allocation will also be enlarged.


.net - Increase the session timeout of my web form? -


I need to end the session of my web access form ...

Can help please?

In web.config:

   ... & lt; /system.web>  

css - Blue lines around images within links in IE6 -


Why do I get a blue line around my pictures when I link to IE 6?

Is there a quick CSS move to get rid of them?

There are limitations around this image, try adding it to your CSS file:

  an IMG {border: 0; }  

This will remove the limitations from all images that are hyperlinks.


mysql - getting multiple tables data with php -


Suppose i have two tables ... i have received / added two table data order based on date Or according to ID!

It is so that if I have the date table1 id msg 2 it is msgd nowdate table2 id Date of comment 2 This comment is nowdate

So how can I get it in a query order by ID?

is the word you are looking for:

  ( Select from Table 1) Union (SELECT * FROM table2) ORDER ID  

networking - Simple way to simulate a slow network in python -


Scenario I have clients with two network connections from the server One connection uses a mobile phone, and the second one wlan connection Is using.

The way I solved it, the server has to listen on two ports. However, the mobile connection should be slower than the wlan connection. The data that is sent is usually just a line of text. I have solved a slow connection problem by allowing the mobile connection to send data in the interval of five seconds, the wlan connection is a second interval.

But is there a better way to do recession? Maybe sending small packets, that is, I need to send more data?

Any ideas on good ways to slow down any connection?

Orjanp

A simple client example with only one connection.

  def client (): import system, time, socket port = 11111 host = '127.0.0.1' buf_size = 1024 Try: mySocket = socket.socket (Socket.AF_INET, socket.SOCK_STREAM) Socket.error, except mySocket.connect (host, port) (except for value, message): if mySocket: mySocket.close () could not open print 'socket: exit' + message sys (1) mySocket.send ('Hello, server') data = mySocket.recv (buf_size) print data time. Sleep (5) mySocket.close () Client ()  

A simple server is listening to a port.

  def server (): import system, OS, socket port = 11111 host = '' backlog = 5 buf_size = 1024 try: listening_socket = socket.socket (socket .AF_INET, sock et.SOCK_STREAM Listening.Sossocotock (socket.SOLCKET, socket.UUUsADRDR, 1) LOSSING_SOCATE.PEND ((host, port) listening_socket.listen (backlog) excluding socket.error, (value, message): if listening_socket: listening_socket off () Print 'socket can not be opened:' + message sys.exit (1) while correct: acceptable_socket, adress = listening_socket.accept () data = accept If the data: accept_socket.send ('hello, and bye.') Approved_socket.close -text "itemprop =" text "> 

In addition to using an external, to imitate the kind of network you are interested in, use a good method to implement the implementation of a socket option.

It involves making socket creation in your function instead of creating a socket module and using it directly for normal operation, you will pass in the actual socket type, but when you have different adverse network If you want to test the situations, you can pass in those implementations that follow those situations. For example, you create a socket type. Parameters of latency and bandwidth (untested code, careful):

  import time, socket class controllable socket: def __init __ (self, latency, bandwidth): self. _latency = latency self._bandwidth = bandwidth self._bytesSent = 0 self._timeCreated = time.time () self._socket = socket.socket () send drf (auto, bytes): now = time.time () connectionsignment = now - Self ._timated themselves ._bitscent + = lane (bytes) # How many bytes have we sent with our # given bandwidth limit, how long will it take to send it? Expected period = self._bytesSent / self._bandwidth time.sleep (maximum (required duration - connection duration, self .latansi)) self-self._socket.send return (bytes)  

If you Apply other socket methods, connect, recv, etc., you can substitute an example of this class for an example of the real socket type. This completely releases all of your programs from any knowledge of your simulation, making it simple, while it tries to do many different network configurations by applying a new socket type to you.

This idea is one of the reasons to turn away, which clearly separates the idea of ​​"protocol" - objects that interpret the bytes from the network and generate new bytes to send to the network Know about - "Transports" - objects that get the bytes from the network and put it on the bytes. Separation makes testing easier and allows such novel configurations, where simulation of some other network conditions (which can be difficult to actually produce) by transport provides.


Android/Java | Wrong time string, but using correct Locale? -


I'm trying to get the current time, but it displays in the wrong format. for example. Here, now it is 00:20 and it's showing 12:20. What am I doing wrong?

  SimpleDataformatetime sdfTime = New SimpleDateform ("hh: mm", locale.GMNAI); Date now = calendar.Ast Instance (). GetTime (); Tv_Time.setText (sdfTime.format (today));  

PS: I tried

  calendar .getInstance (Locale.GERMANY) .getTime ();  

Also, but it still does not work.

.

If you want a locale-dependent time format, use it.


javascript - jQuery UI slider - prevent multiple handles from overlapping -


I have this slider of a slider with four sliders when you drag them, then refuse to cross each other What would be the easiest way? I tried to compare their situation. While returning the left value and false, they are equal to the adjacent handles, but it kills it completely. Ideally, you will not be able to pull it short by the width of the selected dropdown between each handle, but maybe I can find it there. If I can stop them from crossing.

slider ({minimum: 0, maximum: 1440, phase: 15, range: wrong, value: [180, 435, 1080, 1320], create: function (event, UI) {$ .e.e (initial value, function (i, v) {updateValue ({value: v, handle: $ ('.ui-slider-handle'). Eq (i)});});}, slide: Function (Event, UI) {var Handindex = $ (ui.handle). Index (); Update Value (UI); Detective ();}});

You can use the index code> $ ('A', event.target). Index (ui.handle) .

From there, you can use the next / previous handle values ​​and compare that the value of the current handle is between them. If so, then return false and prevent handling from overlapping. for.

In the example given below, 25 value padding has been made difficult to prevent from using overlapping usage.

  slide: function (event, UI) {var handleIndex = $ ('a', event.target). Index (ui.handle), curr = ui.values ​​[handleIndex], next = Ui.values ​​[handleIndex + 1] - 25, prev = ui.values ​​[handleIndex - 1] + 25; If (curr> next || curr & lt; prev) {return false; } Update Value (ui); PositionSelects (); }  

javascript - Regex to split string into verying size chunks -


I am trying to break a string into different size segments, such as the word "wave" like:

  Cat sitting on a mat of cat is sitting on a mat on a mat.  

As the length of words is different, I separate it I want the closest location

I am trying to do a lot more than one line. Although I do not like the idea of ​​loop I have started with it:

  / {5} \ w * / g  

I have tried to add around () and {} but Reggae can not get hanged. Is it possible to do this? Or will it involve some types of loops?

I think that there is something like a Regex, but a lot depends on the input string. Apart from this, you have to think about how to arrange fragmentation, whether to trim or not, how to pad, etc. So there will not be only one regedge.

This Reggae Pattern: ((?: [^ \ S] + (?: \ S | $)) {1,20}) Whatever you do in the following string Searches can generate something similar to that: Sitting on the cat mat on a cat mat cat works on the mat. This works due to the extra space, where the right breaks happen.

  The cat was sitting on the mat, sitting on the cat mat sitting on the mat. See  


Delphi 2007 TPopupMenu hides selected item image on Windows 8 -


विंडोज 8 पर

TPopupMenu घटक चयनित आइटम छवि नहीं दिखाता है:

चयनित आइटम नहीं, नियमित छवि के साथ

क्या इस के लिए कोई फ़िक्स है? या एक वैकल्पिक हल?

डेल्फी 3 के साथ यह तय हो गया है, लेकिन मुझे इस ऐप को डी 2007 के साथ संकलित करने की आवश्यकता है।

मैंने आईडीई फिक्स पैक 2007 4.3 और वीसीएल फिक्स पैक 1.4 को भी स्थापित किया है , डेल्फी 2007 दिसम्बर 2007 अपडेट पर।


python - "Sudden Death" function loops more than once before actually doing anything -


In my code there is a problem with a function and a loop; Actually the issue is that the "sundeeth" function is only a Run the bar and end the game. Although it loop approximately 3-5 times and then the game ends

Here is the pastebin link for the full code:.

However, this function is the cause of the problem:

  def suddendeath (): global charone_strength global chartwo_strength print "\ n =========== = "Print" sudden death "print" \ N "+ str (charone) + 'has been rolled:" PLAYER1 time.Sleep (0.5) print "\ n" + str (chart two) + "is rolled:", player 2 if player 1 == player 2 : Print "\ nIt's a draw!" Süddeath () if player 1 & gt; player 2: ChartVo_Strength = 0 alif player 2> Player1: charone_s And here's the loop:  
  while charone_strength> 0 or chart_stream> gt: if counter == 220: print " \ NThey reached deadline of 200 rupees! Suddendeath () and: mods () Action (charone_strength, chartwo_strength, charone_skill, chartwo_skill, strength_mod, skill_mod) and: charone_strength & lt if; = 0: "died "Print" \ n "+ str (charone) +, chartwo," wins! "Time.sleep (1) elif chartwo_strength & lt; = 0: Print "\ n" + str (chartwo) + "is dead!", Charon, "Win!" Execfile ("GCSE.") In ["yes", "y", "yeah", "y"] if play playing time.sleep (1) = raw_input ("you want to play y / n :?") again. Py ") Other: Print" Goodbye! Thank you for playing! "Exit ()  

I first recommend reading the full code, but any insights and further on solving this issue The assistance will be appreciated. Cheers :)

If suddendeath is considered to finish the game, So you should exit the loop after executing it, for example:

  ... if counter == 220: print "\ n router has reached 220, sudden death mode Active! "  

The problem is that the else of while will not be executed if break is where As far as I understand, this code should be executed in any case, so type it without while any else .

There are other problems, such as counter is not being defined or updated anywhere, but I think you are not posting a complete work code.

Edit: Ignore this answer, just leave it for history. The real problem appears in the situation

  while charone_strength & Gt; 0 or chart_stream and gt; 0:  

which should be

  while charone_strength & gt; 0 more char_streams & gt; 0:  

Therefore the players reach a power 0 and both of them.


angularjs - Angular directive model binding -


I have searched the AngularJS so far and which is a learning curve. Can I recommend any good books that Angular will dive in "practical" in JS. My programming question is:

Consider:

  & lt; Input type = "text" name = "inputfilled 1" ng-model = "myModel.firstName" encrypt-and-service = "myModel.encryptedFirstName" />  

In my name "Encrypted and saved" I want to dynamically bind to model property whose name is "encryptedFirstName" (in this case) I have read that everything says Is that possible, but I have not found a concrete example of how it is done.

Thank you in advance, Jimmy.

What I'm doing here is doing. I discovered the $ parse and I used $ paras in the initialization and Signature for late / real time binding. Does this make sense or am I completely missing something?

  app.directive ('encrypt and save', function ($ parse)) {return {restricted: 'a', requirement: 'ngmodel', link: function (scope, element, etters) , CTLL) {var encrypted model value = $ parse (etter. Encrypt and save); // Wait for model change (can you wait for Blur?) // Scope $ Watch (ethers ngmodel, function (newcomer, oldview) {var encrValue = encryptThis (newValue); encrypted model Valle.assign (scope, encrValue);})}}};});  

Thank you for your help, Jimmy

In your instructions Create a separate scope and use the 2-way bond through the '='

  scope: {encryptAndSave: '='}  

View

  var app = angular Module ('app', []); App.controller ('firstCtrl', function ($ scope) {$ scope.myModel = {first name: "which", encrypted first name: "encrypted"};}); App.directive ('encrypt andsave', function () {return: {encryptAndSave: '='}, link: function (scope, elem, attr) {alert (scope.encryptAndSave)}}}});  
  & lt; Script src = "https://ajax.googleapis.com/ajax/libs/angularjs/1.2.223/geular.min.js" & gt; & Lt; / Script & gt; & Lt; Body ng-app = "app" & gt; & Lt; Div ng-controller = "firstCtrl" & gt; & Lt; Input type = "text" name = "inputfilled 1" ng-model = "myModel.firstName" Encrypt and save = "myModel.encryptedFirstName" /> & Lt; / Div & gt; & Lt; / Body & gt;  


java Iterable as return type got some error for me -


  आयात करें java.util.AbstractList; आयात करें java.util.Iterator; आयात करें java.util.ArrayList; आयात java.util.List; Import java.util.PriorityQueue; Import java.util.Queue; आयात java.lang.Iterable; सार्वजनिक श्रेणी के इटेरेबल & lt; पूर्णांक & gt; मर्जर्सोर्टेडइटरर्स (सूची & lt; Iterator & lt; पूर्णांक & gt; & gt; आईटर) {क्यूई & lt; newIter & gt; मिनएचप = नया प्राथमिकता प्रश्न & lt; newIter & gt; (); AbstractList & LT; पूर्णांक & gt; परिणाम = नया अर्रेलिस्ट & lt; पूर्णांक & gt; (); के लिए (इटरेटर और लेफ्टिनेंट; इंटीजर & gt; आईएआरएआर: इटर्स) {यदि (आईआरएचएएसएक्सईएक्स ()) {minHeap.add (नया नयाइटर (आईटीआर। एक्सएक्ट), आईटर)); }} जबकि (! MinHeap.isEmpty ()) {newIter newiter = minHeap.poll (); result.add (newiter.getValue ()); If (newiter.hasNext ()) {minHeap.add (newiter); }} वापसी परिणाम; } क्लास न्यूइटर लागू करता है Comparable & lt; newIter & gt; {निजी पूर्णांक मान; निजी इटरेटर & lt; पूर्णांक & gt; आईटीईआर; सार्वजनिक न्यू ईटर (पूर्णांक वैल, इटरेटर और एलटी; पूर्णांक & gt; यह) {this.value = val; This.iter = यह; } सार्वजनिक पूर्णांक getValue () {return.value; } सार्वजनिक बूलियन में अगला है () (यदि (iter.hasNext ()) {value = iter.next (); वापस सच; }             विवरण झूठा है; } सार्वजनिक इंट की तुलना करें (नयाइंटर ए) {रिटर्न वैल्यू - a.getValue (); }}  

मैंने सभी वाक्यविन्यास त्रुटियों को समाप्त करने की कोशिश की लेकिन इस लाइन को अब ग्रहण से लाल कर्लिंग लाइनें मिलीं:

सार्वजनिक वर्ग Iterable mergeKSortedIterators (सूची> इटर्स) {< P>

और यह भी लाइन:

  "वापसी मूल्य - a.getValue ();"  

क्या कोई मुझे थोड़ा सा उजागर कर सकता है? बहुत बहुत धन्यवाद!

< P> वर्ग विनिर्देश गलत है। MergelSortedIterators एक विधि है।

  import java.util.AbstractList; आयात करें java.util.Iterator; आयात करें java.util.ArrayList; आयात java.util.List; Import java.util.PriorityQueue; Import java.util.Queue; पब्लिक क्लास उपयोगकर्ता {सार्वजनिक इटेरेबल & lt; पूर्णांक & gt; मर्जर्सोर्टेडइटरर्स (सूची & lt; Iterator & lt; पूर्णांक & gt; & gt; आईटर) {क्यूई & lt; newIter & gt; मिनएचप = नया प्राथमिकता प्रश्न & lt; newIter & gt; (); AbstractList & LT; पूर्णांक & gt; परिणाम = नया अर्रेलिस्ट & lt; पूर्णांक & gt; (); के लिए (इटरेटर और लेफ्टिनेंट; इंटीजर & gt; आईएआरएआर: इटर्स) {यदि (आईआरएचएएसएक्सईएक्स ()) {minHeap.add (नया नयाइटर (आईटीआर। एक्सएक्ट), आईटर)); }} जबकि (! MinHeap.isEmpty ()) {newIter newiter = minHeap.poll (); result.add (newiter.getValue ()); If (newiter.hasNext ()) {minHeap.add (newiter); }} वापसी परिणाम; } क्लास न्यूइटर लागू करता है Comparable & lt; newIter & gt; {निजी पूर्णांक मान; निजी इटरेटर & lt; पूर्णांक & gt; आईटीईआर; सार्वजनिक न्यू ईटर (पूर्णांक वैल, इटरेटर और एलटी; पूर्णांक & gt; यह) {this.value = val; This.iter = यह; } सार्वजनिक पूर्णांक getValue () {return.value; } सार्वजनिक बूलियन में अगला है () (यदि (iter.hasNext ()) {value = iter.next (); वापस सच; }             विवरण झूठा है; } सार्वजनिक इंट की तुलना करें (नयाइंटर ए) {रिटर्न वैल्यू - a.getValue (); }}}  
पर क्लिक करें

c# - How to handle large number of RegEx patterns when using Regex.CompileToAssembly? -


I am trying to compile a list of regular expressions in an assembly.

I've found that the 'name' value should be different for each RegexCompilationInfo objects, so when compiled they are different objects.

However, I have several regx patterns (as it is called about 100). Setting names on them and keeping names as it would be difficult not only that every time I want to check a text for each pattern (which I do), then I have to know all the names And each item must be used to use it)

Is there any easier way to handle it?

list & lt; RegexCompilationInfo & gt; Compile list = new list & amp ;;; RegexCompilationInfo & gt; (); CompilationList.Add (New RegexCompilationInfo (@ "Pattern 1", RegexOptions.CultureInvariant, "Name1", "Namespace Space.", True)); Compilation List Ad (New Regex Complanation Info (@ "Pattern 2", Regex Options. Culture Inventor, "Name 2", "Namespace Space", True)); ... ... collection list. Add (New Reggae Complanation Info (@ "Pattern 100", Reggae Options. Culture Inventor, "Name 100", "Namespace.Space", is True)); // Apply AssemblyTitle attribute to the new assembly // // Define the type of parameter (parameter) of AssemblyTitle attribute [] parameters = {typeof (string)}; // Define the title object of the Assembly [] paramValues ​​= {"compiled regular expression library"}; // ConstructorInfo ctor = typeof of the attribute (System.Reflection.AssemblyTitleAttribute), get the ConstructorInfo object representing the .GetConstructor (parameter); // CustomAttributeBuilder Object Object Custom Attributebuilder [] ATBILDER = {Create new custom-builtbubilder (CTOR, Ultimate valve)}; // Generate assembly with compiled regular expression RegexCompilationInfo [] CompilationRare = New RegexCompilationInfo [compilationList.Count]; Assembly name assemName = new assembly name ("Reggae Lib, version = 1.0.0.1001, culture = neutral, public token = zero"); CompilationList.CopyTo (compilationArray); Regex.CompileToAssembly (compilationarray, assemName, atbuilder);

Usage

  Name 1 name 1 regigix = new name1 (); Name 2 name 2 regigix = new name 2 (); ... .. (if name1Regex.Matches (text) .Qount> 0)  

To name the pattern, you can use only one incremental index. "name" + index .

You can use reflection to load all the patterns in a list

  var asm = assembly.Load ("RegexLib, version = 1.0.0.1001, Culture = neutral, public kokon = zero "); Var pattern = new list & lt; Reggae & gt; (); Var type (var type in asm.GetExportedTypes ()) {if (typeof (Regex) .IsAssignableFrom (type)} {patterns.Add (Regex) Activator.CreateInstance (type)); }} Return pattern;  

php - Access object within an array within an array -


मेरी एपीआई कॉल ने मुझे निम्नलिखित कोड दिया:

  अर्रे ([एबीसी 0]] = & gt ; अर्रे ([0] = & gt; स्टड क्लास ऑब्जेक्ट ([होस्टिड] = & gt; 12345 [location_lat] = & gt; 40 [location_lon] = & gt; 70 [site_address_a] = & gt; हैलो वर्ल्ड ब्लाव्ड [site_address_b] = & gt; फ़ू 100 [साइट प्रिंट] = & gt; रेडमंड [साइट_स्टेट] = & gt; वाशिंगटन [साइटकाउंटरी] = & gt; यूएसए))  

अंततः, मैं इसे प्राप्त करने की कोशिश कर रहा हूं:

  एरे ([एबीसी 01] = & gt; [होस्टआईड] = & gt; 12345 [स्थान_लाट] = & gt; 40 [location_lon] = & gt; 70 [site_address_a] = & gt; हैलो वर्ल्ड ब्लाइवीडी [site_address_b] = & gt; फ़ू 100 [साइट प्रिंट] = & gt; रेडमंड [साइट_स्टेट] = & gt; वॉशिंग [Site_country] पर & gt; संयुक्त राज्य अमेरिका))  

मेरे पास लगभग तीन foreach loops हैं और मैं अभी भी थोड़ा खो रहा हूँ मुझे पता है कि एक आसान तरीका होना चाहिए, लेकिन मैं PHP से भी परिचित नहीं हूं। स्थान ऑब्जेक्ट को प्राप्त करने के लिए मैंने सिर्फ get_object_vars का उपयोग किया है:

  foreach ($ getlocations $ key = & gt; $ value) {print_r (get_object_vars ($ value [0])); }  

क्या मैं सही रास्ते पर हूं? मैं फिर उलझन में कैसे इस मेजबान नाम (एबीसी 101) को वापस टाई, क्योंकि मैं मेजबान के तौर पर उत्पादन करना चाहता हूं। आपकी मदद के लिए धन्यवाद, यह PHP नोओब इसे सराहना करता है।

यदि आप चाहते हैं आउटपुट वास्तव में यह है: < / P>

  सरणी (1) {["ABC01"] = & gt; सरणी (8) {["होस्टिड"] = & gt; Int (12345) ["location_lat"] = & gt; Int (40) ["location_lon"] = & gt; Int (70) ["site_address_a"] = & gt; स्ट्रिंग (16) "हैलो वर्ल्ड ब्लाइव्ड" ["site_address_b"] = & gt; स्ट्रिंग (7) "फू 100" ["साइटबारा"] = & gt; स्ट्रिंग (7) "रेडमंड" ["साइट_स्टेट"] = & gt; स्ट्रिंग (10) "वॉशिंगटन" ["साइटकाउंटरी"] = & gt; स्ट्रिंग (3) "यूएसए"}}  

तब हाँ, मुझे लगता है कि आप सही रास्ते पर हैं, इसे इसका उत्पादन करना चाहिए:

  $ आउटपुट = []; विदेशी मुद्रा ($ कुंजी के रूप में $ डेटा = & gt; $ मान) {$ आउटपुट [$ key] = get_object_vars ($ मान [0]); } Var_dump ($ आउटपुट);  

ध्यान दें कि यह प्रत्येक होस्ट नाम के लिए एक '0' तत्व मानता है।

तब मैं उलझन में कैसे इस मेजबान नाम (एबीसी 101) को वापस टाई सकता हूं, क्योंकि यह है कि मैं आउटपुट के लिए क्या चाहता हूं, मेजबान नहीं

मेजबान नाम foreach में $ कुंजी है, इसका उपयोग आउटपुट सरणी की कुंजी निर्दिष्ट करने के लिए किया जाता है।


intellij idea - Static html pages run from file system instead of built-in web-server -


I am running Intellij 13 Ultimate I am trying to open the web page on which I am working, And it has been opened from the file system:

  file: /// user /  

Instead of something like this:

  http: // localhost:  

The point is, other projects are going on as expected and I am unable to understand the incorrectly configured in this specific project.

"post-text" itemprop = "text">

How do you open page?

If you open your HTML file in IntelliJ and click Run & gt; Xxx.html should run (or debug ), open a local host page. If not, check your run configuration ( run & gt; edit configuration ) and see the URL field.

View & gt; Open in Browser should work as expected.


javascript - AngularJs update directive after a call to service method -


I am trying to create a reusable warning service, which I will only say elsewhere in my application:

Alertservice Soylert ('Warning', 'Something went wrong!'); For example, after calling AJAX calls on backend API, I am using a factory and directive, but it seems that I am doing something wrong because show the instructions. Does not get updated after calling Right now I have something like this:
  var srv = angular.module ('srv', []); SRV Factory ('alert service', ['$ timeout', function ($ timeout) {var alertService = this; alertService.alertNeeded = false; alertService.alertClass = ''; alertService.alertMessage = ''; alertService.setAlertNeedNeedNeed = function ) {AlertService.alertNeeded = true}; alertService.setAlertClass = function (type) {if (type === 'warning') alertService.alertClass = 'alert-warning'; if (type === 'success') alertService AlertClass = 'alert-success'; if (type === 'info') warning service. Alert class = 'alert-information'; if (type === 'danger') warning service.LartClass = 'warning-danger' ;}; Alert service .setAlertMessage = function (message) {alertService.alertMessage = message;}; return {sh OwAlert: function (class, msg) {alertService.setAlertNeeded (); alertService setAlertClass (class); alertService.setAlertMessage (MSG);}};}]). Directive ('MyLater', ['Alert Service', Function (Alert Service)] {Reform {Ban: 'A', Template: '& lt; div ng-class = "alertclass" ng-show = "alertNeeded" & gt; {{Alert Message}} , link: function (scope) {scope.alertNeeded = alertService.alertNeeded; scope.alertMessage = alertService.alertMessage; scope.alertClass = alertService.alertClass;}}} ])). Controller ('alert showing controller', ['$ scope', 'alert service', function ($ radius, alert service) {alertService.showAlert ('warning', 'warning warning !!!')}]);  

My code does not appear at all, but I just want to show what I'm trying to do: I call alertService.showAlert (...) Want to In another module, from another controller (which depends on the srv module) and thus showing the correct alert in the myAlerts update variables .

To see that call to call Alert method values ​​are set, but in the directive code, I alertService.alertNeeded like undefined Getting.

I am totally new in Angular Jays, so maybe I am doing something wrong, but I spent the whole evening working for it and I still do not know what is the proper solution for this is.

Please have two different meanings for your code for alertService .

Within the definition of the factory, it refers to the factory itself. Everywhere, it refers to the returned item by the factory. The easiest way to move forward is to add some missing methods to the returned item by the factory:

  return {showAlert: function (cssclass, msg) {alertService.setAlertNeeded ()); AlertService.setAlertClass (cssClass); AlertService.setAlertMessage (MSG); }, AlertClass: function () {return warning: service. AlertClass; }, Alert message: function () {return warning: service. Alert message; }, Alert Required: Function () {Return Warning Service. Alert Required; }}; Then, change your directive's template so that they can call these functions on each digest cycle:  
  directive ('myAlerts', [ 'AlertService', function (warning service) {return: {a :, 'a', template: '

Then you should see your warning message. .


javascript - Add to variable with a button -


I have a script with javascript variables and a button, now every time I press this button, one, I Have tried as you can see in the script below, but there are some issues, the number is not visible and every time the button is clicked, what is wrong?

Javascript:

  var nativeNR = 1; Function addOne () {nativeNR = nativeNR + 1; }  

html:

  & lt; Form id = "form" & gt; & Lt; Input style = "width: 500px;" Type = "add" id = "plusButton" onclick = "addOne ();" / & Gt; & Lt; / Form & gt; Current amount & lt; Span id = "nativeNR" & gt; & Lt; / Span & gt;  

Each time you click on your case, the number will increase. However, you are not displaying it in Span. To do this, you can refer to the element and set it to native NRR.

Your method should be like this

  var nativeNR = 1; Function addOne () {nativeNR = nativeNR + 1; Document.getElementById ("NationNR"). InnerHTML = nativeNR; } & Lt; Form id = "form" & gt; & Lt; Input style = "width: 500px;" Type = "button" id = "plusButton" onclick = "addOne ();" / & Gt; & Lt; / Form & gt; In addition there is no  type = "add"  in it, it should be  type = "button"  

  & lt; Form id = "form" & gt; & Lt; Input style = "width: 500px;" Type = "button" id = "plusButton" value = "add" onclick = "addOne ();" / & Gt; & Lt; / Form & gt; Current amount & lt; Span id = "nativeNR" & gt; & Lt; / Span & gt;  


encoding - Can't read some characters from UTF-8 file. Pure C -


I know there are many similar topics on the stack overflow, but I have not found a solution to my problem. I try to read the UTF-8 file. Everything is fine with English letters, but I can not read Russian or Spanish letters. Here's my code just the example.

  FILE * fp; Four lines [3]; Fp = fopen ("letters.data", "r"); If return (FP == faucet); Int i = 0; Fred (line, 1,3, FP); // BOM wint_t w; While (w = fgetwc (fp)) {wprintf (el "% c", w); } Fclose (fpose);  

Here is the letters.data file:

 Enter image details here

and output data:

 Enter the image details here

I do not know what to do.

fgetwc () (A "detailed character"). It is not the same as the UTF-8. A wchar is a certain size (often 16 bits), requires variable length and some special parsing between UTF-8 characters one and four bytes. Very easy to work, useful. If you need more complex work, see.

Note that you are assuming a BOM in the beginning. There should not be a BOM in UTF-8 files, however some Windows editors add anyway. You should be careful about this issue.

If you are doing all you need to read and write in one stream, there is no need to worry about UTF-8. You can treat them as just raw bytes. But if you are going to interpret them, then you have to interpret UTF-8 correctly.

He said, you should also verify that you actually have an UTF-8 file, for example, it is very common on Windows that the file has different code pages or UTF-16 (UTF -16 is the file written in the file which is considered to be BOM). I find it almost always useful to see the file in Hex Editor to ensure that the bytes are those that you think they are.


android - Converting input images to svg in an activity -


I was working on an application and I need to change the format of an image file inputed in the SVG format by the user I can use it on different screens without making the images weird, I tried to search, but I came to know how to convert image visualization to SVG. Is there a library available which can convert images into SVG in an application?

If you are using JavaScript


javascript - Cycle2 YouTube plugin not showing correct in iOS8 -


We are having an issue where jquery cycle2 the youtube plugin is not showing full width in iOS 8. It works fine in iOS 7. . You can also view demo site in iOS 8 and see error - on the example page if you see one with video and images you can actually see it.

Has anyone got the solution?


php - Helper not loading in Codeigniter? -


यह मेरा सरल नियंत्रक है:

  सार्वजनिक फ़ंक्शन _construct () {parent :: _ construct (); $ इस- & gt; load- & gt; सहायक ( 'url'); } सार्वजनिक फ़ंक्शन देखें ($ page = "index") (यदि (! File_exists (APPPATH। '/ Views / truelove_view /'। पेज। '। Php')) {// वूप्स, हमारे पास इसके लिए कोई पृष्ठ नहीं है उस! show_404 (); } $ This- & gt; लोड- & gt; देखें ('truelove_view / templates / header.php'); $ इस- & gt; load- & gt; दृश्य ( 'truelove_view /'.$ पेज); $ इस- & gt; load- & gt; दृश्य ( 'truelove_view / टेम्पलेट्स / footer.php');  

जब मैं $-> लोड-> सहायक ('url') शामिल करता हूँ; दृश्य में () कोड काम करता है, लेकिन जब मैं इसे ऊपर के रूप में कन्स्ट्रक्टर में शामिल करता हूं, तो यह नहीं होता। यह भी काम करता है अगर मैं url helper autoload।

कोई भी विचार?

दिए गए कोड में, आपके पास सार्वजनिक है फ़ंक्शन _ रचना () , लेकिन यह सार्वजनिक फ़ंक्शन __construct () होना चाहिए। आपको डबल अंडरस्कोर __

जोड़ना होगा

'#define AP_MODULE_DECLARE(type) type' in C/C++ -


क्यों करता अपाचे स्रोत:

  #define AP_MODULE_DECLARE (प्रकार) टाइप   

क्या का उपयोग कर, उदाहरण के लिए, इस रूप का फायदा है:

  AP_CORE_DECLARE (शून्य) ap_add_per_dir_conf (server_rec * रों, शून्य * dir_config); `  

बनाम

  शून्य ap_add_per_dir_conf (server_rec * रों, शून्य * dir_config);  

धन्यवाद।

ध्यान दें कि अन्य परिभाषाओं उन लोगों के लिए संभव हो रहे हैं मैक्रो। में शामिल / ap_config.h निम्न है (मेरे द्वारा जोड़े गए कुछ इंडेंटेशन के साथ):

  #if! परिभाषित (WIN32) || परिभाषित (AP_MODULE_DECLARE_STATIC) ... # परिभाषित (Win32) # AP_MODULE_DECLARE (प्रकार) टाइप __stdcall # बाकी # परिभाषित AP_MODULE_DECLARE (प्रकार) को परिभाषित करता है, तो टाइप करें # endif ... #else ... # परिभाषित AP_MODULE_DECLARE (प्रकार) __declspec (dllexport) टाइप __stdcall ... #endif  

यहां, AP_MODULE_DECLARE __ stdcall (जो निर्दिष्ट करता है एक विशेष बुला सम्मेलन) जोड़ सकते हैं और करने के लिए प्रयोग किया जाता है / या __ डिक्स्स्पीक (डलेक्सपोर्ट) (जो साझा लाइब्रेरी के इंटरफेस के भाग के रूप में फ़ंक्शन निर्यात करने से संबंधित है)।

ध्यान दें कि उदा। यदि एपी_MODULE_DECLARE_STATIC परिभाषित किया गया है तो __ डीसीएसपीसी (डलेक्सपोर्ट) जोड़ नहीं किया जाएगा। मेरा अनुमान (जो पूरी तरह से सटीक नहीं हो सकता है क्योंकि मैं इस कोड से परिचित नहीं हूं) यह है कि यह एक स्थैतिक पुस्तकालय के रूप में एक मॉड्यूल को जोड़ने से संबंधित है, जिस स्थिति में __ डीक्स्पीप (डलेक्सपोर्ट) नहीं बनायेगा अर्थ है।

अगर आप सोच रहे हैं कि उस फ़ाइल की टिप्पणियों में "dso" क्या है, तो यह गतिशील साझा ऑब्जेक्ट के लिए है यह मूलतः एक साझा लाइब्रेरी है, हालांकि अपाचे को साझा लाइब्रेरी उन चीज़ों के लिए आरक्षित किया जाता है जो रनटाइम पर dlopen (3) का उपयोग करके लोड नहीं किए जाते हैं।


python - PyInstaller and Pandas -


I have a fairly simple Python module that I am trying to compile in a Windows exe file. In my script I am using wxPython and Pandas libraries. The PyInstaller exe file that only opens / opens when the Panda library is excluded from my module works

I am getting the same issue when I use --onefile or -. Onedir in PyInstaller I found online that the 'new' version of PyInstaller (2.1) should have taken care of this bug. Does anyone have any ideas on what to do?

PyInstaller: Version 2.1 Panda: Version 0.15.2 Python: Version 2.7

Thanks

I ran into the same problem I have boiled it down in a simple script, like Holopage:

  import panda print "hello world, pandas successfully Was imported! "  

To import Pendes at the right time, I have to modify Hello.spec in the following:

  # - * - Mode: Python - * - block_cipher = none def get_pandas_path (): import pandas pandas_path = pandas.__ path___ [0] return pandas_path a = analysis (['Hello.py'], pethax = ['c: \\ scriptsatatarepandus'], binaries = any No, Datas = none, hiddenimports = [], hookspath = none, runtime_hooks = none, none outside = none, win_no_prefer_redirects = none, win_private_assemblies = none, cipher = block_per) dict_tree = tree (get_pandas_path (), Prefix = 'pandes', excluded = ["* .pyc"] a.datas + = dict_tree a.binaries = filter (lambda x: 'panda' not in x [0], a.binaries) pyz = PYZ (a.pure, a.zipped_data, cipher = block_cipher) exe = exe (pyz, a.scripts, exclude_binaries = true, name = 'hello', debug = false, strip = none, upx = true, console = true ) Scoll = COLL ECT (exe, a.binaries, a.zipfiles, a.datas, strip = none, upx = true, name = 'hello')  

Then I ran: / P>

$ pyinstaller Hello.spec --onefile

from the command prompt and I hope the message 'Hello World' was found. I still can not fully understand why it is necessary that I have a custom build of Pond - which is installed in MKL libraries - but I am not clear whether the run is causing failure.

This is similar to the answer:


angularjs - Binding global scope variable to directive local variable -


I'm having trouble understanding the area to connect between the controllers and the instructions.

What I'm trying to do is force data in my controller in my command $ scope.systems .

So I setup simple directive call:

  & lt; Kamboox Data = "System" & gt; & Lt; / Combobox & gt;  

I also tried to force the variable, but I did not understand it.

  & lt; Combobox data = "{{systems}}" & Lt; / Told & gt;  

Then I created my driver like

 . Directive ('combobox', function (timeout)) {return {restricted: 'e', ​​substituting: true, templateUrl: '/angular/directives/combobox.php', link: function (scope, element, ethers) {console .log (attrs.data); $ Timeout (function () {console.log (scope.systems)); Console.log ($ scope [attrs.data]);}, 1000);}}});  

I'm supposed to add a scope parameter to a guided return

  scope: {'systems': '='}  

or

  scope: {'system': '= data'}  

I am able to set simple directions where Values ​​are within the scope of the instruction, and they have worked, now I am trying to prepare a reusable instruction where I can tell which data is used from the controller area I have to do it, and I'm stuck now.

This should work though I'm not sure why your template is a php file ... < / P>

  & lt; Combobox data = "foo" & gt; & Lt; / Combobox & gt; & Lt; Kamboox data = "bar" & gt; & Lt; / Cambodia & gt; App.directive ('combobox', function ($ timeout)) {return {restrict: 'e', ​​replace: true, scope: {// it will set $ scope.systems // / data attribute 'system' : '= Data'}, templateUrl: '/angular/directives/combobox.php', link: function (region, element, etter) {console.log (scope.systems);}}}); Do not use  

replace BTW, . The Kangra team said that this will probably disappear soon because it is causing too many issues and is not necessarily anyway.


ios - didSelectLinkWithURL not getting called with TTTAttributedLabel -


So I'm using the fastest TTTTLLB and I (I think) have installed everything properly. Calling didSelectLinkWithURL is not being made, and I do not know why the link appears in the "Highlight" label - so I do not think I'm setting it up incorrectly

< P> This is my code:

  Import UIKit class ViewController: UIViewController, TTTAttributedLabelDelegate {@IBOutlet weak var label: TTTAttributedLabel! Override FunctionDidload () {super.viewDidLoad () var str: NSString = label.text! Rng: NSRange = str.rangeOfString ("fox") label.addLinkToURL (string: "http://apple.com"), with Range: RNG)} func attributedLabel (label: TTA distributed label !, didSelectLinkWithURL url: NSURL !) {Println ("test123")}}  

Any ideas? Thanks :)

add line label.delegate = self


unity3d - Unity5 render at half resolution -


So, for the first time I am attempting to get a better performance (for example) Created a script that combined a new camera with an aircraft in front of it, then presented the original main camera in a texture, and then I showed this texture on the plane. Does it work.

However, I came to know about the method then. It looked very promising but I do not think so.

So I tried the following:

  RenderText texture = new rendering (screen. With / 2, screen wide / 2, 16, rendertiktformat.razb 32); Graphics.SetRenderTarget (Texture);  

But it does not seem to change anything. I was hoping that this would render unity at half resolution. (I saw it in 'update' as well as 'update' method.)

I can not understand the functionality of this method. Am I using it wrong? Or is there something I do not know about?

I can not comment due to the missing reputation, so I have to write a reply ...

Why do you want to use an option, not communicating this text? Or because of the low quality setting, why not try to just use the quality setting of unity, so your performance should be better.

Kind regards


zpl - Possible rotate image printer zebra -


मेरे पास निम्न कोड है:

^ एफओ 005,041 ^ XGDILOGO01,2,2 ^ एफएस

ऊर्ध्वाधर से प्रिंट, मैं क्षैतिज मुद्रित करने के लिए कैसे कर सकता हूं ??

पाठ और बारकोड के लिए आपके लेबल में अलग-अलग फ़ील्ड ओरिएंटेशन को ^ एओएन और ^ बीसीएन कमांड के चौथे अक्षर में निर्दिष्ट किया गया है। इनमें से किसी भी क्षेत्र की ओरिएंटेशन को बदलने के लिए, निम्नलिखित सूची से उपयुक्त अक्षर का उपयोग करें:

  • n = सामान्य

  • R = 90 डिग्री (दक्षिणावर्त)

  • I = उलटे 180 डिग्री

  • बी = नीचे से पढ़ें, 270 डिग्री

  • P>

उदाहरण के लिए, 90 डिग्री में बारकोड मुद्रित करने के लिए, ^ बीसीएन, .... से ^ बीसीआर, ..., या एक विशिष्ट टेक्स्ट लाइन को 90 डिग्री पर प्रिंट करना , ^ एओएन, ... टू ^ एओआर, ....

को अपने लेबल में सभी फ़ील्ड की मूल स्थिति को बदलने के लिए, किसी भी पाठ / बारकोड फ़ील्ड को कॉल करने से पहले आप ^ एफडब्ल्यूएक्स का उपयोग कर सकते हैं, जहां x वांछित डिफ़ॉल्ट अभिविन्यास (ओरिएंटेशन विकल्पों की ऊपरी सूची से) का प्रतिनिधित्व करता है, और केवल व्यक्तिगत पाठ / बारकोड आदेशों में अभिविन्यास पत्र शामिल करता है (यानी, ^ BCN, ... ^ ^ BC ^ ... और ^ AON, बदलें। .. करने के लिए ^ एओ, ...) कि डिफ़ॉल्ट अभिविन्यास के लिए किसी भी अपवाद के लिए।

इसके अलावा, आप क्षेत्र उन्मुखीकरण बदलने के बाद आपको एक्स / वाई निर्देशांक समायोजित करने की आवश्यकता होगी।


Parsing Multiple (Thousands) of JSON objects from a url in Java -


I have to deal with thousands of JSN objects which I am getting in Java from url. I always have the usual JSON code Tried to use but I got the thread "main" org.json.JSONException in error: a JSONObject text2 {character 3 line1]

Because there is no curl braces in JSON data, only the square bits around each JSON object Racquets.

I appreciate any help I can get with it.

> The BTW code I was trying to use was the code posted in the highest answer:

thanks

I have detected the correct method to handle it.

Once I treat the data as Jason Ellie, then it works fine. I then specify the field that I want with the name instead of the number reference. For example: System.out.println (json.toString ()); Println (json.get (2));

The header will print the line and print the second area of ​​the header row.

To process the next object, I think line number on each iteration will work fine.


python 2.7 - mocking sleep in a test -


I have a function to test that eventually calls the second function in which there is some time. If I do not want my trial to sleep, my question is, is it better to duplicate the test function, or is it better to wrap your call in the function to test from the patch?

Example 1

  @patch 'Time.sleep') Def test_some_function (mock_time): data = some_sleepy_function () insert data == expected_data   

Example 2:

  def test_some_function (): @patch ('time sol') DRF run_function (mc_sd): run back_s leepy_function () _ work () == I like the  monkeypatch of py.test to make something simple like expected_data    

unittest Test seas subclasses).

/ html>