Posts

Showing posts from July, 2010

java - How to find occurrence of a string in another string where it's not embedded into another word? -

I am trying to create a static method "indexOfKeyword" and return an index for a string where string is the other word Has not been embedded in. If there is no such incident then -1 will return. For example, string s = "In Florida, snowshoes do not create any interest."; String keyword = "no"; This will return 31. I think the only problem is not to find the next occurrence of the string keyword. What I've done so far: Public static integeroffkeyword (string s, string keyword) {s = s.toLowerCase (); Keyword = keyword.toLowerCase (); Int startIdx = s.indexOf (keyword); While (startIdx> = 0) {string = ""; = "" String after; If (startIdx> 0) {before ssubstring (startIdx - 1, startIdx); } Int endIdx = startIdx; If (endIdx & lt; s.length ()) followed by {s.sstring (startIdx + keyword.length (), startIdx + keyword.length () + 1); } If (((before ((before () (= "A") gt0 = amp; amp; amp; before.compareTo (

node.js - Laravel Homestead NPM Install Gulp no go -

I've updated NPM for the latest on Homestead template Laravel for Vagrant. I wanted to set Gulp in one of your directories, but on "NPM established" a directory I found it with package.json: NPM ERR! Unknown, mkdir '/ home / Hobo / address / SIP / node_modules / SIP imagemin / node_modules / imagemin / node_modules / imagemin-optipng / node_modules / optipng-bin / node_modules / bin- cover / node_modules / bin- version check / node_modules / Bin-version / node_modules / looks-version 'NPM ERR! NPM ERR! If you need help, you can report this error on: NPM ERR! & Lt; Http: //github.com/npm/npm/issues> NPM ERR! Linux 3.13.0-30-Generic NMP ERR! Argv "node" "/ usr / bin / NPM" "Install" NPM ERR! Node v0.10.32 NMP ERR! NMP v2.1.5 NMP ERR! Path / home / Hobo / address / SIP / node_modules / gulpimagemin / node_modules / imagemin / node_modules / imagemin-jpegtran / node_modules / jpegtranbin / node_modules / bin- cover / node_mo

ios - How do you display real time, time on UIView - Swift -

I'm trying to create an alarm clock app but I do not know how to display time in real time. Do I have to do such a program or use an object like UIDAte picture? I have tried to search for it but it is for purpose-c that I am not quite familiar with. If you have any questions, please comment them below below. var date = NSDate () var outputFormat = NSDateFormatter () outputFormat.locale = NSLocale ( Locale Identifier: "en_US") outputFormat.dateFormat = "hh: mm: ss" println (Outputformat.frfformadet (date))

python - If either needle in haystack -

I know that I can: If 'Hello World' Hello ': What if I had many needles (' .csss ',' .js ',' .jpg ',' .gif ',' .png ',' .com ') and I want to check whether one of these is in the string or not. (Note: ends will not do this in this case, they can not be the suffix) < Div class = "post-text" itemprop = "text"> You can find useful: haystack = 'hello world' needle = ['. CSS ','. If someone (Needles for a needle needle in needles): Pass # ... , '.jpg', '.gif', '.png' / Div>

python - Efficiently splitting a column of numpy array -

