Posts

Showing posts from April, 2013

Java pass by reference -

इस सवाल का पहले से ही एक उत्तर है: 71 उत्तर क्यों इस कोड में मैं कर सकता हूँ स्ट्रिंगबफर का स्वैप नहीं है? सार्वजनिक स्थिर शून्य मुख्य (स्ट्रिंग [] आर्ग्स) {स्ट्रिंगबफर ए = नया स्ट्रिंगबफर ("वन"); स्ट्रिंगबफर बी = नया स्ट्रिंगबफर ("दो"); स्वैप (ए, बी); System.out.println ("एक है" + ए + "\ nb है" + बी); } स्थिर शून्य स्वैप (स्ट्रिंगबफर ए, स्ट्रिंगबफर बी) {a.append ("अधिक"); बी = ए; } क्योंकि आप चर के संदर्भ में काम नहीं कर रहे हैं a और b और नए स्ट्रिंगबफ़र ("वन") और नए स्ट्रिंगबफ़र ("दो") संदर्भों के साथ। तो b = a से आप a और b को मुख्य लेकिन स्थानीय प्रतियों में नहीं बदल सकते हैं।

.net - LINQ To Datatable using "Any" with a List -

OK, I can not find it, I use a list of strings in my data to loop through a data sheet. I am trying, but I am not able to work on it. This is what I am trying to do: if d = "these" then lInOutStrings.Add ("Part in") or other lInOutStrings.Add ("Inventory" ) The new option with lInOutStrings.Add ("Repair") is included in the end (if part of the "API") ("INVT_TYPE") in dtParts for each part (LInOutStrings.ToString). ...}) Next ... The problem is that the query does not always give anything, what I found is that, but I am not able to complete the question. What is it that I am doing wrong? I am using VB.Net 2010 and .NET 4.0 This is on the other side, look in the list, not in the string (which is IEnumerable ): in slow query = dtParts.AsEnumerable () where lInOutStrings.Contains ( U.Field (with string) ("INVT_TYPE")) Select new {....}

ios - How to disable user interaction of section index for UITableView? -

I have applied a section index to the right of the table app, which is my app I would like to disable user interaction with that section index in some circumstances, but there is no property on UITableView which allows access to the section index directly How can I disable user interaction for the section index? I have disabled the interaction with the table so that you can not scroll or scroll to any cell, but it still allows the section to interact with the index, so This section will scroll to each section when tapping the section. self.tableView.userInteractionEnabled = NO; If it is not possible to disable interaction with the section index, is there a way to prevent the scrolling of the table from changing? That's exactly what I wanted. I got a solution. Keep a BLL to know when section indexes should be disabled. Then indexed to prevent from scrolling in tableview: sectionForSectionIndexTitle: atIndex: simply return -1 . - (NSInteger) Table vie...

php - Recognising visitors between domains -

Is it possible to get user information that can be used as a unique identifier among domains? What I am trying to do is as a quick example (not exactly, but the principle is the same) that says you have a main website in UK- News.com. You also had three other sites - England-News, Scotland-News.com and Wales- News.com, all of which were hosted on the same server. All 4 sites will share the same database and each just drag relevant information about it. If a user becomes a member of one of the sites, then they have the option of becoming a member of any or all of the others. Will also be given. If a user signs in to the site then he is a member of a member, and then goes to someone else, and how the site can get to recognize it by signing it, so it automatically logs it happens? My principle is to provide some user information (IP, USANN.NET, browser, screen resolution, computer name, OS) in the database via PP Had to store and then check against all those people when the user...

jquery - Make Ajax-call and take care of the response -

