Posts

Showing posts from March, 2015

request - Ruby on rails get # params -

I am trying to do something on backend if I get #test in query string but I think finding it I'm not. How does anyone get these variables? sample url localhost: 3000 / # exam thanks This is called a. P>

c# - MonoMac WebView - Show Console or Web Inspector? -

How can WebKit Console or Inspector be shown from a monomaker application? It seems that this webkit can be set by developers' extras in Objective-C. [USER_DEFAULTS Register Defaults: [Objects with NSDictionary Dictionary: [NSNumber Number for Maths: Yes] Key: @ "WebKit Developer Extras"]]; I have mono mac Webkit Try it out: Var defaults = NSUserDefaults.StandardUserDefaults; Defaults.SetBool (True, "WebKitDeveloperExtras"); Defaults.Synchronize ();

c# - Invalid URI: Invalid port specified when url has more than one colon -

I am using dnsdynamic.org so that my personal website hosted at my house can be talked about. My house IP will often change once a month. Dnsdynamic.org provide a web method call to update the IP. https: // username: password@www.dnsdynamic.org/api/? Hostname = techno.ns360.info and myip = 127.0.0.1 When I call it through the browser it works correctly. When I try to call it via # c #, it throws the following exception. Invalid URI: invalid string specified on system.Uri.CreateThis (String Uri, Boolean dontEscape, UriKind UuriKind) on System.Net.WebRequest.Create (string request urstring) Since the URL looks like a colon, System.uri tries to parse its password as an integer. I tried to add a port after .OR https: // username: password@www.dnsdynamic.org: 443 There is no luck with this. Can anyone tell me how to solve this error? I tried to escape when trying to escape Yuri and avoid the option, still not working. var ri = new Uri ("https: // username: p...

ruby - How to customize devise form css in rails -

कमांड रेल उपकरण तैयार करना: दृश्य \ app \ views \ users \ मैं योजना के रूप को अनुकूलित करने के लिए देख रहा हूं लेकिन यह सुनिश्चित नहीं है कि सीएसएस को application.css में रखा जाना है या मुझे अलग से उपयोगकर्ता बनाने की आवश्यकता है। css.scss । इसके लिए जीट डॉक्टर की जांच करें, लेकिन कोई भी डीसीईएस से निपटने के लिए निर्दिष्ट नहीं है। मुझे इसे संभालने का सही तरीका पता है डिवाईज आपको डिफ़ॉल्ट लेआउट का उपयोग करेगा। इसलिए सीएसएस जो आप अपने views / layout / application.html.erb में उपयोग कर रहे हैं, आपके जनरेट किए गए विचारों में उपयोग किया जाएगा। यदि आप विशिष्ट लेआउट तैयार करना चाहते हैं, तो आप एक दृश्य / लेआउट / devise.html.erb फ़ाइल बनाएं जहां आप विशिष्ट सीएसएस तैयार कर सकते हैं। रेलवे नामकरण सम्मेलनों के कारण इसे स्वचालित रूप से उठाया जाएगा। उपरोक्त किसी नियंत्रक के लिए काम करेगा, बस नियंत्रक के नाम पर लेआउट में एक फ़ाइल जोड़ें। देखरेख / लेआउट / आरक्षण html.erb के लिए आरक्षण नियंत्रक आप Devise :: RegistrationsController एक निर्देशिका दृश्य / लेआउट / बनाय...

Moving from C/C++/PHP to ASP.NET or ASP.NET MVC 4 -

I suggest the best way to advance a project. For the past three years I have been creating web applications using PHP / jQuery / CSS, five years ago I was using C / C ++. My company has now decided that all the new projects will be on the net instead of Linux, which is the development platform of my choice. Now I need to create an intranet web application on the .NET platform (which is limited to my experience of many years). This application is building analytics on sales orders received by my company where I can manually create some algorithms to clean input data and allow employees to edit the input fields of the existing order (only For analytical purposes) I believe C # is the right choice, although it is not sure whether to use ASP.NET web form or ASP.NET MVC4 web application. It should be on browser-based and nat, besides, my company does not care. Since I am going to learn in any way, the route which will recommend taking others, is best for best and long-term support f...

hadoop - Sqoop - Could not find or load main class org.apache.sqoop.Sqoop -

मैंने हडोप , हाइव , एचबीज़ , Sqoop और उन्हें PATH में जोड़ दिया। जब मैं sqoop आदेश निष्पादित करने की कोशिश करता हूं, तो मुझे यह त्रुटि मिलती है: त्रुटि: मुख्य वर्ग org.apache.sqoop.Sqoop विकास वातावरण: नहीं ढूँढ पा रहा है या लोड नहीं किया जा सकता है: ओएस: Ubuntu 12.04 64-bit हडोप संस्करण: 1.0.4 छत्ता संस्करण: 0.9.0 एचबेस संस्करण: 0.94.5 Sqoop संस्करण: 1.4.3 सुनिश्चित करें कि आपके पास sqoop-1.4.3.jar है आपके एसक्यूओपी होम डाइरेक्टरी के तहत नोट: हो सकता है क्योंकि आपने के अंतर्गत गलत वितरण डाउनलोड किया था

How to do a horizontal shift of an image in MATLAB? -

Image
I have an image that I have changed to a double matrix. I want to move it horizontally, but I'm not sure how to do it. I try to manipulate the situation, but it has come to know that I am only adding color to Is there a way that I can reference the pixel position instead, and then can I continuously add to a change? By using the Image Processing Toolbox, you can: img = Imread ('pout.tif'); T = Marketform ('Anne', [0 0; 50 100 1]); % # Translate img2 = imtransform (img, T, ... 'xdata', [1 size (img, 2)], 'ydata', [1 size (img, 1)]; subplot (121) , Imsho (img), axis (122), emsho (img2) on the axle,

c# - Is it possible sort a type's properties returned from Type.GetProperties() using attributes? -

