Posts

Showing posts from June, 2013

string - Getting back the correct values when using classes in Python -

Then I am coming into programming and Python in my study, and in a Python the word scanner object Takes a string and returns a list of tuples that reads in the format (TYPE, WORD), where TYPE is the word type, and word is the word itself, by searching the word for the word in a group of words of that type Determining the type of wordIf there is a word, or a number, then Tupal gives more words like this; If the word is not there, then the tuple gives an "error" and the word, for example, if the input is "Answer for my 3 days", then the list will return such as read something: < Code> [('error', 'mine'), ('(' number ',' 3 '), (' error '), (' error ', gone), (' number ',' answer ') 'Error', 'for'),, 'day')] or something like that. However, when I try to input the code and run it from the main project to get the work done, in the command line, the only value I pu

git gc - git: repack locally, push the repacked objects -

Do I have no way to work again on a local machine, then resulted in packaged databases in my remote repository Press? must use the nearest , re-pack and store All repos in a file I've described it in "". you can do it. The added advantage is that a file transfer is easy. Once copied to the remote server, you can clone or obtain it from that bundle file.

appcrash - Visual Studio Express 2013 for Desktop crashes immediately when started -

Visual Studio Express 2013 for the desktop crashes when it starts immediately Can anyone help with the problem? Signature of the problem: Name of the problem: APPCRASH Application Name: WDExpress.exe Application Version: 12.0.30110.0 Application Timestamp: 52cfa049 Fault Module Name: clr.dll Fault Module Version: 4.0.3031 9.34011 Mistake Module Timestamp: 52 9 68A 96 Exception Code: c0000005 Exception Offset: 0002122c OS Version: 6.3.9600.2.0.0.256.48 Locale ID: 1033 Additional Information 1: 782B Additional Information 2: 782B157F2D9102177560167373 db3dc9 Additional Information 3: 46A5 Additional information 4: 46 I think I have found the problem Framework version 4.5.1 is the problem I have VS Installed the Express Edition and then removed Framework 4.5, which are fixing the problem.

c# - LINQ to Entities does not recognize the method 'Int32 Parse(System.String)' method, and this method cannot be translated into a store expression -

I am using unit framework, and I have a code that is taking a var and it is an i database . var record = reference. Nomination SingleLow Default (Row = & gt; Row.UUSID == Int. Purs (userid) and row.classId == int. Purse (class ID)); Every time I try to run it, I get a rhis error "LINQ to Entities" does not recognize the 'intern 32 pars (system string.)' Method, and this method Can not translate into a store's expression. " I have also tried well var records = reference. FirstOver Default (line = & gt; line.user id == convert.OINIT32 (userid) & amp; quote; class id == convert.OINIT32 (class idid)); And what I found is this error message, "LINQ method does not recognize the INFO TOInt32 (System.String) method 'for the unit, and this method stores in the expression Can not translate And in the end I also tried it, which I know is unusual, but it has worked in the past for similar situations. var record = context.enroll

c# - newline for Arabic or urdu string -

string = ""; s + = "© § u usually ?? © ?? o ?? ± اعظ٠?? u ?? _PN_OF Ø¬Ø ± and ?????????a?a?a?a?§ §?? ?? © Ø§Ø | u ????????a?a=? ØμØا٠?? Mîvan ?? u ????? ± Ù¾Ø ± ات § ???????a??a=? Oracle = "\ n \ r" + "or ?? ?? Or ?? You ± u ?? © Ø ¢ ?? غا٠?? BBC Urdu's "XrLabel1.Text = s; Concerned but your show production like © § U generally ?? Û ?? o ??? ± اعظ٠?? u ?? _PN_OF Ø¬Ø ± and ?? u ?? Ù ?? Ù ?? Û ?? Ù ?? Û ?? Ù ?? دs Ø ?? ا٠?? Û? Ú? ØØØØ | Û ?? Û ?? Û ?? Ú? Û ?? ØμØاÙ? Ø ?? Mîvan ?? u ??????? ± ± Ù¾Ø ± ات§§ ?? ???? ØÙ ?? Ù ?? Û ??: Geoinci Û ?? esei ?? Ø³Û ?? Ø§Ø ± د٠?? and © Ø ¢ ?? غا٠?? Ù¹Ù ?? Ø | Ù¹Ø ± U © Ø§Ø Ù ?? Ù¹Û ??: BBC Urdu I want to talk something like (my code Similarly) © § u generally ?? Ú © Û ?? o ????? ± Ø§Ø Ø¸Ù ?? u ?? _PN_OF Ø¬Ø ± and ?? u ?? Ù ?? Ù ?? Û ?? Ù ?? Û ?? Ù ?? Ø¯Û ?? ا٠?? Û ?? ØØØØ | Û ?? Û ?? Û ?? Ú Û Û? Ø Ø ± Ø § Ù? Ø ?? Mîvan ?? u ?????? ± Ù¾Ø ± ات §? ?? ?? ?? ?? ØÙ ?

Java: Writing to a log file from a server -

I am trying to create a small chat room log file yet it is for logging for me: Fixed zero log (strings) {try {buffed author authors = new buffed waist (new filename ("log" + getting "+". "text")); writer.write (s); } Hold (IOException e) {e.printStackTrace (); }} Every time I broadcast to the cloud, I call it in a thread like this: log (name + " String ") But after that it is called and does not release the program. However, when it used to work, only one thing in the text file is a row, which was previously called. How can these two worms cure? As stated in the other answer, you do not close the file and you do not write a line separator Are there. I know that there is a right answer in Java 7, but you said in the comment that you can not use it. (I think you are using Java 6 instead) Because of this, I have just written an implementation using Java 6 API (using Java 6 javadocs for reference): Public class logfileHelp

javascript - Copy to clipboard with jQuery/js in Chrome -

I know that these questions have been asked here many times, including: or, I reduce the scope Condition: Google Chrome works fine (if cross-browser, but not necessary if necessary) No flash Is there such a solution or solution? You can either Document.execCommand ('copy') or AddEventListener ('copy') , or combination of both. Copy selection to 1 custom event If you compare ctrl-c to another event document.execCommand ('copy') . This will copy what is currently selected, for example on mouseup: elem.onmouseup = function () {document.execCommand ('copy'); } Edit: document.execCommand ('copy' ) is only supported by Chrome 42 , IE9 and Opera 29 , but will be supported by Firefox 41 (scheduled for September 2015). Note that IE generally requires permission to use the clipboard. 2 Copy the custom content on the user triggered trigger or you addEventListener ('copy ') , this copy will interf

xml - Complex xPath query with getNodeSet in R -

I have an XML file downloaded from the uniprot protein database. Protein & lt; - XmlRoot (xmlTreeParse ("http://www.uniprot.org/uniprot/Q01974.xml")) From the many annotated features, I am interested in starting and ending the following Keynes domain stored in the xml node: & lt; Feature type = "domain" description = "protein keyrings" & gt; & Lt; Location & gt; & Lt; Starting position = "288" /> & Lt; End position = "539" /> & Lt; / Location & gt; & Lt; / Feature & gt; With GetNodeSet, I can find out this tag well: getNodeSet (Protein, "// uniprot: feature [@type = \" domain \ "and @ description = \" Unfortunately, I could not reduce the query, except for any other criteria. Example: GetNodeSet (Protein, "// Uniprot: Feature [@ type = \" domain \ "and @ description = \" protein keynes \ "] / location" , C (Uniprote =

java - Incompatible Type - Please help - BlueJ BouncingBall Demo -

I do not understand why I get an incompatible type within the embedded loop within the given loop. When I compile the bounceball = ball.gate (i), I am receiving an inconsistent type error; Anyone have any idea what I am doing wrong? import java.awt.Color; Import java.util.ArrayList; Import java.util.Random; Public Square BallDemo {Private Canvas myCanvas; Private Arrestist Ball; Private bouncingball bounceball; Private random random generator; Public ballmo () {myCanvas = new canvas ("ball demo", 600,500); } Public Zero Bounce () {int ground = 400; Ball = new arrivate (); RandomGenerator = new random (); MyCanvas.setVisible (true); MyCanvas.erase (); MyCanvas.drawLine (50, ground, 550, ground); Bouncingball ball 1 = new bouncingball (position (), position (), 16, color. BLUE, ground, MAC canvas); Ball1.draw (); Bouncingball ball 2 = new bouncingball (position (), position (), 20, color. RED, ground, MAC canvas); Ball2.draw (); Bouncingball ball 3 = new bouncingball (po

Lisp Package Name Prepending Itself to my data without me telling it to -

This is my first time working with packages in lisp. I have general summaries that they can be used as data and code How do it work similar to other languages, I do not have to worry about the differences yet. However, I'm running into a problem where I set something in my code: (setf baseNames' (coffee wax blue pepper sink green soya blanched garden )) It will come out later: (print base-names) (PIZZabel :: COFFEEE PIZZABAGEL :: WAX PIZZABAGEL :: BLUE PIZZABAGEL :: CHILI PIZZABAGEL :: STINK PIZZABAGEL :: GREEN PIZZABAGEL :: SOY PIZZABAGEL :: BLACKEYED PIZZABAGEL :: Garden) Pizza Bagel is the name of my package Is this normal behavior? Suppose I want to do something like this: (position 'wax base-name) I expected that it would return 1, but the package I am prepaid myself by name, it gives zero, I want to know how i can not make it everywhere, or b) What is normal practice for working with this? I am currently writing the work of my position which

javascript - Adding prefix in all controllers & services in sails -

New to Hi Node & amp; Sail and at the same time, there are some criteria in my code. Sales is currently in JS, for example API / Controller / Test Controller JS Services / Test Services JS: Most of the time, I only use the URL format as seen: http: // localhost / test / http: // localhost / test / & Lt; Action & gt; If I add some prefix to my filename, then it will be like this: API / Controller / Prefect controller JS Services / Protest Services JS The URL must be accessed correctly: http: // localhost / prtest / http: // localhost / prtest / & lt; Action & gt; Question: 1) If I add prefix for all my controllers & amp; Service file name, can this URL access: http: // localhost / test / http: // localhost / test / without adding the prefix? I was thinking of configing config / routes.js to get it by editing something like this: '/ test': {controller : 'Preet Controller', Action: '& lt; Action &

android - Phonegap WP7 app not perform any functionality -

I'm working on the Cordova hybrid mobile app that is currently in the Android app It's okay when I make the same app for the window phone now it does not do any functionality. To create WP8, I will then add all my files to the new generation Www in Visual Studio project in the www folder. But when I run the app it only shows its first page and does not perform any functionality. What steps did I take? On click the button I call the following function $ ('# contactBackupBtn') 'Click', function () {$ ('# P2'). Attached ("back up"); Sm_sync.backupAllTheContacts (function () {$ ('# p4'). The attachment ("after the contact backup function is finished");});}); > > this call from the bottom backupAllTheContacts: function (callback) {$ ('# P3'). Attachments ("Backup all the costenses"); Navigator.contacts.find (["*"], function (contact) {$ ('# p3'). Encl

python - Manipulating data from csv using pandas -

There is a question about the data of pandals, what I am looking for to bring two columns from the CSV file, and Manipulate data before saving in the end. The CSV file looks like this: Year Month 2007 1 2007 2 2007 3 2007 4 2008 1 2008 3 This My current code is: record = pd.read_csv (path) frame = pd.DataFrame (record) composite = datetime (frame ['year']. Unstable, frame [' Month ']. Unstable, 1) is an error: typeError: the series is "& lt; type' int '& gt; Any ideas? Daytime work on one Will not panda series (column of dataframe) you to_datetim E or you can use datetime within applicable . You should do something like the following: in [9]: DF out [9]: year months 2007 1 1 2007 2 2 2007 3 3 2007 4 4 2008 1 5 2008 3 in [10]: PDto_datetime (DF ['sal'] Ashstop (SR) + '-' + DF ['month']. Volatile (SR) + '-1') Out [10]: 0 2007-01- 01 1 2007-02-01 2 2007-03-01 3 2007-04-01 4 2008-01-01

c# - Get file to send as attachment from byte array -

I have an ASP.NET MVC application that has a list of recipients given a specific "project" I get this information from a report using SQL Server Reporting Services (SSRS). I have not used SSR before, but I got some code from a colleague where they used it. What he does with the report he downloads it to the client's machine in the browser, so if I do not do this, then I sit with a byte array with report data. Is there a way that I can send files as an attachment on file system without first writing them physically? The report will dry out in Excel format or PDF. Edit: I am using SmtpClient to send an email. To do this, you will need to take advantage of this type of SSRS ReportManager API. Read the report from the web service with the SSRs first Instead of saving the server or the client, read the file in memory MemoryStream object directly e Send -mail to server string strReportUser = "RSUserName"; String strReportUserPW = "

javascript - jquery droppable loses its original class -

I need to get element ID and class when something is dropped on it id works fine, but the orbit Not passed ... HTML & lt; Div id = "drag" class = "two" & gt; Drag & lt; / Div & gt; & Lt; Div id = "drop" square = "one" & gt; Drop & lt; / Div & gt; js $ (document) .ready (function () {$ ("# drag"). Draggable (); $ ("# drop "). Dropable ({drop: function () {warning (this.class +" "+ this.id)}}); "post-text" itemprop = "text"> As stated, when the draggable has been removed, then this square was retrieved, but 2 To use the data - * attribute that is started in HTML 5 $ (document) .ready (function () {$ ("# Drag "). Draggable ({revert: true}} $ (" # drop "). Droppable ({drop: }}}} {Alert ($ (this) .attr ('class') + "" + $ (this) .attr ('id'))}}}} < / html>

html - Flat ui nav bar not rendering properly -

Image
शामिल सीएसएस फाइलें: http://designmodo.github.io/Flat- UI / CSS / flat-ui.css http://designmodo.github.io/Flat-UI/css/demo.css http://designmodo.github.io/Flat-UI/bootstrap/css/bootstrap.css < / कोड> कोड: & lt; body & gt; & Lt; nav class = "navbar navbar-inverse" & gt; & Lt; div class = "navbar-header" & gt; & Lt; एक वर्ग = "नवबार-ब्रांड" href = "#" & gt; ब्राइट फ़ोलियो & lt; / a & gt; & Lt; / div & gt; & Lt; div वर्ग = "पतन नवबार-पतन" आईडी = "नवबार-पतन -01" & gt; & Lt; ul class = "nav navbar-nav" & gt; & Lt; li & gt; & lt; a href = "# संपर्क मॉडेल" डेटा-टॉगल = "मोडल" & gt; संपर्क & lt; / a & gt; & lt; / li & gt; & Lt; / ul & gt; & Lt; / div & gt; & Lt;! - /.navbar- -collapse- & gt; & Lt; / नव & gt; & Lt; / body & gt; मुझे नव बार के ऊपर और ऊपर

plsql - PL/SQL with Java to delete tables older than 3 days -

Questions for dropping 10 days old table for this follwing PL / SQL statement Using callable location cs = null; cs = conn.prepareCall (s); cs.execute (rplSql); But this invalid SQL statement looks at any idea? Try: Select table_name from ALL_TABLES where regexp_like (table_name for the statement in 'ABCD [[:: Points:]] {8}')

redirect - Unix piping and redirection -

Assume that you want to read the file as a password, password password.txt, replace each uppercase letter A lowercase letter and a "$$" for each "## Overwrite it). How do you do it with tr command? Indication: Use piping and file redirection. I tried these 2 commands, but they I did not believe that the file has been stripped by the system, so passwords.txt is empty. cat passwords.txt | Tr '[A-Z`!'] ' '[A-Z' # ']' tr â ???? [A-Z "!"] A ???? one ???? [az "#"] a ?? ?? & lt; passwords.txt & gt; Passwords.txt I know that we write it in a temporary file and "& amp; Amp; Amp; To change the temporary file name of passwords.txt, however, it is a homework problem and we have "& amp; amp; amp; amp; so far, so I believe that to do this, the other way to do this with piping and redirect only I think the file has been stripped by the system, so that passwords. After the txt becomes empty.

php - minecraft server query not echoing motd -

I downloaded the code from here: I echo the server's MOTD with this code Want to: & lt ;? Php include_once 'get.php'; // class $ position = new MinecraftServerStatus (); // call $ response = $ position-> Millstatus ('localhost'); // function $ statusTxt = Call "offline"; $ Version = "N / A"; $ Ping = "n / a"; $ Players = "0/0"; $ Host = "n / a"; $ Motd = "N / A"; $ Version = "N / A"; If ($ response) {$ statusTxt = "online"; $ Players = $ response ['player'] "/" $ response ['maxplayers']; $ Version = $ response ['version']; $ Ping = $ response ['ping']; $ Host = $ response ['hostname']; $ Motd = $ response ['motd']; $ Version = $ response ['version']; }? & Gt; & Lt; div id = "banner" & gt; & Lt; Div id = "status" & gt; & Lt ;? Php echo $ statsetext; ? & Gt; &am

HTMLPurifier syntax issue -

I am using HTMLPurifier with this configuration: case 'comment' : $ config = HTMLPurifier_Config :: createDefault (); Config- & gt; Set ('core. Encoding', 'utf-8'); $ Config- & gt; Set ('HTML.Allowed', 'iframe [src | width | height | frameborder | acceptable screen], p [style], p, br, hr, center, em, u, ul, li, font, ol, div [class] | Style], span [style], blockquote, strike, b, strong, img [src | alt | class | height | width], a [href | rel], object [width | height | data], absolute [name | Value], embed [source | type | permissions effect | width | height] '); $ Config- & gt; Set ('HTML.SafeIframe' is true); $ Config- & gt; Set ('URI.SafeIframeRegexp', '% ^ // (www.youtube.com/embed/playplayer.vimeo.com/video/)%'); $ Config- & gt; Set ('Cache.DefinitionImpl', null); // TODO: remove it later! break; When accepting a YouTube video, the acceptable screen attribute is stripped of why?

xml - Insert html in the middle of xslt -

मुझे परेशानियां मिल रही हैं मुझे XSLT मिला है: & lt; ul class = "services-menu" & gt; & Lt; xsl: apply- टेम्पलेट चुनें = "आइटम / आइटम [आइटम और नहीं (दस्तावेज़ (कॉकैट ('अपेज: //', आईआईडी, '.show_on_summary_page_only')) / यूडाटा / प्रॉपर्टी / मान)" मोड = " inner_left_col_menu "/ & gt; & Lt; / ul & gt; HTML: & lt; ul class = "services-menu" & gt; & Lt; li & gt; & lt; a href = "/ page1" & gt; पृष्ठ 1 & lt; / a & gt; & lt; / li & gt; & Lt; li & gt; & lt; a href = "/ page2" & gt; पृष्ठ 2 & lt; / a & gt; & lt; / li & gt; & Lt; li & gt; & lt; a href = "/ page3" & gt; पृष्ठ 3 & lt; / a & gt; & lt; / li & gt; & Lt; / ul & gt; मैं अपना html सम्मिलित करना चाहता हूं & lt; li & gt; & lt; a href = "/ page4" & gt; पृष्ठ 4 & lt; / a &am

java - Defining a spring active profile within a test use case -

Using Spring 4, I've got the following test setup: @RunWith (SpringJUnit4ClassRunner.class) @ Contact Configuration (classes = JPA config class) @ Active Profile (Resolver = Test Resolver class) Public square is the simplest {}> Public Class Test Resolver Enforce the ProfileProofile Reseller {@ Override Public Sting [] Resolution (class JpaConfig is annotated with the property resource @ property @ property source ("ClassPath: Property / App - $ {spring. Profiles.active:dev} .properties ") @EnableJpaRepositories (basePackages = {" com.my.namespace.repositories "}) public class JpaConfig { This address whenever I run SimpleTest Attempts to apply: Properties / Applications -dev.properties While I expect that property / application-test.properties to be. What I'm trying to accomplish here is based on the following posts: I believe that in fact, the problem you are facing and in it you have an explanation from Dave Sirr and a possible

cordova - Ripple emulator chrome plugin is taking long time to execute -

code> On running my HTML file, which I created for PhoneGap Build, Chrome is taking a good time to give a response. Everything is working, the only issue is delayed on the response. I tried on another desktop, and there it is quiet and fast. I restarted the extension again and again to start Chrome and OS again. Information, when using Chrome I had similar problems, make sure that when you close it Chrome is not running in the background since some versions of Chrome, it is enabled by default to check if this is the case, check your Taskbar. If Chrome is actually running in the background, right-click the Chrome icon in the taskbar and disable "Running in the background". This works for me and now Rappal Fire Superfast.

css - Using font as icon library -

I am trying to use the icon as the source of my webpack, this webpad is a form of UI technology I am developing in The problem is, when I try to use the icon of that font: & lt; span sclass = "entypoWhite" & gt; & Amp; # 128,100; & Lt; / Span & gt; I get the following error: '' (0xd83d) is not a valid XML character Am I doing something wrong? I am using JK Version 5 of PS. Actually this is a bug with Jade itself. They have their DOM verifier and this is wrong with and # 100000 This is the reason that and & amp; # 9666; work. I have the following error: On the line at line 227. I will post a bug report for:

datalog - Datomic aggregates usage -

I want to find people with the lowest age with the next query (d / q '[: search name (minutes? age): [[name] age]]] [["John" 20] ["Bill" 25] ["Jack" 20] ["Steve" 28] ["Andrew" 30] ]] But the result is [[Andrew] 30] ["Bill" 25] ["Jack" 20] ["John" 20] ["Steve" 28]] How to do this? This will be a pure list ([db [["John" [20] ["Bill" 25] ["Jack" 20] ["Steve" 28] ["Andrew" 30 ]]] (D / q '[: search?] * Mi-Edge: In $? Mi-Edge: Where [Name] Mi-Age]] DB (FFirst (D / q '[: Search [(name, age]]]] DB ()))) is not a part of the query language of a type of stream in SQL, but later all queries are executed in peer, nested queries have no upper part. < / Div>

database - having trouble with writing a proper sql query -

I have a table dataet with the following data No data1 access author basic Chapter Data Database Info 2 Writer Using the original black data chapter code to create an overview project area 3 basic data version author special damages to any eclipse damaged book. < P> I am trying to write a question which This type of help coincides with the pattern. rs = s.executeQuery (select data from the data location '% basic data%'); who want to get all records of 1, 2 and 3 but this does nothing return if I execute this query rs = s ExecuteQuery (select data from "data number '% basic basic data';); which outputs as number 1 and 2, but no number 3, how can I write questions which gives me desirable output thanks in advance You check the query if % author basic data% Try this as a complete substrings: Data from '% author%' and data '% original%' and data '% data' / div>

asp.net mvc - How to passing Controller a FormCollection and a class type object to action -

I have encountered a problem with the Controller Pass form store and a Class Type object to take action through Ajax calls . Below is my code. Public addressers AddDealNotes (deal note objDealNote, FormCollection fc) {// code} To send a javascript ajax request using the jquery $ .post object, you need to make sure that you type the data & amp; post-text "itemprop =" text "> contentType parameter. & lt; Script & gt; Function sendDealNotes (note, form) {var dataOutput = {"note": note, "form": form.serializeArray ()}; Var sendData = JSON.stringify (Data Optical); Type: "Jason", Content Type: "Application / Jason", Data: sendData}) .Done (function () {Alert ("success");). File (error) {warning ("error" + error);}) .ways (function () {alert ("full");}); } & Lt; / Script & gt;

javascript - Login using ajax and php -

I had a problem when I wanted to login to AJAX, but no answer !! Div error does not show any message (success or failure). The html code is: & lt; Script src = "http://code.jquery.com/mobile/1.0a4/jquery.mobile-1.0a4.min.js"></script> & Lt; Script type = "text / javascript" charset = "utf-8" src = "http://cdn.app-framework-software.intel.com/2.0/appframework.ui.min.js" & gt; & Lt; / Script & gt; & Lt; Script & gt; Function login () {var par = "username =" + $ ('# username'). Val () + "& password =" + $ ('# password'). Val (); // window. Alert (equals); Printed $ .ajax ({type: 'POST', url: 'login.php', data: {username: $ ('# username'). Val (), password: $ ('# password'). ()}, Success: function (response) {$ ('# error'). Html (response);}}); } & Lt; / Script & gt; & Lt; / Head & gt; & Lt; Body & gt;

symbian3 - Ho to sign Symbian 60 v3 Edition file -

I need to sign a Symbian Series v3 application that can be installed on any phone without having to sign again Can some body assist me in signing the application? Actually no developer certificates are available, nor are there real Symbian signings, you have -Check the only option to use signing

phalcon - Content for textarea will not fill when using volt syntax -

Using the following code in my volt file, is taken directly from the document (present here :). , {code_area ("comment", "this content is", "cols": "6", "lines": 20)}} With correct name and ID, right columns and rows but no content. Only the first parameter is mapped to an internal ID. All other parameters require a key {{text_area ("comment", "value": "this content is", "colonel": "6", " Rows ": 20)}}

accelerometer - JavaScript addEventListener delay -

I am creating a mobile application using Javascript. I need to get the data from the phone's accelerometer, so I want to attach it to an event listener: if (window.DeviceOrientationEvent) {window.addEventListener ("deviceorientation" , Function (event) {If (typeof (event.alpha)! = 'Undefined') {// Here is the event for an event}}, false); } But the problem is that it receives data in every millisecond, so when I call to attract and redraw some according to this data, then It is every millisecond - & gt; The app crashes. Is there a way to delay, or to get this data in a small part? For example, is there a function for every half-second to hear any function? In this "function debuting", you execute your goods only once Are there. A simple implementation would be: var lastExecution; AddEventListener ("deviceorientation", function) {var now = Date.now (); if (now - last exec & lt; 17) returns; // ~ 60Hz lastExecution = n

python - Initializing the weights of a MLP with the RBM weights -

I want to create a deep trust network with scikit-learn . As I know, many restricted Botanical Machines (RBMs) will be trained individually. After this one should make a multi-level polluton (MLP) in which the number of layers should be in the form of the same number (RBM), and the weight of the MLP should be started with the weight of RBM. However, I am unable to find a way to get RMB weight from BernoulliRBM to learn about education. Apart from this, it is not a way to start the weight of MLP in learning a scientific method. Am I a way to describe it? Scikit-learn does not currently implement a MLP which you can initialize through RBM , But you can still reach the weight that is stored in the components I attribute and bias which is stored in the intercept_hidden_ ​​attribute. If you are interested in using modern MLP, torch7, pylearn2, and in depth, then there are all modern libraries and most of these are routine like you describe

java - tools.jar missing when trying to install android studio on linux debian crunchbang -

When I try to run I get the following error. / studio.sh From the command line: In the Android studio gallery, 'tools.jar' does not appear. Please indicate JAVA_HOME to JDK instead of JRE. And here are the paths that seem right to me: Export JAVA_HOME = / usr / lib / jvm / java-7-open jdkg Export PATH = $ PATH: /usr/java/jdk1.6.0_27/bin Help is greatly appreciated. No, they are wrong. You need a standard version Oracle JDK, not Open JDK In addition, you need JDK6, 7 not Yes (7 is backward-compatible, and Android's The official Android documentation only says that it supports 5 or 6) And yes, it seems that you have 1.6 and 1.7 installed (I Have seen that after your editing), but you feel that you Which should be used in the environment variable. / html>

jquery - switching opacity of a div onclick -

मुझे टेक्स्ट लिंक पर क्लिक करते समय 2 एनीमेशन करना है: एक div प्रदर्शित करें किसी अन्य डिवा की अस्पष्टता को 0.5 पर बदल कर, और जब अस्पष्टता को वापस पर क्लिक करें (अस्पष्टता = 1 पर वापस) बदलते समय इसे छिपाने के लिए। अस्पष्टता क्लिक करते समय काम करता है, लेकिन दूसरी क्लिक पर मैं इसे अस्पष्टता = 1 पर वापस नहीं कर सकता। मैंने कोशिश की: । FadeTo, .fadeToggle, लेकिन मैं इसे काम नहीं कर सकता ... तो "# संस्करण 2014" पर क्लिक करते समय, "। Menuu_edition_2014" प्रदर्शित करता है और "# मेनू" फ़ेड फ़ेड फ़ेड एनीमेशन के साथ, और "# संस्करण 2014" पर फिर से क्लिक करते समय, "। Menuu_edition_2014" छुपाता है और "# मेनू" फ़ेड को 1 में, एनीमेशन में फीका हुआ है। यहां मेरा जेक्जरी है: $ (दस्तावेज़) .ready (function () {$ ('# edition2014')। क्लिक करें (फ़ंक्शन () {$ ('। Menu_edition_2014')। स्लाइडटॉगल ("धीमा"); $ ('#menu') .FadeTo ("तेज", 0.5);});}); Itemprop = "text">

php - stop include from being placed at top of page in wordpress -

The issue using a shortcode, including a list just started with php, is that the wrapper's top , Where I'm placing it in the html editor: function (which I put in the function .php): function object list (include "(object 1. php "); } Add_shortcode ('get_my_objects', 'objectitist'); html (WordPress HTML view): & lt; Div class = "listGenCont" & gt; & Lt; Div class = "objectList1" & gt; [Get_my_objects] & lt; / Div & gt; & Lt; / Div & gt; But the output ends: & lt; Ul class = "thingsathome" & gt; ** This included list is ** & lt; Div class = "listGenCont" & gt; & Lt; Div class = "actress list" & gt; ** This is where I need it ** & lt; / Div & gt; & Lt; / Div & gt; Why this happens and how to fix it Then Check this code snippet (): function included_file ($ ATT) {// Check input and override the default fil

c# - LINQ - can't create a request -

हैलो मेरे पास निम्न संरचना है: टेबल देश: - देश आईडी - देशनाम तालिका रिकॉर्ड्स : - RecordID - RecordName - CountryID यह LINQ सभी देशों की सूची "जैसा है" की सूची देता है: (i से db में। देश चुनें new selectListItem () {Text = i.CountryName, मान = i.CountryID.ToString ()})। ToList (); मैं इस तरह के देशों की इस सूची को सॉर्ट करना चाहता हूं: शीर्ष सूची में "रिकॉर्ड्स" तालिका में सबसे लोकप्रिय देशों। यह कैसे करें? आप इस तरह से कुछ कोशिश कर सकते हैं (I से db.Countries में डीबी में शामिल है। I। CountryID पर आरकॉर्म्स आर। आर। क्रम में आरडीएस के अनुसार आरक्षित है। गणना () ) })।सूची बनाने के लिए();

How to test javascript (PouchDB) that requires a server -

I want to write a unit test on some JS which uses the Pouchbd library to use PouchDB, give me a simple HTTP server * must start. My file structure is / public (all HTML and JS services have been served) / specs (all JS and Ruby spec files) If I have a server in / public folder (Like a racket), I will not be able to use the specs in the / specs folder (because the / public folder root will become the web server). If I had to start the racket in the / specs folder, then I would like to test JS files in the / public folder (because / the glasses folder web server will be rooted). I think that if I reconstruct it so that my glasses are in my public folder, it can work but it looks very crappy. I think I can also duplicate JS files which I'm testing in the Glasses folder. Again, it feels great. Of course, there is a better way to do this. * When I try to do the following simple code without running a simple http server, I get an error: var db = new PouchDB (' todos&

java - Can different type of objects(sub-class types) added on a List (if type of List is their common superclass)? -

Recently, I saw similar articles about various objects on the list (Please see the duplicate form Do not mark in) It has been mentioned in the article that for these items a general class has to be implemented. However, in the following sections of the code, the classes of the above items are classified as employees not applicable Use> and I wonder if it can work like that import java.util *; Public Sector Main {Public Stable Zero Main (String [] Args) {SalariedEmployee emp1 = New SalariedEmployee (); Hourly staffing staff = new hourly staff (); Emp1.setName ("Jack Smith"); Emp1.setAm ("72154f"); Emp1.setSalary (3000); Emp2.setName ("John Smith"); emp2.setAm ("13521a"); emp2.setHoursWorked (300); emp2.setHourlyPayment (4); & Lt; Employee & gt; Emp = new arreelist & lt; Employee & gt; (); emp.add (emp1); Emp.add (emp2); (For Employee Item: AMP) {System.out.println ("Employee ID:" + item.getID ()); Sy

javascript - using window.location and window.history -

If you use Gmail, you will see that once you are logged in, and on the back and forward buttons Click, the page is not reloaded, and therefore navigation is really quick to do a little research, I have tracked about the window. History and windows Javascript's location It seems that these can be used to achieve Gmail's functionality. I want to use it on our site, as the user clicks on the back and forward button once every time. I've got this doctor (window history): But what does the history.back () method run for example? I think they are called when a user clicks the back button in the browser? But how do you know when the user clicks on the back and / or the forward button, so that you can take the necessary action in your code? Should anyone have a good JS Bella on the use of the window, it will be appreciated "Javascript History Object - Property of the Window Object - An array in the list of previously visited URLs. In this article, we present the H

javascript - How to get an HTML element that called a function in AngularJS ? -

Image
I have an AngularJS instruction, which should be added after the HTML element, which is called it. Element structure can have several nested buttons at different levels of DOM structure. An instruction is now added to the wrong place instead of a container element in which there is a button, which is called append function. It looks like: < / p> The instructions should be added after a button, which was clicked. Director: app.directive ('recursivefields', function ($ compile, $) Copy: "httpPostController", Template:' & lt; div ng-repeat = ') {Return: {field:' field = 'model:' = model '}, restrict:' e 'nested field in field. Enstandard "" gt; & Lt; Div ng-show = "{{nested field.ICCTA & amp; nested field.ICNU}}" & gt; '+' & Lt; p ng- show = {{nested field. protected}} & gt; {{Nestedfeld .name}} *: & lt; / P & gt; '+' & Lt; P ng- show = {{nested

Python: optimizing pairwise overlaps between intervals -

I have a lot of interval (about 5k to 10k). The beginning and the end position of these elements is; Such as (203, 405) coordinates of intervals are deposited in a list. I want to determine the coordinates and length of the between each pair overlapping parts of the intervals it can be done as follows: #pecification For a small list, usually around 5000 = length (= (20, 54), (25, 48), (67, 133) (9, 152), (140,211), (19230)), C1 in enumerate (CLIIS [: - 1]): # Linear pairing for C2 in # CLIS [i + 1:]: left = maximum (C1 [0], C2 [0]) = right (C1 [1], C2 [1]) overlap = Overlap if right-left & gt; 0: Results in the "left:% s, right:% s, length:% s"% (left, right, overlap) : Left: 25, Right: 48, Length: 23 left: 90, right: 133, Length: 43 Left side: 140, Right: 152, Length: 12 left: 190, Right: 211, Length: 21 As can be seen, it works ... because it can take some time (20 seconds) I have a question, how do I optimize it? I tried to make another cut for the l

python - multiple bullets pygame space invaders -

I am quite new to Python and I'm trying to create a little space attacking game. My problem is that I do not have another shot on the screen. I would like to set fire to at least 3 in the original game. What would be the best way to do this? Here is my code: file name): self.x = xpos self.y = ypos self.bitmap = image.load (filename) self.bitmap.set_colorkey ((0,0,0)) def set_position (self, Xpos, Ypos): Selfkx = Xpos self = Ypos Def render (Self): Screen. Blit (Selfkbitmap, (Selfkx, Selfky)) Dianf differential (S L_aks, S 1_, 2_ S, S 2_a): if (S 1_x> S 2_ x - 30) and (s1_x & lt; S2_x + 30) and (s1_y & gt; s2_y - 30) and (s1_y & lt; s2_y + 30): return 1 and: return 0 init () screen = display.set_mode ((640,480)) key.set_repeat (1, 1) display.set_caption ('PyInvaders') backdrop = image.load ('data / backdrop.bmp') enemy = [] x = 0 count = 0 for count range (10): if calculation and lieutenant; 10: Enemy.Append (Sprite (50 * x + 50, 50, &#

asp.net - DIV tags moving when moving other DIV tags -

Image
The problem I am having is that when I am transferring a DIV tag, another DIV tag is automatically formatted What I am doing is not growing what I am doing. This is an image that is now on my screen: The label is within the text box 1 DIV tag, the box image is the background of another DIV tag and the button has another DIV tag. This is my html code: & lt; Div id = "loginbox" style = "background-image: url (image / loginbox_v2); background-repeat: repeat any; height: 500 px; width: 500 px;" & gt; & Lt; Div id = "notification" & gt; & Lt; Asp: label id = "lbl_U username" runat = "server" text = "username:" /> & Lt; Br / & gt; & Lt; ASP: Textbox Runat = "Server" id = "TB_UU Name" /> & Lt; Br / & gt; & Lt; Br / & gt; & Lt; Asp: label id = "lbl_Password" runat = "server" text = "password:" /> & Lt;

android - Change a TextView to an ImageView -

one drag and amp; Skip activity, I want to drag an image and drop it on a TextView. And change the text view to the image view, which I have left. Case drag event Action_DROP: View View = (see) event.getLocalState (); View.setVisibility (View.INVISIBLE); // This is the textview of Traggettextview DropTabz = (TextView) Drag Weave; // Probably now see an image will now see, // drag the view and dropped the dropped ImageView (= ImageView); // Now here I want to set the dropView textView as ImageView left, this is how I do this dropTarget.setAnimation (left .getDrawable ()); break; Please help You will use TextView and background Set it in the text view it will help you.

ios - Resume data is always nil when invoking cancelByProducingResumeData: -

When I end the application, trying to access the resumeData of the downloading file I am I tried to call the method in willEnterBackground and willpower in the appDelegate . I resume value from view class , but the problem is that when this method is implemented, then download session will automatically close it happens. When canceling , resuming data: , it is again The data will start and then it will call URLSessionTask-didCompleteWithError . There we found out how the app is stopped or not, and we can store resumeData without canceling the download. This can start again later when the app launches as the following: self.downloadTask = [self.session downloadTaskWithResumeData: objFile resumeData]; [Self. Download Task Resume]; // Here objFile is a stored object in a core data

c++ - Why does std::sort compare the element to itself -

As the subject says, why do some of the elements in the code below compare to them? # include & lt; Iostream & gt; #include & lt; Vector & gt; # Include & lt; Algorithm & gt; Class A {public: A (int value): Value (value) {} ~ A () {} Bool operator & lt; (Consta and RA) Const {if (>-> value == rhs.value) std :: cout & lt; & Lt; This & lt; & Lt; "" & Lt; & Lt; This- & gt; Value & lt; & Lt; "\ T" & lt; & Lt; & Amp; Amp; Rhs & lt; & Lt; "" & Lt; & Lt; Rhs.value & lt; & Lt; Std :: endl; If (this-> values> ls; rhs.value) return true; return false; } At Value; }; Int main (int argc, char * argv []) {std :: vector & lt; A & gt; Vec; For (int i = 0; i I tried the above code on Windows, Linux and OpenBSD, it seems to be on Windows that it does not compare the element in itself, but it would have happened on both Linux and OpenBSD is. My g

directory - Get path of parent requiring file, Ruby -

Is it possible to get the location of the file, for which another file is required in Ruby? I have a project where I used to create some processes and I would love to be able to code to make sure which file is the parent of the required file, it is good when debugging . Example: # initial.rb: "./my_file.rb" is required "fork" / my_file2.rb "end < / Pre> - # my_file.rb: puts "required from file: # {?????}" - # my_file2.rb: Required "./my_file.rb" I hope to do something like this: Required from file # = & gt; /path/to/initial.rb # = & gt; Required from file: /path/to/my_file2.rb Based on the end I need need_relative and to < Red> | "\ t # {x}"} "% s requires% s "% [Caller.first.split (/: \ d + /, 2). First, arg] Old_require_related Arg end alias: old_require: def requirement (arg) # ~ collar.map {| x |" \ t # X} "}"% s requires% s "% [caller.fir

c - What are pthread cancelation points used for? -

In some cases the respondents say that unless the programmers do not know that they are doing the pthread cancellation points (in many cases) If there are very well, the cancellation points should not be used. My question --- what is the use of pthread cancellation points? [Updated from the comment] Does a cancellation status allow those specific API calls to be canceled? Why not others and others? Does anyone want to use them for something else? Is he a hack to deal with a problem in the kernel, or are they contained in some things that are with posics? Do you want to use the user-level code or only the cancellation point in the API? whether a cancellation point allows to cancel those special API calls is? Stuck with PTHREAD_CANCEL_DEFERRED, this can be the center of confusion. You are thinking about it at the rear side about the Allow system call (the API does not name your name) to cancel the cancellation point, checks the call whether a cancellation reque

python - Django - filtering in views -

I am working on a basic application and I am stuck in displaying some information. Please see: Model: class companies (models.model): name = models.CharField () address = models.CharField () def __unicode __ (self) ): Return itself Name class payments (models.Model): Company = Model Fairanyki (companies) year = Model. Kharifild (option = YEAR) month = model. Kharefild (option = month) date = model.deidfeld (auto_now_add = true) I would like a scene in which only to show companies that do not pay a monthly fee. So I started this way: def check (request): i = datetime.datetime.now () an_c = i.strftime ('% Y' ) Comp = Companies.objects.all () pay1 = payments.objects.filter (a = an_c, month = '01 ') But in the template I do not know how "comp" Filter the list. I want to display the template from "Comp" in all the records, except for those who can find ID / PK in "pay1.company" You will not do this in the template. Do th

javascript - How to use select properly with firebase data in Angular UI typeahead -

I am trying to use the Konari-UI Type with some data from my firebase. The data looks something like this: data: {"-JL8IPEAs0vLSt4DJ4V9": {"name": "something"}, "-JL8IbggYn3O8jkWoPmv": {"name ":" Something else "}} My HTML looks like this: & lt; input type = "text" ng-model = "help type" typeahead = "label (in, value) in the answer object; limitTo: 8" & gt; Actually my problem is how do I understand the selected part in TypeBeith with my current data structure? These resins were useful: But I did not really understand how to do this. I'm guessing that this is relatively simple, but I could not get anywhere that could help me. I have tried many different combinations, but when the part of the typehead of the head is given a very useful response, when I am doing it wrong, I have found myself arrested. Any help would be greatly appreciated thanks. It looks like ang

angularjs - angular directives comment section -

I am working on a website that displays many articles Each article has a comment section. I have been able to effectively rewrite the comments to DOM with recursion within a ng-repeat though, I should be able to click on a feedback button on any comment (they appear in nested fashion ) And insert a div below the clicked button. This will be a text field for comments in the field in which they want to submit and a button when this second button is clicked, the controller will save the comment to the database. I initially wanted to do this by adding DOM directly to the controller. However, after further research, this would be a direct violation of the MVC / MVW pattern. I believe the correct answer is to create a custom command. Please give me some information about how to do it correctly. Any other and all information will be very helpful thanks in advance. You do not really need to direct it to get it. html: & lt; Div ng-repeat = "articles in articles" &

Email sent using intent going to outbox Android -

I am developing an application that sends emails for which I intend to use < Pre> intent Emails = new intent (Intent.ACTION_SEND); EmailI.putExtra (Intent.EXTRA_EMAIL, new string [] {"aaaaa@gmail.com", "bbbbbbb@gmail.com"}); EmailI.putExtra (Intent.EXTRA_SUBJECT, "Email Testing"); EmailI.putExtra (Intent.EXTRA_TEXT, "Dear Sir / Mm Find My Mail"); EmailI.setType ("Message / RFC822"); StartActivity (Intent.createChooser (EmailI, "Choose an Email Client:")); After running this code the new message is generated in the email account's Outbox, I used to send mail. I have given the following permissions: & lt; Usage-permission Android: name = "android.permission.ACCESS_NETWORK_STATE" /> & Lt; Usage-permission Android: name = "android.permission.READ_PHONE_STATE" /> & Lt; Usage-permission Android: name = "android.permission.INTERNET" /> I am running the

Streams in C++ crashing the programme -

This is a simplified version of what I want to do. If I post the whole thing then there will be more than 500 lines, so I created it to test the material and I get an error similar to that of a big mistake. #include & lt; Iostream & gt; # Include & lt; Fstream & gt; # Include & lt; Cstring & gt; using namespace std; Int main () {int node1, node2; Four * CMD; Four * file; Int ARR [1000], AR2 [1000]; Easiest command; Commands.open ("commands.txt", iOS :: In); If (! Command) {cerr & lt; & Lt; "failed to open commands.txt" & lt; & Lt; Endl; Return 1; } Cout & lt; & Lt; "Hello"; Orders & gt; & Gt; Cmnd & gt; & Gt; File; The court's & lt; & Lt; "Bye"; Instream input; Input.open (file, iOS :: in); If (! Input) {cerr & lt; & Lt; "Failed to open input"; & Lt; & Lt; Endl; Return 1; } Int i = 0; While (input.good ()) {Input> & Gt; Node 1 &

java - applet to Jframe -

I have followed the tutorial of Kilboult to make a game () then changed it. I used an applet but now I want to convert it to Jeffrey. What I did: 1- I imported and raised Jeffram instead of the applet. 2- I has changed an init method to a constructor and added public static zero main (string [] args) {// thread-security Use the Event Dispatch Thread to create UI for SwingUtilities.invokeLater {New Runnables} {@Override Public Zero Run () {New AltMain (); // AltMain is the name of my main square.}}); } I have copied this code from somewhere and I do not know what it does. I would probably use it instead: public static zero main (string [] args) {new AltMain (); What I could not do: They change something: (my first priority now) base = getDocumentBase (); and bg = getImage (base, "data / bg space.jpg"); GetImage and GetDocumentBase give me the "Undefined error" for AltMain type. How can I fix them? Are there any jeframes for t