Posts

Showing posts from September, 2014

Android ADB command to get the application specific log in command prompt of windows -

Hi I want to receive application special log in the command prompt of windows I tried it < / P> adb -d logcat com.mycompanyname.demoapp: I *: S but did not work for me, too much log printing was going on It was hard to find my app specific logs. I want to print my app specific log command prompt. logs logs (you call log class methods in your app Using the string as the string used when doing so), not the package name of the app.

node.js - remove objects from array elastic search -

I need to remove an object that satisfies the condition, I am able to update the base's object ( "Tweet_id": "1", "a": "b"}, {"tweet_id"), which is as follows: PUT twitter / twit / 1 {"list" "123", "a": "f"}}} Post / Twitter / twit / 1 / _update {"script": "foreach (item: ctx._source.list) {if item ['tweet_id'] = it is working > I am doing this posted / twitter / tw ("Item": "foreach" (item: ctx._source.list) {if item ['tweet_id'] == tweet_id) {ctx._source.list.remove (item);}} "," Params ": {tweet_id": "123"}} but it is not working and giving this error, ElasticsearchIllegalArgumentException [script Failed to execute]; Nested: concurrent reformation exceptions; Error: ElasticsearchIllegalArgumentException [iled for executing FA script]; Nested: ConcurrentModificationException I delet

python - Parasite axis appearing at two positions and overlapping -

