Posts

Showing posts from June, 2011

string formatting - Java NumberFormat isn't respecting comma as decimal separator -

I found a bug in my app where when using an international format my currency string is not showing the right group and decimal separator was. I tried to isolate the code and display the problem. In the code below, I am a U.S. I'm making a format and a world format. Both of them use the same currency pattern, but the United States formatter uses a period as the decimal separator and the world format uses a comma as the decimal separator. When I ask the World Formator to ask what their separators are, then they report them correctly. However, when I get a string for my value, it does not do it properly. This surprisingly uses the duration for grouping and decimal separator. Public static zero master throws exception (strings [] args {String currencyFormat = "¤¤ #, ## 0.00; - ¤ #, ## 0.00"; Number formatting msaa = number format.getcurrencyinstance (); Decimal functional decimal time currency = AA = (decimal format) currencyUSA; DecimalCurrencyUSA.applyPattern (cur...

inetaddress - I am trying to ping www.google.com using JAVA in my office but it is not pinging the same -

I am trying to ping www.google.com to my office network but it is not ping. The code I am using is as follows: import java.io.IOException; Import java.net.InetAddress; Import java.net.UnknownHostException; Public Class Demo 1 {Public Static Wide Men (String [] AGR) UnknowHost Exposure throws, IoE extension {try {string address = intrader.ATBanam ("www.google.com"). GetHostAddress (); InetAddress inet = InetAddress.getByName (address); System.out.println ("Sending the address" + address); If (inet.isReachable (50000)) {System.out.println ("host is reachable"); } Else {System.out.println ("Not accessible to host"); }} Hold (Exception E) {// TODO Automatic Holding Block e.printStackTrace (); }}} I do not know what the problem is, it can not ping it at www.facebook.com or www.youtube.com I do not have "access to the host" but it can ping the internal system of my office. All these external systems like google.com open in the brows...

how to delete a line in file routes.rb ruby on rails -

In my file paths. Rb Namespace: Administrator resources: excluding albums,: [: new :: edit, delete] resource: except conversation_replies,: [: new: edit, delete] Resource: Excluding the author: [: new, edit, deleted] expiration Now, I want the line "resources: except the authors, except: [New: Edit, delete] "Ruby in code by Rail Please help me a lot Thanks This is a text file. It is not programmatic, it means to edit by hand. You simply delete the line Open your editor, select the line, and press the backspace or delete the key.

ios - CGImageCreateWithMaskingColors returns null -

I have a scene with black text around which I want to make a white "glow" I think I can grab a screenshot, reverse the colors (it's just black and white), transparent masking with black, and the resulting image "irritable" in each direction. When I try to mask the blackmoney with the CGImage buyer, the masking color I get a null CGImageRef so far I have it. // First get a screenshot in a CI image so that I can apply a CI filter UIGraphicsBeginImageContext (self.view.frame.size); CGContextRef Reference = UIGraphicsGetCurrentContext (); [Self.view.layer renderIncontext: context]; CImage * CIIGJS = [[CIMAge ALOOC] Initvith CGImage: [UigRXGetImageFrenchInsources ContactCGImage]]; UIGraphicsEndImageContext (); // Now CIColorInvert Filter CIFilter * Filters = [CIFilter filterWithName: @ "CicolorInvert" keys and Values: kCIInputImageKey, ciImage, Zero] Apply; CiImage = [filter value forKey: kCIOutputImageKey]; // Now I need to get a CG image from the C...

scala - In Lift, making a JObject with an inline function -

This is common in JavaScript, especially in jQuery, to call a function with a literal argument and the area of ​​that argument To be an inline anonymous function. Like this: $ (function () {$ ("# mylist"). Sort ({placeholder: "ui-state-highlight", stop: function () {warnings ('hello !);}}};}); Is it possible to make such a call from the elevator? It's as far as I've found: " # JsonScript "# & gt; script (js.jquery.JqJsCmds.JqOnLoad (js.jquery.JqJE.Jq (" # mylist ") ~ & gt; JJEJSfank (" Sortable ", Jobised ( Jeffield ("Placeholder", Jestring ("U-State - Highlights")): Jeffield ("Stop", J.J.E. Phonique (JSCMG Alert ("Hello!")) :: Neil)))) The compiler complains that AnonFunc is not a JValue which is absolutely correct: it is not But in Javascript, a function () {} call is a legal value for a literal object area. How can I lift it? For the function body her...

where clause - mysql select from column if not equal 0, else select from another column -

मेरे पास यह प्रश्न है SELECT products। *, Colors.name as colorName, बनाता है .name makeName, genders.name genderName, group_concat (categories.name द्वारा DISTINCT categories.name आदेश) distCategories के रूप में, group_concat (subcategories.name द्वारा DISTINCT subcategories.name आदेश) के रूप में distSubcategories के रूप में, group_concat (बनाता DISTINCT makes.name आदेश के रूप में .name) distMakes, group_concat (products_availability.size द्वारा DISTINCT products_availability.size आदेश) के रूप में उत्पादों से distSizes LEFT products.color = colors.id बायाँ शामिल हों पर रंग के शामिल होते ही पर products.make = makes.id वाम उत्पादों पर लिंगों में शामिल हों बनाता है। लिंग = genders.id बाईं तरफ products_and_categories.product = products.id बाईं तरफ products_and_subcategories.product = products.id बायाँ शामिल हों products_availability शामिल हों products_and_subcategories पर products_availability.product = products.id वाम products_and_categories शामिल हों पर products_and_categories.cat...

knockout.js - Durandal 2.0 custom dialog -

I want to create a fearindle custom dialog which is an existing compose-worthy view-model with a title and footer Adds window frames. I have a custommodel template and div As you can see, I want to prepare a view-model within the custommodal template body. This is because Vyöllold has not been passed, which is linked to a model display, but can easily use it. I have created a custom model .js model like this: define (['plugins / dialog'], function (dialog) {var custommodel = function ( Title, model, view, option) {this.title = title; this.model = model; this.view = view; this.options = option;}; CustomModel.prototype.SetOption = function (dialog) {dialog.close ( This, dialogue result);}; return custommodel;}); But when I try and use it to bind the '.html' template, Am I missing something here? And is it really the best way to do this? Thank you. I created a simple example in which you can use as the starting point. It contains an index view ...

Merge 32bit and 64bit installer into one installer using NSIS -

I have created a simple installer using NSIS. I want the installer to detect the OS that is using a client. If the client is using 32-bit OS then all the files should be copied into the program file (32 bit) or if She is using 64 -bate OS, all the files should be copied to 64-bit. Anyone can help me know how to find it. Thanks and do not forget to include x64.nsh) function .oninit $ {if} $ {running x64} stroke $ INSTDIR "$ PROGRAMFILES64 \ myProduct" $ {ELS} StrCpy $ INSTDIR "$ PROGRAMFILES \ myProduct"; $ PROGRAMFILES32 also works $ {EndIf} FunctionEnd Alternatively, you can also view Registry View (see)

javascript - How to stop the incompleted animation while mouse out and then mouse in again in .hover()? -

I'm trying to use. () To hide and show the user mouse in the image. This is my JS code: $ (document) .ready (function () {$ ('# test'). Hover (function () {$ ( Show '(' slide ', {direction:' left '}, 1200);}, function () {$ (' caption '). Hidden (1200)})}}; But if I make the mouse out of the mouse several times faster and faster, the speed of the tag can not be retained with the mouse, and I want to do that when I run again, then what is incomplete animation And call current I tried to add a .stop () but then the function can not repeat me again would anyone Thanks, thanks. Here is JSFiddle: Usage Stop (true, true) In Jquery.We can use a lot of linear animations to create a good slide effect without adding common stops (true, true) to the series: $ (Document) .ready (Function () {$ ('# test'). Stop (true, true) Show ('slide', {direction: 'left'}, 1200);}, function () {$ ('.coption' ). Stop...

javascript - Can we set cursor as a session variable? -

I tried to set a cursor as a session variable as if it is not working. Think about it ?? My code: Meteor.call ('apiresult', function (e, result) {console.log (result); session .set ("object", result)}); // Getting variable var abc = session .get ("object"); Return abc.skimlinksProductAPI.numFound; It seems that it is not working Cursor can actually store in session ... sometimes open it and try it in the browser console: & Gt; Session .set ('mycursor', player. Search ()); Undefined Session.get ('mycursor') LocalCollection.Cursor {collection: LocalCollection, selector_f: function, sort_f: null, skip: undefined, border: undefined ?? |}} & Gt; (Object, object, object, object) Download now, use the latest meteor, and do so in a browser console you can find: Estimate the moral story, do not place the cursor in the session variable. Store instead of objects ( sort , field etc.)

Asp.Net MVC model validation with default text in textbox -

I am trying to validate the input control in ASP.Net MVC. Check the code given below if the project name is zero and throws verification. I'll get some default text in the textbox on page load. I have a scenario to see that the name of the project is not empty and the name of the project is not a "test project" can I do in a similar scenario? [Required (error message = "Choose project name."]] [DisplayName ("Project type:")] Public string SelectedProjectName {get} set;} You can write your own custom carrier. Public class ProjectNameValidation: ValidationAttribute {Public ProjectNameValidation ( } {} / / / Private const string error msg = "{0} should not be greater than {1} or {2}; Public override button ISYID (object value) {if (value ! = Null & value! = "Test project") {return true;} description is false;}}

java - LIBMSVM svm_node format -

Hi, I am currently working on a project and started using the LIBSVM () library to train datasets for my Java application. I have a question about svm_problem and svm_node in the svm_problem we have the following code package libsvm; Public class svm_problem applies java.io.Serializable {public int l; Public double [] y; Public svm_node [] [] x; } Is it correct to say that Does all represent the size of the image? In my case, the image is labeled I + 1 / -1 and now svm_node [] [] About my second question goes to X package libsvm; Public class svm_node applies java.io.Serializable {public int index; Public double value; } From 1 to i each svm_node is located in every array where I have the number of my properties. So for example I have an image value as follows 1: 1.5 2: 2.5 3: 4.5 -1 1: 1 2: 2 3: 3 then my int l = 3 y y [0] = 1 y [1] = -1 X [0] [0] .index = 1 x [0] [0] .value = 1.5 x [0] [1]. Index = 2 X [0] [1] .value = 2.5 x [0] [2]....

Database manage in Ruby project -

I have a few questions with Ruby on my team and applying an application in Rail. This is my first ruby ​​project and I wonder how to manage database changes. For example, in the beginning I will create a DB schema and I should create a dump for all team members who can import all DB schema locos or create migration and all can manage their own (no dump). Does the migration be used only for DB changes ?? Can we use migration to set up DB Schema Locia ?? What are trends ?? Thanks for all the answers migration Only DB is used for changes Answer: Yes migration is used to manage operations on the database but migration is also used to create a database if you have not created datebase. Just run a command rake db: migrate and it will update the schema rb file and create a database on the specified server in your yml file. Can we use migration to setup DB Schema Locia ?? Answer: Yes you can. What are the trends ?? > Answer: Every time you want to make any ...

ruby on rails - Will_paginate with mongoid (total_entries issue) -

'विल_पेग्नेट' मणि के साथ mongoid का उपयोग करते समय, यह 'total_entries' नामक विधि की तरह लगता है जो काम करता है जो perfomance को प्रभावित कर सकता है इसलिए मैं 'विल_पेग्नेट' मणि के साथ मोंगॉयड का उपयोग कर रहा था और मुझे 'total_entries' विकल्प के साथ इस समस्या थी, और अधिक विशिष्ट, मुझे नहीं लगता कि यह बिल्कुल भी काम कर रहा था, जो कई स्थितियों में परिष्कार के लिए बहुत अच्छा नहीं है ... कुछ समय बाद मैंने मणि पाया लेकिन यह नहीं दिखता कि 'कुल_एडिट्री' पद्धति वहां काम कर रही थी, इसलिए मैंने यहाँ किया है: 1) विग_पाग्नेट_मैगॉइड स्थान में खोला गया mongoid_paginator। 2) थोड़ा तय किया, तो यह इस तरह दिखता है: WillPaginate :: collection.create (विकल्प [: पृष्ठ], विकल्प [ : Per_page]) | पेजर | Items_count = options [: total_entries] || स्वयं कोटा fill_pager_with self.skip (विकल्प [: ऑफसेट])। सीमा (विकल्प [: per_page]), आइटम की गणना, पेजर जो मैंने लिया और हालेलुजा, यह फिर से काम करता है, नहीं हर लोड पर अधिक मायने रखता है। चूंकि मैं एक नौसिखिया ह...

javascript - Working With Dynamically Created Inputs -

I have a dynamic form that you can add elements like, you type in a name, and then if you To write a new name, you click on 'Add Name', and another text box appears. Their names are names [] . I can process those inputs with PHP on the server side. However, I want to make a calculation with those inputs, such as by typing on all types of pages as the user type However, because these inputs, those textboxes are dynamically created, Javascript only selects the first text box with the name name [] Let me clear it. In this way it would be better to get me a textbox I input in the age of the age if I want to enter a new era, then I will click on the 'Add Age' button, and a new input box will be pop out. I write the value of the new age and as I type, on the third lesson text, the values ​​of those ages are printed on average. But due to those input boxes name age [] with execution time (not on collection time, I'm not sure that these are suitable words for...

azure - NServicebus: Programmatic reading of error queue -

Let's currently create an application using NServicebus and Azure Regular Procedures Work But now I want to do more about the application's management and monitoring aspect. The customer wants to see a dashboard where he can see the health of the application and also be able to solve the problem. What do I want to do: Find out when an error queue (an administrator is sent to be able to send a warning) is sent to Allow administrator to handle messages on the error queue from the management application, without resorting to the provided command line tool. Is NServicebus a way to tackle the problem with the program? I know which errors are transient and which errors may require manual intervention. Is it possible to plug in logic? Is it possible to handle messages on the error queue program? Thank you, Irwin "About the Dashboard where it can see health Be able to correct the application and also issues ": Please take a look at service pulse...

jquery - Sending Kendo grid row to server when click submit button -

I have an aspx page that has several html controls and a condo grid on it. I want the submit button Click on all the data of the web form that is sent to the server. I know the solution of the html control, but can I send it and maybe convert it to the Jason Marie condo grid? If the grid is in editing mode, all you have to do is: grid To send complete data to: $ Ajax (url: 'url', cache: false, type: 'post', type of content: 'app / jason; charset = utf-8', data: jsn.strynwive ($ ("# gridname"). (.cendo grid._data)}); To send data for one line in editing mode: $. Ajax ({url: 'your url', cache: incorrect, type: 'post', type of content: 'app / jason; charset = utf-8', data: json string ($ ("# gridname"). ("Kandogreid"). Datasource. Selection ())}); I hope it helps!

Reset identity seed after deleting records in SQL Server -

I have recorded a record in a SQL Server database table. A primary key was defined in the table and the seed to identify auto increment has been determined. This is mainly because SQL is done in Ezur, the primary key and identity must be defined in each table. But since I have to delete some of the records from the table, the seed of identity will be disturbed for those tables and the index will be disturbed by the column (which is generated by the increment of 1). How can I reset the column in the ascending order in the numerical order after the record? The identity column is not used in the foreign key anywhere in the database. Management command is used to reset the identity counter. Example: DBCC Investigator ('[TestTable]', Race, 0); GO This Azure was not supported in previous versions of SQL database, but is now supported.

Jackson Object mapper to convert java map to json maintaining order of keys -

I'm using the jackson.map.ObjectMapper API to convert the json string to the map I am I'm using writeValueAsString method to get this. I pass a map sorted by value to the writeValueAsString method. The JSON string I get is surrounded by keys. Is there a way to change the map using Jackson without affecting the order of objects in Maps in Maps. I tried setting the value to Feature.SORT_PROPERTIES_ALPHABETICALLY , but according to the documentation it is applicable only for POJO types. said any ideas for implementing the behavior. with Jackson 2.3.1 (you do not know for previous versions) as an example Treemark, Sort can be respected. Here is an example in Junior 4: @Test pushes public Zero Test (Cyrilize) JsonProcessingException {ObjectMapper om = new ObjectMapper (); Om.configure (SerializationFeature.WRITE_NULL_MAP_VALUES, false); Om.configure (SerializationFeature.INDENT_OUTPUT, true); Om.setSerializationInclusion (Include.NON_NULL); SortedMap &...

c++ - Qt empty space column in QGridLayout? -

Image
I have the following code where I place a button and a text box in QGridLayout . Issue notices that I use columns 3 and 4 for them. QGridLayout * insAddPanel = New QGridLayout (); {QLineEdit * ledInstrumentName = New QLineEdit (); InsAddPanel- & gt; AddWidget (name of leadership, 0, 3); QPushButton * btnAddInstrument = New QPushButton (); BtnAddInstrument- & gt; SetText ("add"); InsAddPanel-> addWidget (btnAddInstrument, 0, 4); } Main Layout- & gt; Adlayout (In AdPaneel); ...... While I run it, I get something like this: I wanted to capture the text editing and the button only available 2/5 of the horizontal space, this is why I And put it in 4 columns. Since it does not work, how can I do it? Is there something like Spaces widget in QT? I searched but could not find it. You Stretch = 1 for all the columns. This will give you the view you want.

php - Error in mySQL form submission -

I am working on a student registration system, where user login is used by username and amp; After entering the landing page display student name, user_id, and department (using the echo function from muxel), the password assigned to them (the login system works fine) is asked to choose courses to register them, After submission, I need to update the syllabus against ISSL User_id (which was shown on the previous page) Update on selected course mysql. Received do but only if i user_id would define for example: mysql_select_db ( 'school', $ con); $ Fresh = $ _REQUEST ["Fresh"]; $ User_id = $ _REQUEST ["user_id"]; $ Sql ​​= "UPDATE` rasmp_accounts` SET` fresh` = '$ refresh' Where 'user_id` =' 001 '"; But when I define the situation where it does not work: mysql_select_db ('school', $ shan); $ Fresh = $ _REQUEST ["Fresh"]; $ User_id = $ _REQUEST ["user_id"]; $ Sql ​​= "UPDATE` rasmp_ac...

javascript - JQuery rolling - stop previous & generalize -

मेरे पास ऐसा कोड है: जावास्क्रिप्ट $ ( (Function () {$ ("a.link1") {$ ("a.link1")। क्लिक करें (फ़ंक्शन () {// $ (this) .stop ()। PreventDefault ()। ({Scrollopop: $ ("# link1") ऑफसेट ()। शीर्ष}, 2000);}};}); $ ("a.link2") क्लिक करें (फ़ंक्शन () { // $ (this) .stop ()। PreventDefault ()। चेतन (फ़ंक्शन () {$ ('html, body')। चेतन ({scrollTop: $ ("# link2")। ऑफसेट ()। शीर्ष}, 2000 ());}); $ ("a.link3") क्लिक करें (फ़ंक्शन () {// $ (this)। रोक ()। PreventDefault ()। चेतन (फ़ंक्शन () {$ (' एचटीएमएल, बॉडी ')। चेतन ({स्क्रोलटॉप: $ ("# लिंक 3") ऑफसेट ()। शीर्ष}, 2000);}};})}}}; एचटीएमएल का शरीर: & lt; div id = "menu" & gt; & Lt; a href = '# link1' class = "link1" & gt; LINK 1 & lt; / a & gt; & Lt; a href = '# link2' class = "link2" & gt; LINK 2 & lt; / a & gt; & Lt; a href = '# link3' class = "l...

http - Allowing others to change css of content inside iframe -

I am creating a solution similar to Twitter's widget. I was wondering if there is any way to allow others to change the style of content in their iframe? I know that the same basic policy exists, but I wonder what is there in the headline notice that I can leave the iframe content to allow browser ignore? Solution, when passed through the URL URL parameter or better resolution (in my opinion) If done, create such a URL parameter for each optimization item? ? Bgcolor = 000000 and fontcolor = ffffff

c# - How to get the row index of a WPF Datagrid? -

I am using image control column in wpf datagrid. That control is used to remove the row in the datagrid if click is done. Anyone can tell me how to select the entire line of the grid, click on control, my code below the event is now. XML code: & lt; DataGrid x: name = "dg" & gt; & Lt; DataGrid.Columns & gt; & Lt; DataGridTextColumn header = "id" binding = "{binding path = area id}" /> & Lt; DataGridTextColumn Header = "Sector" Binding = "{Binding Path = Sector ID" /> & Lt; DataGridTemplateColumn Width = "40" & gt; & Lt; DataGridTemplateColumn.CellTemplate & gt; & Lt; DataTemplate & gt; & Lt; Image X: name = "imgDel" source = "delete.png" stretch = "none" MouseLeftButtonDown = "imgDel_MouseLeftButtonDown" /> & Lt; / DataTemplate & gt; & Lt; /DataGridTemplateColumn.CellTemplate> & Lt; / DataGridTemplat...

ios - Core Plot sliceWasSelectedAtRecordIndex with 2 pie chart -

I will create a graph with two piechart plot like donutchart: the first is " piechart ", the second Is " center donut ". There is only 1 piece in the center donut, with white color, value 1. If users press a piece of "piechart" then it works well with the correct index. If users press a piece of "center donut", then "piechart" instead of "centerDonut" To exchange. Why does this happen? I [myself] I want to try with the center]: , but it does not work. - (zero) initPlot {[selfconfigured host]; [Self configurable graph]; // Configure the chat I configure and add the pie chart and then center the donts [selfconfigured charts]; // I have 2 labels in the storyboard on the graph, their fixed value and performance. [Autobiological allwell]; } set pieInnerRadius Code> to make it a ring.

vba - How can I install word font programmatically? -

I am creating a word template for some users, and I need to use the "MT extra" font, Whatever I know is normal for all word versions, but I need to make sure that it is installed because the word installation can not choose to install any font at user's time! So I can add a VBA piece of code to install it, whatever the font on the user's machine, the settings of the machine ?? (32/64 bit or whatever). It's not that easy ... Take a look here: / P>

r - Is cv.glmnet overfitting the the data by using the full lambda sequence? -

cv.glmnet has been used by most research papers and companies for similar functions such as cv.glmnet for Glmnet.cr When creating (a similar package that applies lasso to successive regression continuity ratio) I have come to cv.glmnet in this problem. cv.glmnet fits the first model: glmnet.object = glmnet (x, y, weight = weight, offset = offset, lambda = lambda, ...) The whole figure is created with the glmnet object goes as follows: lambda is removed from the full model fit lambda = glmannet.object $ Lambda Now they ensure that the number is greater than 3 if (nfolds A list has been created to store cross-authenticated results outlists = as.list (seq (nfolds)) i seq (nfolds)) a for the loop to fit various data parts {which = foldid == i (Is.ma tricks (y)) y_sub = y [! Which,] and y_sub = y [! Which] if (is.offset) offset_sub = as.matrix (offset) [! Lambdas full data outlists [[i]] = glmnet (x [! Joe, drop = false], y_sub, lambda = lambda, offset = o...

split - Want to separate a string by spaces, but not escaped spaces -

I would like to write some code that will take a string and "" , but No "\" I usually use std.array.split for division, but it can not handle it clearly. What will be the best way for me to do? Regular expression (+ view) is powerful enough for: Import std.regex; Zero Main () {Auto Parts = Split (R "EF repeatedly", Reggae (R "(? & Lt;! \\)")); Emphasis (parts == ["foo", "repeatedly", "falcon"]); }

c++ - Is there a way to search for functions among a large folder of libraries (.a and .so files) in UBUNTU? -

I have a project in Eclipse using a library and I include any files without your project (directory included Can I import trouble?) In Ubuntu, searching for works through a list of libraries is a tool, but I do not know which libraries to include (I know library paths with library libraries). ? "NM" is a device that lists all the exported libraries, structure variables, etc. of a particular library, if there is no "function for fashion" tool, then I must write a program that uses "nm" Search for works Adding the link to the project's ownership of your libraries and headers, you You can use autocomplete, where the problem Or? If you are using Foo Library, you must link: c / c ++ build-> settings-> c + + link-> gt; ; In the list c / c ++ build-> settings-> c ++ compiler-> gt; Keep it. Put * .h Foo Path. Then in your program .. main.cpp #include & lt; Foo /a.h> Int main (A); a. } When you click on ...

javascript - jQuery ajax call is not sending japanese character in headers attribute -

I am using jquery.ajax call to call my service and $. Ajax ({url: "my / url / for / post", type: 'POST', header: {name: "ç§ ????" ???? ???? ???? ???? ???? ???? © one ?? ¹ã? ?? ?? ÃÆ'à ¢ â,¬Å¡Ãƒâ € šÃ, ·? ContentType: "application / octet-stream", process data: wrong, async: right, data type: error}); But when I send a request to send the header, then the name was not. Do I have any other specialty which is to send the Japanese or Chinese character to the header? name: unescape (encodeurIComponent ("ç§ ?? a ??ll ? encodeurIComponent () Special characters will encode Unsap () will encode the encoded string.

Javascript: function and its argument -

I have a problem with my function and its arguments ... this code is: function alab () {var up = arguments [0]; Var id = logic [1]; Lane = arguments Long-3; For (var an = 1; a & lt; = 10; a ++) {arg = (logic [2] + a); // id tag html: [nome] [num] document.getElementById (arg) .style.display = "block"; } (Var i = 3; i & lt; len; i ++) {warning ('test1'); Document.getElementById (argument [i]). Style.display = "none"; Warning ('test2'); } Change_price (above, id); } The script is hanging in another cycle: It prints 'test1' , but does not print 'test2' . Where's the error? Thx all;) Note that this advice should be used for all things: (var i = 3; i & lt; len; i ++) {var node = document.getElementById (argument [i]); If (node) {node.style.display = "none"; In other words, if any element can be found if you are not 100% sure to be even more pedantic: i

ios - How can a modal view controller be dismissed if the presenting view controller is changed? -

I am presenting a modal view controller on the iPad that changes the presented view controller during the presentation. For example: A visual controller VC presents the Model View Controller when the user selects a cell in the table view. The user has been designated a Model Model Controller and the second VC has been opened in the first place. Importantly, the visual controller is of the same type before changing the example. The modal view controller can not be dismissed or the exception EXC_BAD_ACCESS is generated. It is understandable to fail: Current view controller is no longer available. In fact, how would I reject this presented Model View Controller from a different Presented View Controller? I have already code: ViewController1.m - (minus) showModalViewController: (UIViewController *) ViewController {UINavigationController * navigationController = [[UINavigationController alloc] initWithRootViewController: ViewController]; Navigation Controller Model Pr...

python - FrameSelected isn't working -

I have this problem where I'm unable to get the function frame select () In my view, I have a camera called TT_CAM, and there is a list of models with label labeled 'model' (this is called pebble / sphere etc.) called My aim is to The user executes the script, I tried to use the code given below but This failed for the frame. Here's what I have tried: Import cmas cmlook.lookThru ("TT_CAM") as CMD cm mAssets = cmds.select ('Model *' ) # Cmds.viewFit (mAssets) cmds.FrameSelected (MAssets) I call it a I will not post it as an answer. I did not know that Pimail actually had such a task, but you have to import it explicitly to use it (it is a problem from here that you get it from CMDS How are you calling ). Due to the size of your code, I just rewrite it using just the piemail. Import pymel.core to import from pmym.core.runtime import from frame frames related to pm.lookThru (" TT_CAM ") mAssets = Pm.select ('Model *...

php - Strip tags (< and >) -

I & amp; Lt; and & gt; ; and all of them in PHP save it in one variable. Example: From: & amp; Amp; Lt; P & gt; This is a paragraph & amp; Amp; Lt; Strong & amp; ; Gt; Bold & amp; Lt; / Strong & amp; Gt; Text & amp; Lt; / P & gt; To do this: This is a paragraph with bold text Have also got an example or idea? Thanks! If you have nested & amp; Gt; Not and & amp; Lt; , then you can try the following to match occurences: $ matches = array (); Preg_match_all ('/ amp; lift; ([\ s \ S] *?) & Amp; gt; / s', $ string, $ matches); Try the code for your stroke in ? Pay attention to which makes unbelievable matches in the grave, you can find the answer to a similar question. If you want to delete values, use preg_replace_callback :

Git never (auto) merge composer.json -

I have my compositor GI In this way, I can develop a composer. Jason, who uses development-development package, while one of the master uses only the Dev-Master package. According to the suggestion, I can use two composer.json files, but I am afraid that I will have my composer for the master. Jason will forget to add a bundle. Especially when automating tasks, it can end in a disaster. In fact, I would like GIT either: There is always a dispute while merging composers, so I based on the number of lines only Merge on .. So if a bundle is added / removed, then the number of lines changes, then merge it, struggle, whatever, if the content of the change in a row changes, then ignoring it While I I believe that the special scenario you have indicated indicates that you have in-depth problems with your development process, that you set the merge attribute on file in question By making GIT easy to ask, one of the two values, from the "Merge in three ways" secti...

jquery - Hide links from Google via JavaScript -

We have some links that we want to hide from Google, on the "hide" link to use javascript, but This is the real client. I was told to the SEO Agency that the best way to encrypt the link to the base 64 is to call it via javascript: My problem is now, I do not want to include the second 2 files for the link (they suggest me crypto-js lib) I want to ask you, Google has linked the link How to highlight and follow them and what is the easiest way without loading more scripts is available in JQuery. This is what I've ended: Link look like: & lt; A href = "#" onclick = "link action (this); return false;" Data-href = "uggc: // fgntvat ....." & gt; Where data-href Rot13 is encoded and the link action does: function link Action (e) {Window.location = rot13 ($ (e) .data ('href')); } .. In the external js file. I think this performance is the best option without overhead. See what the SEO Agency says:...

python - locals().update(kwargs) is not working -

इस सवाल का पहले से ही एक उत्तर है: 4 जवाब वर्ग फू ( ऑब्जेक्ट): def __init __ (self, x): self.bar (x = x) def बार (स्वयं, ** kwargs): प्रिंट kwargs स्थानीय ()। अद्यतन (kwargs) प्रिंट xf = Foo (12) यह स्पष्ट है, लेकिन यह काम नहीं करता है, पहला प्रिंट आउटपुट {'x': 12} होगा, जो सही है, फिर भी मुझे यह त्रुटि मिलती है: नाम की त्रुटि: वैश्विक नाम 'x' परिभाषित नहीं है ऐसा क्यों होता है? धन्यवाद। द्वारा दिया गया शब्दकोष केवल पढ़ने के लिए है आप वर्तमान गुंजाइश में गतिशील रूप से चर को जोड़ नहीं सकते।

android - How to declare function which accepts Generic AsyncTask as an argument -

I have many actions and in my application, AsyncTasks I want to define an interface that is a normal async task and Accepts Boolean. I will implement that interface in all the activities and want to call the interface method asyncTask. How should I declare a method to accept all the sub-classes of asynchronous? I want to make it normal so that I can know that to use the example operator which is called an override method in asyncTask activity. I tried to use: public onupdate (AsyncTask & lt; param, progress, result & gt; jobs, boolean show); but not allowed. You can declare it by the way: Update on Public Zero (AsyncTask & lt;?,?,? & Gt; Function, Boolean Show) {} Then you can use it by expanding a AsyncTask : Private Class SomeTask AsyncTask and lt; String, integer, long & gt; {@Override protected long doInBackground (string ... parameter) {// TODO auto generated method stub returns empty; }} and calling your method: onUpdate (new s...

windows - CreateFile path error in Visual C++ -

के लिए (int i = 0; i & lt; 1000; i ++) {sprintf_s (पाठ, "पाठ से प्रक्रिया % D \ r \ n ", GetCurrentProcessId ()); हैंडल hFile = CreateFile (_T ("\\\\। \\ डिवाइस \\ HarddiskVolume2 \\ dev \\ test \\ test.txt"), GENERIC_WRITE, FILE_SHARE_READ, 0, OPEN_ALWAYS, 0, 0); यदि (hFile == INVALID_HANDLE_VALUE) {DWORD error = GetLastError (); Cout & lt; & lt; "फाइल खोलने में त्रुटि" & lt; & lt; GetLastError () & lt; & lt; "सूचकांक में" & lt; & lt; मैं & lt; & lt; endl; टूटना; } SetFilePointer (एचफ़ाइल, GetFileSize (एचफ़ाइल, NULL), NULL, FILE_BEGIN); DWORD बाइट्स; लिफ़ाफ़ाइल (एचफ़ाइल, पाठ, स्ट्रेलन (पाठ), और बाइट्स, नल); CloseHandle (hFile); } मैं वास्तविक डिवाइस नाम \ Device \ HarddiskVolume2 का उपयोग करके लिखने को खोलने की कोशिश कर रहा हूँ c: \ फ़ोल्डर पहले से मौजूद है c ड्राइव में मैं त्रुटि फ़ाइल खो रहा है त्रुटि कोड 3 है कारण आप देख रहे हैं क्योंकि \\। \ Device \ HarddiskVolume2 कच्चे डिवाइस का प...

c# - update app.config file programatically with ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); -

Update the app .config file with the program Configuration Configuration = Configuration Manager. Openexe configuration (configuration subsystem level none); This is my XML & lt; Configuration & gt; & Lt; ConfigSections & gt; & Lt; Section name = "nhibernate settings" type = "ProjectBase.Data.OpenSessionInViewSection, ProjectBase.Data" /> & Lt; / ConfigSections & gt; & Lt; AppSettings & gt; & Lt; Add key = "NHibernateConfigPath" value = "D: \ PROJEKTI \ crawler \ WebCrawlerSuite \ ViaMura.Web \ NHibernate.config" /> & Lt ;! - & lt; Add key = "NHibernateConfigPath" value = "C: \ _ZAGON \ ViaMura \ CurrencyApp \ at \ NHibernate.config" /> - & gt; & Lt; Add Key = "Client SettingsToppedRepair Service" Value "" = "" /> & Lt; / AppSettings & gt; & Lt; ConnectionStrings & gt; & Lt; Add name = "connec...

objective c - Change iOS7 Status Bar Colour programmatically, mid-run? -

Image
Let's try to change the position bar color mid-run, i.e. when an administrator loads. I change the background color of the scene, so I have to change it from black to white and vice versa. I know that I can change it by using preferredStatusBarStyle . And setting in plist, but as far as I can see it will only set the view controller to launch Can I do this? Go to your application and add it as new line in Plist ; Color & amp; Add a toggle method @ Property (nonomatic) BOOL black; - (zero) toggle StatuSBar: (ID) sender {if (black) {[UIApplication shared application] setStatusBarStyle: Animated UIStatusBarStyleLightContent: Yes]; Black = no; } And {[UIApplication shared applicant] Setstats Bars Style: Uititas Bars Style Default Animated: Yes]; Black = yes; }} Here is a sample screenshot When the menu is closed, the color is white When the menu is open Color is black Hope that helps.

How can I use a SQL nextval function in a Django insert - Custom Model Field? -

I am trying to write a model field when the call is placed when inserting a model, then nextval (" My_seq ") is something like the queries of the query DNS that arises: app_table (A, B) values INSERT ("Some", next ("my_seq")); So far I have come up with a field that I override get_db_prep_value and returns it to nextval string when the object Is being inserted, but it gets quoted How do I get around the quoted value? I have this area for: class MyField (models.Field): def __init __ (self, * Argus, ** kwargs): self.obj = Any Super (MyField, Self) .__ init__ (* args, ** kwargs def contribution _to_class (self, cls, name): Super (MyField, Self) Contribution_sto- Class (CLS, name) setter (CLS, self name, self) DEF __get __ (self, oBJ, TP = none): If OBJE is none: Entitlement Entry (can only be accessed by 'example) self .obj = obj return obj .__ dic T __ [self.name] def __set __ (self, obj, value): obj .__ dict __ [self.value] = self...

php - How to setup Facebook sdk with CodeIgniter to do a Facebook fan Page Tab? -

I am trying the following: If defined ('basepace') ) Exit ('no direct script entry is allowed'); Class invention enhances CI_Controller {function __construct () {parent :: __ construct (); $ This- & gt; Load-> Library ('facebook', $ this-> config- & gt; item ('fb_config')); } Public Function Index () {$ user_id = $ this- & gt; Facebook-> GetUser (); $ Data ['user_id'] = $ user_id; If ($ user_id) {// We have a User ID, then probably a logged user // If not, we will get an exception, which we handle below I {$ User_profile = $ this-> Facebook- & gt; Try the API ('/ m', 'GET'); Echo "name:" $ user_profile ['name']; } Hold (FacebookApiException $ e) {// If the user is logged out, you may have a // user ID, although the login token is invalid // In this case, we will get an exception, therefore we just // Ask to log in again. $ Login_url = $ this- & gt; Facebook- & gt; Milgli...

ios7 - CGContextSetStrokeColorWithColor fails with iOS 7 -

I use this function to attract a custom UILabel. This iOS 6 works and before but fails with iOS 7 I replace CGContextSetStrokeColorWithColor with CGContextSetFillColorWithColor, not with iOS7 but 6 and his first job. void ShadowedStrokedText (CGContextRef ctx, NSString * text, CGPoint textStartPont, UIColor * textcolor, UIFont * Font, CGFloat linewidth, UIColor * shadowColor, CGFloat shadowThickness) {CGContextSaveGState (ctx); CGContextSetInterpolationQuality (ctx, kCGInterpolationHigh); CGContextSetLineJoin (CTX, KCGLineJoinRound); CGContextSetLineWidth (CTX, Linewid); CGContextSetStrokeColorWithColor (ctx, textColor.CGColor); // --- It works with IOS7 / CGContextSetFillColorWithColor (ctx, textColor.CGColor); CGContextSetTextDrawingMode (ctx, kCGTextStroke); CGContextSetShadowWithColor (Sitiaks, Sijisijhmek (0,0), Shadow Taitisen, [Shadow Rngrng CGColor]); [Text drawAtPoint: textStartPont with font: font]; CGContextRestoreGState (ctx) ;?} Why drawAtPoint: withFont: ...

css - Needed - Javascript button to utilise Ctrl + and - keyboard shortcuts in web browsers -

I am trying to create a button on the web page to increase the page size, font size image size. To make this more accessible it is a special requirement of the website www.applefieldsschool.co.uk Please note that this work is in progress. So far I have been able to come up with it; - & lt; Button onclick = "body.style.zoom = '300%'" & gt; Zoom 300% & lt; / Button & gt; This works, but praises the page provided on the page and is not responsible. My page is responsible for the various viewport size of HTML5 and CSS3. If I use the keyboard shortcut Ctrl + and Ctrl - this is exactly what I need. I now have to program a button to use the keyboard shortcut. Unfortunately this is getting slightly ahead of my javascript skills (which I have, in the last week, has started playing together) Thanks in advance. Your browser must have ' CTRL + + Key 'is not possible to use. Specifically: body {conversion: scale (1.1); Change-...

sql server - Unable to run MVC web application locally -

I have been asked to make changes to an existing MVC website, unfortunately the site is not the original developer long in the company By the time, there is no document and no one really knows about it much, besides this it is currently our test & amp; Live environment However, when I set the project as a project and run it, I get the following beautiful white error page: Access is denied. Description: An error occurred while using the resources needed to fulfill this request. The server can not be configured to access the requested URL. Error Message 401.2.: Unauthorized: Logon failed due to server configuration. Verify that you have permission to view this directory or page based on the credentials and authentication methods on the web server given to you. Contact the web server administrator for additional help. There is no heavy amount to go for (at least for me) so I have to go to the web. Checked in the config file and authorization is set as: ...

ios - How to create CGAffineTransform from CGAffineTransformMake? -

I went through the apple document for CGAffineTransform . But I was not able to understand that the values ​​for the CGAffineTransformMake method for CGAffineTransform are required. CGAffineTransform requires six values ​​to be passed. They are A, B, C, D, Tx and T. Can someone tell me about the parameters? CGAffineTransformMake Rotation / Scale / Translation methods that provide a lot of cleaners and clear interfaces for standard tasks that you want to complete. You can also chain changes with CGAffineTransform Rotate / Scale / Translate so that you can create the same complex conversion (or add for the previous conversion) .

javascript - if statement not working properly in jquery -

मेरे पास दो सरणियाँ हैं: arr और myArraycode । दोनों एक डेटाबेस से प्राप्त कुछ मान है। myArraycode के मान प्रत्येक पंक्ति में चुनें में प्रदर्शित होते हैं अब मुझे उन सभी पंक्तियों को अक्षम करना होगा जिनके पास arr सरणी में दिखाई नहीं दे रहा है। उदाहरण के लिए, arr = ["abc "" सीडीई "]; myArraycode = [ "नमूना", "एबीसी", "सीडीई"]; मेरे पास तीन तालिका पंक्तियां हैं जिनमें नमूना एक पंक्ति में, एबीसी में और cde में एक तिहाई। अब मुझे नमूना के साथ पंक्ति को अक्षम करना है क्योंकि नमूना सरणी arr में नहीं है। मैंने कोशिश की है निम्नलिखित कोड: var kt = 0; Var केटी = 0; Var sk = 0; Var sv = 0; जबकि (kt & lt; myArraycode.length) {यदि ($। InArray (myArraycode [kt], arr) === -1) {$ ("# table tr")। ('टीडी') खोज। : शामिल ( "+ myArraycode [kt]") "।।।) निकटतम ( 'tr') लगता है ( 'इनपुट [प्रकार = पाठ]') attr (" अक्षम "," अक्षम ") ;; $ ("# टीटी")...

internet explorer - html5 tag does not work in safari and IE -

I have a webcam video running on my site which is not working on Safari and IE. I have used the code & lt; Video src = "http://video.webmfiles.org/elephants-dream.webm" control autoplay loop preload = "auto" poster = "http: //my-site.com/images/home-banner.png" class = "Only-default" width = "613" height = "354" & gt; & Lt; Source type = 'video / webm; Codecs = "vp8, vorbis" 'src = "http://video.webmfiles.org/elephants-dream.webm" & gt; & Lt; / Video & gt; WebM is not supported in IE and Safari More info Here

python - Basic RegEx pattern throws non desired results -

I have input like this ( list mylist name): Ankatrodos 2 Inmubls Pagha 1 D1 Ancordado 1 Inmubls pay ¡live 1 D1 Ankatrodos 0 Inmubls Ankatrrados 1.931 Inmubls pay ¡live 1D 12 9 Ankonadros 12 Inmubls Página 1 de 1 I want to extract the first occurrence of each line to be two digit number 0-99. The desired output: [ '2', '1', '0', '12'] I do not want the fourth line matches because more than two points (in Spanish decimal point is a comma, and the thousands separator dot) My approach is pattern (\ d {1,2}) , With mask = re.compile ('\ d +') , then I take the first group with the [[mask.search (item)). Items in my list for the group (0)] But the output I am getting: ['2', '1', ' 0 ',' 1 ',' 12 '] I believe that this happens because the first incident in Encodrados 1.931 embubbles. Página 1 de 12 9 is the string '1' that follows the word 'pygin' but I can fix th...

c# 4.0 - throw new applicationexception c# but in debug mode do not highlight it -

Image
Hi, It is possible that the new application should be thrown to the application C #, but do not highlight it in the window in debug mode specifically for application option for VS 2012. No need to show error window I tried it but I could not find the solution. You can feature your method with the [debuggerStepThrough] attribute. [DebuggerStepThrough] Public Static Zero ThrowError (...) Alternatively, you can try: In Visual Studio, " Debug "menu and choose" Exceptions ". In the following dialog you can choose what exceptions should be prevented by Visual Studio Please note that this is a global setting for the project. This will not stop at any ApplicationException , not only that which was put in ThrowError .

dataframe - R: Help using dummyVars and adding back into data.frame -

I have a data of 373127 objects. Frame is some variables of the 193 variable that I want to use the dummyvers () to separate each factor into my column. I then turn different dummy variable columns into my original data. Frame, so I thought I could apply the whole thing, but some is not working and I do not know what it is. Sample: dat_final & lt; - Applicable (dummies.var1, 1, function (x) {dummies.var1 Thanks ! The real answer is ... .. do not do this it's almost not necessary.

visual studio 2012 - Latest Resharper giving me random build errors -

Image
For a week now, I'm getting random build errors that do not understand at all. First of all, I released another build until there was no error. error MSB3249: application configuration file "now" App.config "is invalid file 'XXX \ app.config' not found. The strange thing about this one is that XXX does not have any app.config (this is a native C ++ dll) in the asociated project. Also, XXX optional projects. Error MSB3027: Could not copy "YYY.dll" to "bin \ x86 \ Debug \ YYY.dll" The number of re-withdrawal of 10 is exceeded. : \ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ Microsoft.Common.Targets (3540,5): Error MSB3021: Unable to copy the file "YYYdll" with "bin \ x86 \ Debug \ YYY.dll" This process can not use the 'YYY.dll' file because it is being used by another process . They always come in pairs, looking at the process with Explorer, that the other process is always MSBuild.exe o...

c++ - Virtual Function During Construction Workaround -

I have found a base class that has a virtual function; I want to call that class as it is because I want to The function for each of the derived classes is called. I know that I can not call a virtual function during the creation, but I can not think of an elegant solution (i.e., avoid repetitive code) solution. What are some things around to do a virtual function call during construction? The reason for this is that I want to avoid it because I do not want to make consultants who just call the base class. Class A {Public: A () {read (); } // read it at anytime Virtual Zero () = 0; } Class B: A {Public: B (): A () {}; Read () {/ * Do something special for B *}} Category C: A {Public: C (): A () {}; To read () {/ * something special to C PSY: Python way to do this: raiseImplementedError raise in one :: read () . I'm returning to C ++ and I thought it was worse than that. This is the factory method approach, putting the factory in the base class: class A {pub...

c# - Get a unique number -

For the school, I need to create a project in C # which will ask 20 questions randomly. I is a text file containing answers questions. With some code we put questions in an array. Now we can make a number from 0 to 19 (20 questions). But every question must be seen only 1 time and 1 time. We can not do random first and in the next order. Each question should be random. My code (in Dutch): Public Inc. Random VraagMaker () {int num; Random Random = New Random (); Num = randNum.Next (0, 19); For (int i = 0; i You can create a list of all your questions, and then randomly You can ask questions from: // Use a list & lt; String & gt; Question or list & lt; Int & gt; Index T Remove Questionental Question & lt; T & gt; (List & lt; T & gt; question, random random) {// TODO: add verification (i.e .:: question is not empty, has at least 1 element, etc.) int index = random.Next (questions.Count); T question = question [index]; Questions.Remov...

class - Python: method with variable name for setting value of an object -

Values ​​and ways to set them should be a simple class: class Object: Def __init __ (self, id): self .__ id = id self__ value 1 = none at all self___ value2 = none ... etc def set_value1 (self, value1): self .__ value1 = value1 def Set_value2 (self, value2): self __value2 = value2 ... etc Can I merge them some way .set_valueX (valueX) - works to be one, it How is it done and easily imported without libraries? This can be done using setter: class Obj (object): def __setter (self, ** kwargs): key, value = kwargs.items () [0] setattr (self, "__" + key, value) def __init __ (self, id): self. Id = id self .__ value1 = none .__ value2 = none # You should assign the setter to the set function as follows: self.set_value1 = self .__setter self.set_value2 = self .__setter #and On this ... init method can be reduced, we use the same technique

file io - How to write data on USB stick safely - Linux (ARM) - C++ -

I am trying to copy some folders and files to a USB stick and after all is cured , To remove the USB stick. Implementation is something like this: Make the related folder structure by using mkdir fsync on each USB stick, each file On each file descriptor, copy fsync After copying the file Every directory descriptor Just after copying the last file, I remove the USB stick (~ 500 MS-1s). But sometimes the entire folder structure disappears. To avoid that file, I used fsync again on every directory descriptor after copying the previous file. At this time all the files and folders are present on the USB stick but sometimes I have a garbage in the folder structure or the USB stick gets corrupted. USB stick file system vfat is about how to properly save data. Even thoughts? Unmount it before deleting device. For non-journaled file systems such as VFAT, there is no guarantee that the file system will be in a consistent position on the disk, while it is mou...