I use a free API for collecting users information from Ip-adress. This method: public JsonResult GetIp () {string url = "http://ip-api.com/json"; Dynamic googleResults = new URI (url) .GetDynamicJsonObject (); Jason Returns (GoogleResults, JsonRequestBehavior.AllowGet); } When this page is provided to the method, then I am thinking this way: $ (document) .ready (function ("Type" "Post", url: '@ Url.Action ("GetIp", "Home"), Content Type: "Application / Jason; Charset = UTF-8", Datatype: "Jason ", // here I need the code which receives JSON from the controller ...});}; Besides, is it the best way to go about this kind of work? I was reading that Jason can also be passed as a simple string? Any suggestions on best practice appreciated. Thank you. You will not find the client in this way, you will get a server IP because it calls the machine. Do you want the call to be directly in JavaScript...

Github check for pull done on github repository -

Is there any way to check Gitob repo that someone has drawn from it or connecting that person as that ally after? If it is important then the repo is private. No (unless there are some internal logs about GitHub support). The highlighted by will include: But nothing about pull / fetch / clone

sql - How to consolidate blocks of time? -

I have a derived table with a list of seconds relative to the foreign key (id): Create table time (id INT, time INT, time INT); The table contains mostly non-overlapping data, but there are occasions where I have a timetable & lt; Time from any other record: + ---- + ---------- + -------- + | ID | From time to time Time to + ---- + ---------- + -------- + | 10 | 10 | 30 | | 10 | 50 | 70 | | 10 | 60 | 150 | | 10 | 75. 150 | | .. | ... | ... | + ---- + ---------- + -------- + The result set means a flat linear inactive report, but in these With so many overlaps from, I end up with negative time in use. To wit. If the window above was 150 seconds long for the id = 10 , and I had expressed the difference of relative seconds to decrease the size of the window, give me the code (20 + 20 + 90 + 75) = - 55 . I have tried this approach, and I came to know that there were overlaps that were flattened. So, what I'm looking for is the solution to level one overlap at on...

MongoDB Aggregation Framework : Using dynamic javascript variables in Project "key" field -

A newbie is enough for the mongodibi aggregation framework to think that in a holistic framework, a project can use dynamic variables There is a way. Example This is my code, it is not for Javascript syntax, but if you get this thing: // My javascript variable var my_variable = "salary" ; // db.article.aggregate ({$ Project: {title: 1, author: 1,}}); Now, in the code given above, I want to dynamically change the projection of "author" of "pay". To do something like this db.article.aggregate ({$ project: {title: 1, "my_variable": 1,}}); who will project the salary dynamically in this case. Your variable is not really dynamic here because this aggregation can not change during the pipeline. The aggregation framework does not evaluate javascript, so whatever you have been provided should be obtained from the pipeline that is provided or the document is being processed. However, you can certainly make the pipeline a program t...

cygwin - Why does clang -MM output a Windows-style absolute path with a colon, which is invalid for make rule syntax? -

About MM Flood: Instead of output the result of preprocessing, output A rule is appropriate to describe the reliability of the main source file. The preprocessor makes a rule that includes the object file name for that source file, a colon, and the names of all the included files, including the -max or the -max command-line option. The version of the gem I am using is part of the Android NDK and uses the Windows-style path instead of the Cygwin-style path. Using the -M flag, the quarrel is outputting the name of one of the included files as a full, Windows-style path in which there is a colon after the drive letter, thus breaking the syntax That's expected of Cyngin's GNU Make. Blur outputs and I can adjust the path before using it, but it looks like a hack because the -mm flag does not produce the appropriate output (A valid make rule). Is there a flag or environmental variable to improve this behavior? Unless the colloquium in support of some variants is ...

javascript - Can I edit React components without reloading the browser? -

postproduct "itemprop =" text "> If the proposals respond to DOM reconciliation, it is possible to reload the dynamic component code and re-submit Is it after editing it? I'm looking for a solution that allows me to edit, save and update JSX files automatically in the browser without unloading or losing its position without reloading the page. Without it. Ideally this browser should work without the plugin. You , a drop-in loader Enables live editing for a browser plug-in or IDE hook required With Marriage Webpack (HMR) response If you do this, you can use:. Your reaction components donÊ ¼ bad bad effects; You're ready to switch to Webpack for module (it is not difficult to switch); You (minutes if you already use an extra pair of hours webpack). How it works: It uses the WebPack HMR API to learn about a "module update". . Event This varies for React.createClass special call createClass and updateClass ; When...

If you wrote a C program with no pointers -

If you have written a program with an indicator, then this means how much memory can the program consume? If not, in other ways, can you consume more memory than the amount / type of variables present in your code? In addition, how much does the indicator use? - Edit - I feel that a lot has come in the answer You are limited to the size pile If you do not use dynamic allocation Does this mean that if you have dynamic allocation then the system / compiler will increase your stack / as soon as you go? --EDIT # 2 When I said "how much memory the full range of ...", the program does not have unlimited memory with indicator (But how sweet it would be?), But what I meant was the amount of memory that the program can consume quantitatively as a finite number, or for the memory allocation for variables in other ways. Other ways to continue to grow from the amount are @ Dies Ecklin and @Walick reported that recurrence could be a cause of memory to increase dyna...

Array reference equality in Xcode 6 b3/b4 -

I am playing fast with the playing field. This code is compiled at beta 2 and previous but not beta 3 or beta 4: var myArray = ["foo1", "foo2", "foo3 "] Var myArray2 = myArray myArray2 === myArray myArray2 + =" Hello "MyArray2 === myArray indicates that type [string] corresponds to any object protocol Not . We read on it b3: The arrays have been completely changed to keep the semantics full value to match the behavior of the dictionary and string. Now an array is completely immutable, and a var array is completely unstable. So it is right to say that we have lost reference equality operator === arrays? Operator == is not obvious, because it compares array elements. Yes it is fair to say that we lost === for array Given the true true value of value , which means that they always make a copy when assigned to a new variable. This code is useless because it is never true. The reference type (or class) is the only ...

Odata url not returning count -

I am trying to check the total records with a filter on the ODATA query. ? $ Filter = (id eeq 377 and msf unit). Any suggestions? 'good') / $ count $ counts is not a query option $ count /? $ Filter = (id ea 377 and msf eq 'good')

Is htaccess-like password protect from PHP possible? -

You know that the htaccess password protection of a folder displays the system's default modal window with a password prompt; I would like to know that I can achieve that functionality, but only after programming, whether it is needed or not. Which means that the same URL may need password protection in two different situations, so if some of my conditions have not been met, then I like it if I Can easily throw the "box" without the need of own session controller code (or implement) in PHP from PHP (PHP) The short answer is yes - see example 1, on which I'm down Defense Published: & lt ?? Php if (! Isset ($ _ SERVER ['PHP_AUTH_USER'])) {header ('WWW-authentication: original realm = "my area"'); Header ('http / 1.0 401 unauthorized'); Repeat 'Text To Read If User Cancel Cancel Button'; Go out; } Else {echo " Hello {$ _SERVER ['PHP_AUTH_USER']}. & Lt; / p & gt;"; Echo "& lt; ...

How To Write Simple Query Using Couchbase View? -

सरल रूप से, मेरा मतलब है के बराबर: SELECT * FROM ORDERS जहां स्थिति = 'शिप' ; यह दस्तावेज होगा: {"प्रकार": "आदेश", "आदेश_no": 10002, "आदेश-दिनांक": "2010-07-24", "स्थिति ":" भेज दिया गया "," ग्राहक_नो ": 1001} मैं इस तरह एक मानचित्र के साथ एक दृश्य बना सकता हूँ: फ़ंक्शन (डॉक्टर, मेटा) {if (meta .प्रकार == "जेसन" & amp; amp; amp; & amp; doc.type == "ऑर्डर" & amp; amp; amp; amp; & amp; डॉक्टर.स्टेटस == "शिप किया गया") {emit (meta.id, doc); }} लेकिन फिर मुझे प्रत्येक स्थिति मान के लिए एक अलग दृश्य की आवश्यकता होगी जिसे मैं क्वेरी करना चाहता था। मैंने काउचबेस कंसोल में फ़िल्टर पैरामीटर के कुछ विभिन्न क्रमभूमियों की कोशिश की है, लेकिन अभी तक एक कार्यशील संयोजन खोजना है। मैंने इसे एक समझ लिया और मुझे लगा कि मैं अपना समाधान साझा करूंगा। एक एक दृश्य का उपयोग करके "इंडेक्स बनाना" के बारे में बहुत कुछ पढ़ता है, और यही वह एक एसक्य...

PHP variable in MySQL query WHILE string breaks -

Why can not I use the PHP string variable in a MySQL query in a LIKE selector? $ weekday = '% w%'; Resonant "day of the week"; $ Sql ​​= "Choose from ID of Message ID, where day day" looks like; $ Result = $ pedo-> Query ($ sql); I receive the error message: "SQLSTATE [42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; manual that is to your MySQL server version The correct syntax for using '% w%' on '2%' I have tried it with double quotes around the variable yet still gets an error. If I replace it with '% w%' instead of the variable, then it works fine. I have used the PHP variable in other queries without any problem. I can not understand this. Edit: Sorry, I think that I was more tired than it was. You are right I posted the wrong query. I was trying to do everything to work with the placeholder and I do not know what I was doing. But I have a problem Which I can not ge...

c++ - Example from "Sams teach yourself C" Uses "fgets" but returns errors -

The code included is absolutely out of the book example, but it returns errors, is there anything that the book has done wrongly? I have #include & lt; String.h & gt; Before , only #include & lt; Stdio.h & gt; , but still what I am doing should be three arguments. #include & lt; Stdio.h & gt; #include & lt; String.h & gt; Int main (zero) {four buffer [256]; Printf ("Enter your name and & lt; enter & gt ;: \ n"); Fgets (buffer); Printf ("\ nYour name is% d characters and spaces!", Stellen (buffer)); Return 0; } the compiler says meaningful issue with fgets (buffer); - Very few arguments to call, than 3, 1 format String is a problem (Stellen (buffer)); - Specifies 'int' in format, but the logic type is 'unsigned long' fgets () will have to take three parameters. The string was to be read The number of bytes to write in this string But if you've got entered the key carrier , it w...

ios - How to reuse a NSString method? -

I am writing a method that takes the string and gives the string I'm trying to use it in some other method I am - (NSString *) formatDate: (NSString *) showStartDateTime {NSTimeZone * tz = [NSTimeZone Time ZoneWithName: @ "UTC"]; NSDateFormatter * dateFormatter = [[NSDateFormatter alloc] init]; [Date-time set-timezone: TJ]; [DateFormatter setDateFormat: @ "EEE MM / DD / Yay"]; NSDate * dattt = [dateFormatter dateFromString: showStartDateTime]; [DateFormatter setDateFormat: @ "yyyy-MM-dd"]; NSString * tempo2 = [dateFormatter stringFromDate: dattt]; Return tempo 2; } In this way I am using it. [Self format date: @ "Venus 08/08/2014"] Is this the right way to use it? NSString * hellostring = [Self format date: @ "Venus 08/08/2014"]; NSLog (@ "% @", hellostring); I know that this does not work. Any suggestion is appreciated. I wrote a command line app and it was not already able to run dateFromString : A...

cocoa - Matt Gemmell's NSBezierPath+StrokeExtensions draws outside of clip rect -

Image
I am using Matt JeML's NSBZear path + stroke extension range so that an internal stroke can occur on NSRact. Here is the code for the whole range: - (zero) StrokeInces {/ * stroke is using without any extra clipping rectangle. * / [Self stroke instantly: nssarrite]; } - (Zero) StrokeInsideDihine: (NSRact) ClipRark {NSGFix Context * This Context = [NSGFix Contact ContentContacts]; Float linewidth = [self linewidth]; / * Save Current Graphics Reference * / [This Contact SegraphicsState]; / * Double the width of the stroke, since the stroke is a stroke on the center path. * / [Self set linewidth: (linewidth * 2.0)]; / * Clip clip on this path; Do not remove anything outside the route * / [self setclip]; / * More clip drawing for clip clipping, usually the frame of the scene * / If (clipRect.size.width> 0.0 & amp; clipRect.size.height & gt; 0.0) {[NSBZairpath clip: clip opinion ]; } / * stroke path. * / [Self stroke]; / * Restore previous graphics references * / [this...

rss - SourceForge file releases -

I want to automate updating from SourceForge, it was working for a while http://sourceforge.net/projects/msys2/rss?path=/Base/x86_64 However, I realized that RSS feeds contain up to 100 items, so if chosen path was last updated earlier, then it will not be on the RSS, and 500 internal server error Do I have any other "API" sourcing G file will be entered into the list? I would not want to deny the page like an animal. This is a workaround, but PowerShell can easily parse HTML $ base = invoke-webRequest 'http://sourceforge.net/projects/msys2/files/Base/x86_64' For example, get the latest file $ base.links | ? Class-eq name | tar select $ Base.links | | ? Href-match tar | -fir 1 -exp href

layout - Center Responsive CSS circle with centered text inside of a parent DIV -

I have recently started working on the web layout for css Which I intend to plug in in Wordpress Theme . I'm just focusing on two things - 4 buttons similar-radius circles, and a fully responsive layout. I found a great way to create a responsible board with centered text: Only one issue here should stand inside the parent DIV and take it to the center going. Absolute position does not work, and I do not think it can, because the height of the button is unknown. I am currently playing with CSS Conversion and it is by far the closest one. I have implemented the vertical center class called the different parts centered here, as seen here. CSS: .circle {margin-left: auto; Margin-right: auto; Limit-Radius: 50%; Width: 100%; Status: Relative; Background color: purple; }. Vinegar border (range: 1 px solid black;) .circle: {content: ""; display area; padding-top: 100%;} .circle-inner {status: full; top: 0; left: 0; bottom: 0; Right: 0; Text align: center;}...

regex - Match Partially Duplicated Lines -

Image
I have rows in a list that are sometimes similar to the first "space" character, then can change ( I.e. a date later). Vooller Joule / 12/12 bilis joule / 13/13 chess joule / 14/12 tcrice joule / 12/12 I can easily Sort the lines from, but I would love to remove duplicate later dated entry. I have received a Rezox suggestion, but it only matches that line, the need to be able to mark the entire line of the same username in the file Here are my examples given above The row will be highlighted at 1 and 3. (edited for clarity) See duplication from one line to another For PCRE engine (used by Notepad ++), there will be a compact formula (? M) ^ (\ S +). * \ R (? S). *? \ K \ 1 This will work in N ++ As you remove the duplicate line, more can be marked, because initially the regd stops at interval lines to highlight duplicates. Explanation Code> ^ and $ to match each line Turns on multi-line mode ( Anchor claims that we are at the b...

php - Magento: adding css to a theme -

Image
I picked up the task to modify a magenta subject and I already have a heavy headache. So, I'm just trying to add a CSS to the page. Xml CSS is included only properly, however, the base URL is off my subject is rwd / default. What can be happening? You set your code to rwd / default . Magento has call back functionality built for theme management, it means that it will see a file in the package / theme directory that you have defined via the administrator (if you have a custom theme set If not, the default package will be for rwd / default for Magento 1.9 and default / default & lt; magento 1.9 ) If the file is not found there, then that file will be base / default Will be examined in Older. In this case, this call back functionality will work in such a way to some degree. Browser request browser of CSS file for Magento. Accepts Magento requests It looks like the current theme is being used. Magento recognizes the current theme rwd / th...

Load csv into mysql using Python syntax error -

This question and an answer is already here is: 1 answer I TSV file has the following structure: before the storm #DAteTime User ID View (divided from each \ t) 2009-06-07 02:07:41 http://twitter.com/hokiepokie728 @ fabro84 '' There is a new song from the Jonas Brothers that is going to be on their new album. Miley is a duet with Nick! 2009-06-07 02:07:42 'http://twitter.com/annieng' is now in How can I import this file into a MySQL table which is tweet with dragon? 1 DT dated 2 user varchar (141) 3 to varchar (141) 4 ID bigint (20) AUTO_INCREMENT the mysql- connector-Python 1.2.2 as you can do it like this import mysql Are there. CNX Connector Import ClientFlag from mysql.connector.constants = mysql.conector.connect (client_flags = [ClientFlag.LOCAL_FILES], ....) CUR = cnx.cursor () cur.execute ( "data load local INFILE '& lt; / Path / per / data / file & gt; "INTO" "Table Tweet")

java - How to get the I.P. Address of client that is hitting your webservice? -

itemprop = "text"> The title says too much, I have written a rev website on Java using RSS and jersey in Java, and I Like the removal of an IP address of the customer coming into my code if I have a class: @ path ("/ service") public category service {@GET public zero doAction () {// ...}} What do I do from there? P I'm asking for debugging help No , I'm asking how can I retrieve the IP address of the customer connecting to my web service @ NIRTRAR gave a good answer How to @ContextHTMLProviderViewer P> @GET Public ZeroAction (@Contact HTTPSvette Request) {// Get IP address string ipAddress = req.getRemoteHost () again; }

c# - Somewhat complex list sorting -

I have several objects with 3 numerical properties: "high", "low" and "tibrecker" Should be solved: If an object is less than the height of any other object, then it appears before the list. Similarly, if the height of an object is at least the other, then it appears later in the list. But in this case there are contradictory categories on two objects (such as someone's high object is between low and high of second object), the property of the tiebraker is considered in which the object with the upper tibrere value is placed first in the list. I am working with C # in particular, but I think the language of thoughts here is very ignorant as any kind of code should be welcomed. In addition, I is worked on it myself. I have a nested for-loop that is not working for me yet, I leave some code, but I'm on my phone and it works as a house, besides it, maybe it's fun for you and you have some I do not even need my ugly code in the way. ...

c# - Task.WhenAll() only executes 2 threads at a time? -

In this problem I am trying to cache a single value, let's call it foo. If the price is not cashed, then it takes during recovery. My problem is not that apply it , but test . To test it, I close the work together using Task 5. When receiving all () cached values, the first person enters the lock and receives the asynchronous value, while the other 4 threads should wait on the lock. After waiting, they should check again the cached value once again, it shows that it has been recovered from the first thread, and it has been returned without the second recovery. [TestClass] public class class 2 {private readonly semaphore semaphore = new semaphore (1, 1); Private Bull? Foo; Private async Tasks & lt; Bool & gt; GetFoo () {bool fooValue; // Nuclear operation to obtain current Fu Balls? CurrentFoo = this.foo; If (currentFoo.HasValue) {Console.WriteLine ("Foo already recovered"); FooValue = currentFoo.Value; } And {Sikfire. WaitOne (); {// Atomic operatio...

sublimetext - Can I clean up/reformat text with regex in a text editor? -

मान लें कि मेरे पास इस तरह का पाठ है: "title": " ब्लॉग पोस्ट शीर्षक "," url ":" http://urlofblogpost.com/article "," title ":" ब्लॉग पोस्ट 2 शीर्षक "," url ":" http://urlofblogpost.com/article2 ", या इसे पसंद करें (अगर मैं इसे थोड़ा साफ करता हूं): ब्लॉग पोस्ट शीर्षक http://urlofblogpost.com/article ब्लॉग पोस्ट 2 हेडलाइन http: // Urlofblogpost.com/article2 क्या मैं खोज और सब्लाइम पाठ में बदल सकता हूं और इसे इस पर बदल सकता हूं? & lt; a href = "http: //urlofblogpost.com/article"> ब्लॉग पोस्ट शीर्षक और & lt; / a & gt; & Lt; a href = "http://urlofblogpost.com/article2" & gt; ब्लॉग पोस्ट 2 शीर्षक & lt; / a & gt; खोज: "title": \ s * "([^" ] +) ", [[आरयूआर] +" यूआरएल ": \ s *" ([^ "] +)",? बदलें: & lt; a , नीचे प्रतिस्थापन देखें। स्पष्टीकरण "शीर्षक": शाब्दिक ...

Bootstrap 3 Modal: how to check if modal is open or closed using jquery/javascript -

Can someone please tell me how to check the bootstrap 3.0 modal status, whether it is open using jQuery or Javascript or Closed. I use the following code, but when you open a model for a time, it works, otherwise data gives insufficient error. if ($ ('# addMemberModal'). Data ('bsmodal') .isShown == true) {console.log ("the model is open"); } You can use jQuery directly like this: . $ ('# myModal') is (': visible');

java - How to access MySQL database with an Android application? -

Where similar functionality will be developed. Therefore, this requires database (MySQL) contact It would be grateful for any ideas. Need PHP or Webservices? This will require web-services, You can set up your MySQLSQL / Oracle database Can not access it from your application. Just because some of the other environments of these databases have been deployed, and a large database such as a mobile database such as MySQL can not be deployed. So that you need to use web-services to access those databases (MySQL / Oracle). ). WebServices : A system that calls some server-side script like PHP, ASP, JSP . Accessing your MySQL database in all these APIs will ultimately result in this script in your application form JSON / XML . Via HTTP Connection yourAPP - & gt; This will execute some peace code that talks to your server (Calling Web Services-> GetStudent () -) Server - & gt; * It will execute something like getStudent () - Select "Fr...

javascript - How do manually trigger the F12 (Developer Tool panel) on document click -

इस सवाल का पहले से ही एक उत्तर है: 4 जवाब 3 जवाब कोई भी जानता है कि मैन्युअल रूप से Jquery या Javascript में F12 (डेवलपर उपकरण पैनल) कैसे ट्रिगर करता है मैंने क्लिक ईवेंट का उपयोग करने की कोशिश की जैसे कि $ (document) .click (फ़ंक्शन (इवेंट) {if (event.which === 123) {// मुझे नहीं पता है कि कौन सा कोड आता है}}); $ (दस्तावेज़) .trigger ( "पर क्लिक करें"); कोई भी इस पर शोध करता है ... नहीं आप ऐसा नहीं कर सकते क्योंकि यह ब्राउज़र के साथ जुड़ा हुआ है और पृष्ठ के साथ नहीं। जेएस ने पृष्ठ के साथ संवाद करने और नेटवर्क कॉल करने की शक्ति रखी है। ब्राउज़र और मशीन पर अन्य ईवेंट के साथ नहीं।

javascript - How to use an angular factory correctly? -

I am reading enough about sensory dependency injection and factory vs. services like this post - I am struggling to put it in practice and am surprised if you can suggest me how you will do it. My current code looks like this var app = angular Modules ("Martisk Coolap", ['Firebase', 'NGRUT']) Function Main Controller ($ Scope, $ Firebase) {var db = New Firebase ("https: //**.firebaseio.com/"); $ Scope.messages = $ firebase (db); $ Scope.addItem = function (error) {if (error.keyCode! = 13) returns; $ Scope.messages $ Add ({name: $ scope.name, price: $ scope.price}); $ Scope.name = ""; $ Scope.price = ""; }; } I decided that I want to use angular routes and divide this basic function into two separate controllers which I will use for my test app. The main controller will only show everything in Firebase DB and the admin controller will be able to add the message to it var app = angular Modules ("Maltese Cool app...

Eclipse - Errors running builder 'Android Package Builder' -

I updated ADT from 22.x to the latest 23.x and now I'm getting the following error in trying to run Project: Errors occurred during build. Project error in sample project -1 builder 'Android Package Builder' running errors com / android / utils / GrabProcessOutput $ IProcessOutput There are no comments: java.lang.NoClassDefFoundError: com / android / utils / GrabProcessOutput org.eclipse.core.internal.events.BuildManager com.android.ide.eclipse.adt.internal.build.builders.PostCompilerBuilder at $ 2.run .build (PostCompilerBuilder.java:212) $ IProcessOutput (BuildManager.java:733) org.eclipse.core.runtime.SafeRunner.run (SafeRunner.java:42) org.eclipse.core.internal.events.BuildManager.basicBuild on At (BuildManager.java206) at org.eclipse.core.internal. events.BuildManager.basicBuild (BuildManager.java:328) org.eclipse.core.internal.events.BuildManager.build (BuildManager.java:403) org.eclipse.core.internal.resources.Project $ 1.run (project Java: 618) org.ecli...

php - Form outside of wordpress gives wordpress 404 on submit -

I have a WordPress site, and there is a sub-directory on the server that is excluded from WordPress, this is the line To which I am using the .htaccess file to exclude that directory: RewriteCond% {REQUEST_URI}! (App) [NC] I have a form inside that directory whenever a single URL is in the field, I get WordPress 404 when I submit it. If there is no URL in the field, then it normally submits how can I resolve this issue? Edit: Here's what I've tried: Adding a prefix for the form element name form using a random string of characters as the element name form value encoding base 64 submission add a subdirectory with a .htaccess file Reserve angle of the command With the relative and full URL, "Action" for both you and the other page. Adding Eshta. Full text of wordpress .htaccess here: # version and lieutenant; IfModule mod_rewrite.c & gt; RewriteBase / RewriteRule ^ index RewriteEngine on \ .php $ - [L] RewriteCond% {REQUEST_URI} (app...

python - Django - ResolutionError and DistributionError -

I had to uninstall my DNS == 1.6.4 and install 1.5 for a project, but now when I try starting a project with 1.6.4 PIP and with a django-admin.py startproject PN traceback (last call final): File "/ Library / Framework / Python.framework / version / 2.7 / bin / django-admin.py", in line 5, in & lt; Module & gt; pkg_resources.run_script ( '(required for Django == 1.6.4', 'django-admin.py') file "/Library/Python/2.7/site-packages/pkg_resources.py", line 534, run_script self.require a) [0] .run_script (script, ns) file "/Library/Python/2.7/site-packages/pkg_resources.py", line 1432, run_script increase ResolutionError ( "a script named% r"% script) pkg_resources in. ResolutionError: There is no script named 'Django-admin.py' martinssmacbook: bin martinspasov $ pip installation django = 1.6.4 I tried installing 1.6.5 but then when I try to start a project; Modules & gt file "/Library/Frameworks/Pyt...

vim - How to open a file from buffer in a split window? -

I have two files, file1.txt and file2.txt Added in buffer buffer I have currently opened file1.txt and I know that the command : b2 opens file2.txt buffer To But, I'd like to open file2.txt in the split window, which should be kept file1.txt . Is there a way to do this, like : vs file2.txt without using commands? I'm looking for a command running buffer. : sb2 buffer in a horizontal window Opens # 2. : vert sb2 Opens buffer # 2 in a vertical window. : tab sb2 Opens buffer # 2 in a new tab page. : sb 12 is : help: b SOA ?? | Try the following lines a little hard next time.

jquery - Show child-items of any ONE top menu-item and hide/slideup child-items of other -

Image
I have a small issue with the menu toggle. Below is a visual reference to the problem. Currently you can see that both the top links are visible. I need a child to see only one top link at any time. If a top link is clicked then the other should slip / hide their child's items. JS jQuery (document) .ready (function () {jQuery ('menu-item'). Click (function () {var position = JQuery (this) .position (); jQuery ('.sub-menu', this) .slideDown ('slow');});}); HTML - Sample structure of menus. & lt; Ul class = "menu" & gt; & Lt; Li class = "menu-item" id = "544" & gt; & Lt; A href = "#" & gt; Top link a & lt; / A & gt; & Lt; Ul class = "sub-menu" & gt; & Lt; Li class = "menu-item" & gt; & Lt; A href = "#" & gt; A link & lt; / A & gt; & Lt; / Li & gt; & Lt; Li class = "menu-item" & g...

jquery - dcAccordian issue on expand collapse in wordpress -

Hi there I am using the dcAccordion jquery file for my plugin menu I add an attribute to collapse and expanded Extend it to a file and make a condition for it and use the plus (+) sign (-) symbol for this. When I open the site for the first time, the sign is showing me on the parent menu, now if I click on the parent menu then the minus sign in the plus sign is converted, but when I use the child Clicking on the menu then signing in to Minus Sign Plus. Do not know what is happening. This is my code: Collapse / expand the attribute in the DCacordian file expandCollaps: true This is my position // Here is my position if (defaults.expandCollaps == true) {$ ('li.' + ClassParentLi, obj). Each (function () {var state = {collapse: '& lt; span class = "wpc-collapse"> (-) ', expand: '& lt; span class = " Wpc-expand "& gt; +) & lt; / Span & gt; '} $ (This) .find (' a '). first (). Attachment (state.expa...

c# - Saving a binary file in PDF format -

I am trying to save a Web API response which is in PDF file in PDF file. What I'm doing here: filestream fs = file Create ("API_response.pdf", 5120, file option.); BinaryWriter F = new binary-vaitters (FS); // ASCIIEncoding asen = new ASCIIEncoding (); Byte [] Ba = encoding.unicode Gatebates (response data); F.Write (BA); F.Close (); Fs.Close (); But when I am trying to open the API_response.pdf file it says that the file is damaged and it can not be repaired. This is the response I get from APIs and what I am dumping in the API_response.pdf file, % PDF-1.3% one Pound a ?? ? 1 obj is & lt; & Lt; / Creator (htmldoc 1.8.27 Copyright 1997-2006 Easy Software Products, All Rights Reserved.) / CreationDate (D: 20140725043937 + 0500) & gt; & Gt; Endobj 2 0 obj & lt; & Lt; / Type / encoding / differences [32 / space / exclam / quotedbl / numbersign / dollars / per / Ampersand / quotesingle / parenleft / parenright / asterisk / plus / co...

javascript - how to get around chrome mailto maxlength limit -

Chrome's mail list length is approximately 2000 characters. It sounds good but in fact it is only sufficient for English language because the length is calculated after the encodeur . For example, only for a Japanese character 'a ?? | ' The encodur ('a ??' ')' becomes "% E3% 81% A6", which is 9 characters long, so I only have around 2/2000 = 200+ Japanese characters in my mail content I can type it really very small. So is there any way to achieve this limit? Something like the setting of the Chrome plugin is acceptable. Edit I have finally decided to use a server side solution: To create a popup page emulate the mail client, Together, CC, Subject, Content as well as a Send Button After clicking the Send user button, the form will be submitted and the server will send the mail to the user It looks like a Microsoft Windows issue I have tried the following and works well with various browsers (Safari, Chrome 30 and 36, ...) on ...

loop checking checking in javascript -

I have several files to upload to a PHP page. Two of those that require that area are required To check out I wrote a JS in my JS, file type 1 & amp; 2 Essential types are: counting is the number of files to upload. (I = 1; i & lt; = count; i ++) for {if (file_type == 1 || File_type == 2} {found1 ++; }} When submitting found1 will be form submission as 2 . But there is a problem here that the required field '1' is being created as a flag value and twice as "code> 2 and form submission will be done. My requirement '1' is to be included in the form submission in '2'. How will this solve? This will work, but there should be better ways. upload file file, incorrect for file2Uploaded = (i = 1; i & lt; = count; i ++) {if (file_type == 1} {file1Uploaded = true;} And if (file_type == 2) {file2Uploaded = true;}} check if (file 1 upload and file2 upload) { // submit form}

Dynamic object method invocation using reflection in scala -

I'm looking to make a way of dynamic call logic based on the template id within the scale Then log on to template id 1, logic id 2 call logic b, etc. The logic will be varied but there will be only one input / output, in addition the number of different template IDs will be found in thousands and will not be known before time, hence a loose coupling seems to be the way to go. I have started to see the reflection to do this 2.11.1 And when I know the logic used for time, but it does not seem to be correctly understood to use the reflection For example, logging argument for example, entering template id 2 would be arguments. Below is a cut example that shows how the static version works and I'm still using the skeleton for the dynamic version. Import the package to scala.reflect.runtime. {Universe = & gt; RU} attribute {ext theMethod (x: string) = {println ("a" + x)}} {def theMethod (X: string): unit} // different logon organized in different object objec...

xml - Choose as value based on a selection -

If I have this XML input that I want to change: & lt; Money & gt; & Lt; Balance & gt; & Lt; Type & gt; & Lt; BalCode & gt; Family welfare & lt; / BalCode & gt; & Lt; / Type & gt; & Lt; Zodiac Ccy = "PHP" & gt; 4.00 & lt; / Zodiac & gt; & Lt; CreditDebit & gt; CRD & lt; / CreditDebit & gt; & Lt; Date & gt; 2013-08-19 & lt; / Date & gt; & Lt; / Balance & gt; & Lt; Balance & gt; & Lt; Type & gt; & Lt; BalCode & gt; OP & lt; / BalCode & gt; & Lt; / Type & gt; & Lt; Zodiac Ccy = "PHP" & gt; 5.00 & lt; / Zodiac & gt; & Lt; CreditDebit & gt; CRD & lt; / CreditDebit & gt; & Lt; Date & gt; 2013-08-19 & lt; / Date & gt; & Lt; / Balance & gt; & Lt; Balance & gt; & Lt; Type & gt; & Lt; BalCode & gt; CL & lt; / BalCode & gt; & Lt; / Type ...

c# - Image file copy, is being used by another process -

I am trying to create a user perfil edit window, this window has an image control - when I click on an image The file selected, it will show in this image control and will copy this file to my image folder, for the first time ok, but for the second time, it shows an error "The process can not access the file." : \ 1.jpg 'because it can be used by any other process Yes. " I think this is my image control using this file, so I do not know what I can do Private Zero Select_Click (Object Sender, RoutedEventArgs e) {OpenFileDialog od = New OpenFileDialog (); If (od.ShowDialog () == true) {string imageLocal = @ "C: /1.jpg"; File. Copy (od.fileName, imageLocal, true); Image1.Source = New bitmap image (new URI (image local)); }} If you want to load and display an image, and file the Keeping Responsible To work in the file system (such as reloading it or transferring it to another directory), the Uri constructor will not work because (as you say), t...

javascript - insert a js variable into a json object -

मेरे पास एक वैध json ऑब्जेक्ट है जिसे list_to_book_for नाम दिया गया है: {"Fold1-key1": {"name": "van antwerpen"}, "fold2-key2": {"name": "delporte"}, "fold3-key3": {"name": "Lallemand"}} मैं इस ऑब्जेक्ट में मेरी वैरिएबल की सामग्री जोड़ना चाहूंगा: "fold1": {"name": "बहुत पुस्तक" "आइटम": {}}, मैं आइटम में वैरिएबल सम्मिलित करना चाहता हूं, संभव है? यह संभव है, बिल्कुल var x = 'आपके आइटम'; Var obj = {fold1: {नाम: "बहुत पुस्तक के लिए", आइटम: {}}}; Obj.fold1.items = x;

Exception raised during rendering: TabHost requires FrameLayout with id "android:id/tabs" -

Image
I have a terrible problem with TabHost inside my application. Actually, I'm changing the name of all the IDs How should I do this alt = "Enter image details here"> Here's the whole top piece & Lt; LinearLayout Android: layout_width = "fill_parent" android: layout_height = "fill_parent" android: orientation = "vertical" Android: layout_alignParentTop = "true" & gt; & Lt; FrameLayout Android: id = "@ id / tabcontent" android: layout_width = "fill_parent" android: layout_height = "fill_parent" & gt; & Lt; / TabHost & gt; & Lt; LinearLayout Android: id = "@ + id / looks" Android: layout_width = "fill_parent" android: layout_height = "fill_parent" Android: orientation = "vertical" & gt; & Lt; / LinearLayout & gt; Change ID of TabWidget android: id Android: ID = "@Android: ID / tab" ...

Changing the locale of OK button in a MessageBox in InstallShield -

We have a basic MSI installer project. On a fixed communication, we verify the data provided by the user and Then use the message message () to throw the appropriate message. Now when the message box arrives, we want this message and an OK button. We have a problem wrt locale of this OK button when tested on English, French window 2008 machine, then we can get the OK button, where OK is in English when we are on a Spanish window machine If you use the same installer, the OK button comes with OK in Spanish. I did not know what is the reason for this behavior Any help / help would be very helpful. It is not clear from your question that you call the API, and in exactly the exact scenario. Note that for almost everyone, displaying OK buttons in the machine's "native" language will not be confusing, so problems arise during the QA process only. MessageBox API windows are localized for the same space as windows, on the contrary, to take a language parameter,...

javascript - addEventListener worked only for the first time -

I am using $ .post to load the registration form, the code below is loaded, its After this page uses XMLhtppRequest () to send form data and return response to the same page, Whenever the register button is clicked the first time, everything is working fine , But if I want to resubmit the form then any validation errors, the script is not working Rega and full page will be reloaded. & lt; Form & gt; & Lt; Input type = "text" name = "email" placeholder = "email" /> & Lt; Button type = "submit" id = "register" & gt; Register & lt; / Button & gt; & Lt; / Form & gt; & Lt; Script & gt; Var Handling Control Process = Event (Event) {event.preventDefault (); Event.stopPropagation (); //console.log ($ ("input.email") Val ().); Var data = new form data (document.forms.namedItem ("register")); Var Requests = New XMLHttpRequest (); Request.open ('Post', 'url her...

java - Does an ExecutorService get garbage collected when out of scope? -

I am asking this question because I am creating many executable services and I already have a memory leak There is a need to investigate, I think a recent change in the following code has really worsened, so I am trying to confirm what is happening: @ FunctionalInterface Public Interface BaseConsumer Consumer & Lt; Path & gt; {@ Override default accepts zero (last path path) {string name = path.jet filename (). ToString (); Executor Services = Exporter. NaveSinglethread Exclorator (runnable -> gt; thread thread = new thread (runnable, "document id =" + name); thread .SetDemon (true); return thread;}); Future & lt ;? & Gt; Future = service.submit (() -> gt; baseAccept (path); return tap;}); Try {future.get (); } Grip (Prerupted Pre-Probe) {Thread.currentThread (). Interrupt (); } Hold (Execution Exception) {new runtime exception (ex); }} Zero base acquisition (last path path) throws exceptions; } Then this consumer & lt; Path & gt; The...