Using this example as a guide: I tried to create a plan with several axes which was using twinning instead of twinx. However, in both one- par2 top of the axes and the position appears in both par1 overlapping on top What am I doing wrong? plt host = host_subplot (111, axes_class = AA.Axes) as a.A. pl..subplots_adjust Import matplotlib.pyplot as mpl_toolkits.axes_grid1 import host_subplot import Parl = Hostktwiny (from mpl_toolkits.axisartist (down = 0.2)) par2 = host.twiny () new_fixed_axis = par2.get_grid_helper (). New_fixed_axis par2.axis ["bottom"] = new_fixed_axis (loc = "bottom", axis = par2, = offset (0, -40)) par2.axis ["bottom"]. Toggle (all = true) host.set_xlim (0, 2) host.set_ylim (0, 2) host.set_ylabel ( "distance") host.set_xlabel ( "density") par1.set_xlabel ( "Temperature") par2.set_xlabel ( "Velocity") p1, = host.plot ([0, 1, 2], [0, 1, 2], label = "density") p2, = Par1.plot ([0, 3,

string - Wrong answer in c++ -

You have been given a DNA sequence, and some enzymes, a DNA sequence is like this: ATGCTGCTATGCATGCAGTGACT , and you are given an enzyme that can remove the AT and GC sequences. In this way, you must first remove all the events of AT from DNA and then improve DNA and apply the next enzyme to remove all GC incidents. The problem will be the issue string, which you get to improve the fragments extracted by the previous enzyme. Input The first line input contains an integer N, which represents the number of enzymes. DNA sequence in the first line is the input B1, B2, B3 ... BN in the next T lines. Output The sequence for given input DNA, the last improved DNA in which single bar B1, B2, B3 ... BN . From the removal of all incidents, a single line is produced. If DNA is completely eaten then print 0 indicates there is no DNA balance. Obligations 1 & lt; = N & lt; Example: 1: Input: 2 ATACGCATGACGATGCATGCAGCAT ATA GC Output: CATGACGATATAAT

javascript - JqueryUI resize & draggable does not work together? -

I have a problem using jqueryui resize and draggable same elements should work together? In this version, I can resize the image, but I can not drag it. The idea is to be able to pull the image in the large Divi, but it does not change the big internal Divel it should be the end result would be a worthy how to pull a signal to change the size in the same element Is here in it here HTML & lt ?. Div id = "container" & gt; & Lt; Div id = "region" & gt; & Lt; div class = "testi" & gt; & Lt; img class = "imageHere" width = "200" src = "https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibQpLmEpS580SE5rzQG3aCU_X7c524Y4yOvwmFQt4swgUDruH4e-2ZXrPaT6oEgs6ovQsTBqK3ZWY5LhO-kAWryNPDQPkLx4J7_f1OGIgZJ3R9soT-OeKvqq7v16PLSnY6lJ6RzX3VFCo/ /google-logo-874x288.png" / & gt ; & Lt; / Div & gt; & Lt; / Div & gt; css #area {status: absolute; Top: 67px; Left: 75px; Border: Sol

c# - How to enable wcf tracing prgrammatically? -

I have a WCF service (project output type-window application) that is hosted as a Windows service. All client and server logic is in the C # code and I do not have any configuration files. I need to enable wcf tracing without using the config file. How can I do this? You can configure the program that you file your .config If you initialize your service, just add this code (customize it according to your logging requirements): var listener = new XmlWriterTraceListener ("Log.xml"); Debug.Listeners.Add (listener); Note that you can set all properties (log level, for example), as you would with the attributes in your .config file Do: debug Etoflu = true; Listner. TraceOutputation = Traceaptis. call stack; You can also add your custom filter: listener.filter = new MyCustomTraceFilter ();

Spring MVC Controller method that won't affect session timeout -

I have a Spring MVC Rest method which, from time to time, said in my application to vote for notifications in the background goes. I would like this pattern to not affect the session method so that users are automatically logged out, if they leave the browser window without any contact. Is it possible to annotate a Spring MVC controller method that this session will not affect timeout? AFAIK, the session timeout is managed at the container level, above any spring controllers and any java The EE move does not know that some requests should not reset the timeout of the session. The only thing I can imagine is to report the timeout in the front-end application: if no user interaction for the scheduled time-end, a disconnection request for front-end automatically Sends.

asp.net mvc 4 - Passing data from a controller to a view (MVC) -

I'm having a small problem where I can not send the data to the view. I have the controller ViewBag.InvalidParts = invalid; I have this view & lt; H2 & gt; @ html.DisplayText ("InvalidParts") & lt; / H2 & gt; I get this error on my web page: System. Selection. Generic List 1 [System.String] When I step through my code I see that 20 records are stored in my visual bag, my problem is that I can not see them. Am I making the wrong call? Thanks in advance for help In your foreach, you need to use defined variables. In this situation, I do not think you need Assistant to try changing your code @foreach (ViewBag.InvalidParts in varB invalid) {& lt; Text & gt; & Lt; H2 & gt; @ Invalid & lt; / H2 & gt; & Lt; / Text & gt; }

Grails Scaffold hide table column -

Image
मैं GORM दृश्य से password कॉलम कैसे छिपा सकता हूं: मेरा डोमेन वर्ग: class secUser {static scaffold = true क्षणिक स्प्रिंग सिक्युरिटी एसवाजी स्ट्रिंग यूज़रनेम स्ट्रिंग पासवर्ड बूलियन सक्षम = सच बूलियन अकाउंटअपेक्षित बूलियन अकाउंट लॉक बुउलियन पासवर्डअनुक्रमण किया गया था स्थिर ट्रांसफ़िक्स = ['स्प्रिंग सिक्योरिटी' सेवा]] स्थिर बाधाएं = {उपयोगकर्ता नाम खाली है: गलत, अद्वितीय: सच्चा पासवर्ड (प्रदर्शन: गलत, रिक्त: गलत)} स्थिर मैपिंग = { पासवर्ड कॉलम: '`पासवर्ड`'} सेट करें & lt; SecRole & gt; GetAuthorities () {SecUserSecRole.findAllBySecUser (यह)। सेट {} के रूप में {it.secRole} def} def beforeInsert () {encrycodePassword ()} def beforeUpdate () (यदि (isDirty ('password')) {encodePassword ()}} संरक्षित शून्य सांकेतिक शब्दों का पासवर्ड () {password = springSecurityService.encodePassword (पासवर्ड) // पासवर्ड = पासवर्ड}} डिस्प्ले: झूठी बाधा का उपयोग डिफ़ॉल्ट स्कैफोल्ड किए गए दृश्य से संपत्ति को छिपाने के लिए किया जाता है। इस परियोजना में यह दर

oracle - What are different ways to create new connection using SQL developer? -

I SQL Developer for a few months ago to check the queries locally installed. Is it necessary to install oracle server 10g / 11g to create a new connection? I am currently using virtual box and Oracle_DB_Developer_VM_new.ova to create a new connection. When I run a virtual box, the system slows down, there is a way to connect to other servers like mysql db saver or tomake saver ever. E. . Note: Server is running locally for testing purpose. You can install it to be a full database installer with your Developer de Virtualbox VM Depends much more than it does. And yes, you can connect to MySQL - assuming that you have a MySQL JDBC Jars and a real MySQL database to play with.

java - Array index out of bounds - converting 2d to 1d -

I'm not really sure why I'm getting an array index out of bounds exception. For my understanding, my double array is of 3 sizes, so the index goes from 0 - 2. I have the qualification method, I try to calculate the number of inversions within my double array, where an inverse The pair of blocks I and j is l & lt; Jammu, but after Jammu, when the row-main sequence is considered on the board, I try to do this by converting my 2D array into 1d array so that I cross through the 1d array to count all the inversions. Can do If the inversion is also (inside the weird numbered board of size), then 8 puzzle boards are able to solve. For loops, only my length of the array is counted, so I'm not completely sure how I am getting an array index outside the exception of the barriers thanks in advance! Every answer prevents me from making the same mistakes in the future and prevents me. int n = 3; Fixed int [] [] copy; // Build a board with an N-by-N array of blocks / (where

hadoop - ERROR for load files in HBase at Azure with ImportTsv -

In Microsoft Azure Cloud, using a recommended approach to connect through remote desktop and connecting via remote desktop Trying to load the HBS running in H.2site in the HBS T1 table by trying to load the t1.tsv file (with different columns from two tabs) from the HDF command line: C: \ apps \ dist \ hbase- 0.98.0.2.1.5.0-2057-hide2 \ bin & gt; hbase org.apache .hadoop.hbase.mapreduce.importTsv -Dimporttsv.column = HBASE_ROW_KEY, num t1 t1.tsv and get: Error: one or more columns in addition to the row key and timestamp (optional) Required use: importtsv -Dimporttsv.column = a, b, c To move the location of the specified column, HBASE_ROW_KEY C: \ apps \ dist \ hbase-0.98.0.2.1.5.0- 2057-hadoop2 \ bin & gt; hbase org.apache.hadoop.hbase.mapreduce.importTsv -Dimporttsv.columns = num, HBASE_ROW_KEY t1 t1.tsv I'm getting: Error: HBASE_ROW_KEY should specify exactly one column as used: importtsv -Dimporttsv.columns = a , B, C It tells me that comma separator in the co

How can you assign multiple css stylesheets to various sections of html content? -

We are looking to refer to many CSS stylesheets within a single page. The header will have a nav bar with a set of stylesheets, while the rest of the page will need to assign a different stylesheet. We do not have permission to change any of the stylesheets. Snippet of the code below: & lt; Head & gt; & Lt; Meta charset = "UTF-8" & gt; & Lt; Meta http-equiv = "X-UA-Compatible" content = "IE = Edge" & gt; & Lt; Meta name = "viewport" content = "width = device-width, initial-scale = 1" & gt; & Lt; Title & gt; Title & lt; / Title & gt; & Lt ;! - Latest compiled and minified CSS - & gt; & Lt; Link rel = "stylesheet" type = "text / css" href = "stylesheet1" & gt; & Lt; Link rel = "stylesheet" type = "text / css" href = "stylesheet2" & gt; & Lt; Link rel = "stylesheet" type = "text / css

Data concatenation in SPSS -

I have two data columns in SPSS hhid = 1 2 3 carid = 26 27 28 I want to create a new column which connects both Hahid and Karjid and gives me output newid = 1_26 2_27 3_28 I'm new to SPSS, I appreciate your help. The following code assumes that your IDs are variable numerals otherwise the COMPUTE command Delete the STRING function from * Generates a string variable of 17 characters. Adjust the length as you wish STRING Nude (A17) COMPUTE Newid = CONCAT (LTRIM (STRING (Hahid, F8)), "_", LTRIM (STRING (Carid, F8)). Executed. Explanation: STRING (var, format) function converts the numeric value of "var" to the string of the given format. The code above the format has an 8 digit number without any decimal. The output of these functions is an 8-character string, which is the main spacing. To delete the main spaces, this function is wrapped in the LTRIM (string) function.

ios8 - allowRotation in SceneKit? -

How can I reject the rotation of a node in SceneKit? For the East, I want a model (cone) to move, jump and fly, but always vertically oriented? I tried to fix it in apple's vehicle demo, this is a bad solution. Besides, I tried the code below, but the model slowly and glitchy fell down < Code> I »¿- (Zero) Renderer: (id & amp; lt; SCNSceneRenderer & gt;) was done by a renderer Amit Phishing: (NSTimeInterval) time {_node.rotation = SCNVector4Make (0, 0, 0, 0); //[_node.physicsBody Reset Transform]; // - have also tried to do this) ... and finally I have not given any "permission = brightness = no" in the scenario manual. in the spritekit instead of the flag, the sneaker lets you choose which direction the body is allowed to rotate And how much View property Is this probably a better idea than toggle matter between different values ​​??? This approach seems to be unexpected behavior, so you do not want to trust it.

applet - Understanding this keyword in Java -

When events are registered in the init () method of applet, we add the method AddTypeListener (this) . But I know that the keyword this refers to the object which is called the method. Therefore, when we have not created an object in the applet class, then this < / Code> What happens? Please clarify your doubts. cause this when you work in heaven 't Clearly has made an example of your applet because JRE treats applets differently. The applet is a special class that is loading Java for you immediately. From there, the object is owned by JRE and is interfacing in this way. Once Java creates an example of your applet, then the caller calls it to call init () (since a prototype) manufacturer. Similarly, when your applet is done or the page gets unloaded, then Java worries about closing your applet.

asp.net mvc - Can I add a custom attribute to a controller method without writing a filter? -

I would like to add attributes to my controller methods, which can be inspected by reflection. I can see how it can write a filter, and I will write an empty filter, if it is the only way to get me, but I really want to be a reflection-visible The feature that can be used to generate documentation. Example: [Operator Friend Description ("Start a new message from a letter template and set the initial property.")] Create public actions (string editor name, int mastki, ...) (Alternatively, is there any other approach or documentation feature that will allow me to set the operator's favorable name for personal controller methods and retrieve it with reflection?) / P> There is no magic method that you can use without defining the operator preferred description But if it does not require filter functionality, then do not get it from FilterAttribute . If you declare MVC FilterAttribute , you will see that this is just a special System.Attribute . Pu

Login Form using sql database c# -

I am trying to create a sign up page. You enter the username and password and save it in the SQL database. Note: As long as I add another column (password), the matter works. This is a password code (username is the same): static public zero deletion (string _Password) {try {connection.Open ()} SqlCeCommand commandInstert = New SqlCeCommand ("Include [table] values ​​(@ password)", connection); Command insert Parameter. Add ("password", password); CommandInsert.ExecuteNonQuery (); } Hold (SqlCeException Expaction) {message box. Show (Excl. ToString ()); } Finally {connection.Close (); }} and this button settings are: Private Zero Button 1_Click (Object Sender, EventArgs e) {if (deleteBox.Text! = " } {SQLFunctions.Insert (insertBox.Text); SQLFunctions.delete (deleteBox.Text); SQLFunctions.Refresh (this.dataGridView1); } Other {message box. Show ("login failed"); }} Thanks I think you need to make some changes to your code lik

php - Ajax connection from Intex XDK failing -

I have a problem connecting to a php page using Ajax from my phone. I've made the transaction as simple as possible. The server side code is: & lt ;? Php echo (json_encode ('success')); ? & Gt; Customer side code is: $ Ajax ({'url': "http://www.skynet.ie/~lobo/ test.php", 'success': function (result) {warning (result);}, 'error': function (XMLHttpRequest, TextStatus, errorThrown) {warning (JSON.stringify (XMLHttpRequest));}}); I get a successful response when testing with the Intel XDK emulator. When I launch the app from my phone (IOS): readyState: 0, response text: "", position: 0, status text: "error" From the error function I have tried to add header ('Content-Type: Application / Jason; Charset = UTF-8'); Header ("Access-Control-Permission-Origin: *"); To make no profit on the php page. I've set $$. Support.cors = true; At the local level I have tried to use $ .

ajax - .NET WebMethod with xhrHttpRequest File Upload -

I am trying to upload an asynchronous file using JavaScript with WebMethod in VB.NET Javascript: xhr.open ('post', "upload.aspx / upload", is true); Xhr.setRequestHeader ("content-type", "app / x-www-form-urxed"); Var formadata = new form data (); // files (for files in var i) {formData.append (base.el.name, files [i]); } Xhr.send (formData); VB.NET: & web.Services.WebMethod (enabled session = true) & gt; _ Public Share Function Upload () "Hello World as String Return!" If I use content-type = application / x-www-form-urlencoded , or multipart / form-data , then the last function If I use content-type = application / json , then webmath can not hit, webmother is hit, but the response message is 500: Invalid JSON Primitive: ---- - WebCard frame ... Is there a way that AJAX webmath can work with multipart form data? Net content type will not allow multipart / form-data : Security has an inherent

r - Naming and adding columns to a dataframe -

I am working to add different text files to a data frame, so far I have files = list.files () data = lapply (files, function (x) read.table (x)) data_rbind & lt; - do.call ("rbind", data) I would like to add column headings, I have tried colnames (data_rbind) = c ( 'Car', 'color', 'price') However, this error message returns error colnames & lt; - The name 'attribute [3] should have the same length of the vector [1] - ( * tmp * , value = ("car", "color", "price")) I want to add the values ​​associated with the name of each file to add 4th column called 'year', is it possible? Edit - I have realized that the above error is because my dataframe reads only as 1 variable when it should be 3. 3 columns all begin to be contained within 1 column. I'm not sure why this happened I want to separate the data into 3 separate columns and to read the structure function data.frame

HOW do I load a Javascript call in a Joomla module BACKEND? -

I am developing a simple module for Joomla 2.5. Everything is almost complete, but I have a series of form fields in the module parameter backend, on which I click on a specific checkbox when I want to hide ... I have a function, it is just a document There is a loop with GetElementblablablabla .style.display = 'none', but how can I load JS and attach the function to the checkbox? A quick solution! You can include your script as a normal script in your module XML files. For this method, you can & lt; Description & gt; You can use the description tag of & Lt ;! [CDATA [& lt; Script type = "text / javascript" & gt; // Your Javascript Code (s) & lt; / Script & gt; ]] & Gt; & Lt; / Description & gt; This method works well for the Joomla version but it does not have any professional method if you prefer more standardly then you have to use the ultimate or Hope it helps ..

android - Moving multiple buttons? -

Can someone help me? I have this problem. I want to move the button. Do I have any kind of problem? the expansion of the main activity activity of the public class (button [] B = null; intent [] intention = null; translation animation [] trans; typefaces font; see image view, laziniasti; animation drawback, Organizer; Int i = 0, f = 2000; @ Override Protected Zero; Create (Bundle Saved Instantstate) {Super.Nocrat (Saved Instantstate); setContentView (R.layout.activity_main); Class [] Naslovic = Class, second, category, third. C, Fourth, Class, Fifth class}; Font = Typeface.createFromAsset (getAssets (), "FatmakerTTF"); B = New Button [] {(Find Button) VViBiID (RID.button1), (Button) Find VVBiID (RID.button2), find (find) VVBiID (R.B.ton3), find (find) VBiID (R. Id.button4), (button) Find VibiBID (R.B. button 5), }; Intention = new intention [b.line]; for (i = 0; i <5; i ++) {intent [i] = new intent (main activity, this, naslovi [i]); b [I] .setTag (i); b [i] .setOnC

php - How do I convert parts of the string to uppercase? -

I have a string that I want to convert to uppercase besides the word 'and' which would always be surrounded by underscores is. / P> then it becomes me_and_you ME_and_YOU does not always contain 'and' in the string, so it can be you me_you ME_YOU Obviously strtoupper () makes the whole thing uppercase Do I have to use something like preg_split () or explosion ()? You could probably write a regex to do this, but there would be an easy solution solution: echo str_replace ('_ AND_', '_and_', strtoupper ($ your_string));

popen2("unix") not working in octave -

I'm trying to get octa to perform a 2-way sub-process to communicate with white While data processing received from the shell normal popen is not good for me because it is waiting for the sub-process to return it before being able to process the data. So I tried all kinds of methods, and Anne Popen2 ( "Sort") read Octave example to use , but this did not help me to get popen2 ( "unix"). I get the error: Error: popen2: popen2 (child): Unable to start the process - no such file or directory * I get this error for other popen2 commands like popen2 ("help") . Maybe I'm missing something error message error: popen2: popen2 (child): Unable to start the process - there is no such file or directory * tries to tell you that no command or program is "Unix" Which OS are you using and why are you expecting that the "Unix" command is available? BTW, have you taken a look at the system? If you really want to comm

javascript - How To Retain Cursor Position When Updating A Knockout js Observable In An Extender -

The goal is that the user input is converted into upper case as they type. I am using the following extender: ko.extenders.uppercase = function (target, option) {target.subscribe (function (newview) {target (newValue.toUpperCase ()); }); Return target; }; This extension can be added to the sequences associated with the HTML text box: self.userField = ko.observable (product.userField || "") .extend ({uppercase: true}); This works great text can be seen in the upper case. As the user writes text in an empty area or adds to the end of the existing text, the text is converted to upper case. So far, great! Now when the user wants to insert the text, the cursor is placed at the insertion point with either the cursor key or the mouse and the new text is entered, the letter is inserted as the upper case But the cursor's position now jumps at the end of the text because the built-in pattern is updated. Update 1: I have created a custom binding I can use the

What is the correct way to include headers between two files in C -

I think this is a very dumb question, but I have to face a small problem in my program Assuming: Assume that I have file1.c and file2.c I am declaring in file1.c and file2.ca struct in file2.c. I am using the function inside the file1.c file. C So what have I done that I wrote in file1.h and #include "file2.h" in file1.h File1 .h ... but while compiling, I have an infinite loop. How can I fix this? Thank you You will see file1.h and file2.h . Something like this #ifndef FILE1_H_ #define FILE1_H_ / * ... * code * / #endif / * FILE1_H_ * /

android - Taking pictures without requiring an SD card -

The Android documentation shows you how to capture an image and avoid external storage, but I want my app to work Do not, even if the user does not have an SD card. I just need to temporarily save the file until I upload it. So I create a file and pass the URI with the intent of the camera app: file imgfile = new file (getFilesDir (), imageFileName ); Imgfile.setReadable (true, incorrect); Imgfile.createNewFile (); Intent capture intent = new intent (mediastore.action_IMUNCUCTE); CaptureIntent.putExtra (MediaStore.EXTRA_OUTPUT, Uri.fromFile (imgFile)); StartActivityForResult (capture intent, IMAGE_PICKER_TAKE); But when I take a picture and hit just fine, the camera app does not return to my app. I'm guessing this because I have passed this file because it's in the directory given by getFilesDir (), which I think is not considered accessible by other apps, is not able to access it. I tried to set the set readable (), but did not fix it. Is there any other director

jquery - Change ftp css style -

I am programming a PC management website but I want to change the style of FTP: // it is included in IFrame But when I want to change something with jQuery, I get a cross-domain error: SecurityError: accessing the cross-root frame blocked a frame with the original "http: // 192.168.0.114:8010" Got FTP is included with ftp: // 192.168.0.114:21 ' I hope the style It is possible to change because it does not fit with the rest of the site. I am using Windows 7's IIS7 FTP client. Unfortunately, due to security restrictions, this is not possible possible. If the FTP folder is in the publicly accessible folder (facing the internet), you might want to edit a page to display content and to fit that page with your website. Note that this does not just HTML use PHP!

excel - How do I add a custom search filter to my method? -

I am writing a macro that involves taking .csv files from folders. The macro asks the user to enter the folder path and when it is entered, it will take all the .csv files in the folder and sheet them in the workbook. I want the macro to ask the user what extension they want in the workbook. For example, some files have names like Chan_41-103.csv, Chan_41-109.csv, and Chan_44-103.csv. So if there is a way to ask the user what they want and they can enter "* -103.csv" and the files in the macro file name with -103.csv. I know that I can do the straightforward code "* -103.csv" and it will do this, but there are so many files with different names and I want to give this macro to a group of files Will have to run for. If it can ask the user, then it would be great. There is already code at: sub CSV_Sheets () 'from this one The csv file takes the specific folder and it's string cell (2, 2). In the form of a string dimension in the form of slow I a

How can I associate two values in Javascript or Jquery? -

It seems that this should be easy to do but I can not find any practical solutions to the original idea code associated with the URL With an array and depending on whether the URL is parsed as a referral, a code is inserted in the local storage. var site = {â ???? Example1.com : "X10", an example? Example 2.com: "X11", an example? Example 3.com: "X12"} if (document.referrer.indexOf (site value)! = -1) {if (localStorage) {localStorage.setItem ("code", sitekey); }} So if the reference is example1.com, the code set locally will be "x10" and so on. I have probably read about using Underscore.JS_Invert method, but I think I should have a more clear solution. Lesson "> It is slightly incompatible, because it finds matches after processing, but this is a very simple code: Object.keys (site). ForEach (function ( Key) {if (document.referrer.indexOf (gtk)> gt; -1} {if (localStorage) {localStorage.setItem ("code"

android - updating listview after inserting row via content provider -

I am using custom ContentProvider to enter and query SQLite database in Android. When I query from the database, I am populating the data on the listview but this problem occurs when I include that row which I also want to update the list view. Custom Adapter is created by increasing Cursor Adapter and LoaderManager.Loader Callbacks , now when I Context.getContentResolver (). Insert () function, I want to update listview I have tried adapter.notifyDataSetChanged (); After adding the row, but the listview is not updating. There is only one option I have seen RestartLoader () Any other watt to update the list view? This is my insert code context.getContentResolver (). Insert (ContentUris.withAppendedId (URI.) Expected word (column CONTENT_URI, Columns.INSERT_LOGS), column .LOGS), value); I am including the log of the application and showing in the list view here is the code inside the content provider If (rowId> 0) {Ury DartURI = Content uris With expec

How does snmpd process SNMP requests? -

I am new to the SNMP protocol. I would like to know how the SNMPP implementation of SNMP requests, for example: snmpget -v1 -c public localhost sysName I understand that this is implementing MIB, e.g. SNMPv2-MIB, but execution of uname -n ? See net-SNPP SNPP mapping for CISNAIIID OID for that it sometimes < / Strong> is actually based on uname , see the code snippet below: # Ifdef HAVE_GETHOSTNAME gethostname (sysName, sizeof (sysName)); #else #ifdef HAVE_UNAME strlcpy (sysName, utsName.nodename, sizeof (sysName)); #ElS #if Defined (HAVE_EXECV) & amp; Amp; ! Defined (mingw32) sprintf (extmp.command, "% s -n", UNAMEPROG); / * * Setup error * / extmp.type = EXECPROC; Extmp.next = NULL; Exec_command (& amp; extmp); strlcpy (sysName, extmp.output, sizeof (sysName)); If (stren (sysName)> gt1 = 1) sysName [strlen (sysName) - 1] = 0; / * chomp new line * / #else strcpy (sysName, "unknown"); #endif / * HAVE_EXECV * / #endif/ * HAVE_UN

knockout.js - Set backgroung color of input in case of an error -

There is a problem with pushing and validating me when there is an error, I would like to paint my input The problem is that when I use the knockout.validation library with github, there is an error: {"error": "Please use post request"} < / Code> View: ko.validation.configure ({insertMessages: false, decorating element: true, error ElementClass: 'error'}); And when I use it from the CDN, there is no error, but the color does not work. Look: Thank you. < P> Your second example with the CDN in the CSS field is & lt; Style & gt; tag. As the value of your form is bound to model.toValidate (), you can modify the self.validate1 function as the following: self.validate1 = function () {self. toValidate (self.toValidate () || ''); }; Do this:

matlab - calculation gives me NaN -

I am trying to implement multilateral logistics regression using the gradient lineage, but my cost job is NaN Does the value of the weight tell me what I am doing? Calculates the cost for the gradient lineage, assumes there is a% extra feature in inputX, continuous and weights a class X. Function [cost] = costFunctionMultiNominal (inputX, resultY, weight)% UNTITLED8 Features matrix [rows, columns] = size (inputX); NumOfClasses = Size (weight, 1); Yoga = 0; I = for 1: rows class level academic = 0; For Jammu = 1: numOfClasses if resultY (i) == j denominatorSum = 0; For L = 1: numOfClasses denominatorSum = Denominator + XP ((InputX (I, :) * Weight (L, :) ') - 4444); End ** Class Level End = Class Level End + Log (XP (IPX (I, :) * Weight (Jay, :) '- 4444) / DinominatorSam); ** End End End = Equation + Class Level Easy; Cost of the end = equation / (- lines); Weight update function is: function [weight] = getWeightsUsingGradientDescentMultiNominal (training X, resultin

css - Getting "Invald property value" on animation -

The following code results are in "invalid asset value" on the animation properties and I'm not sure why. Edit, Full Code . Spinner {animation: cyclic 1.4 s linear infinite; } @ Keyframe rotator {0% {transform: rotate (0deg); } 100% {conversion: rotate (270 degrees); }}. Path {stroke-dashayar: 187; Stroke-Doss Offset: 0; Change-origin: center; Animation: Dash 1.4S Easily embedded, Color 5.2 S-In-Out Infinite; } @keyframe color {0% {stroke: # 4285F4; } 25% {stroke: # D3E35; } 50% {stroke: # F7C223; } 75% {stroke: # 1 B9A59; } 100% {stroke: # 4285F4; }} @ Keyframe dash {0% {stroke-dashoffset: 187; } 50% {stroke-dashoffset: 46.75; Convince (135deg); } 100% {stroke-dashoffset: 187; Convert: Rotate (450deg); }} I'm trying to apply the spinner taken from this example: If you are on Chrome / Safari, then you have to add webkit-animation to .spinner : -webkit-Animation: Cyclical 1.4S Infinite Linear; and you will have to do this for .path : -webki

html - @Font-Face rendering in Chrome 40 -

I am running with some of the most weird font rendering with Google Chrome 40, and hoping that someone else's To cope with and how he knows how to fix Everything was working fine till two days ago, so I was wondering if there is just one bug with the new chrome, but I can not find other cases of this. All of this is happening with three font-faces that I use on my site, one of which is Google web fonts, the other two are locally embedded. I tested Chrome 38 (Mac) Canary - Bad Chrome 40 (Win) Canary - Incompatible Safari 7.1 - OK Safari 8.0 - OK Firefox 32.0 1 - OK Firefox 33.0 Beta - OK Firefox Aurora 34.0 A2 - OK Firefox Night 35.0 A1 - OK IE 11 - OK IE 10 - OK I have the following attachments in my CSS In body element: body {margin: 0; Padding: 0; Height: 100%; Font: {Family: $ font-body; Size: 1.4rem; } Color: $ half-night blue; Background color: $ white; Line-height: $ alt-baseline; -webkit-font-smoothing: antialiage; -Moz-OSX-font-smoothing: grayscale; Tex

sprite kit - Scene size in Xcode 6 / SpriteKit / Swift -

I should be really simple stuff in Xcode, I'm trying to add a ghost in this case. And to sit in the bottom left corner: var groundTestxture: SKTexture = SKTtexture (imageNamed: "dirt-block") var Ground: SKSpriteNode = SKSpriteNode (texture: a mixture of ground) ground .position = CGPointMake (ground.size.width / 2, Ground size.height / 2) self.addChild (ground) It does not show anything, so what I saw is the scenario dimension And self. The frame size.width and the self.frame.size.height are the width of 1024 and the height of 768 are returned, regardless of orientation. I want to decide it in landscape mode if it makes a difference in answering? Obviously I remember a very basic idea to set up this scene, if anybody can put light, then it will be very much appreciated. p> Thank you. You have to edit GameViewController: viewDidLoad Exclude and everything from super.viewDidLoad () overwrite viewWillLayoutSubviews override func viewWill

java yahtzee game check for full house -

I am making Java game and I was just wondering if the following code would generate false positives in any case < Death is an array in which there are pseudo-random (Math. random ()) numbers for each die and I sorted them using a bubble sort: if it is randomly dead where {1, 2,1,2,1} before they were examined by the following code {1,1,1,2,2} The Rules will be made inside a method that returns the boolean value. int count = 0; If [die [0] == die [1] and dies [1] == die [2] = die [0] == die [1] and die [2]! = Die [1]) {count ++; } If (die [3] == die [4]) {count ++; } If (calculation> 1) {back true; } return false; If you want to see the correctness of your code, then I recommend the unit test I am (with Junich). Try to investigate as many cases as possible, using parameterized tests can help:

java - error while running main function without libgdx -

I am using libGdx for a while now. I have created a new project without using libGdx and trying to make some code some code if it is the intention of my work, however, I am getting the error that the main class is not found in the libgdx package. How do I switch between libgdx and just native IDE For example ... package com.example.example. Public class examples {public static zero main (string [] args) {System.out.println ("hey"); }} When I try to run this code I Exception in the formula "main" java.lang.NoClassDefFoundError: com / badlogic / GDX / Jnigen / BuildTarget is due to the targetOs com.badlogic.gdx.physics.box2d.utils.Box2DBuild.main (Box2DBuild.java:13): java.lang.ClassNotFoundException: com.badlogic.gdx.jnigen.BuildTarget at $ TargetOs java.net.URLClassLoader $ at java.net.URLClassLoader.findClassJava.security.AccessController.doPrivileged (Native Method) (unknown source) on java.net.URLClassLoader $ 1.run (unknown source) 1.Run (Unknown

javascript - jQuery Mobile form submission with signature image -

I'm using jQuery signer pad here, with source and demo: now All this shows the image of your signature when you click, now with the image on the page, how can I submit my form. I am sending my form to a PDF converter named MPDF using a modified version: To get an image on PDF, I want to get it from the picture on the page Now what to do, as you click on submitting it, there is no information in dragging that image. > I am not the most lover in PHP because any help I am learning will be greatly appreciated. Update Code provided by Thanasus Grammotopolos function fun_submit () {If (isSign) {var canvas = $ ("# canvas") Get (0); Var imgData = canvas.toDataURL (); // To change the code here, do not display the image, it was sent to Server $ .AJX ({type: "POST", url: "script.php", data: {imgBase64: imgData}}. O) {Warning ('Sub-limit'.);}); ClosePopUp (); } And {warnings ('please sign in'); } } PHP: & lt ;? Php de

rust - Task 'rustc' has overflowed its stack -

Chat server that fails to compile: use std :: io: : {TcpListener, TCPstream}; Use std :: io :: {acceptor, listener}; ANIM Streamorisis {SRM (TCPSTream), SLC (UIT, [U8,. 1024]) FN Main () {Hedge = TCPLSToner :: Bind ("127.0.0.1", 5555); // Listened to the specified address; mut accept = listener.listen (); Let's (tx, rx) = channel (); Spawn (proc () (Repeat Streams: VACAT; TCPstream> = VAC :: New (); Loop {RXD: Stream Orssistia = Rx. RCV (); Match RXD {SRM (stream) => streams.push section)}} SLC (lane, buff) => for stream in stream.iter_mut ()) {let_ = stream.write (buf.slice (0, len))}}}}} ); // Acceptable and process them; Increase a new task for each incoming (stream) for acceptance {match stream {error (e) = & gt; {/ * Connection failed * /} OK (Mute stream) = & gt; {// connection tx.send succeeded (SRD (stream.clone ())); Let tx2 = tx.clone (); Spawn (proc () {mut buf: [u8, ..1024] = [0, ..1024]; loop {let lan = stream. Reed (buff); tx2.send (l

compare - comparing two decimal numbers in bash -

I need to compare two numbers in a bash script. I get an integer error, are there any other methods available ? The format for our construction is YYYY.M or YYYY.MM. Therefore, I need to compare this 2014.7 (October 2014) is older than 2014.7 (July 2014). #! / Bin / bash NEWVER = "2014.10"; # 2014.10 Crover = $ (Head-N1 / Release); # 2014.7 If [$ NEWVER & gt; $ CURVER]; Then the echo "This version is new"; The complexity is that July is formatted as 2014.7 Consequently, floating point arithmetic will not work, instead of 2014.07 . A solution is to separate the information of the year and month and compare it separately: NEWVER = "2014.10" crossover = 2014.7 IFS =. Head 1 Small 1 & lt; & Lt; & Lt; "$ NEWVER" IFS = Major 2 Short 2 < & Lt; & Lt; Read "$ CURVER" [[$ major1 -gt $ major2 || ($ Major 1-au $ major 2 and $ 1-1-GT $ small 2)]] & amp; Amp; Alternatively, we can fix the format of

c - C89 - error: expected ')' before '*' token -

I'm getting this error inside C error: expected ')' First '*' token but it can not be traced. zero print_structure (struct_alias * s) // error within this line {...} // end of print method My question then received Where is the error where this error can return error? Is there a problem with this function, can it be an error with what is being passed? What is the scope of the error? The compiler does not recognize the name as struct_alias . For that code to be compiled, struct_alias should be declared as typedef , and that declaration is visible to the compiler When he sees the definition of print_struct (Typedef names are tough. In effect, they are temporarily user-defined keywords, which is why their errors can cause such a misleading error message.) It is not specific for the C89; It applies equally to the C90 (which is the same language as C8 9), CAMT, and C11.

mysql 5.5 - How should I properly store and retrieve IPs? -

मेरे पास एक कॉलम उपयोगकर्ता है > उपयोगकर्ता प्रकार VARCHAR (15) से। मैं इसे में एक अवधि सम्मिलित कर सकता हूँ: INJECT IN 'एलजे`। यूज़र (`उपयोगकर्ता') VALUES ('।') अब मैं इस अवधि की खोज करना चाहता हूं: SELECT * से 'उपयोगकर्ता' जहां 'उपयोगकर्ता' की तरह '।' या SELECT * से 'उपयोगकर्ता' जहां 'उपयोगकर्ता' = '।' दोनों ही मामलों में, मौजूदा प्रविष्टि नहीं मिली है: MySQL ने एक खाली परिणाम सेट (अर्थात शून्य पंक्तियाँ) लौटाया। (क्वेरी को 0.0001 सेकंड लिया गया) अल्पविराम के साथ एक ही समस्या। असल में, मेरा इरादा आईपी पते को 125.50.75.80 जैसे स्टोर करना है, लेकिन मैंने उबला हुआ एक विराम चिह्न के लिए खोज करने में असमर्थता नीचे समस्या मैंने कोशिश की '\।' भी कोई लाभ नहीं। और यह literals के साथ एक समस्या है; समय के साथ स्ट्रिंग युक्त वेरिएबल्स के साथ क्या करना है? अद्यतन: मैंने टेबल के साथ कमांड लाइन में बनाए गए डेटाबेस में परीक्षण किया है: बनाओ टेबल एलजे। यूज़र (उपयोगकर्ता VARCHAR (

terminal - Dart string interpolation through console run script -

I am using Dart to generate controller classes in the project structure using the script created in the tool directory. . The script is run using the following terminal commands (in the project directory of the course): Dart Tools / Controller_kart Dart Controller Name This script runs Using the string 'projection' to inject the following script and name in the required fields by taking the 'Controller name' parameter before using the console to use it as the value for the 'name' variable. Is: import 'dart: io'; Zero main (string name) {string content = "" part of controllers; Class $ extends name controller {// ------------------------- -------------- ------------------------------------ -------------- - // functions // ----------------------------- -------------- ------------------------------------ ------------ / * * * Meets the criteria and launches Superclass constructor / $ name (): Super (new virtual directory (root_package_

Using session variables on php embedded in Wordpress -

I have spent many hours searching without success, please help me with the following: I have my new WordPress Wp exec plugin is installed install I can use regular php and mysql queries within the WordPress post; Now I have to use the WordPress user session variable to send mysql queries from php scripts in wordpress post. I mean ....... (like "Select from the table, where id_user = '". $ _ Session [' id '].' '); Thanks a lot Diego Jimenez User ID Use this standard function to obtain and the rest should work: $ user_ID = get_current_user_id (); View

ruby - Display an icon before text in a QTreeView -

Image
I am using QTB with QT 4.8.6 and am trying to create a tree view where each item There is a custom icon between tree control and name. The end result should be: I get the allotted space for the icon where I should go, but I do not see any icon, what do I have to do to show them? Here my code (Slightly simplified to remove no-data-side-case cases): class MyModel & lt; Qt :: AbstractItemModel # ... def data (index, role) role of the case when qt :: displayroll case index.column when 0; Qt :: Virion.nu (index.internalPointer.displayName) when the 1; Qt :: Variant.new (index.internalPointer.displayType) when Qt :: DecorationRole if index.column == 0 Then # test to show a constant icon for all items Qt :: Pixmap.new (': / resources / Images / Objects-Scene-General Page '') End And End And Mitivyve.model = Mimodel.New If you want to inspect the Qt Designer .ui File (if the tree view should have a property set I do not have). Let me verify that the im

html - Is it OK to use inside ? -

Is it okay to use the "div" tag inside the "code" tag? I am using Netbeans 8.0.1 to write some HTML pages. And at some point I was using "div" inside "code". You can see a part of your code Netbense gives me the following error Elements The element "div" in this context is not allowed as a child of the "code". / Strong> The result is what I want but the error bothers me, is it a problem anyway? Is there a way to get the same results without error? Code from jsfiddle: & lt; div class = "codeDiv" & gt; & Lt; Pre & gt; & Lt; code class = "black" & gt; State & lt; Sub & gt; 0 & lt; / Sub> & Lt; Div class = "back-red codebox margin" & gt; If (XPRT 1 gt;) & lt; div class = "back-green codebox margin" & gt; If (XPropRT; LT; sub-gt; 2 & lt; / sub & gt;) {stat & lt; Sub & gt; 1 & lt; / Sub> State &a

camera - Save 12-bit image (0-4095) to png file using openCV -

I know that openCV treats 12-bit image as u16, but aligns most bits on the left. So if I just want to write raw data (with 12-bit below the windows-GC 660m), then my image looks completely black, I think the windows do not know that the dynamic range of my image 0-40 9 5 I then use the Labview image package to verify the correct data, and then save it to PNG. This time Windows 7 can display my image with the correct category. What do I remember when using OpenCV? Sorry if I did not clarify the question before. After doing a little research, I got the answer. Therefore, to see the PNG file properly, the data (12-bit) is shifted to the left of the full bit depth (16-bit), then fill with the empty (right 4-bit) most important bit. For example: 3144 = 0b 0000 1100 0100 1000 50316 = 0b 1100 0100 1000 1100 All three programs (Matlab, Labview, and OpenCV) used to write the left-replication image, but only use LabWave sbit (critical bits) By default part of the PNG forma

hadoop - Why my map reduce job is running sequentially? -

I have 4 node clusters and the total is 96 GB memory. I have my input in 100 files Have split up and set the job for 100mps. Logs seem to be that the mappers are running successively. [2014/10/08 15:22:36] Information: total input path for process: 100 [2014/10/08 15:22:36] Information: Number of divisions: 100 [2014/10/08 15:22:36] Information: Action to start: try_local1244628585_0001_m_000000_0 [2014/10/08 15:22:36] Info: Token for Job: job_local1244628585_0001 [2014/10/08 15 : 22: 36] information: split processing: hdfs: //.../input/in10: 0 + 2 [2014/10/08 15:22:38] info: work: effort_lok 1244628585_0001_m_000000_0 is complete. And is in the process of committing [2014/10/08 15:22:38] Information: Work Effort_Location 1244628585_0001_m_000000_0 is now allowed to commit [2014/10/08 15:22:38] Info: Work 'try_local1244628585_0001_m_000000_0' Saved output Hdfs: //.../output/_temporary/0/task_local1244628585_0001_m_000000 [2014/10/08 15:22:38] Info: hdfs: //.../input/in10:

csv - Cannot Merge Node error: Neo4j -

I have 2 csv files that I want to convert to a Neo4j database. They look like this: first file name, enzyme Aminomonas paucivorans, M1.Apa12260I Aminomonas paucivorans, M2.Apa12260I Bacillus cellulosilyticus, M1.BceNI Bacillus cellulosilyticus, M2.BceNI second file name, origin Quote paucivorans Aminomonas, GGAGNNNNNGGC Aminomonas paucivorans, GGAGNNNNNGGC Bacillus cellulosilyticus, CCCNNNNNCTC you can see the common factor creatures and name. There will be some enzymes in each organism and each enzyme will have 1 shape. The shape can be similar between the enzymes using periodic loads Loads of CSV COMMIT: I used the following statement to create my database (as the csvLine match o "File: /Users/Desktop.n_e.csv: C: creatures {name: csvLine.name}), (e: Enzyme {name: csvLine.enzyme}) o Create () - [: has_enzyme] - & gt; (e) load CSV COMMIT with periodic "file header: C: / users /Desktop/n_m.csv" aS csvLine MATCH (O: Orginjm {name: csvLine.name}), (M: shape

How to efficiently bring in all raster files into R? -

I'm bringing 10+ raster files (one-band files, not too large) in the executive directory. Call different files, but it is getting tough I have seen that people use such code: is required (raster) current.list & lt ; - list.files (path = "wi: / local / rasterdata / current", pattern = ".tif", full.names = TRUE) c.stack & lt; - stack (current.list) However, this is adding different errors for me, " .rasterObjectFromFile (x, band = band, objecttype =" RasterLayer " ,): Can not create RasterLayer object from this file. (File does not exist) " Note, I have tried many different formats (.grd, .img) and often command You need (RGDL) even before you run. Thanks in advance for your thoughts! I have not tested it, but I think that if you change your pattern = ".tif" Add a "$" sign at the end of the section, i.e.: current.list & lt; - list.files (path = "wi: / spatial / rasterdata / current"

ruby - Array of strings to float values can correctly sort negative numbers but same values using sprintf, kernel.format, etc. sort incorrectly -

Why can string.to_float sort a array of values ​​correctly, but those same values ​​are sorted incorrectly When '% .3f'% I am currently working on a challenge that provides you a text file. The rows filled with numbers (example) are: 1.123 -3.010 3.999 -2.199 -1.212 2.190 4.121 0.000 My goal is to sort these numbers And print them to console them properly Try it for the first time, divide these lines into their respective string numbers, then change them to Floating Point Value with .to_f Give, and lastly, sort them and give them one Date back to us (space delimited). It looked something like this: line.chomp.split ("") .map {| e E.to_f} .sort! .join ("") By the time I did not realize that any number in the exact three decimal places like 68.060 has ended, then the last zero will be lost. And thus, instead of 68.060, shows as 68.060 which invalidates the solution. I went around and found a lot of references: kernel.format ('% .