के अनुसार, Type.GetProperties () GetProperties विधि एक विशिष्ट क्रम में संपत्ति वापस नहीं करता है, जैसे वर्णानुक्रमिक या घोषणा आदेश। आपका कोड उस आदेश पर निर्भर नहीं होना चाहिए जिसमें गुण लौटाए गए हैं, क्योंकि वह ऑर्डर बदलता है। गुणों को किसी तरह से टिप्पणी कर सकते हैं (कस्टम विशेषता, हो सकता है) ताकि आप कुछ कर सकें इस तरह से? var गुण = प्रकार (myClass) .GetProperties ()। एएनएनमेरेबल ()। आदेशबी (Func & lt; VoodooOrdinalAttribute & gt;); के साथ पब्लिक क्लास मायक्लास {[वूडूऑर्डिनल एट्रिब्यूट (2)] सार्वजनिक स्ट्रिंग रंग {get; सेट;} [वूड आइडिनल एट्रिब्यूट (3)] सार्वजनिक स्ट्रिंग आकृति {प्राप्त; सेट;} [वूडूऑर्डिनल एट्रिब्यूट (1)] सार्वजनिक स्ट्रिंग मास {प्राप्त; सेट {}} और यह सार्वजनिक वर्ग VoodooOrdinalAttribute: विशेषता {सार्वजनिक VoodooOrdinalAttribute (int ordinal) { यह। ऑर्डिनल = क्रमानुसार; } सार्वजनिक अनिर्णनीय {प्राप्त; सेट; रंग आकार और प्रॉपर्टी का क्रम मास Li> हां, आप गुणों को ऑर्डर करने के लिए एक विशेषता का उपयोग कर सकते हैं। ...

Changing an Activity's TextView in a BroadcastReceiver (Android) -

I have a simple Android app with a single activity, including textview. I created a broadcast receiver whose purpose is to make a few numerical calculations, convert the result to string, and then change the text value of textView into that string. However, because the activity of the app is not present when the Broadcast receiver is usually called, so I can not find the textview of the activity (I can not always find a way to find a way to get a null pointer exception). I have read other articles on stack overflow that suggest a listener with a callback method for my broadcast receiver, but I honestly do not make sure how to Implement. I am aware of the concept of callback method, I just do not know how to implement it in this context. Can someone suggest how I can accomplish this? Thanks! edit Asinka Task will be done to take action in the background. Note that you will have to pass your TextView to its creator inside AsyncTask

java ee - EJB lookup - Failed to create remoting connection -

I have a problem with my EJB lookup, all the work in the servlet is fine, but I have to connect with AJB to the remote client . The deployment console log: java: global / easymenu-webappEAR / EasyMenu / CounterBean sk.jbase.projects.easymenu.CounterBeanRemote Java app / EasyMenu / CounterBean! Sk.jbase.projects.easymenu.CounterBeanRemote java: Module / CounterBin! Sk.jbase.projects.easymenu.CounterBeanRemote java: jboss / exported / easymenu-webappEAR / EasyMenu / CounterBin! Sk.jbase.projects.easymenu.CounterBeanRemote java: global / easymenu-webappEAR / EasyMenu / CounterBean Java app / EasyMenu / CounterBean java: module / CounterBean I ejbmodule the webapp (I do not Know how it separates) Getting the Reference: Public static initial syntax throws the getInitialContext (string URL) NamingException {Properties property = new properties (); Properties.setProperty (Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming"); Properties.setProperty (Context. PROV...

javascript - Dynamically Ajax loaded Bar chart not displaying -

I am working to replace a high-end bar chart with dynamically Ajax calls. I think I'm really close to finding it, but this is not showing up and I'm not seeing the problem. I believe that I can update the points in the way I have set it inside the Intern Festival. I'm hoping someone can look at it and suggest me ... thank you very much Check syntax, i.e. the suspension closes properly As I have seen series: [{name: 'good', data: [80]}, {name: 'bad', data: [1] }] } should be} P> } flag = 0; // reset the flash after point update.}, 3000); // } Is missing }); }); Check it

internet explorer - IE HTML1114 Error with custom CLeditor button -

I am using CLeditor, Fineuploader, and Bootstrap to create a custom button that pops up more advanced file upload models But every time I launch the model, I get an error and I do not know how to fix it. Basically the whole browser freezes HTML1114: Overrides conflicting codepage window -1252 (11) with codepeep Unicode (Unicode byte order mark) I found out that this warning was still going wrong, but it is normally done. Then CLeditor has a terrific design where it runs commands on the custom button clicked instead of waiting for the buttonClick callback, a situation where IE Calling getRange (editor) .paste with the undefined to reduce the HTML (value) Click the button event handler // image uploader if other (button name === "upload image") {return; } // Avoid this unnecessary for all other buttons custom buttons! Else if (! ExecCommand (editor, data.command, data.value, data.use css, buttondiv)) {return false; } Are you outputted headers for ...

virtualenv - Fabric + Virtualenvwrapper gives fatal error: run() received nonzero return code 1 while executing -

I have a fabric script to use the virtualweaver to create a virtualwave, but after the mkvirutalenv running Cloth Script complains return About the code, see below [local host] runs: export WORKON_HOME = / srv / www & amp; Amp; Source /usr/local/bin/virtualenvwrapper.sh & amp; Amp; Mkvirtualenv james --no-site-packages --distribute [localhost] Login password for 'james': [localhost] Out: New Python executable in James / Bin / Python [Localhost]: Installing Distribution ..... ................................................ ................................................ ................................................ ................................................ .. ............done. [Local Host] Out: Installing Pipe ................ Fatal Error: Running execution (), nonzero return code 1 was received! Requested: Export WORKON_HOME = / srv / www & amp; Amp; Source /usr/local/bin/virtualenvwrapper.sh & amp; Amp; Mkvirtualenv james --no-site-packages -...

asp.net mvc - Handle create controller exception in MVC3 -

I have a controller that takes many arguments and I am using Unity to make an example of that controller . The problem is that in certain circumstances, unity is not able to produce all the things that are necessary for my constructor, so it throws an exception. "text"> Do not handle, either create a parametrical constructor for those objects, which are instant, or do not make them in the constructor. Handling those exceptions will only be a mask of the problem.

testing - Running an arbitrary command/program on selenium grid node -

Is it possible to run an arbitrary OS program on the Selenium node before the trial runs? Why I need such a strange thing: In a test of the web application I need to simulate the mouseover for 1 second, but the point is - if the browser window But if there is a mouse pointer, the Selenium webdriver is not long, keep mouseover events for a long time, it is being interrupted after several milliseconds, and after that the real mouse pointer starts releasing the mouseover event. So what I want to try is to run a trivial program that takes the mouse cursor in the screen corner UPD : to a particular driver Before launch, an apps app has been created to move the cursor to the corner: If you are using JUnit4, you can do something like java .lang.Runtime.getRuntime () Executive ("One-Command") .; In a method that runs @BeforeClass . In June 3 you will have to do this in setUp () , so before each test. There are different mechanisms for obtaining the same thin...

Use PHP and Windows Task Scheduler to try again on exit(1) -

I use the Windows Task Scheduler to start a php script which works perfectly well. Basically the c: \ php.exe -f c: \ myscript.php There is some work in my script which sometimes I will be working again in 5 minutes Wants to run I changed the effect of the work and tried to implement it to restart every 5 minutes, if the function fails and my php code exit (1) to the task scheduler I know I get out of an error code of 1, but it does not run the script again. Does anyone know what I can do to do this so that the task manager will try again for 5 minutes if I signal it with my code in any way. Can not work in the answer to the question, but can work as a fallback if you do not work it : In any database or file, run your job every 5 minutes, even if anyone, and then track the "last success" / "last failure" > Before doing anything, the script can check the log's status, and if the last time had a failure, then try again (possibly due to limite...

Gnuplot: How to remove vectors below a certain magnitude from vector field? -

I have a 2D CFD code which gives me X and Y flow velocity at every point on the grid. I currently have Gnuplot I am looking at data using a vector field. My goal is to see how far the feathers are from the explosion, so if they fall below certain area then they can be prevented by the vectors being shown to everyone in the area, so it will be very clean. Does anyone have an idea to go about this? My current gnuplot script is below, I can also modify the input file as well. Set the set png to 'set the title' Explosion simulation: timestep '. [I: 0: 10]] Set the set png set xrange [0: 5.1] to set yrange [0: 10.1]. Set output 'path / flovel' esprint ('% 04.0f', i). 'PNG Plot' path / flowprint ('% 04.0f', i) Operating operator filtering a move data: 1: ($ 3 & gt; 10? $ 2: 1/0) Use conspiracy 'file', which The offers data in three columns of which column Kndarit in two columns, the column ten. `1 / 0` is undefined; `Gnuplot...

x86 - Get the size of a variable in assembly language at runtime -

I am trying to get the size of a register (bytes) on the runtime in X86 assembly language, but I do not know that it is still possible in the X86 assembly language, whether it is possible to obtain the size of the register at runtime is? For example, is it possible to obtain the size of a register or variable (like ebx ), and it is possible to transfer it to another register (like eax )? When I tried to run the command mov bx, sizeof bx , then the MASM codel generated the following error: 1> P4.asm (57): error A2009: syntax error expression . Yes, just do it mov ex, 4; EX = Size in ebaytes bytes CPU registers are not flexible in size; they are fixed. For variables, just use the variable and the difference after your label, something like this: Mastring DB "Blah Blah Blah", 10,0 Mistressed Label $ ; Or just "mestringand:" ... mov eax, mastrendend - mystring; Or "Offset Mystring Offset Maestring"

python - get csv data from a website -

How do I download CSV data on website using Python and It depends on what you want to do with the data. If you just want to download the data that you can use. import urllib2 download_data = urllib2.urlopen ('http: // ...') downloaded_data.readline () in: print Python 2.x import csv import urllib2 download_data = urllib2.urlopen ('http: // ...') for the line in csv_data csv_data = csv.reader (downloaded Gone_data): print line Python 3.X import csv import urllib.request download_data = urllib.request. Csv_data: print (line)

javascript - UIWebView retrieve a link and navigate to it -

I'm adding a UIWebView to my app, which should load the password-protected webpage. Automatically select a link from that page and navigate to that page. This website constantly changes, so there is no way to choose the intended page URL. I must first login and then select a link from the main page After logging in for the desired link, how can I code and navigate to search my main page Am I I think that will help. NSError * Error will handle NSError errors; // Create the URL for your page Http://example.com/index.php Just one example NSURL * pageURL = [NSURL URLWithString: @ "http://example.com/index.php"]; // Recover page regex to parse it by using NSString * pageHtml = [NSString stringWithContentsOfURL: PAGEURL encoding: NSUTF8StringEncoding error: & amp; Error]; If (error) {NSLog (@ "Error retrieving HTML:% @", error); // will terminate my app (); // TODO: handle the connection error here} error = zero; // Creating regex to parse // page ...

c - struct EMPLOYEE {...} em1,em2; or struct EMPLOYEE {...}; -

क्या ये दोनों समान हैं? struct EMPLOYEE {...}; Int मुख्य (शून्य) {// स्थानीय घोषणा संरचना EMPLOYEE em1; संरचना EMPLOYEE em2; ... वापसी 0; } और struct EMPLOYEE {...} em1, em2; यदि मैं उत्तरार्द्ध मामले का उपयोग करता हूं, तो क्या मैं उन संरचनाओं को मुख्य कार्य में घोषित करने के लिए आवश्यक नहीं है जैसा कि मैंने पहले के मामले में किया था? struct EMPLOYEE {...}; EMPLOYEE नामक एक संरचना को परिभाषित करता है लेकिन अन्यथा कोई भी उदाहरण नहीं बनता है। struct EMPLOYEE {...} em1, em2; संरचना EMPLOYEE को परिभाषित करता है और em1 और em2 नामक दो उदाहरण बनाता है।

undefined class/module X in Rails 3 despite requiring models in initializer -

We use Rails.cache and see an undefined class / module X error when loading those squares Loads which call square X We follow the suggestion to include an initializer in which all the models in the Dev environment are required. However, do we see the same error, any other suggestions? We include the starter code below, and from output to console, it seems like code is happening. We are at Rail 3.2.12 + Ruby 1.9.3. If Rails.env == "Evolution" Dir.foreach ("# {Rails.root} / App / Model"). Model_name | "Requiring defending: # {model_name}" is required unless model_name == "need_dependency model_name" || Stack trace: Processing by DandyController as #get_apps JSON parameter: {"category" => Warning: Can not verify CSRF token authentication 2ms completed in the argumentsError (undefined category / module application) 500 internal server error, "attributes", "country_id" = "143,441" "langu...

android - Having trouble using load() and save() methods stored outside of main.java -

Here's what IO.java file looks like, in which the square is "io", which loads my methods ( ) And save (). package com.myschedules; // FILE I / O import java.io. *; Import android.content.Context; Public class IO {reference asdf; // save file public void save (string filename, string data) {try {fileOutputStream fos = asdf.openFileOutput (filename, reference. MODE_PRIVATE); Fos.write (data.getBytes ()); Fos.close (); } Hold (Exception precedent) {}} // Load file Public string load (string filename) {try {fileInputStream fis = asdf.openFileInput (filename); BufferedReader Reader = new BufferedReader (new InputStreamReader (fis)); String line = zero, input = ""; While ((line = reader.readline ())! = Null input + = line; reader.close (); fis.close (); return input;} hold (ex before) {return "";}} } When I had to call these methods in the main, it looks like: io login_io = new when (); String login_preferences = login_io.load ("login_pref...

python - Tkinter 'label' widget - Newlines adding space randomly -

I am trying to create a 'label' widget that contains help for my program. Assuming my label widget is called 'menu', I use it: Menu ['text'] = '1 \ N2. \ N3. \ N4. \ N5. ' Something like this should be output: 1. 2. 3. 4. 5. However, it does output: 1 2 3. 4. 5. What am I doing? label when creating your anchor and justification option like: myLabel = label (self, text = '1. \ N2. \ N3. \ N4. \ N5.', Anchor = W, Justify = left) anchor = w your text in the west (hence the w ) label , While justify = LEFT will ensure that any additional lines are given appropriate support for the text.

excel - Determine working day include weekend but excluding holiday -

I'm working with Excel now. And I have a problem with it. Example: I have to send some time to Friday, January 20, 2012. I need 3 days to send it. Then, Monday, January 23, 2012 is a holiday, if I calculate the manual, then it is very easy I will get an answer of 24 January 2012. But I do not know how to bring the case to Excel. Please help me. Thanks In Excel, 2010 you WORKDAY.INTL function = WORKDAY.INTL (A2, B2, "0000000", holidays) Where the date of A2 and B2 days are added and there is a holiday holiday holiday dates .... but try this array formula 2007 in Excel = small (if (COUNTIF (holidays, A2 + line (indirect ("1:" + 2 CTRL + SHIFT + enter assume that you do not have more than 4 consecutive holiday dates (if you do 5 * 10 * or more )

oracle11g - what is the difference bettween char and nchar datatype when installing oracle 11g with unicode char set option? -

I install Oracle 11g with the option set Unicode char. And I came to know that I can insert the Unicode character in the chart data column. So my question is: What is the difference between CRAR and NCHAR datatype when installing Oracle 11G with Unicode option? "post-text" itemprop = "text"> There are two main differences. By default defaults to CHAR (30)! = NCHAR (30) but CHAR (30 CR) = NCHAR (30) . The default length economics (as specified by the NLS_LENGHTIMITIPCP parameter) is used for CRAC, but not for NCHAR. The default value byte for this parameter is the length of the NCHH is always in the letters. It is important because NCHAR (30) will always have 30 unicode characters - like Chad (30 CRAR) - but in CRAR (30) only 30 bytes will be defaulted Which will be equal to 30 Unicode characters or not. The AL32UTF8 (database character is Unicode default) and AL16UTF8 (NLS_NCHAR_CHARACTERSET default) are not equivalent. Both variable lengths ...

html - How to replace "-" with "_" in Vim using regular expressions? -

Do you want me to replace - to _ with a regexp I can give advice on my HTML file but focus on href and src attributes (no changes are made to my webpage's content only). For example: Previously: & lt; A href = "my-profile.html" & gt; PLF series & lt; / A & gt; & Lt; Img src = "images / my-sample.jpg" & gt; After : & lt; A href = "my_profile.html" & gt; PLF series & lt; / A & gt; & Lt; Img src = "picture / my_sample.jpg" & gt; It should be repeated until it matches: % s / \ (\ (src \ | src \) * = * "[^" -] * \) - / \ 1_ / g

html - CSS3 3D Transformations not working in Chrome (Linux) -

You will need Linux chrome to see it. On my dev site (see three boxes below), my backfoss is showing through them. How can I fix this? CSS ... . Container {status: relative; -Winkit-perspective: 800; -Moz-perspective: 800; Perspective: 800; Background: None; }. Pumpkinhead {width: 100%; Height: 15em; Webkit-conversion-style: protected-3D; -Wbkit-Infection: 1s; -MOZ-Transform-Style: Protected-3D; -Moose infection: 1s; Conversion-style: protection-3d; Infection: 1s; }. Container: Hover Pumpkinhead {-VBKit-transform: Rotate Y (180 degrees); -MOZ-TRANSFORM: Rotate Y (180 degrees); Convulsually rotate (180 degrees); } .face {status: complete; Webkit-Backfiest-Visibility: hidden; -MOZ-BACKEX-visibility: hidden; Backfirst-visibility: hidden; Z-index: 5; }. Back {width: 66%; Height: 127%; Webkit-transform: rotate (180 degrees); -MOZ-TRANSFORM: Rotate Y (180 degrees); Convulsually rotate (180 degrees); Background: # 000000; Background: -WebKit-Linear-Slope (Top, RGBA (0,0,0,0.65) 0%, RG...

java - Updating JTable row dynamically after the deletion successive rows -

I have a JTable and I'm putting that JTable dynamically in lines. After some user intervention, a The new line will be inserted. Then I will call a function as the selected row number with the parameter and within that function, I will have some code that will update the same line accordingly. Each line entry and line value will run the update code in a separate thread. Public Zero updateRow (int row, JTable myTable) {string text = ""; // After several processing, set the table cell value on the 'row' on the 4 column myTable.setValueAt (text, line, 4); } The problem I am facing is as follows, If the user is removing any row, the status of the row will change and that Time function UpdateRow () is trying to update some other line, then it will fail due to change in line number. Indicates that I have 3 lines at one time and updates on each line are turned on. line for first line update (1, usertable); // Row (2, UsTable) for second line updates; // ...

debian - Clear an environment variable passed through pdebuild -

I'm using pdebuild to test my package on older versions of Ubuntu Although an environment variable, GOROOT is leaked through construction from my environment. debian / tmp / usr / lib / gocode / src / code.brandscreen.net /cortex/go/util/http.go summary: In the package "io" can not be found Is / home / mjoiner / src / go / src / pkg / IO (from $ GOROOT) / tmp / buildd / golang -brandscreen-0.0 / debian / tmp / usr / lib / gocode / src / io (from $ GOPATH) / Usr / lib / gocode / src / io How do I clear it (and other environment variables) pdebuild or GOROOT has ~ / .builderrc effect?

javascript - Sorting an Array according to the order of another Array -

I have an array with such shapes: var arr = [ 'Small', 'small', 'small', 'small', ... 'medium', 'medium', 'medium', 'medium', ... 'big', 'big', ...] ; I need to reconstruct this array according to this command: var command = ['short', 'small', ' Medium ',' medium ',' big ']; Then the result ends: var arr = ['short', 'small', 'medium', 'medium', ' Big ',' small ',' small ',' medium ',' medium ',' big '...]; I know about other such questions, but I could not find anything yet. I am uncertain about how to contact this. I was thinking sorting but for whom should I test? It sounds simple but I'm stuck, do not know where to start. Any signals? Just define scorer for your sort method. This is your code. Try it var init_arr = ['small', 'big', ...

Unix Shell scripting: how to modify output file names accordingly -

तो मेरी मौजूदा शटल स्क्रिप्टिंग है: जे के लिए * .jpg टीसेरैक्ट $ J $ j किया जहां tesseract पाठ फ़ाइलों में jpg फ़ाइलें धर्मान्तरित। इस स्क्रिप्ट के साथ, अगर फ़ाइल HAHA.jpg थी, तो आउटपुट फ़ाइल नाम बन जाता है, HAHA.jpg.txt, लेकिन मैं चाहता हूं कि यह केवल HAHA.txt क्या आउटपुट को बनाने का एक तरीका है HAHA.jpg.txt के बजाय HAHA.txt के रूप में फाइल नाम? इस लाइन को अपने tesseract कमांड के बाद जोड़ें : jpg के लिए * .jpg tesseract $ j $ j mv $ {j} .txt $ {j / jpg / txt} भले ही tesseract ने आपकी फ़ाइल का नाम बदल दिया है, चर $ j में HAHA.jpg होगा।

python - cx freeze does not work -

I'm new to Python, I've written a script in Linux machine using Python and wxpython. Now to convert .exe from .py to me, I used cxfreeze for that purpose exe $ python setup.py build / step to create python / setup $ python pip cxfreeze $ Cxfreeze script.py But when I execute "./script (exe)" in other systems I get this error: file "/ usr /local/lib/python2.7/dist-packages/cx_freeze/initscripts/Console .py ", line 27, & lt; Module & gt; File "script.py", line 3, & lt; Module & gt; The file "/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode/wx/__init__.py", line 45, in & lt; Module & gt; The file "/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode/wx/_core.py", in line 4, in & lt; Module & gt; The file "ExtensionLoader_wx__core_.py", line 18, & lt; Module & gt; ImportError: No Name Module I used to use the following on seqoofreeze Try the simple wxPython app...

php - Loading MathJax into loaded div -

It is not entirely certain how the phrase of this question is. I have a website that uses MathJax to display math problems. The text on a page is filled with different files that someone searches for. So, for example, the search for 'apple' brings the page to 'apples' This text is stored in a class in another PHP file, and the math equation is also typed there. However, once I load the equation in the page, it does not type in: & lt; Script type = "text / javascript" src = "https: //c328740.ssl.cf1? .rackcdn.com / mathjax / latest / MathJax.js config = Tex-Ams-MML_HTMLorMML" & gt; Function companium () {document.getElementById ('title'). InnerHTML = '& lt ;? Php echo $ pageTitle? & Gt; '; Document.getElementById ('body'). InnerHTML = '& lt ;? Php link ($ page body, $ new_classes)? & Gt; '; Document.getElementById ('nav'). InnerHTML = '& lt ;? Php echo $ pageNav? & Gt...

php - Datetime Difference Error -

I have a problem when I use the difference of datetime. Here is the php code $ datetime1 = new date time ('2009-10-11'); $ Datetime2 = new date time ('2009-10-13'); $ Interval = $ datetime1- & gt; Different ($ datetime2); Copy $ interval-> day; The correct result should be 2. But unfortunately this is the result of 6015 . Even when I change my date, its still 6015 are you facing this problem? I tried to run the script from other computers but its work. Try it out, $ start_date = new date time (" 2009-10-11 "); $ End_date = new date time ("2009-10-13"); $ Interval = $ start_data- & gt; Different ($ end_date); Echo "result" $ interval-> Y "years,". $ Interval-> Me "Months,". $ Interval-> D. "day"; You can enter $ interval-> Day to $ inter-> d. Change to Day " You can see your answer on the date difference for more information. This can help you.

git prompting me before commit -

What is the one way git has given me a "Are you trying to commit one in the production branch. Are you sure (Y / not)? "Messages before every commitment is as clear from the message, I want only one specific branch (say the production branch) to avoid making any mockery. Set your hint properly and look at the branch you are always in - If you want better tools like better git prompts, ruby ​​version prompts, python virtual and prompt, etc. Bash-it - If you want the correct solution that you describe here, set some nickname script for git comma, a pre-commit hooks, which will look at your current branch and will prompt you as needed.

javascript - I have a couple of questions related to the use of call() and apply(), or how these two types, Array() and Math are called in this example -

Make a array of multi-max (multi) {// all, but the first argument is var allButFirst = Array ( ) .slice.call (logic, 1); // Find the largest number of arguments in that largest number allButFirst = Math.max.apply (mathematics, allButFirst); // Multi Result Returns Multiple Return * Largest AllButFirst; } Insert (Multi-Max (3, 1, 2, 3) == 9, "3 * 3 = 9 (First, the biggest argument.)"); to I have two questions for someone. Why we need to use Array (). Math () Maximum. Why we use arrays (). Piece, and not Array.prototype.slice (I have seen that Array.prototype.slice will work, but I am trying to understand why I am the other, only in this example, but in any instance) Thank you. Array () will give an empty array example, While Array is just a constructor function, Array.slice does not work because the .slice method is present only on the array examples, through their prototype.The monastery is not a constructor function, it is an object that has many uti...

javascript - how to add image along with some other data in a table cell using php -

I am preparing a calendar using Javascript and to show what special that day, some icons I have to add, but I used echo to print the present day in each table cell, I have to add that date to those relevant dates. ($ I = 1; $ i & lt; ($ maxday + $ startday); $ i ++) {if (($ i% 7) == 1) Let me say "& lt; tr & gt;"; If ($ i & lt; $ start day) {echo " & lt; / td>;); to continue; }; $ Current_day = $ i - $ Beginners + 1; If (in_array ($ cYear. "-" $ cMonth. "-" $ current_day, $ unavailable)) {echo " " $ Current_def " "; } Else {echo "& lt; td class = \" available \ "& gt; $ Current_day "& Lt; / td>"; }} If (($ i% 7) == 0) echo " }? & Gt; Just using the echo, I'm displaying on the 1st from the 31st, but I have to add some marks with some specific dates. You either echo the tag, or if you want a picture on the background, you can create a square Re...

exception - spring @ExceptionHandler -

सभी, मेरे नियंत्रक: @RequestMapping (method = RequestMethod.GET, value = "/ खोज") @ रिस्पॉंसबॉडी सार्वजनिक कब्रिस्तान रीसस्पॉन्शन & lt; सूची & lt; स्ट्रिंग & gt; & gt; खोज (@RevenParam ("स्थान") स्थान स्थान) {कब्रिस्तानरस्ट्रेसपॉइंट & lt; सूची & lt; स्ट्रिंग & gt; & gt; RestResponse = नया कब्रिस्तान रीसस्पेंस & lt; सूची & lt; स्ट्रिंग & gt; & gt; (); RestResponse.setBody (नया ArrayList & lt; स्ट्रिंग & gt; ()); लांग ए = लांग.वल्यूउफ़ ("एएएए"); कोशिश करें {के लिए (सार्वजनिक कमेन्ट्री कब्रिस्तान: कब्रिस्तानडीओ.फंडबाय लोकेशन (स्थान)) {restResponse.getBody ()। जोड़ें (कब्रिस्तान .getNameCn ()); }} पकड़ (अपवाद ई) {try {नया SQLException फेंकना}; } पकड़ (SQLException e1) {e1.printStackTrace (); }} RestResponse.setSuccess (सच); रिटर्न ब्रेस्ट रीस्पॉन्स; } एक ही नियंत्रक में मेरे एक्स्प्लेशन हैंडल विधि: @ExceptionHandler (मान = {अपवाद। वर्ग, SQLException.class, IllegalArgumentException.class, Numb...

probability - Using matlab function "pdf" -

I have found a Gaussian mix of 64 dimension distribution object obj and want to keep it in However, when I type the pdf function to type pdf (obj, obj.mu (1, :)) This generates very high probability (i.e. 2.4845 a + 06 9) to examine the object and this does not make sense, because the probability is between zero to one needed. Is there a problem with my MattelBab? ps pdf (obj, obj.mu (1, :) + obj sigma (1,1) * rand ()) create a high probability ( 2.1682e + 06 9) First things first: A probability density function does not always evaluate for 1, it only integrates to 1 on its domain Besides, what you are seeing (see page 434, figure 9.7) when Gaussian mixing model fittings. Some components collapsing at a data point necessarily lead to variance to go to 0 and PDF to explode. It often appears in the Gaussian mixing model because it is not log-convex and the maximum maxim is local maxime. We try to find a well-behaved local maxim that works well, and singularity is ...

java - Sort HashMap basis on Object's member variable from value -

इस सवाल का पहले से ही एक उत्तर है: 44 जवाब एक वर्ग है क्लास कर्मचारी {int id; स्ट्रिंग का नाम; } और एक नक्शा जिसमें मूल्य में यह वस्तु है मानचित्र & lt; पूर्णांक, कर्मचारी & gt; नक्शा = नया हैशमैप & lt; पूर्णांक, कर्मचारी & gt; (); अब मैं ऊपर मानचित्र को कर्मचारी का नाम का आधार क्रमित करना चाहता हूं। अग्रिम धन्यवाद इस निर्माता का उपयोग करके एक कस्टम के साथ प्रयोग करें:

joomla - Is it possible to hide content for one specific user group? -

I know that we can show content based on the level of usage of users using Joomla ACL, but what Is it possible to show content to all users except a specific group? if so, how? I have tried to create an access level called news , which included all groups except no_news group, then my module's Use level News . Unfortunately the user related to the no_news group was able to see the content. Any suggestions? no_news class inherited from registered. Has your Noise Group inherited from the public? If so, exclude the public group from the news access level; in fact, the idea is that if there is a use of parent group, then all children will be group also.

android - Logcat messages disappear after a short time -

Eclipse logcat messages sometimes disappear after closing the app for a short time (mostly not less). Can not be automatically disappeared? EDIT: My device is still attached and after launching the device, how to set it to launch and clear it before next launch? This device is also being attached to me and therefore all internal actions are being logged and error The message disappears very quickly. If 1 does not work, you can try to increase the log message message size. From the window & gt; Preferences & gt; Android & gt; Logcat (increase to size more than 5000) The first one worked for me In this way you do not need to separate the device to deploy the app from the app. Related questions, second question - you can always clear the existing log from the [Log In] button.

asp.net - Inline ReportViewer PDF cant open hyperlinks in new window -

An old report generated by ReportViewer in a webpage (asp.Net) has been changed so that the report is in the same window Can generate as an inline PDF: byte [] bytes = master. ReportsViewer.Local Report .Renderer ("PDF", Device Info, Mime Type, Out Encoding, Out Extensions, Out Strides, Out Alerts); Response.ClearHeaders (); Response.ClearContent (); Response.Clear (); reaction. Content type = mimetype; Response.AddHeader ("Content-Displacement", "Inline; File Name = Report." + Extension); Response.BinaryWrite (byte); Response.Flush (); Response.End (); Purpose: Large reports make the webpage unresponsive. Inline PDF does not have the same problem. Problem: Hyperlinks can open in only one window Anyone had the same problem? Or is there a simple solution? What does your link look like? Can you set your hyperlink target to "_blank"?

javascript - datatables empty table error -

I have a piece of code where I use the datatable plugin. The table structure looks like this: But note that I have been hiding the last four columns in the initial code. In my code, I do the following: if ($ data-> response code this works else {echo & lt; Tr & gt; & Lt; Td colspan = 4 & gt; & Lt; H1 class = "error" & gt; '$ Data- & gt; Error message.' & Lt; / H1> & Lt; / Td> & Lt; / Tr & gt; '; } When I do this, I get the following error: "Database warning (table id = 'databatables_tab)': The requested unknown parameter '1' Data Line ({"iDisplayLength": 100, "Data Source for Row 1" Here is the database code: var oTable = $ ('Table1') "Ice Styling Fixed": [[0, 'de' ']], "AAserting": [[0,' ACC ']], "Ao column defs": [{"Beasible": Incorrect, "One Goal": [4,5,6, 7]}...

android - How to write List into parcel -

पब्लिक क्लास श्रेणी लागू करने योग्य पार्सल योग्य {निजी इंट एम सीरीज आईडी; निजी सूची & lt; वीडियो & gt; mCategoryVideos; सार्वजनिक int getCategoryId () {वापसी mCategoryId; } सार्वजनिक शून्य setCategoryId (int mCategoryId) {this.mcategoryId = mCategoryId; } सार्वजनिक सूची & lt; वीडियो & gt; GetCategoryVideos () {वापसी mCategoryVideos; } सार्वजनिक शून्य सेट कंबल वीडियो (सूची & lt; वीडियो & gt; वीडियो लिस्ट) {mCategoryVideos = videoList; } @ ओवरराइड पब्लिक व्हायड लिस्ट टओपरेल (पार्सल पार्सल, इंट आई) {parcel.writeInt (mCategoryId); parcel.writeTypedList (mCategoryVideos); } सार्वजनिक स्थिर अंतिम अनुभागीय। निर्माता क्रिएटर = नया पार्सल योग्य। निर्माता () {सार्वजनिक श्रेणी बनाएँफ्रैम पर्सेल (पार्सल पार्सल) {अंतिम श्रेणी श्रेणी = नया वर्ग (); category.setCategoryId (parcel.readInt ()); category.setCategoryVideos (parcel.readTypedList ()); * /// ** मैं यहाँ क्या लिखा था *** वापसी श्रेणी; } सार्वजनिक श्रेणी [] नयाअरेरे (पूर्णांक आकार) {नई श्रेणी [आकार] वापस; }}; } ...

android - how to convert PictureDrawable into Bitmap -

How can I convert a bitmap object to a PictureDrawable object? I have shown the following code below and it gives zero indicator. > > Private Bitmap pictureDrawable2Bitmap Bitmap to PictureDrawable Convert (PictureDrawable pictureDrawable) {bitmap bitmap = Bitmap.createBitmap (pictureDrawable.getIntrinsicWidth), ImageDriveBlobalGetIntercityHigh (), Configuration.Argb_8888); Toast.makeText (HTMLActivity.this, "bitmap" + bitmap.toString (), Toast.LENGTH_LONG) .show (); Canvas canvas = new canvas (bitmap); Canvas.drawPicture (pictureDrawable.getPicture ()); Return bitmap; } The sample to show what I am doing in my code; Private picture diagram; Private string url; Private WebView WebView; Private bitmap HTML bitmap; Private Pictorial HTMLPic Draw; // goal is to change WebView - & gt; Picture - & gt; Picture drainage - & gt; Bitmap image = webview.capturePicture (); HTMLPicDraw = New Picture (Picture); // HTMLPicDraw is a PictureDrawable object is goo...

uitableview - How do I create an ios table with first column fixed and the next column, rows horizontally scrollable to 1 -

In iOS, I basically want to display images as follows: Column is required. The image given in the first column is fixed, and in the second column, the rows should scroll horizontally to scroll through the pictures. If you select an image, it should go to another view. You need to follow, and like it. For details about how to determine the first image, there is no better way than this.

c++ - Safely reading string from Lua stack -

How is it possible to read string values ​​safely from Lua Stack? Both the function lua_tostring and lua_tolstring can both increase a Lua error (longjmp / exception of a strange type). Therefore the function should probably be called in protected mode using lua_pcall , but I can not find a good solution how to do this and get string value from Lava stack to C ++. Really need to call lua_tolstring in safe mode using lua_pcall ? In fact it is bad to use lua_pcall because the string I want to read from the Lua Stack is an error message stored by lua_pcall . Use lua_tostring before lua_type : If lua_type returns LUA_TSTRING , then you will not be allocated any more memory to get the lua_tostring string securely. lua_tostring allocates only memory when it has to convert a number to a string.

r - setRefClass pass by value, pass by reference -

I suspect that I do not understand all the aspects of setRefClass in RSS. For example, setRefClass was started I would like to create the variable X so that this variable is equal to a copy of the example, or the example of setRefClass Does. Is there a difference: x = instanceoffsetrphClass and x I am not fully able to understand and I feel that my code has strange behavior. Thanks for your help I do not think your problem is related to reference sections. To do anything, but to do the following, consider the following example: We start by removing all the variables from our workspace and A : rm = Ls ()) A = setRefClass ("A", fields = list (x = "numeric")) Next we create and call the function f : f = function () {X1 = 1 a1 = A $ new (x = 10) x2 & lt; & Lt; - 2a2 & lt; & Lt; - A $ new (x = 10)} f () & lt; & Lt; - Main difference between and = operators' & lt; - & lt; - 'and...

Smarty date variable. Add days, change format -

I have a question about date format in smartaris. Let me run a trick variable: $ order-> Oxidar_accordad-> Value}] Let me give this variable: 2013-03-10 10:45:17 Now I have to add 14 days, delete time and date format: So now my wish is this: 24.03.2013 Is it possible and how do I straighten it / .pl file? Thanks for the help and congratulations! Test in Smertie 3 {"$ Order-> oxford_order number-> values ​​+ 14 days" | Date format: 'DMY'}

android - reference to library project -

I have a project marked as a library and uses that main library It seems that everything is fine , The main project's manifest has library activity with the hole name (package.Nname) but I do not know how to call library classes, I have the main effect (import com.example. Libreriasuscripcion.MainActivity;) from main library And when I do it this way I call from: @Override Public Zeros click on (see V) {// TODO auto generated method stub Log.d ("Zoogo - Oncate", "On OnClick" ); Int'l i = new intent (getBaseContext (), MainActivity.class); StartActivity (i); } There is an error: This log is Cat 03-21 09: 45: 00.534: E / Android Random (413): Fatal exception: main September 3 to 21: 45: 00,534 e / AndroidRuntime (413): java.lang.RuntimeException: unable to instances of activity ComponentInfo {com.example.juego / com.example.libreriasuscripcion.MainActivity}: java. lang.InstantiationException: com.example.libreriasuscripcion.MainActivity 03-21 Sept...

c# - How to store coordinates(Latitude,Longitude) in RDF -

मेरे पास निर्देशांक दिखाना एक सी # वर्ग है वर्ग निर्देशांक {डबल अक्षांश; डबल लोन; } मैं आरडीएफ में आरडीएफ ट्रिपल में इसे कैसे परिवर्तित कर सकता हूं क्योंकि आरडीएफ डबल प्रकार का समर्थन नहीं करता है? और अगर फ्लोट का उपयोग किया जाता है तो मैं केवल 6 अंक का प्रतिनिधित्व कर सकता हूं। " किसी भी विचार? मैं अपनी आरडीएफ स्कीमा बनाने के लिए और scema में डेटा के ट्रिपल्स लिखने के लिए उपयोग कर रहा हूं ... आरडीएफ भी इसका समर्थन करता है। इसे करने के लिए इसे प्राप्त करने के लिए इसका प्रयोग करें।

java - how can I make the webdriver click on element as soon as it is clickable , instead of loading of entire page? -

The "Register as a new user" link text appears on the home page, as soon as the WebDriver gets (driver. Get). But still it waits to load for the full page to be executed below the line. driver.findelement (By.linkText ("Register as new user")). Click (); How could it be possible to click on the WebDriver element as it appears on the page, if any element is visible to other elements or not? I am using: Java, Ubuntu I'm not sure if the untruth waits After completely opening a URL the page is completely Waiting for the driver until the load, but it is clearly trying to wait. In the code below, the driver has to wait until the element becomes clickable and clicks on it. If the element is not clickable in the specified time (in the example below it is set to 30 seconds) then the driver throws timeout exception . WebDriverWait wait = new WebDriverWait (driver, unit in 30 / second seconds); Wait.until (required conditions. ElementtoBabelable (By.li...

ios6 - IOS Custom UIBarbuttonItem change position in detail view -

Image
I am trying to customize UIBarbuttonItem of my navigation bar so that I am using it my appdelegate.m // The Finnish LaunchingWith Option: {UIImage * navBarImage = [UIImage imageNamed: @ "nav-bar.png"]; [[UINavigationBar presence] setBackground image: navBarImage forBarMetrics: UIBarMetricsDefault]; [[UINavigationBar appearance] setTitleVerticalPositionAdjustment: 5 for Bermatrix: UIBarMetricsDefault]; UIImage * barButtonSave = [[UIImage imageNamed: @ "nav-bar-button.png"] Resizable CapsenseSet with Image: UIEdgeInsetsMake (0, 2, 0, 2)]; [[UIBarButtonItem Appearance] setBackgroundImage: barButtonSave forState: UIControlStateNormal Style: UIBarButtonItemStyleDone Barometrics: UIBarMetricsDefault]; [[UIBarButtonItem Appearance] setBackgroundVerticalPositionAdjustment: 5 for Bermatrix: UIBarMetricsDefault]; Yes come back } When I work with it, then I keep a UIBarbuttonItem with the storyboard and I am doing it. I have noticed that the "Save" button ...

python - making a dictionary from two lists using indices -

मेरे पास दो सूचियां हैं: alist = [11,12,13,11, 15] blist = ['ए', 'ए', 'बी', 'ए', 'बी'] मैं एक शब्दकोश बनाना चाहता हूं जहां फॉल्स में चीजें कुंजियां और आइटम हैं Alist में सूचियों के साथ दो सूचियों में सूचकांकों के लिए मान हैं: परिणाम होना चाहिए: {'ए': [11, 12, 11], ' बी ': [13, 15]} मैंने इसे करने की कोशिश की है: dictNames = {} एक्सरेन्ज में (लेन (अलविदा)): Blist में पत्र के लिए: यदि पत्र नहीं dictNames: dictNames [letter] = [] अन्य: dictNames [letter] .append (alist [i]) जो परिणाम देता है: यह पहले से मौजूद अक्षर को डिक्शनरी में संलग्न करने के बजाय क्यों नहीं जोड़ता है शब्दकोश में पहले से ही? पहले, आप दोनों सूचियों पर लूप। अलविदा में हर आइटम के लिए, यह blist के माध्यम से loops तो आंतरिक पाश 25 बार चलाता है इसके बजाय, आप इसे 5 गुना चलाना चाहते हैं, इसलिए आप केवल एक लूप चाहते हैं। दूसरा, यदि आप अभी तक मौजूद नहीं हैं, तो आप सही ढंग से सूची को इनिशियलाइज़ कर सकते हैं, लेकिन उस स्थिति में नंबर सूची में ...

c# - Changing reportviewer values in code -

I have an integer value stored in my database representing the document status. I want to write the report that shows the situation in one of the columns. However, I do not want to show the raw integer value in the column. I want to show a string that turns the situation into a human-readable format. Example: 1 - & gt; New 2 - & gt; Pending 3 - & gt; Sent It looks as if it needs more than one expression - that is: Is the C # code possible? You can also solve the problem using the case in the query that you use to choose . Select position when = 1 then 'new' when position = 2 then 'pending' when condition = 3 then "status" as "sent" as "status" ... ;

python - Special use of args / kwargs -

मुझे कुछ ऐसा करने की आवश्यकता है: def func1 (a, * args, B = "BBB", ** kwargs): मुद्रित "a =% sb =% s args =% s kwargs =% s"% (a, b, args, kwargs) तो ऐसा कॉल करना: func1 ("एएएए", एच = "एचएचएच", जे = "जे जे जे") उत्पादन का उत्पादन: a = aaaa b = बीबीबी आर्ग्स = () kwargs = {'h': 'hhh', 'j': 'jjj'} लेकिन * आर्ग्स के बाद एक डिफ़ॉल्ट नाम का तर्क देना संभव नहीं है ( SyntaxError: अमान्य सिंटैक्स ) यह क्यों अनुमति नहीं है? क्या इसे लागू करने के लिए कोई पठनीय तरीका है? एकमात्र तरीका मुझे पता है b = kwargs.pop ("b", "BBB") , लेकिन यह बहुत पठनीय नहीं है। मैं फ़ंक्शन कॉल परिभाषा में इसे पसंद करता हूं, जहां यह संबंधित है: यह एक पैरामीटर है जो हमेशा के पास एक मान होता है, या तो कोई डिफ़ॉल्ट मान या उपयोगकर्ता द्वारा दिये गए मान। संपादित करें मैं b के सामने args : def func1 डाल सकता / सकती हूं ए, बी = "बीबीबी", * एल्ग्स, ** क्वार्ज): मुद्रित करें ...

linux - How to read path from input file -

I XML files.now I have a txt file path for those who want to read the path of the text file and print each XML Number of tabs present in file.how to do this? Here is what I have done file with the path txt / home / user / Desktop / Software / Firefox / searchplugins / bing. xml /home/user/Desktop/softwares/firefox/searchplugins/eBay.xml /home/user/Desktop/softwares/firefox/searchplugins/answers.xml / home / user / Desktop / software / Firefox / Searchplugins / Wikipediakxml / home / user / Desktop / softwares / firefox / blocklist.xml code to count the tab for each file code :. What tab = $ (tr -cd '\ t' & lt; $ file | wc -c); "File $ tabs tabs" "gt; & gt; /home/user/Desktop/output.txt in $ file" Echo! " where /home/user/Desktop/files.txt list of Xml files: #! / Bin / bash while IFS = File [-f "$ file"]; then tab = $ (tr-cd '\ t' & lt; "$ file" | wc -c); "$ $ in file $ Ta...

php - email via server -

I have an app where people can fill some data and send it to my email, mail is sent and Works fine except that the body of mail is empty. My method for the connection: - (zero) ActionShop: (UIActionSheet *) Action sheet did the DISISM with distribution index: (NSITAZ) button index {if ( ! (Button Index == [Cancel Action Sheet Button Index])) {NSString * post = nil; Post = [[NSString alloc] initWithFormat: @ "name spell =% @ Uitleg =% @", spelnaam.text, Uitleg.text]; NSLog (@ "DIT Word Vertyurud% @", Post); //works fine! NSDTA * PostData = [Post Data Usage Encoding: NSSEIITITING Encoding Permission Loansy Conversion: Yes]; NSString * postLength = [NSString stringWithFormat: @ "% d", [PostData Length]]; NSMutableURLRequest * Request = [[[NSMutableURLRequest alloc] init] autorelease]; [Request Set URL: [NSD URL URL with string: @ "http://www.myserver.nl/theemailfile.php"]]; [Set http system: @ "post"]; [Set set property: post leng...

how to change height and width manually of pdf by using html2pdf in php -

After I am using html2pdf to convert html to pdf ... actually i like 12x12in (inch) HTML container has a larger size. And I have used the A4 size for the first time, then my HTML content has not been fully displayed according to the size (12x12 inch), then I have noticed your site and I have got all the paper sizes here. Thanks for this important information ... but now, when I have used the A3 size, I've got all my HTML content inside the PDF file ... but p I have to know ... so i want to know ... what is there any way to reduce this place in pdf or any other way to convert HTML into pdf with manually defined page height and width ... Thanks in advance. HTML2PDF class creator says that the $ format parameter is the same > TCPDF class @param mixed $ format tcpdf The class says the code used for the constructor code> pages about the $ format parameter, it is either one of the following values ​​(case insensitive) or a two-element array form In a width...

php - How to separate a while loop into pages using only one script? -

I am currently creating a survey-type system in which the system uses a one-time loop, Displays the number. Unfortunately, I do not know how to create a page and instead, I can completely loop it into a full-page script. Here's my code: while ($ fetch = mysql_fetch_array ($ query1)) {// code here ($ fetch = mysql_fetch_array ($ query2)) { // Reply if (isset ($ _ POST ['voted']) {if_array ($ _POST ['scores ('. $ Fetch ['questionID']. ')'], $ Radio value)) {} Other {$ Miss ++; } $ Checker = true; }} // Check if the radio button is missed if ($ checker == true) {if ($ $$$$ lines $$$ is missing & lt; $ rows & $ miss! = 0 ) {Echo " all items are required "; } And {// some code here}} $ query = mysql_query ("Select * from question"); While ($ fetch = mysql_fetch_array ($ query)) // displays the question with the question number // some code here shows a radio button from // 1 to 5 / there are some code here}} By...

mysql - Symfony 2 Console command for creating custom Database -

I am working on the Simplon 2 project where each user has his database. In my config.yml file, The principle is: dbal: orm is set to a client, but there is no connection property because they are set to runtime and are referenced by all users. I.e I only have a default debil connection and two orm-connection and the user's volume is unlimited. This works fine but I need to create databases and schemas when user is registered (FOS UserBundle). I can keep my logic in the Extended User Bundle Controller The problem is that I can not run 'php app / console doctrine: database: create' because there are no fixed parameters for the new user. Is there a way to specify custom database parameters for the console commands? I could probably find some pretty ugly mysql commands around this but I'd rather not want to thank many in advance! You can create your own order as outline using the code given below: Namespot theory / bundle \ datrein bundle \ command; Use Symf...