I have a CSV file with 5 columns, in which the second column time format 10/22/1414 : 00 I want to create another file with different data divided into different columns this time. I used the following code to split the column imported import loadex import import number as np time import stripteam file name = 'data / file.csv' data = loadtxt (File name, delimiter = ',', dtype = str, skiprows = 1) newdata = np.zeros ((data.shape [0], 7)) newdata [, 0] = data [, 0] In (lane (data [:, 1]): TM = striptime (data [i, 1], "% m /% d /% y% h:% m") new data [i, 1] = tmtm_yure New data [I, 2] = Tm.tm_wday newdata [i, 3] = tm.tm_hour newdata [,, 4:] = data [,, 2:] Is there a better way to use Numpy methods or other modules of python? You can reduce the generation of using the following three lines newdata : Data changes data time objects into strings: for D in the data < P> I think that you use from da toetime import datetime . Collec

java - Eclipse: change default file templates -

How do I change the default file template for new classes, interfaces, Java sealettes etc in Eclipse? I know that this is possible in any way, but I did some research, and have not got any information about it. Try Window -> Preferences -> Java -> Code Style -> Code Templates < / Em>. There you can edit existing code templates and even import new ones.

php - Can I import contents of a table into a Laravel seed? -

I have a team member who requires my complete database structure and content. / P> P> One option is to use a package like iSeed - which creates Laravel 4 migration and seeds based on existing database tables.

c++ - Cin failing to execute following the first iteration of loop -

I have a loop that can be used by the user for input using std :: cin In order to get the distance between the two longitude / latitude points, however, after the first repetition of the loop, fails to execute std :: cin and then to run before the loop Using the stored variable at # include & lt; Iostream & gt; #include & lt; string & gt; #to & lt include, cmath & gt; #to & lt include, sstream & gt; #to & lt include, vector & gt; #to & lt include, iterator & gt; using namespace std; Int main () {string start position; Int numDest; String arrowstart [3]; Gateline (pin, starting position); Stringstream ssinStart (initial position); Int k = 0; String airport = ""; While (ssinStart.good () & amp; amp; amp; amp; amp; amp; amp;; & lt; 3) {if (k & lt; 2) {ssinStart> & Gt; ArrStart [k]; ++ k; } And {string mid; SsinStart & gt; & Gt; Middle; ArrStart [k] .append (middle); Arrest [K]. Append ("&q

php - How pass variables for alternative if -syntax? -

& lt;? Php $ a = 3; $ Dir = '/ php /'; ? & Gt; & Lt;? Php if ($ a == 3) {? & Gt; & Lt; form action = "/ php / form.php" विधि = "पोस्ट" & gt; & Lt; p & gt; नाम: & lt; इनपुट प्रकार = "लेख" नाम = "नाम" /> gt; & lt; / p & gt; & Lt; p & gt; आयु: & lt; इनपुट प्रकार = "लेख" नाम = "आयु" /> gt; & lt; / p & gt; & Lt; p & gt; & lt; इनपुट प्रकार = "सबमिट करें" / & gt; & lt; / p & gt; & Lt; / प्रपत्र & gt; & Lt;? Php}? & Gt; मैं $ dir को फॉर्म एक्शन में पास करना चाहता हूं, जैसे कि कार्रवाई = $ dir.form.php यह संभव है? हाँ, संभव है कि आपको बस $ dir कार्रवाई करने की कोशिश करें & lt; form action = "& lt;? Php echo $ dir;? & Gt; form.php" method = "post" & gt;

r - Get eigenvalues for large dense matrix inR -

I have a large matrix (36169 * 36169), the formal class 'dgCMatrix' R package "matrix". I need the amount of eigenvalues, so I need to either detect eagenval or this matrix. I have tried to convert the matrix to the 'normal' matrix format in the form of asmatics (). , To be able to use matrix.tas (). When I try to convert the file, I get memory problems, I get an error message: The error code in the file 'Out of memory' .. / Core / Cholmode_memory c., The next step I search for methods of obtaining direct diagonal value (trace) for DGC matrix, I now know that the diagram signature in the matrix package ( X = "dgCMatrix"), with setMethod, but I have not been able to find an example of how to use it. Is there an example code here showing how it works or any other solution? Try it out: Library (matrix) set.seed ( 123) M & LT- (Matrix (rnorm (4), 2), "dgCMatrix" # Exam data amount (diagram (m)) [1] -0.48 99673

caching - CacheOutput Attribute Ignoring Azure-hosted Redis Cache -

I have yet to output caching of my ASP.NET Web API controllers to an Azure hosted radis cache. I have written a custom class that implements Strawal Web and calls equivalent stackexchange methods. It is registered as proven in cache output in global .asax.cs. Here is an example usage: Public class MyApiController: ApiController {Private const int FIFTEEN_MINUTES_IN_SECONDS = 900; [CacheOutput (ClientTimespain = FIFTEEN_MINUTES_IN_SECONDS, ServerTimespace = FIFTEEN_MINUTES_IN_SECONDS)] async Public Tasks & lt; Data & gt; GetAsync (integer param1, string paragraph 2) {return to GetExpensiveData (); } [Serialable] Public class data {// member left for comments}} When AP Andpo is called on, then I can see that the framework is correctly all my essentials Calling methods IApiOutputCache class is included, set up and receive However, even when a cached copy is found and returns, the GetExpensiveData () method always runs and returns the 'Fresh' data . No error

jsp - Servlet path "/" returns that servlet content for any request pattern -

When I mapped the servlet with the path like this: & lt ; Servlet & gt; & Lt; Servlet-name & gt; Home1Servlet & lt; / Servlet-name & gt; & Lt; Servlet category & gt; Com.project.servlets.Home1Servlet & lt; / Servlet category & gt; & Lt; / Servlet & gt; & Lt; Servlet-mapping & gt; & Lt; Servlet-name & gt; Home1Servlet & lt; / Servlet-name & gt; & Lt; URL pattern & gt; / & Lt; / URL pattern & gt; & Lt; / Servlet-mapping & gt; And then when I request a servlet from the browser via any other way: http: // localhost: 8084 / project / http: / / Localhost: 8084 / project / adh: http: // localhost: 8084 / project / why http: // localhost: 8084 / project / hell all these requests have the same home page content Why come back? How can mapping सर्वोलेट only for "path"? I am using ApacheTMAC 6.0.26, JavaEE 5.. The reference path is: / project If you want to map only se

linux - Unable to flash a Nexus 7[2012][Wifi] with the ANDROID PREVIEW SYSTEM IMAGE -

I was trying to flash the Nexus 7 [2012] [WiFi] with an Android preview system image that is < Available in / p> I follow the step-by-step instructions, but when I executed "flash-all.sh", it was not working, The following messages were found at the prompt: sending 'bootloader' (3911 KB) ... OKA [0.487] 'write' bootloader ... failed (remote: (invalid Tate): Total time spent: Reboot 0.715s in bootloader ... OK [0.025 S] Finished Total Time: Collection of 'recovery.sig' in 'boot.sig' collection in 0.075 does not contain 'system.sig' Do not include 'vendor.img' which does not include file system with parameters: Size: 14569963520 Block size: 4096 blocks per group: 32768 inodes in group: 8160 Inode size: 256 Journal block: 32768 Label: Block: 3,557,120 Block groups: 109 secured block group size: 11/889440 inodes and 97309/3557120 Blow Composed of 871 built-in file system standards with file system: Size: 464519168 Bloc

html - CSS bubble div Inverted Triangle image overlay -

I have a question with the inverse radius image overlay. I have made it from to codepen.io What do I want in my demo You can see that there is a bubble divide inside an image, a triangle appears on the right side of the image is. I should see this in the triangle in the picture. How can I do that someone can help me? CSS: .bubble {position: fixed; Width: 345px; Height: 235px; Padding: 0 pixels; Background: #FFFFFF; -Vibit-boundary-radius: 2px; -max-boundary-radius: 2px; Boundary-radius: 2px; Limit: # d8dbdf Solid 1px; -WebKit-box-shadow: 1px1px1px px rgba (216, 219, 223, 0.52); -MOZ-BOX-SHADOW: -1 PX1 PX1 PX0 PX RGBA (216, 219, 223, 0.52); Box-Shadow: 1px1px1px px rgba (216, 219, 223, 0.52); } .bubble: after {content: ''; Status: Completed; Border-style: solid; Threshold width: 10px 0 10px 10px; Border color: transparent #fff; Display area; Width: 0; Z-index: 1; Correct: -10 pixels; Top: 16px; } .bubble: {content: ''; Status: Completed; Border-style: solid;

compare first column of two altenative lines and if match then check which value is greater in column 2 of two lines and print max one line using awk -

इनपुट: anil 14 anil 25 उमर 78 उमर 13 उमर 06 अमृत 06 amritha 25 Amritha 17 आउटपुट: anil 25 umar 78 amritha 25 कैसे एक एकल awk का उपयोग कर इस आउटपुट पाने के लिए आदेश? कृपया इस बात का सम्मान करने में मेरी मदद करें। यदि आप सबसे बड़ा मान चाहते हैं, तो यह कोशिश करें awk awk '{a [$ 1] = $ 2 & gt; एक [$ 1]? $ 2: एक [$ 1] } 'फ़ाइल amritha 25 umar 78 anil 25

C++ less operator -

I am getting this error: Error 1 error C2678: binary '& lt ; ': No operator found which takes a left hand operation type' const data '(or no acceptable conversion) but my struct is defined like this: < Pre> structure data {string strudata; Int intData; Double DoubleData; Data (): InteData (-1), DoubleData (-0.F) {} Data (Const String and String, Int I., Double D): Stradata (ARR), InteData (I), DoubleData (D) The Bull Operator & lt; (Constant & amp; Rewardata) {Return strData & lt; RightData.strData; }}; I think I have '& lt;' Operator, though the compiler tells that I do not mention one thing, now I am comparing the const data ; data type, maybe const does something bad I think that this is just a small mistake, but I can not see it ... You should: Bull Operator & lt; (Constant & amp; rightData) Const {return strData & lt; RightData.strData; } and string class also requires an operator, i

processing - Trying to make a paintbrush effect for my drawing app, but it starts too thick -

As part of my curriculum, working with a target running on my Nexus worked with a drawing app in processing is. However, when this code first shows the paintbrush effect for the brush, but the weight of the line is not properly reset, the next line always starts very thick, any help would be very commendable. What I have done so far float max = 6; Float thickness = 1; Zero setup () {size (500, 500); Smooth (); Background (255); } Zero draw () (if (mouse is pressed) {if (thickness> max) {line (mousex, macie, PMUX, PMU Y); StrokeWeight (thickness); Thickness = thickness + 0.25; } Other {line (mousex, macie, PMYSEX, PMU Y); StrokeWeight (max); }}} Zero mouse relayed () {thickness = thickness / thickness; } As the program runs from top to bottom, you get a strokewhite ( Thickness); line () before , then it draws the line with the appropriate thickness . Just change this order and you are good. float max = 6; Float thickness = 1; Zero setup () {size (500, 500); Smoo

jquery - Parse XML with javascript from url -

Hello, I am making a start in JavaScript, For a project, With XML file, I am using Zacry. How can I open XML by my URL? var xml = "Fichier.xml", xmlDoc = $ .parseXML (xml), $ xml = $ (xmlDoc), There is an error on the line xmlDoc = $ .parseXML (xml), : invalid XML: test.xml (error 0) In your case, you expect a valid XML content as your argument. You have a URL that is not a valid XML, so you're getting the error. What you can do, use it to load remote content and its success can be processed in your callback var xml = "Fichier .xml "; $ .get (xml, function (doctor) works with {var $ xml = $ (doc); // $ xml}, 'xml');

java - Open client's desktop application from web page link -

It is possible to launch client-side desktop applications such as Adobe Reader, any game or other soft-goods / Strong> from the web? I got a link Where one of them gave way to open Notepad (desktop applications) using javascript, which is limited to IE. In the same way, I want to create such links on my web page so that users click on the link like for example, if the user clicks on the link then " Adobe Reader "Then the Adobe Application should open / launch. Is there any way to open any desktop application from the Web? I have come to the signed applet concept, where we will sign the web page from the web page using the tag, & amp; Inside Applet will call desktop applications By using the applet method, I have created a signed applet, & amp; I am able to open the Notepad application by providing the path directly in the applet: process process = new processbler ("C: \\ Windows \\ notepad.exe"). But how can I do this in the ge

php - Maintain order of records after soft delete -

I have created a soft deleted system for a table that contains the following columns: Sample data (3 rows): 1 section Dd1x1 - ID (Auto increment 1) - Category - Title - Is_Deleted - Timestamp (Created) < P> Sample data (3 rows) 0 2014-10-24 18:41:54 2 Logistics L2x14 0 2014-10-24 16:55:27 3 Transit T4 These 3 2014-10-24 17:09:27 < / Code> Also work on soft delays while updating a record Are ready for. (business requirement). If I update "department data" from "department" then I do this with: update categories_most SET Is_Deleted = 1 WHERE id = 1; Enter the categories _ most recent (Category, Title, Encoded) values ​​('Department Data', 'DD1x1', 0); This code works fine, but when I display this data in the frontend, it changes the order of the records due to the order of the ID The only way to think about getting around it is to have an extra column with any type of "order" variable, which must be sorted

osgi - Remote Declarative Services In Equinox -

I am trying to provide a remote declaration service using Eclipse ECF. In the definition of service provider component, I have set the following attributes: service.exported.interfaces = * service.exported.configs = ecf.generic.server ecf.generic.server.id = Ecftcp: // localhost: 3787 / server However, how can the service be searched from the consumer side using these properties. (I want to be able to provide service from a osgi environment and search it from any other osgi.) Discovery will run automatically if you have specified "service.exported.interfaces" To work for it, you need to install the ECF search bundle in both your targets. Above this, you have to choose a search provider. Like SLP, JmDNS or Zookeeper Please note that some search providers need additional features to run correctly. For example, if you have a double network, then you have to specify in JMDNS provider on which to search the network. Ensure that the ECF distribution bundle has s

SSL laravel forge in default site -

I have read up to set up SSL for my Larvel site. I did not read everything (oops), and did not remove the "default" site. I have generated CSR from the default site (but with domain for example.com) now I have a certificate and I used to do it through Laurel Forge Installed, but it does not work: (browser / curl) can not connect to does not redirect to https /var/log/nginx/default-error.log I have nothing at nginx again Initially the Here are my / etc / nginx / sites-available / default file content: server {80; #server_name Default; Server_name example.com www.example.com; # Return 301 default $ request_uri; Return 301 https: //example.com$request_uri; } Server {443 SSL; #server_name Default; Server_name example.com www.example.com; Root / home / forge / default / public; #forge ssl (do not reply!) Ssl_certificate /etc/nginx/ssl/default/XXXXX/server.crt; Ssl_certificate_key /etc/nginx/ssl/default/XXXXX/server.key; Index index index.htm index.php; Chars

c# - Method call based on Bool without if statements -

Preparation of a title was difficult, however, I would quickly explain my current options and hopefully someone gave me this Can tell a neater method to work The first "quick" solution was we. public square test {use public hair = some wrong; Use of Public Bunds Group Esee = false; Public Bull Usage Other = false; Public Zero MyMethod (if (UseSomething) {if (UseSomethingElse) {if (UseAnother) {// UseSomething, UseSomethingElse, UseAnother} else {// UseSomething, UseSomethingElse}} else {// UseSomething}} else if (UseSomethingElse) {If (UseAnother) {// UseSomethingElse, UseAnother} else {// UseSomethingElse}} // etc ...}} Now this was an ugly solution in my opinion And really got destroyed quickly, especially if you wanted to add options So I quickly came up with another solution as follows: Public class Test {use public boole Something = false; Use of Public Bunds Group Esee = false; Public Bull Usage Other = false; Short Options = 0; Public Zero Init () //

Time format in SAS HHMMSS -

एसएएस ईजी 9.3 में निम्न प्रोग्राम मुझे निम्नानुसार परिणाम दे रहा है: डेटा काम .header; गणना = '"A00",' || '"399",' || '"नोम",' || PUT (DATE (), yymmddn8।) || "," || डाल (समय ()), hhmm8.2); भागो; "ए 0" हालांकि मुझे समय लगता है कि "100345" जैसे एचएमएमएमएस? किसी भी मदद की सराहना की जाएगी। उपयोग करने के लिए प्रारूप है TIME8। , जो आपको एच एच: एमएम: एसएस उदाहरण के लिए डाल (समय (), time8।); देता है: 10:46:40 इस से बृहदान्त्र हटाने के लिए, आपके पास स्ट्रिंग फ़ंक्शन का उपयोग करने के लिए, मैं निम्न के लिए जाता हूं: संक्षिप्त करें (डाल (समय (), समय 8।), '', 'Dk'); जो केवल संख्यात्मक वर्ण रखता है, दे: 104640

regex - Perl regular expression - lines must contain ADFHKMPRTWCEGILNQSVY and nothing else -

After the Someone can help me - I need to match a regular expression only lines containing the letters ADFHKMPRTWCEGILNQSVY more. Nothing else I need a loop through the lines of text that will look like this: & gt; Gee 46450118 | Gb AAS96767.1. Women with a family of proteins [Desflibrio Vlgaris unstar Hildenborough] MVDLSRKKTQALLPTDILFQTPYWAQVKTRLGMESHAFDIRSSGPWGDVLVLLRRFGRHRVAIVPQGPEV APPHEDYGVYLESFSLALAEGLGPDVAFIRYDLPWVSPYADEMHDEGWNAFPEARLRELRMNMGTRHWNL RKSFQDLTVASSLVVDITGEEAAVLERMKPKTRYNIGLARRKGVAVREVGRESLPQFHALYRQTAIRNGF EPCSITHFSAMFHALCDGAGSTELLFLLATHGTDILAGCIVGLAGRTANFLYGASGNVKRNLMAPYLMHW TAMCHARDRGCHDYEMGAVPPGHDPAHPFHGLYRFKTGFGGRVALRSGSWDYPLDHAAYRDFCNAESLYR TDAAPGRTQ & gt; Gee 46450117 | GB AAS96766.1. Iron-sulfur proteins Kuf [Deslfovibrio Vlgaris Straw Hildenborough] MNHEELFVIQAEAEKCRACRKCELACIASHNNLTIKEAAKKRTVFAPRVHVVKTDEVKMPVQCRQCKDAP CARVCPTRALVQDDGVVTMRAQFCAACRLCIMACPYGAISLSFIGLPEEDEAGAMHGREVAVRCDLCSEW RAREGKSSCACVEACPTKALHMVPLAEARGRHQ & gt; Gee 46

asp.net mvc 3 - What steps are involved in moving mvc 3 application and associated database to new servers? -

We have a related database deployed on a MVC 3 application and rental server. Now I have to host both on my home server. Do anybody want me to direct it towards a detailed link or know the steps involved? It will be completely new to me as I originally came to the project after being deployed. I believe that we currently need to set two servers with a space similar to the user, where the connection string is necessary ... but unfortunately, I am sure that much more is ?? Thank you.

datetime - CalendarExtender doesn't work correctly in Asp.Net -

मैंने aspnet में पाठ बॉक्स के साथ CalendarExtender का उपयोग किया & lt; एएसपी: पाठ बॉक्स आईडी = "txtDateTime" textmode = "समयदिनाँक" runat = "सर्वर" & gt; & lt; / एएसपी: पाठ बॉक्स & gt; & LT; ajaxToolkit: CalendarExtender आईडी = "CalendarExtender1" runat = "सर्वर" TargetControlID = "txtDateTime" स्वरूप = "जी" एनिमेटेड = "सही" PopupPosition = "right" FirstDayOfWeek = "सोमवार" & gt; & lt; / ajaxToolkit: CalendarExtender & gt; मैं पाठ बॉक्स के मूल्य के लिए वर्तमान दिनांक और समय सेट Page_Load घटना पर: txtDateTime.Text = DateTime.Now.ToString (); उसके बाद, कैलेंडर एक्स्टेंडर सही ढंग से काम नहीं करता है। कैलेंडर फ्रेम पूरी तरह से सफेद हो जाती है , क्या आप मेरी मदद कर रहे हैं कि समस्या क्या यहाँ है & lt; एएसपी: पाठ बॉक्स runat = "सर्वर" आईडी = "txtDateTime" ValidationGroup = "ModalPopup" & gt; & lt; /

android - Index 2 requested with size of 2 -

I'm a newbie for Android development and here is my first project in the Gridview database. I sqlite I am using database db file this is my code Please help me !!! !! Expands the main activity activity of the public class (overwrite public zeros on SQLiteDatabase mydb; Grid view data; @Create (bundled saved instance) {super. ); SetContentView (R.layout.activity_main); Data = (Gridview) Find VVBIID (RIDGrid View 1); List of & lt; string & gt; Li = New Arreelist & lt; string & gt; () ; ArrayAdapter & LT; String & gt; DataAdapter = New Array Adapter & lt; st Ring & gt; getApplicationContext (), android.R.layout.simple_spinner_dropdown_item, li); dataAdapter.setDropDownViewResource (R.layout.activity_main); try {mydb = openOrCreateDatabase (getString (R.string._sdcard_sales_db), MODE_PRIVATE, null) ; Cursor CR = mydb.rawQuery ("select from users", blank); if (ver! = Tap) {if (cr.moveToFirst) {do {string desc = cr.getString (cr.getC

java - Is it possible to write a batch file to assign shortcutkey to a .jar file in Windows -

As explained in my question, yupp, I'm looking for this one yes / no answer, if possible Do I have a way to do this? Actually, I know about the thread "", but the shortcut keys suggested by NIRCMD in thread are not working, so I am looking for an option to do this. To clear note that I know how to manually click and set a shortcut key in Windows, but I am looking for CMD Line or .bet path :) Thanks! The advice is :) Thanks in advance! You can call it directly cmd.exe command (without third party tools) You can not use it, but for this you can create a small VBScript script. Shell interoperability is in the ActiveX object and the method you require is: shell = new ActiveXObject ("WScript.Shell"); Link = Shell.CreateShortcut ("Shortcut file name .lnk"); Link.TargetPath = "Path to Your Program"; Link.Arguments = "Programmable Logic"; Link.Description = "Shortcut Details"; Link.hotkey = "CTRL + SH

javascript - How to pass data in a button event handler on a Google script extending a spreadheet? -

expand a Google spreadsheet, I run a script showing some data in a sidebar. Below, I want to add a button to match the data. However, I can not understand how the data handler of the button across this: no possibility to have data in the event of a call; event is no way to get the button object information, I can only get ID, which is useless if I can not get on UI Instrens manufactured outside handler function). So what's the trick? You callback element (possibly a panel which requires you everything wrapping) server handler button You must add before specifying. For example: function myFunction () {var app = UiApp.createApplication (); Var panel = app.createVerticalPanel (); Add.it ('a'). AddItem ('A') (app.creativebox). AddName ('boxExample')) Add (app.createListBox (). SetName ('listExample'). AddItem ('B')); // ↓↓ This is what you need ↓↓ var handler = app.createServerHandler ('callbackFunction'). AddClallEl

Dynamically adding rows to table through jquery -

I'm trying to add new rows to the table when I click on a button. While doing so, my new line is wrapping in the first column of the already existing row $ ("AddEntry") ("click", function ($ {"(" #momTable "). Endend ('& lt; tr class =" newRow "& gt; & lt; td style =" width: 20px; "& gt; Input & lt; td & gt; 2 & lt; td & gt; Input & lt; td & gt; input type =" text "class =" owner input active "name =" Activity "value =" "& gt; & lt; / td> & lt; td & Gt; & lt; Input type = "text" class = "project name" active "name =" projectname "value =" "& gt; & lt; / td> & lt; td & gt; & lt; input type = "Text" class = "field active input" name = "field" value = "" & gt; & lt; / td & gt; & lt; td &

c++ - MPI_Comm_size always returns 1 on Code Blocks -

I have the tutorial below for executing the MPI on codeblocks If I execute the simple MPI code tutorial, I always get 1 for MPI_Comm_size. How do I get more sources than the code below? #include & lt; Iostream & gt; #include "mpi.h" #include & lt; String & gt; using namespace std; Int main (int argc, char * argv []) {int my_rank; / * Ranks of process * / int no processions; / * Number of processes * / int name sequence; / * Name length * / four computer name [MPI_MAX_PROCESSOR_NAME]; MPI_Init (& amp; argc, & argv); / * Start determines the size of the group associated with MPI * / * * / * Communicator * / MPI_Comm_size (MPI_COMM_WORLD, & NO Processes); / * Communications * / MPI_Comm_rank (MPI_COMM_WORLD, & my_rank) determines the rank of calling process; / * Processor Name * / MPI_Get_processor_name (Computer Name, and Name Seize); Printf ("% d processor% d on% s process \ n", my_rank, noProcesses, computerName); MPI_Final

jquery - How to make a website load only a certain div(class) to save load time, using JavaScript -

Is it possible to load only a certain device for me If any link is clicked on the page, then I want the whole page to be the same except by leaving that part of the page using Javascript, in a sliding transition should be there. I tried to search it on Google but it did not help me because I am very poor in javascript. Please help, thank you! This is the most common and perhaps the best way to do this with Ajax though I have a different solution It can not be the best but it works, and this answer is no server required it will use jQuery and a plugin called a plug-ins called bicycles will be called malshup. Instead of using images on the plugin, you can use the div in which your content may be included then use your link as a pager. There is a minimum level of style: HTML & lt; Div class = "container" & gt; & Lt; Div class = "contentbox" & gt; About content & lt; / Div & gt; & Lt; Div class = "contentbox&qu

xcode6 - Shortcut to make an action in xcode -

Let me type it into ';' There is a lot of need to click the option of the end of the line where it is required for this, when I ";" Press First of all, press "shift + enter" at the end of the line to automatically create a "shift + Enter +; " I can do / can do anything for the combo; Open the encoded from the menu bar -> select the Preferences key binding, then press the key bindings ?

html - Set data attribute as unique with jQuery -

मैं अब तक काम कर रहा हूं यह है: $ ("। PhotoWrapper img" ) .attr ("डेटा-वस्तु", "0"); मैं जो तत्व चुन रहा हूं उसे मान निर्दिष्ट करने में सक्षम हूं; मैं क्या नहीं कर सकता 2-500 छवियों के पास 2-500 का मान है दूसरी छवि में 2 का मूल्य होगा, तीसरे के पास 3 होगा, आदि। कोई भी मदद काफी सराहना की जाएगी। आप अपने प्रश्न को बहुत खराब परिभाषित कर सकते हैं। मुझे लग रहा है कि आप सिर्फ डेटा-मद संख्या चाहते हैं जो ऊपर की ओर गिना जाता है, इसलिए केवल सभी के माध्यम से लूप और पाश का उपयोग करें वे छवियां जिन्हें आप डेटा-वस्तु को असाइन करना चाहते हैं। var images = $ ("। PhotoWrapper img"); के लिए (var i = 0; i & lt; images.length; i ++) {$ (छवियाँ [i])। एट्र ('डेटा-वस्तु', आई); } JSFiddle:

Implementing live video android streaming with wowza -

I'm trying to implement live video streaming with Vowja but I have a problem with video quality. I am using When I use this code it works fine mSession = sessionBuilder.getInstance () .setContext (getApplicationContext ()) .setAudioEncoder (Session BUILDER .UDIO_AAC) .setAudioQuality (New Audioquake (8000, 16000)). SetVideo Encoder (Sessionbilder.VIDEO_H264) .SetSpace View (mSurfaceView) .setPreviewOrientation (0) .setCallback (this) .build (); The video resolution I have is 172 x 144, but when I try to set up another resolution, mSession = sessionBuilder.getInstance () .setContext (GetApplicationContext ()) .SetAudio Encoder (session builder .uido_ac) .SetAudio property (new audioquisition (8000, 16000)) .SetVideo Encoder (SessionBilder. VIDEO_H264) .setVideoQuality (new videoquizion (320,240,20,500,000)) .Setface View (mSurfaceView) .setPreviewOrientation (0) .setCallback (this) .build (); When I try to shot with Samsung Galaxy S3, it is not working on some devi

javascript - Textarea is not getting focus when modal jQuery UI dialog has opened -

When I try to click on textarea with id "customNotepad" then this focus is not happening when using the UI dialog has been opened. However, I am able to resize the texture When I click the div with the ID "Header" it is also giving a warning. #customNotepad {z-index: 1002! Important; Position: Absolute! Important; } #notext {z-index: 1000; } & lt ;; Doctype html & gt; & Lt; Html lang = "en" & gt; & Lt; Top & gt; & Lt; Meta charset = "UTF-8" & gt; & Lt; Title & gt; JQuery UI dialog - default functionality & lt; / Title & gt; & Lt; Link rel = "stylesheet" href = "// code.jquery.com/ui/1.11.2/themes/smoothness/jquery-ui.css"> & Lt; Script src = "// code.jquery.com/jquery-1.10.2.js"></script> & Lt; Script src = "// code.jquery.com/ui/1.11.2/jquery-ui.js"></script> & Lt; Link rel = "stylesheet" href = &qu

maven - build.gradle - error deploying artifact -

I'm having problems with publication in the local Nexus Maven repository. I agree, there is considerable experience in using T. I would say that I have tried to understand the credibility and the examples which have been given through the Gradual website (with some stack overflow questions). I get the following error when I try to publish: The execution of the operation has failed: publishMavenPublicationToMavenRepository '. & Gt; Publishing 'Maven' Repository 'Maven' & gt; Error in publishing artifact in 'com.myproject: myproject-sdk: jar' error: error in deploying artifact: resource not found: file: http://git.site.com:8081/nexus / Content / repositories / releases / com / myproject / MyProject-sdk / 3.0.0 / myproject-sdk-3.0.0.jar does not exist The entire build.grill file looks like this Is: Apply prefix code: Apply 'java' plugin: Apply 'maven-publish' plugin: 'build-version' buildscript {repositories

c# - Is it possible to do Multi threading of Unit Tests? -

I have some 500 units of test. And as soon as it is started, a service is prepared there. Currently a single service is created and used by all trials. I want to apply multiple threading to them, like all 500 tests will run simultaneously. And if one of my threads (testing) is entering the service then it should not affect the second test service. Is it possible to do this or should an independent service be created for each of my threads I am using C # and Visual Studio 12. I may be very vague with the question, but please enter your answers. Provide at least any useful links. Good unit testing should not be shared with state resources (about your example, someone It may be astonishing that if there is a state service that you can "enter", it is a good idea in the first place). If you follow that approach, then you should not have any problem in running your tests in parallel, because most modern test runners allow you to do it.

c++ - include class and compile with g++ -

I am the first in C ++ and working with Unix. So my question is I have written a few lines in the main function, and I need the function, which is defined in the c_lib - library. main.cpp: #include & lt; Iostream & gt; #include "c_lib.cpp" int main () {Return 0; } I want to execute it on the terminal, so I wrote g ++ -c c_lib.cpp g ++ -c main.cpp G ++ -o run C_lib.o main.o To this point, there are no error reports. Then . / Run I get an error Error: ./run: Any such file or directory That's wrong? with a .cpp is usually not done, usually only Headers are included. Headers usually have announcements that define the interface code in the second .cpp Can we show us the source of c_lib? It can be helpful. The source of c_lib is #include , there is no need to compile it separately. In fact it can cause errors / (first of all to come to mind many definitions). All you need to do is: In this case, g ++ -o run main.cpp to

javascript - Generating all possible binary combinations in words ('true' 'false') performance -

I see the performance improvement of the script below. I am pretty sure that it can be modified to a great extent, I did it because it was the first thing that came to my head and it is only for the performance which I am seeing. function pad Nn, width, z) {z = z || '0'; Nn = nn + ''; Return nn.length & gt; = Width? Nn: new array (width - nn.length + 1) .join (z) + nn; } Var makeIntoBinary = function (ii, length) {return pad (ii.toString (2), length); } Make makeIntoTrueFalse = function (binary) {var str = ''; (Iii = 0; iii & lt; binary.length; iii ++) for (if (binary [iii] == '0') {str + = 'false';} Else {str + = 'true'; }}; Console.log (str + "+ + binary);} Var runner = function {n} {var iter = Math.pow (2, n); for (i = 0; i ; iter; i ++) {makeIntoTrueFalse (MTN)}}} I want to generate a set of words for all possible combinations which are basically binary above (< Code> Runner (2); false false , false tru

Android: show this screen on start up checkbox? -

इस सवाल का पहले से ही एक उत्तर है: < / P> 1 उत्तर मेरी मुख्य गतिविधि स्क्रीन पर ऐप लॉन्च होने पर लॉन्च किया जाता है, ऐप कैसे काम करता है, आदि के बारे में मेरे पास कुछ विवरण हैं, और उपयोगकर्ता "चलो शुरू" पर क्लिक करता है - जो प्राथमिक एप्लिकेशन गतिविधि स्क्रीन में कूदता है। मैं एक चेकबॉक्स प्रारंभिक स्क्रीन पर "स्टार्टअप पर इस स्क्रीन को दिखाएं" लेबल के साथ, और चेकबॉक्स डिफ़ॉल्ट रूप से चयनित होता है यदि उपयोगकर्ता इसे अचयनित करता है, अगली बार ऐप चलाया जाता है, यह स्क्रीन को छोड़ देता है और सीधे प्राथमिक एप्लिकेशन स्क्रीन पर जाती है। यह कैसे करना है पर कोई सुझाव? ऐप आपके डिफॉल्ट चेकबॉक्स से शुरू होता है और साझा प्राथमिकताओं से प्रारंभिक चयन लोड होने पर आप एक चेतावनी दिखा सकते हैं। (उदाहरण के लिए, एक "झूठे" ध्वज) जब उपयोगकर्ता चयन को बदलता है, तो साझा मूल्य को फिर से साझा करें। ("सच" में बदलें) इसके बाद, उपयोगकर्ता साझा किए गए मान से sharePreferences से स्ट्रैटअप पर डायलॉग नहीं देख पाएंगे। साझा मूल्य से आपके मूल्य क

c++ - Message is highlighted in blue in Modal box in VC++ -

We are using the code to populate the messages in a dialog box, when the message appears, the message blue Highlighted in - like we chose the message using the mouse. I want this message to not appear when it appears. Anyone can help me on this issue CDialog :: Onintiology (); CFont * m_pFont = New CFont (); LOGFONT LF; Membrane (& amp; lf; 0, size (LOGFONT)); Lf.lfHeight = 16; Lf.lfWeight = FW_BOLD; Strncpy_s (lf.lfFaceName, "Arial", 6); M_pFont-> CreateFontIndirectA (& amp; nbsp;); GetDlgItem (IDC_EDIT1) - & gt; SetFont (m_pFont, true); M_message.SetWindowTextA ((LPCTSTR) message); Return TRUE; Whenever the edit box becomes the selected item, the selection will be set to all text . If the editing box is the first in the tab order, or if you click on tab or click on it, then all the characters are selected. You can override this behavior by capturing EN_SETFOCUS event and resetting itself: void CMyDlg :: OnEnSetfocusEdit1 () {m_edit1.SetSel (

angularjs - How to change a div when a link is clicked and show its content -

I need to change the contents of that div when I change a div in a page and click a link. I want to do this with angular. For example I have 3 link views 1 scene 2 and 3 view. These 3 links are shown in 3 HTML files, see 1.html, View2 and View 3. Html which holds different content in each of these files. When I click on link view 1, I have to load the view1.html page content in a div. (Dynamically loading the page without changing other content), and when view2 is clicked, view2.html is clicked, it should be loaded Div.How do I do? If I use NG-View, it will load a full page. Do I Need to Use NG-Click? If so, how can I do this? Please explain .. do i need controllers? If so give me an example: ( you use ng-include Can see the demo here & lt; a href = "" ng-click = "template = 'view1html'" & gt; 1 view & lt; / A & gt; & lt; a href = "ng-c lick =" template = 'view 2.html' "& gt; 2 refer & lt; /

ios - Order NSArray with objects -

मैं एक NSDictionary निम्न डेटा के साथ: (एलएलडीबी) सब फ्राइड्स {71685207018702188 = {आईडी = 71685207018702188; नाम = "माइकज़िरी"; उपयोगकर्ता नाम = mi; }; 93374822540641772 = {id = 93374822540641772; नाम = "एलन वीक्लिप्स"; उपयोगकर्ता नाम = zuka; }; 96553685978449395 = {id = 96553685 97844 9395; नाम = "मोनिका वेक्लीप्स"; उपयोगकर्ता नाम = अमोनीका; }; 96556113096345076 = {id = 96556113096345076; नाम = जेवियर; उपयोगकर्ता नाम = ब्रैंको; }; 97017008427632119 = {id = 97017008427632119; नाम = "डायरियो वेक्लिप्स"; उपयोगकर्ता नाम = तारजान; }; } मैं नाम पर आधारित इन ऑब्जेक्ट को सॉर्ट कर रहा हूं, यदि उनके पास नाम नहीं है, तो मैं इसका उपयोग करूँगा उपयोगकर्ता नाम । कि, मैं एक नया NSDictionary नाम और आईडी बनाने ऐसा करने के लिए और विधि के अंत में मैं उन्हें नाम के आधार पर सॉर्ट । उन्हें सॉर्ट करने के लिए कोड निम्न है: - (NSArray *) ऑर्डरफ्रिएर्स {NSMutableDictionary * newFriendsDict = [[NSMutableDictionary alloc] init]; के लिए (इंट आई =

javascript - Google CSE X-frame-options -

I am trying to create a custom search for a website. I currently work as a web dev to maintain many sites. It was recently brought to my notice that there was a problem on the search page, which did not result in the result properly. I looked at it and the person who originally created the site was found in a copy from an existing site, then the Google search string (cx called in it in Google Docs) was pointing to the wrong one (Olde Site). So I went to Google and created a new custom search engine and just changed the old CX value. Apart from this, all the codes are the same I provide JavaScript to you by Google and the API is not directly. Javascript generates an iframe in a predefined device and it is said that iframe embeds the search results. The problem is that Google X-frames-option is sending the same original response. I checked other sites and the only difference is that these sites have a CX stir. Their all search functionality works just fine. How do I fix this so much

linux - cannot login to my aws spot instance even though it is running -

I can not enter my aws spot example though it's running. I can not access my data via SSH or SQL I know that my pim key works for other examples, so this is not an issue with the Paid Key. ssh -i my_pem_key.pem ubuntu @ my_dns_name and I get permission denied (publisher). What can I do to retrieve my data in the ongoing spot instances? I tried to create an image of an example (AMI) and logging in the new instance, but he did not even work. There may be some things here. Have you tried the following? Make sure the security settings on your instance are set to use the same PEM credentials Verify the DNS or IP address of the server connecting correctly Trying From Amazon Docks: Verify that you are connecting with your appropriate username for AMI. Enter the user name in the host name box in the PuTTY configuration window. For an Amazon Linux AMI, the user name is ec2-user. For an RHEL5 AMI, the user name is either root or ec2-user. For a Ubuntu AMI, the

Excel Hyperlinks stop working intermittently -

Currently working with macros in an Excel 2010 spreadsheet, and hyperlinks to other cells / tabs in the same document (a topic Page linking for other sheets). Hyperlinks work for a short time (maybe a day or two) without any problems, but hyperlinks will not work if the file is reopened. Hovering over a hyperlink cell gives you a file tip that has a file path and file name but it seems that the sheet and cell reference is lost. Did anyone else have to face it and got any solutions? Thank you.

linux - Setting up ACL permission - creating new directory applies wrong filter (default problems) -

When I run down I get ACL settings below. The problem occurs when I make a new directory for some reason For the default ACL parameter new DIR AppUser1 @ r01mgt: ~ $ hadoop fs -getfacl / somedir / # file: / somedir # The owner is not being passed: Owner # 1 group: Group 1 user :: rwx group :: rx group: group 2: rx group: group 3: arvwex mask :: rwx other :: Rx Default: User: RWX Default: Group :: Rx Default: Group: Group 2: Rx Default: Group: Group3: rwx Default: Mask :: RWX Default: Other :: RX - CREATE new dir AppUser1 @ r01mgt: ~ $ Hadoop fs-getfacl / somedir # file owner: owner # 1 group: group 1 user:: rwx group :: rx group: group 2: rx group: group 3: rwx # effect: rx mask: : RX Others :: Rx Default: User: RWX Default: Group :: Rx Default: Group: Group 2: Rx Default: Group: Group 3: RWX Default: Mask :: RWX Default: Other :: Rx Does anyone know That's why my group: Group 3: RWX becomes effective RX? And why does my Mask R-X? Is this due to Umask? see <

java - How to get the real display size in Android -

I try to get the dissection size (in Java-class) in Android. I used methods: display.getSize (size); Display.getRealSize (size); But a correct result for both the width comes back but the height is high, is there any suggestion, why do I get the wrong result? Try Grace, Andre : < Code> display meticode dm = getResources (). GetDisplayMetrics (); Int w = dm.widthPixels int h = dm.heightPixels Hope this helps.

ivy - gradle adding -source.jar to war -

I am in the process of converting several projects from ANT + IV to Gradle. One of the projects ( address / code>) produces a simple jar to be included in a webapp. I have established the build.gradle to publish a personal java and a source jar. Address / build.gradle Excerpt: Apply plugin: Apply 'Publication' plugin: 'IV-Published '[... link ...] Work source jar (type: jar) {SourceSets.main.java classifier "source"} {Repositories {ivy {url' http://dev.example.com/ivy/ ' Layout "pattern", {artifact "[organization] / [module] / [type] s / [artifact] - [amendment] [code] I published it with [Ext] "}}} Publications {Ivy Enlightenment} {components.java from Artifact (sourceJar) {type" source "}}}} Crowley published It may result in jar on my webapp: compile 'com.example: address: 1.0.0' I have a problem This is that when I do gradlew build on the webapp, the web-INF / Lib address-source

Can't get Google App Engine OAuth2-sample (for Python) to work - 400 Error: redirect_uri_mismatch -

This question is already an answer here 23 answers I use OAuth2 I need to do it through app engine and Python because Google offers sample-code, making the process easy: It should be simple; Just download the file, set the application name in app.yaml and id / hide in client_secrets.json. Then run / upload through Google App Engine Launcher. Error: redirect_uri_mismatch redirect URI request: However, I get the error 400. {local host or appspot.com} / oauth2callback does not match a registered redirect URI Request details scope = https :. //www.googleapis. Com / authentication / plus.me response_type = code access_type = offline redirect_uri = {local / appspot} / oauth2callback state = {local / appspot} /: GP-pigwbwB3IBwMjafPlPToxNDE0NTA4ODYy client_id = {id-stuff} .apps.googleusercontent.com I suspect that the problem is in the code (because it is a working sample), but what can be more than that, what do I remember? After the go to the API c

date - Calculating time difference in milliseconds for two given times with "DD/MM/YYYY HH:mm:ss:ms" format in javascript -

मेरे पास दो बार है। आरंभ समय: "2014/10/28 11:50:28: 318 " एंडटाईम:" 2014/10/28 11: 50: 35: 249 " मुझे मिलसेकंड्स में उनके बीच अंतर की गणना करने की आवश्यकता है I मैं इसे गणना करने के लिए पल का इस्तेमाल किया। मेरा कोड: var msElapsedTime = moment (एंडटाईम, "डीडी / एमएम / वाई वाई वाई वाई एचएच: मिमी: एसएस: एसएसएस")। Diff (पल (शुरुआती, "डीडी / एमएम / वाई वाई वाई एच एच: mm: ss: एसएसएस ")); उत्तर: 7000 यह मिलीसेकंड के रूप में दिखाता है, लेकिन एक गोल मान लेता है। पार्सिंग टोकन, नहीं ms या sss । आपका दिनांक टोकन गलत क्रम में भी था। var प्रारंभिक समय = "2014/10/28 11: 50: 28: 318", एंडट्रीम = "2014/10/28 11:50: 35: 249 "; Var एमएसएप्लेस्डटाइम = पल (एंडटाईम, "वाई वाई वाई / एमएम / डीडी एचएच: एमएम: एसएस: एसएसएस")। एफआईएफ (पल (स्टार्टटाइम, "वाई वाई वाई / एमएम / डीडी एचएच: एमएम: एसएस: एसएसएस")) अलर्ट (एमएसएप्लेस्ड टाइम); // 6931

iso - xcode 6.1 iOS 8.1 NSLocale displayNameForKey NSLocaleIdentifier return nil -

- (NSString *) countryNameByCode: (NSString *) देशकोड {NSString * identifier = [NSLocale localeIdentifierFromComponents: @ {NSLocaleCountryCode: countryCode }]; NSString * countryName = [[NSLocale currentLocale] displayNameForKey: NSLocaleIdentifier मान: पहचानकर्ता]; वापसी देशनाम; } देशनाम शून्य यह आईओएस 8.1 सिम्युलेटर के लिए एक ज्ञात ऐप्पल मुद्दा है - क्यों? स्थानीयकरण और कुंजीपटल सेटिंग्स (तृतीय पार्टी कीबोर्ड सहित) को सफारी, मैप्स, और आईओएस 8.1 सिम्युलेटर में डेवलपर ऐप द्वारा सही तरीके से सम्मानित नहीं किया गया है। [एनएसएलोकेल चालू लोकल] रिटर्न एन_US और केवल अंग्रेज़ी और इमोजी कीबोर्ड उपलब्ध हैं। (18418630, 18512161)। अधिक जानकारी के लिए देखें।

count string value using map in javascript, return NaN -

I am trying to use a map to measure the duplicate string number in an array, my code: < / P> var map = {}; Var Mearer = ["John", "John", "John", "Do", "Do", "Smith", "John", "Do", "Jo"]; (Var a = 0; a & lt; myarray.length; a ++) {if (map [mare [a]] == tap) {map [marta [a]] + = 1; } And {Map [Mareare [A]] = 1; }} But when I do console.log (map); gives it object {John: NaN, Doe: Nain, Smith: Nain, Joe: Nain} Why is this Nyan? ? I should have a similar result: John: 4, DOE: 3, Smith: 1, Joe: 1 How can I do this? Thank you in advance. In this case you null strictly === < / Code> because is not equal to null . Try it: if (map [mare [a]] = tap) { or simply: (Map [Mareare [A]]) {

phalcon - Phalconphp binding view with ajax using volt template -

I am using the Falcon framework, I have a 'controller' post like 'action': View / Layout / Post.Vault {% for post in the post} & lt; H1 & gt; {{Post.content}} & lt; & Frasl; H1 & gt; & lt; H2 & gt; {{Post.like}} & lt; & Frasl; H2 & gt; & lt; A href = "#" onclick = "like ();" Data-id = "{{post.id}}" & gt; Such as & lt; & Frasl; A & gt; {% endfor%} & lt ;! - - & gt; & lt; Script & gt; var such = function () {var id = / * ... * /; // Post ID which is $ Event like '$' Ajax ({Data Type: 'Jason', URL: 'Post / Like /' ID} enhances) (function () {/ * some meaningful}); & lt; & Frasl; Script & gt; Controller / PostController.PP / * ... * / Public Function Index () { $ this-> View- & gt; Posts = / * ... * /; // read from the database to show the view } public functions such as action ($ id) {

Node.js: When exactly one should emit a 'drain' event? -

मैं इस node.js के लेखक हूँ lib:। मैं वर्तमान में एक कार्यकर्ता / कतार सुविधा। डिफ़ॉल्ट रूप से, कार्यकर्ता एक समय में एक नौकरी की प्रक्रिया करता है, लेकिन संगामिति स्तर को कुछ भी समायोजित किया जा सकता है। मान लीजिए कि मैं एक संवर्ग स्तर 3 का, इसलिए 3 से async नौकरी किसी भी समय लंबित हो सकता है लेखन के समय, मेरी जिंदगी 'नाली' घटना का उत्सर्जन करती है, जब कोई और नौकरियां लंबित नहीं होती हैं, यानी जब सभी नौकरियों ने अपने कॉलबैक को शुरू किया है उदाहरण के लिए, हम 'नो-थ्री-लंबित-जॉब' इवेंट के लिए कॉल करें। हालांकि, किसी भी समय किसी भी काम को छोड़ने की इच्छा हो सकती है, क्योंकि लंबित कार्यवाही की संख्या 3 से नीचे होती है, जिसका अर्थ है कि अगर कोई नई नौकरी कतार में जोड़ा जाता है, यह तुरंत चलाएगा। आइए अस्थायी रूप से इसे 'तैयार करने वाली प्रक्रिया-नई-नौकरी-अभी-अभी' घटना को कॉल करें। वास्तव में, यह घटना 'अधिक-लंबित-नौकरी' घटना से कहीं ज्यादा उपयोगी है। तो ... 'नाले' के लिए नोड। जेएस में वास्तव में मानक क्या है? क्या यह 'अधिक-लंबित-नौकरी'

c++ - I get 20 errors in the algorithm file when trying to sort a struct vector. I don't know what is wrong? -

यह मेरा कोड है #include & lt; stdio.h & gt; # शामिल करें & lt; cstdio & gt; # शामिल करें & lt; math.h & gt; # शामिल करें & lt; एल्गोरिथम & gt; # शामिल करें & lt; सेट & gt; # शामिल करें & lt; struct.h & gt; # शामिल करें & lt; vector & gt; #include & lt; कार्यात्मक & gt; नेमस्पेस एसटीडी का उपयोग करना; संरचना अंक {int x, y; }; बूल ऑपरेटर & lt; (कॉन्स्ट पॉइंट्स एंड पी 1, कॉन्स्ट पॉइंट्स एंड पी 2) {रिटर्न पी 1 एक्स। & Lt; p2.x; }; वेक्टर के & lt; अंक & gt; एक (1000000); Int i, n, निकटतम; Int main () {scanf ("% d \ n", & amp; n); (I = 0; i & lt; n-1; i ++) के लिए {scanf ("% d% d \ n", & amp; एक [i] .x, और [i] .y); } सॉर्ट (0, एन -1, ए); वापसी 0; } त्रुटियों जो मुझे अधिकतर राज्य मिलती हैं "संकेतक सूचक सूचकांक ('int' अमान्य) की आवश्यकता होती है। क्या गलत हो सकता है? मैं वेक्टर में स्ट्रेंक्ट को सॉर्ट करने की कोशिश कर रहा हूं। प्रयुक्त ओवरलोड। ऐसा नहीं है क

bash - Make grep output more readable -

I am working with grep in a file with a pattern grep -orI "id = \" [^ \] \ | \ "\." Sort | UniC-D which returns an output like the following: ./ myFile.html: id = "matchingR" ./myFile Html: id = "other" ./myFile .html: id = "cas" ./otherFile.html:id="what "./otherFile.html:id="Whairas" ./otherFile.html: Other "./otherFile.html:id="whatever" < / Code> What would be a convenient way for pipes, this is the output as follows: .mymyfile.html id = "matchingR" id = "Other "Id =" cas "./otherFile.html id =" what "id =" wheras "id =" other "id =" whatever " Group results. Not the most beautiful but It works. awk -F: -v OFS =: 'F! = $ 1 {F = $ 1; Print F} F == $ 1 {$ 1 = "" ; $ 0 = $ 0; Sub (/ ^: /, ""); print} ' If any one of your lines is ever colonized, then this simple version A

html - Generating checkbox using javascript -

Image
I have written this javascript code to generate the check box: ques = document .getElementById ("question"); Var q = ques.appendChild (document.createElement ("ol")); Q.appendChild (document.createTextNode (allQuestions [0] .Question); Var list = ques.appendChild (document.createElement ("ul")); (Var i = 0; i & lt; 4; i ++) for {var option = list.appendChild (document.createElement ("input")); Option.type = "checkbox"; List.appendChild (document.createTextNode (allQuestions [0] .choices [i])); List.appendChild (document.createElement ("br"); } The result is in the following output: and generated HTML is: & lt; Input type = "checkbox" & gt; David Cameron & lt; Br> & Lt; Input type = "checkbox" & gt; Gordon Brown & lt; Br> & Lt; Input type = "checkbox" & gt; Winston Churchill & lt; Br> & Lt; Input type = "checkbox" &