Posts

Showing posts from January, 2015

scope - Using Instance Variables Across Modules in Ruby -

Here is an example of a script that I want to be able to support: Class testing includes dialect url_is 'http: // localhost: 9292' end = page = test.new @page.view Here are some things to note: I am including a speech module (code is shown below.) I am calling the url_is () method directly on the class. I'm going to set a @URL variable to see a view (example) on an example of class method () method that ideally looks like that variable Will be able to read. This is the code that I do not seem to be able to do this here is the code which supports the above script: Module Bid Module Generator Module Accoreration DRF URL_IS (URL) @url = URL and End End Module Dielect DRF self.included (collar) collar. Delint :: Expand the Generator :: Stop the End Def "# {@ url}" End End Here you can see that when the bid is spoken, The way inhibition module that sets the frequency variable to url_is () and url_is () sets the frequency variable, you can see ...

objective c - Why does casting a large double to a long sometimes return a positive and other times return a negative value in C? -

I put it in the case of an iOS test and run it in the (32 bit iPad simulator): Double Wow = 3166323616091.220215; NSLog (@ "Double:% F", WOW); NSLog (@ "long:% ld", (long) whu); NSLog (@ "double:% F", 3166323616091.220215); NSLog (@ "long:% ld", (long) 3166323616091.220215); Output is: 2014-04-23 13:40: 50.904 extract [53336: 303] double: 3166323616091.220215 2014-04-23 13: 40: 50.905 ext. [53336: 303] Long: -2147483648 2014-04-23 13:40: 50.906 ext. [53336: 303] Double: 3166323616091.220215 2014-04-23 13:40:40: 50.907 Execute [53336: 303] Long: 2147483647 Why do I get this to shorten the big double value in maximum value for maximum (32 bit) but when literally cut a positive Value returns variable casting negative value Gives Yon? In fact, I do not understand why the negative has returned back to everyone. Am I missing something like this with precision, perhaps? Runtime code will result from a variable casting and the re...

java - How can I create customized builtins in Jena? -

I'm wondering how I can create a new custom build for Jenna. I know that for this purpose both "class" baswilin and class "bitrinist" (but how?) Should be used. I have also found a plugin for Eclipse which is called "SADL" but I'm not sure if I can use it for this purpose. If I can ... Which method is better and why? Will any of you tell me how should I take it? Cheers! In one, I provide the code displaying the answer to this question. I have repeated it here for those people who need a quick reference in this buildin, the name is example and according to its maximum functionality and accordingly. J.T. for reference to your previous question Thank You for. The underlying registry. Heregistry. Registry (New BaseBeltin () {@Override public String getName ()) Return "Example";} @ Override Public Aid Head action (last node [] args, final int length, final roulettecontent reference) {System.out.println ("Head Action:...

while loop - Mode of a List - Python -

I am trying to write my own function which finds mode in the list, But this sptter occurs when there are multiple modes to help me add something to a function, which is related to the case in many ways. thank you in advanced! DEIF Modellist (AIM): subscript = 0 while subscript & lt; Lane (nums): If nums.count (nums [subscript]) & gt; Nums.count (nums [subscript + 1]): Return is "mode" + str (nums [subscript]) + "." Other: subscript + = 1 print mode list ([2,4,6,8,6,8]) Code: Demo: & gt; & gt; & gt; Counter & gt; & gt; & gt; DEF Modellist (LCT) by collection import: ... counter (LST) back .most_common (1) [0] [0]. .. >> Add to itertools.groupby () If you want to import all value: import from importer, the importer came to the object Import from user: deferred mode list (lst): calculation = counter (lst) group = by group (calculations max_opran (), item (1)) next (grouped) [1]] DEMO: > Impo...

c++ - 2D Array of pointers to objects -

I'm trying to be a manager class in which some objects include arrays of pointers, let's call these objects mushrooms Are there. But I do not know how to get the syntax for expression and once I have declared it, how should I use the indicator. Here are some ways that I thought the announcements should be done. mushrooms ** mushrooms; Mushrooms * MushroomsAurre [10] [10]; Mushroom Mushroom Aurere [10] [10]; Is any of these valid? What are the differences? And how would I have to go about mushroom reaching pointers after the 2D array was declared after "right"? Thanks post = "itemprop =" text "> sign It should be very straightforward: Mushroom * Mushrooms around [10] [10]; And how would I go about pointing to the mushroom in a function if you have defined a local variable Are you talking about and used inside the same function? Few functions from zero (mushrooms * mushrooms around [10] [10]; Mushroom array [0] [0]...

symfony - Doctrine ManyToMany - join multiple relations -

I'm wondering if there is a way to get a record using multiple relationships from a table (to explain it With an example that is probably easy) I have 3 models: There are many links between article, subject and type and article & lt; - & gt; Topics & Articles & lt; - & gt; The type and what I am looking at is to get the type of articles that have been assigned to the definitive subject. I hope this makes sense. Below you can see the announcement of my institutions: class articles {/ ** * @ subject * * @ORM \ ManyToMany (targetEntity = "Topic") * @ORM \ JoinTable (name = "article_topic") * / protected $ topics; / ** * @ type type * * @ORM \ ManyToMany (targetEntity = "Type", invoked by = "article") * @ORM \ JoinTable (name = "article_type") * / protected $ types; } Article subject {/ ** * @ Article * * @ORM \ ManyToMany (targetEntity = "article") * / Private $ article; } Article type {** ** Ar...

sql - Error with Between clause -

I am getting the following error with this question: between 'operator' and '[DateTime] between query expression [ StartDate ' query and database access is in 2010 Thank you in advance for your help! SELECT t1 [Name], Max (T1 [Sum3Areas]) from [max] to (select qry example. [Name], year (qryUnion. [Date]) DTIIER, DatePart ("ww", [date]) + DIFFeek as IIF (Wight ([Date]) = 6,1,0), as SUM (qryUnion. [Zodiac]) from Sum3Areas (as selection 1 source, as EID [name ], Closed as [zodiac], completed as IssueTrakINNER [date] [dateRangeCriteria] [date time] and [end] union as the source of all select 2, EID AS [Name] [ Date], at the end of the date, enter the code from [date] to the Kana Inner [date range rating] at [date time] [start date] and [end] union as source 3, eid AS [name ], [Date], year (Curie union. [Date]), datedart ("YW") as the date [date], [DateCell classification] from O. Quienian Group by Qi Union, ", [Date]) + IIF ( T1 Group by ...

c++ - Why is OpenMP outperforming threads? -

I'm calling it in OpenMP #pragma for num_threads (totalThreads) Omp parallel) (unsigned i = 0; i; total threads; i ++) {workOnTheseEgeges (startIndex [i], and index [i]); } and it is in C ++ 11 std :: threads (I believe they are just pthreads) vector & lt; Thread & gt; Threads; (Unsigned i = 0; i But, the OpenMP implementation speed is 2x - fast! I expected C ++ 11 threads to be sharp, because they are low levels Note: The above code is not being called once, but maybe 10,000 times in the loop, it may be that with some To do? EDIT: For clarification, in practice, I have OpenMP or C + 11 version - not both. When I am using OpenMP code, it takes 45 seconds and when I am using C ++ 11, it takes 100 seconds. Where total threads comes from your OpenMP version? I'm not sure this is startIndex.size () . OpenMP version totalThreads workers queue requests on thread. It seems that C ++ creates 11 versions, startIndex.size () threads, which contains...

perl - Baffling "Useless use of a constant in void context" in simple code -

I am performing a small pearl script inside a bash script. Pearl reports that Absolute use in unused material- A line 28 , which is later at the end of the Pearl code. Bash excerpt: To parse the album list file # Pearl script # PERLSCRIPT = $ (cat & lt; -'__END__ '#! Use / usr / bin / perl hard; Use caution; Use XML: my $ album_file = $ ARGV [0]; My $ album_id = $ ARGV [1]; $$_data = $ XMLin ($ album_file) , Balrere => [album ']); My $ album_key = ""; ($ album == $ album_id) {$ album_key = $ albums_data- & gt; {album} - & gt; My albums are $ ($ Album == $ album_id) {album} - & gt; {$ album} - & gt; {key}; print "$ el Exit_button_button_button_button_button_button_button_button_button_button_button_button.png / Code> When I am executed, I see the following: 454: calling parallel useless usage What is the complaint about? I believe this will be done with '__END__' Refers to the line. Bash & lt; ...

javascript - How to push data into highchart with just one decimal place? -

I am trying to create sinus and cosinus graphs. Data pushed in such a way: Data: (function exp () {var data1 = [], // i = 0, x = 0, y = 0; for (i = - 10; i & lt; = 10; i = i + 0.1) {// x = i.to fix (4); x = i; y = math sin (i); data1.push ({// x: Math round (i * 10000) / 10000, x: X, y: y,}); if ((y.toFixed (4) == 0) || (y.toFixed (4) == -0)) / var x = Math.sin (mathematics. I * 10000) / 10000); // var y = Math. (Math. Sin (i) * 10000) / 10000; addtext (x, y);}} return data 1;}) ()}, Therefore the x value should be: -10; -9.9; -9.8, -9.7 and so on ... but if you look at the graph, then the x values ​​are: -10; -9.9; -9.8, and then -9.700000000000001 and all the next x values ​​have been damaged in the same way. I have tried to use methods of .toFixed and .toPrecision , but they (for example) made point [0, Something like sin (0) should be [-0.0000, -0.0000], what's definitely bad, because it assumes x -0.000000000000187 ... does anyone help me push data with ju...

php - Order mySQL results based of the current time and the chosen time by the user? -

In my page, I show some entries based on the time limit I selected, to be chosen to contact the user , And it is saved in mySQL 09: 00-11: 00 11: 00-13: 00 13: 00-15: 00 15: 00-17: 00 For now, I show results according to the time selected $ sql = "Select from table order based on the time selected"; I want to sort the results based on the present time. For example, if the time is 10:30, then the first rows selected are between 09: 00-11: 00, if it is 11:00, then the first 11:00 - 13:00 result Show. I am thinking about a between , but I do not know how to move forward with it Assume that selected time characters Type is, in a definite and authentic format, it is not difficult at all. We currently need to format the format hh: mm (like 10:30) to match the archived format. If we want to get the current time from the database in that format, then it is a simple expression: DATE_FORMAT (NOW (), '% h:% i ') The ugly part is to split...

sql - Set cursor order to desc but still start at beginning of table? -

I have a problem with the backing of a cursor I have a ranking of items if input 2 is, then I I want to select item 1 and 2, but to show it this way; rank 2 1 Now, when My cursor just follows by order of items based on rank Choose; Used in the loop in this way: FOR i IN REVERSE 1..v_num LOOP dBMS_ OUTPUT.PUT_LINE (to_char (v_RANK) || To_char (v_ITEM); v_arank, v_item; when CIrCank * notesfonds; and loop; Carchcatch when there are number of items to be displayed. I have tried to set For asc and then desc (like order asc, rank desc , both), but that does not work. Reverse output I have seen other such questions which are similar but no answer was found, I am stumped. It has been an easy decision, I just can not seem to know what it is. Assuming that v_num is considered the number of elements that you You want to return, it looks as if you choose from * (rank select, order rank from the order ACC gate This item) where rownum & lt; ...

javascript - jQuery Mobile slider handle moves past track at one end -

Image
Then the issue I am coming to is that my slider handle appears to run before the limit of the track when I call it Moves the minimum price (top left) you can see what I'm talking about below, as the handle of the first slider is still within the track, but the handles of the second slider eliminate it by a few pixels. looks like. How do I offset the handset here? Or is there something that I can change with the track to fix this problem? Thank you! It looks like you've changed the size of the track and handle it via CSS when you change the handle size, then you have to change the negative left margin to half the width of the handle . In addition, reducing the radius of the track's range will help slightly in the sequences: .ui-slider-track, .ui-slider-switch {height: 30px; Boundary-radius: 12px; } .ui-slider-track .ui-btn.ui-slider-handle {width: 16px; Height: 36px; Margin Top: -20px! Important; Margin-left: -8px! Important; }

Memory de-duplication in the Linux kernel -

Can anyone explain me the algorithm included in memory de-duplication in the Linux kernel It is difficult to understand and implement it. Can anyone explain this in simple steps? The article you linked appears to be quite straightforward. The application advises the kernel (by using madvise () syscall) some areas of that memory may have duplicate pages. KSMD adds pages in this area to "unstable list" (tree actually, for ease of viewing later). "Volatile" means that pages are still likely to change. Checksum is calculated in the "volatile" list for each page The code will scan all the pages in the KSMD list and see if the checksum had changed. If it is really different every time, then nothing should be done (the page is still "unstable".) After the notice of some scanned KSMD , that the checksum page for some particular was stopped changing between iterations (the page was "static"), this "stable" lis...

parameters - Entering text into tinymce using webdriver, ruby and variables -

I am using WebDrive and Ruby ... So I was able to write in text Was using the script below to tinyes the field. However, on the last line, driver.execute ... I would like to replace the fixed value 'bob' which is going to pass the variable, parValue I have tried some modifications to the driver. Execute_script line, but I continue the errors. In other words, I do not know javascript and I am not able to find a way to do this. I tried to change the code and send it, but it does not print anything in my tinxbox box. Is the value used to be passed from parValue and 'Bob' can be changed? def enterValues ​​(driver, parField, parValue) tinymce_frame = driver.find_element (: id = & gt; parField) driver.switch_to.default_content driver.switch_to.frame (tinymce_frame) editor_body = Driver.find_element (: TAG_NAME = & gt; body ') driver.execute_script ("arguments [0] .innerHTML =' bob '", editor_body) end It's very easy, so I...

Why Object.new.methods == Object.methods is false in Ruby -

आईआरबी में, Object.new.methods == Object.methods या हैश नए और बिना किसी नए आउटपुट के विभिन्न तरीकों के साथ क्यों? वस्तु एक कक्षा है Object.new एक नया ऑब्जेक्ट बनाता है, जो क्लास नहीं है चूंकि कक्षा के ऑब्जेक्ट से अलग-अलग उदाहरण तरीकों हैं, इसलिए उन अभिव्यक्ति के परिणाम समान नहीं हैं।

Know If a String contains the same sequence in Java -

Right before that I want to know how often I can say "laziness" to the world string string 1 = "quick brown fox jumps on a celestial dog"; String String 2 = "lazy brown fox jumps on lazy dogs"; I know that two strings will work by using the Java string. Include, but how do I know that the first string in it is the word "lazy" and the second string 2 is "lazy" The word because it has a boolean method, so in this case I do not need it. I want to know how to do this without the use of regesx, because I am learning how to create a Reggae engine. It could actually use simple regex in one pass. Of course you can summarize it and make it systematic and streamlined. pattern p = Pattern.compile ("lazy"); Int events; Matcher M = P. Maternity (string 1); // etc while (m.find ()) occurences ++;

python - How to make the turtle draw one step at a time -

I have a hangman's game, I think that in every wrong letter to attract a part of the hanging, But I do not know how DEF Dropsl (user input, word): Then I must take the following steps: Import Turtle Hangman = Turtle Turtle () Hangin Serikal (45) Hands Wright (90) goes Forward (150) .... How can I write this code so that not every user input should be dragged into one word from those steps? If you define a counting variable to track the number of incorrect counts, then you can define a function Import Turtles, Time Hanging = Turtle Turtle () DRF draw_hangman (counting): If calculation & gt; = 1: Hangman (Score: 3, div>

java - actionPerformed using two same buttons variable -

जेपीएनएल बीटीएन = नया जेपीनल (); Btns.add (नया जेबटन ("बीटीएन 1")); Btns.add (नया जेबटन ("बीटीएन 2")); Btns.setLayout ((नया फ्लो लेआउट (फ्लो लेआउट ट्रैफ़िक))); southPanel.add (btns); हैलो, ऊपर, मैंने कोड प्रदान किया है। मैं कुछ बटन के लिए क्रियात्मक विधि कैसे बनाऊं? उदाहरण के लिए, जब मैं बीटीएन 1 पर क्लिक करता हूं, तो इसे प्रिंट किया जाएगा बटन 1 को क्लिक किया गया है। जब मैं बीटीएन 2 पर क्लिक करता हूं, तो इसे प्रिंट किया जाएगा बटन 2 को क्लिक किया गया है। धन्यवाद। बटन को ऑब्जेक्ट का एक उदाहरण बनाएं .. जेबटन बटन 1 = नया जेबटन ("बीटीएन 1"); जेबटन बटन 1 = नया जेबटन ("बीटीएन 1"); फिर उन्हें पैनल में जोड़ें btns.add (button1); Btns.add (बटन 2); बटन को एक एक्शन कमांड जोड़ें: button1.setActionCommand ("button1"); button2.setActionCommand ("button2"); \ एक ऐसा क्लास बनाएं जो ActionListener सार्वजनिक शून्य क्रियाप्रवर्तित (एक्शन एवेन्ट evt) {स्ट्रिंग एक्शन कॉमांड = ईवैट.एटएक्शन कॉमांड ()...

javascript - Can the browser change references to tags? -

मेरे पास निम्न जावास्क्रिप्ट कोड है: var bodyRef फ़ंक्शन init () {bodyRef = document.body} init () फ़ंक्शन को body.onload पर लागू किया जाता है क्या यह सुरक्षित है मेरे कोड के अन्य भागों में bodyRef चर का उपयोग करने के लिए, या document.body ब्राउज़र के दस्तावेज के संदर्भ को बदलने के लिए स्वतंत्र है नहीं, यह ' टी। document.body हमेशा वर्तमान फ्रेम के शरीर को इंगित करता है। क्या मेरे कोड के अन्य भागों में bodyRef वेरिएबल का उपयोग करना सुरक्षित है हाँ यह है। लेकिन सुनिश्चित करें कि आप document.body को कुछ असाइन न करें

string - Write char[128] array to file in C -

I wrote a program to write a four [128] array in CR to file using the write () function is. My code, though, after writing, I can see that the "testeg" string "d" or "a?" Is there a proper way to write four [] arrays to file this in the TestFile.txt file? int main () {four pathfile [MAX_PATHNAME_LEN]; sprintf (pathfile, "testFile.txt"); Int fareccipitator = open (pathfile, o_rrdw | o_appnannnarrat, 0777); int num_segs = 10; Int Mode = 200; Const char * segname = "testeg"; / * * / Four real_assigns [128]; Strcpy (real_segname, segname); Write (filed claims, & amp; num_segs, sizeof (int)); Write (Claimed Claimant, Real_signame, Stellen (Real_assignment)); Printf ("real_summammem length% d \ n", (integer) string (actual_signame)); Write (filed claims, and modes, sums (integer)); Close (filedescriptor); Return 0; } ... char to write [128] array. .. I can see that the string "testeg" ... ... is a cont...

flask-admin ModelView custom create_form -

I have a custom UserViewCreateForm (using wtforms) in my flask admin I am composed of: - App.vendors.models Import from vendor class UserViewCreateForm (form.Form): Username = fields.TextField ('Username') first_name = fields.TextField ('First name') last_name = fields text field ('last name') email = field. Testfield ('email') contact_number = fields.TextField ('contact number') password = field. Passwordword field ('password') is_admin = fields.BooleanField ('Administrator') (URL), (), (),), (),), Form_args = dict (`selectionField` title = dict (option = TITLE_TYPE) Def.___it (): def __init __ (self, session, ** kwargs): super (UserView, itself) .__ init __ (user, session, ** kwargs) Def is_accessible (auto): return login.current_user.is_auth enticated () Def create_form (self): form = UserViewCreateForm () for form.vendor.choices = [vendor.query.all (vi) v [[v., V 'name]] [(v.id, v. Name]] Return form The Seller ...

swing - Contentpanes not working in java -

I can reply early tomorrow (I'm really tired) did this Was: This line of code is giving me an error: win1.getContentPane (). Add (empty label, BorderLayout.CENTER); I have problems with this part: Empty label This throws an error and it To change win1, which does not show an error, but throws it Full class: package examplepackage; // import import java.awt.borderLayout; Import javax.swing.ImageIcon; Import javax.swing.JFrame; Import examplepackage.location.GetFilepath; Public category starter {public static zero main (string [] args) {GetFilepath FP = New GetFilepath (); Jeffram Win 1 = New Jeffram ("Example Window"); win1.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE); Win1.getContentPane (). Add (empty label, BorderLayout.CENTER); Win1.pack (); Win1.setSize (600, 800); Win1.setVisible (true); Win1.setLocationRelativeTo (win1); win1.setIconImage (new IMP (FP + "\\ window \\ main"). getImage ()); }} Then, by example, GetFilePath ...

Activate Javascript when click link PHP -

I have a link in HTML / PHP, and on click event, I have to implement JavaScript / Jquery code / code: PHP / HTML: echo "& lt; a id = 'codeelinka' class = 'linknew' href = '' & gt; $ kd_mrp & lt; / A & gt; "; Javascript: & lt; script type = "text / javascript" & gt; $ ('# Codelink') Click (function () {var value = "bbbb"; Alert ("AAAAA"); $ ('# codelink'). FadeOut ();}); & Lt; / Script & gt; How do I enable the script? e.g. echo " You need to stop the anchor tag default action. You can also do this like $ ('# kodelinka'). Click (function (e) {E.preventDefault (); Make your script work in your page

spring mvc - which annotations comes under ? -

Does it scan for controller, service, daO, autowire annotation? What is the impact on request mapping, responibody, and other hibernate annotation line id, table etc. If I am not using any controller, service, doo, autoinver annotation in my project and using only request mapping, responibody and hibernate-annotation then it is necessary to sender xml or not. For your scenario, there is no answer. This sample is because you do not add any spring annotation to the class, it means that beans are not managed by spring. So spring can not do anything on it, it is similar to hibernate annotation. For further reference: Component-scan, I advise you to open a reference schema: It is a description of it. Also note that for all types of configurations, please open the schema and Check the details, it is very clear.

android - Show ProgessDialog on Button Click -

मैं प्रगति डीआईएलओघ में OnClick () विधि को मेरी गतिविधि । मैं निम्नलिखित की तरह कर रहा हूं, लेकिन कोई त्रुटि है क्या ठीक किया जा सकता है 04-24 अक्टूबर : 52: 46.241: ई / AndroidRuntime (21,846): गंभीर अपवाद: मुख्य 4-24 अक्टूबर: 52: 46.241: ई / AndroidRuntime (21,846): android.view.WindowManager $ BadTokenException: -: 52: 46.241: खिड़की जोड़ने में असमर्थ टोकन रिक्त नहीं एक आवेदन 4-24 अक्टूबर के लिए है ई / AndroidRuntime (21,846): android.view.ViewRoot.setView पर (ViewRoot.java lesson161) 04-24 10: 52: 46.241: ई / एंड्रॉइड रेंटाइम (21846): एंड्रॉइड। पर। विन्डो मैनेजर आईमप्ल.एडव्यू (विंडोमैनैजरमॉड। जेवाइआर 77) 04-24 10: 52: 46.241: ई / एंड्रॉइडरेंटाइम (21846): एंड्रॉइड। पर। विन्डो मैनेजर आईएमएलपी। एडव्यू (विंडो मैनेजर इंपल। जावा। 9 4) 04-24 10: 52: 46.241: ई / एंड्रॉइड रेंटाइम (21846): एंड्रॉइड.एप.डिलाओग। शो (डायलॉग। जावा डे6565) 04-24 10: 52: 46.241: ई / एंड्रॉइड रेंटाइम (21846): कॉम पर। Wamiq.test_layout.ComposeMessage $ 4.onClick (ComposeMessage.javathing37) 04-24 10: 52: 4...

ios - Transfer money in application -

My application is using funds transfer between users. Here is the flow of my application. Users will register in my app. After that, he repays his account to send money to another account. When the user recharges his account app, he will provide a token (virtual money) to keep his balance in the app and send it to another user. And then users who receive the token from another user, whenever they want it will claim the application with their money. Meanwhile my application is charging the user a small amount when he sends money to another user. Therefore, when any user recharges the account, he will pay real time money and bring the token and when another user receiving that token claims to pay, he will pay the app. In real-time Can anyone tell me how to maintain real money transactions, this means what payment gateway would I use for both scenarios? Should be 1. When a user restores their account 2. When the user claims for his money I am currently using PayPal as my PG. I...

sql - How to optimise query containing subqueries from same table? -

Image
I am very new to MS SQL I have a table that includes all comments from customer As well as admin [CommDate]) [TicketId], [t0]. [TransactionID], (SELECT MIN ([t1]. [CommDate]) [DBO]. [Comments History] AS [T1] WHERE [T1]. [TTIID] = [T.]. [TTIID]) and ( [T1]. [Like commented '% client%'] [Asked midday], (SELECT MIN ([T2]. [CommDate]) [Comments] History [T2] where ([T2]. [ Ticket ID] [T0]. [Ticket] and (No ([T2]. [Like commented '% client%']) AS [ResponseManadat] FOR [DBO]. [Comments History] AS [T. ] Where (converter (DATE, [t]]. [Comet]] gt; = DATEAD (mm, -1, gaterate ()) and [T] [TTIID] is not [T] [TTI] [TTIID] DESC, [T.]. [Command] I have applied the index, but since The non-unique content of the column is not very helpful. Is there any other way to write these types of questions, or should I consider reducing the table itself? returns the above query results, but is very slow, I want to know that my query op Is not optimized or is the selection of th...

python - Context with Render page in Django app -

मेरे djangoApp में, views.py मेरे पास है: status = true context = { 'स्थिति': स्थिति, "फ़ॉर्म": प्रोफ़ाइलफ़ॉर्म ()} वापसी सौंपनेवाला (अनुरोध, "नमूना / समाचार", "संदर्भ") क्या होगा अगर मैं संदर्भ के साथ रीडायरेक्ट का उपयोग करना चाहता हूं समारोह? उदाहरण के लिए: स्थिति = सच संदर्भ = {'स्थिति': स्थिति, "फ़ॉर्म": ProfileForm ()} वापसी पुनर्निर्देशित ("नमूना / न्यूज़म्मा.html", संदर्भ) - यह नहीं है काम!! मैं रीडायरेक्ट फ़ंक्शन के साथ संदर्भ का उपयोग कैसे कर सकता हूं? पुनर्निर्देशित फ़ंक्शन तर्क के रूप में कोई भी टेम्पलेट नहीं है। इसे देखने के नाम या यूआरएल की जरूरत है पहली तर्क के रूप में। यह देखें पुनर्निर्देशित के लिए आवश्यक संरचना है। यदि आप पुनर्निर्देशित के साथ डेटा भेजना चाहते हैं, तो इसे आज़माएं: def my_view (अनुरोध):। .. वापसी पुनर्निर्देशित ('कुछ-दृश्य-नाम', स्थिति = सत्य)

java - Cleaning Tomcat server causes 500 error -

Image
For some strange errors was a service I was going well, I was looking for space (this servlet area New) and chose to clean the server (not the project). After doing this, I get the following error: where others get this error because Servlet does not have a package defined, but this Servlet was working and I have never changed the servlet code what does it do Can be cleaned? I am using Eclipse Kepler to run this environment. Stack trace: Apral 24, 2014 07:14:16 org.apache.catalina.core.StandardWrapperValve serious call: servlet MyServ allocate exception java.lang.ClassNotFoundException: org.apache.catalina. loader.WebappClassLoader.loadClass (WebappClassLoader.java:1680) on org.apache.catalina.loader.WebappClassLoader.loadClass (WebappClassLoader.java:1526) MyServ on org.apache.catalina.core.StandardWrapper. LoadServlet (StandardWrapper.java:1128) org.apache.catalina.core.StandardWrapper.allocate (standardWrapper.java:827) at org.apache.catalina.core.Standard...

What is the programming language with syntax like this? -

I have some scripts written in the proprietary language. I want to know if someone with this kind of syntax Is also a language? PROCEDURE MY_PROC_NAME DO {Number of ABC numbers [ABC]: = 123; If ([ABC] = 123) then {when (true) DO {}} ELSE {returns} # a comment some function (123, 456); Call another document; } Thank you. It seems that comal.

Prolog Assigning integer to a variable -

I am new to Prol, and I am using GNU prol, so no clip (FD) is permitted. Whatever I'm trying to do, is for an integer n, make a list with elements of 1 ~ n. Set (3, T). Production T = [1,2,3] Even so far away from me: set (0, []). Set (N, T): - Set (N-1, T1), (T1, [N], T). When I try Set (2, T), it crashes. I was debugged with a trace and found out that it is not evaluating N-1 but it is doing N -1-1-1 ... Anyone can tell me that How to solve this? Thank you. should be: set (n, t): - N2N1, set (N2, T1), append (T1, [N], T). Arithmetic operations are done using the is / 2 . There is a cloak for N-1 , - (N, 1) (like N2 is N-1 is the short story (N2, N-1) ), then you were just making the infinite tree - (- (- (- (... (1), 1,1,1) A little educational note: If you want to have a set / 2 for a proper connection, then it's like Can answer the questions set (3, x) , set (x, [1,2,3]) and set (x, y) Without error, you should write this way: ...

javascript - D3.js, multiply element -

I'm D3.js newbie I am trying to duplicate a SVG group but I do not understand That's how to do it correctly. This is my group: // External & lt; G & gt; Var group = svg.append ("g"); Group.attr ("class", "mygroup"); Group.append ('circle') .attr ({cx: 20, cy: 100, r: 4, fill: 'black', 'fill-opacity': 1, stroke: 'red', 'stroke-width': 0}); // internal and lieutenant; G & gt; Line and text with var groupLine = group.append ('g'); GroupLine.append ('line') .attr ({x1: 20, y1: 100, x2: 20, y2: 20, stroke: 'black', 'stroke-width': 0.4}); Group line. Append ('text'). Text ('Text Text') .attr ({x: 200, y: 200, 'text-anchor': 'start', 'conversion': 'translation (-182,294) will rotate (-90)'}). Style ("font-family", "verdana"). Style ("font-size", "12px"); (Bela here :) Now, o...

javascript - Jquery ajax success function not executed? -

जेक्जरी अजाक्स सफलता फ़ंक्शन निष्पादित नहीं किया गया है? जेसन यहाँ /controll/operation.php?p=demo {"message-count": "1", "संदेश" से जेएसओन आउटपुट है: [{"to": "3321313", "स्थिति": "6", "त्रुटि-पाठ": "अपठनीय संदेश - अस्वीकार", "नेटवर्क": "एमवी-निहित"}]} यह जेसन सत्यापनकर्ता से एक वैध जेसन चेक किया गया। जावास्क्रिप्ट कोड $ ('# send')। क्लिक करें (फ़ंक्शन () {var to = $ ('# से')। val (); var प्रेषक = $ ('# प्रेषक')। val (); var संदेश = $ ('# संदेश')। val (); अगर (== "" ) ($ ("# Forto")। AddClass ("है-त्रुटि"); वापसी वापस;} अगर (प्रेषक == "") {$ ("# forsender")। AddClass ("है-त्रुटि"); वापसी झूठी;} अगर (संदेश == "") {$ ("# फ़ॉर्मसेज")। AddClass ("है-त्रुटि"); लौटाने के लिए झूठे;} $ ("# send")। Prop ("disabled", true); $ ...

assembly - FASM Bootloader input -

I started by creating a bootloader from scratch in FASM. I just made a basic input but I do not know how some To do. This is my code: Start: mov ax, add 07C0h ax, 288 mov ss, 4096 mov ax, 07c0m mov ds, aus wax c, text_string Call print_string jmp read; The infinite loop of reading! Text_string db '& lt; Hammerz & gt; : Booted! ', 13, 10, 0 read: mov ah, 0h; Get the character from keyboard int 16h; Store it in AL MOV ah, 0eh; Display a letter in AL int 10h; Alias, read it echo jmp read_read_txt: mov c, AL call print_string print_string: mov ah, 0 this Repetition: lodsb CMP al, 0Ge .Done int 10h jmp .repeat .done: Ret times 510 - ($ - $$) db0 dw 0xAA55 This accepts input on console , But when I press enter, I want to see the contents of the input and depending on it, I want to do the stuff. In addition, I want to move the cursor to the next line Now if I enter I write the text on the same line. In the place where you meet four and then write it on the s...

execute function automatically in Angularjs -

I have to execute this function automatically, but I'm not working. $ scope.checkdate = function () {$ scope.checked = 0; $ Scope.unchecked = 0; (Var i = 0; i & lt; $ scope.inventories.length; i ++) {If ($ scope.inventories [i] .modified === $ scope.time) {$ scope.checked = $ scope. Checked + 1; } And if ($ scope.time2! == $ scope.time) {$ scope.unchecked = $ scope.unchecked + 1; }}}; $ Scope.checkdate (); And my template looks like this: & lt; Ul ng-init = "checkdate ()" & gt; & Lt; Li & gt; & Lt; Input type = "checkbox" /> Checked {{Check}} & lt; / li & gt; & Lt; Li & gt; & Lt; Input type = "checkbox" /> Unchecked {{uncheck}} & lt; / li & gt; & Lt; Li & gt; & Lt; Input type = "checkbox" /> All & lt; / li & gt; & Lt; / Ul & gt; First of all, almost ng-init to: The only proper use of NGIITIT is to aliasing the special properties of NG...

r - Change the thousands separator in a ggplot -

When plotting a plot with ggplot, I'm having trouble getting the preferred thousandth separator. I want to separate thousands by a dot rather than a comma. This way it does not give a separator: is required (ggplot2) required (scale) option (scipen = 10) D = data.frame (x = c ( 1,2), y = c (1000001500000) p = ggplot (d, aes (x, y)) + gom_bar (state = "identity") p and thus This gives a comma: p + scale_y_continuous (labels = comma) How do you get the dot in the form of thousands separators? I have not been able to find documents about some documents, which have other types of labels. Thank you in advance, Forza P + scale_y_continuous (labels = function (x) format (x, big.mark = ".", Scientific = FALSE))

converting normal java code to hadoop code without mapreduce? -

I am currently working on the hoop. I want to change the map to my Java code. I want to code my code with hdfs i.e. my code is normal file system, i want to work with hdfs (hd file system) I want to work below code in Hood (HD File System) import java.io.file; Import java.io.FileInputStream; Import java.io.FileOutputStream; Import java.io.IOException; Import java.util.zip.GZIPInputStream; Import java.util.zip.GZIPOutputStream; Public class GZIPExample {public static zero gzip () {int i = new file ("/ media / 0052ADF152ADEC1A / all partitions") List (). Length; System.out.println (I + "here"); While (i> gt; {} string file = "/ media / 0052ADF152ADEC1A / all partitions / files" + i + ".txt"; String gzipFile = "/ media / 0052ADF152ADEC1A / collapses / filegages" + i + ".gz"; String Newfile = "/ Media / 0052ADF152ADEC1A / All / ThEup Ebook / Test 1.txt"; CompressGzipFile (file, gzipFile); Decompress Jump File (...

asp.net - asp:imagebutton hover effect css -

I have the buttons given below so that what they should do, but I would like to add a CSS they do There can be a method of and asp: GridView id = "GridView1" runat = "server" AllowPaging = "True" DataKeyNames = "pageID" DataSourceID = "SQLData" AutoGenerateColumn = "False" PageSize = "1" width = "100%" height = "500px" gridline = "none" ShowHeader = "False" & gt; & Lt; Columns & gt; & Lt; ASP: Boundfild Detafild = "Pejaid" Hadertakst = "Insert Pejaid" = "false" Reed Oli = "true" Sortaksresian = "Pejaid" Soheder = "false" visible = "false" / & gt; & Lt; Asp: boundfield datfilled = "sectionID" headerText = "section id" sortexpress = "section id" visible = "incorrect" ShowHeader = "False" /> & Lt; ASP: Boundfield datedfield =...

Speed, VBA VS Excel Formulas -

आम तौर पर बोलते हुए फ़ार्मुलों तेज या कुशल VBA कोड यदि कोई ऐसा कार्य है जो यह कहता है कि 100% वीबीए कोड या 50% वीबीए और 50% फ़ार्मुलों क्या दूसरे के साथ जाना बेहतर होगा? मैं इसे गति के परिप्रेक्ष्य से पूछ रहा हूं? मैं बहुत सारे VBA मैक्रो लिखता हूं हाल ही में मैं अपनी परियोजनाओं में बहुत अधिक फ़ार्मुलों का उपयोग कर रहा हूं। मैं सोच रहा हूं कि चीजें अधिक कुशल बनाने के लिए यह सही दृष्टिकोण है। एक सरल कार्य के लिए एक अंतर्निहित एक्सेल सूत्र संभवतः तेज़ है क्योंकि वे निश्चित रूप से सी / सी ++ में लिखे गए हैं जो तेजी से मूल कोड का उत्पादन करते हैं। VBA कोड को। NET परिवेश को लक्षित करते हैं, और उसे चलाने से पहले इसे पार्स और संकलित किया जाना चाहिए , जो कुछ ओवरहेड जोड़ते हैं। लेकिन जटिल नेस्टेड फ़ार्मुलों के लिए, एक्सेल में कोई सुराग नहीं है, जो आपके डेटा की तरह दिखता है, उसे ऑपरेशन से पहले प्रकार की जांच करनी पड़ सकती है, वह कई बार मूल्य की संपूर्ण सरणी से गुजर सकती है कुछ मेमोरी आवंटन आदि। उस स्थिति में एक मैक्रो तेजी से हो सकता है, क्योंकि आपको यह पता चल सक...

java - WebSphere 8 persistence.xml syntax error (expected root element) -

Installing my web application on WebSphere application server 8 fails due to syntax error in my persistence.xml. According to my IDE, there is no error, what is the real problem? persistence.xml: & lt ;? XML version = "1.0" encoding = "UTF-8"? & Gt; & Lt; Persistence xmlns = "http://xmlns.jcp.org/xml/ns/persistence" version = "2.1" xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" xsi: schema location = "Http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_1.xsd" & gt; & Lt; Persistent-entity name = "myapp" & gt; & Lt; Provider & gt; org.hibernate.jpa.HibernatePersistenceProvider & lt; / Provider & gt; & Lt; / Persistence unit & gt; & Lt; / Persistence> Excerpt from steak trace (SystemOut.log): 1: Reason by: com.ibm.ws.metadata . MetaDataException: CWWJP0040E: There is a syntax error on line number in...

jsp - Calling javascript inside option tag -

& lt; स्क्रिप्ट प्रकार = "टेक्स्ट / जावास्क्रिप्ट" & gt; फ़ंक्शन टूवर्ड (इंडेक्स) {var theword = ""; यदि (सूचकांक == 0) theword = "अनुसूचित"; यदि (सूचकांक == 1) theword = "चालू"; यदि (सूचकांक == 2) theword = "रद्द"; यदि (सूचकांक == 3) theword = "समाप्त"; वापसी शब्द; } & Lt; / script & gt; & Lt; c: forEach var = "statusItem" आइटम = "$ {statusList}" & gt; & lt; विकल्प मान = $ {statusItem} & lt; c: यदि test = '$ {statusItem eq jobItem.getJobItem ()। getStatus ()}' & gt; चयनित & lt; / c: if & gt; / & gt; ToWord ($ {statusItem} ) & lt; / विकल्प & gt; & Lt; / c: foreach & gt; statusList.add ( "0"); statusList.add ( "1"); statusList.add ( "2"); statusList.add ( "3"); Request.setAttribute ("स्थिति सूची", स्थिति सूची); हैलो फिर से ... मैं एक जावास्क्रिप्ट फ़ंक्शन का उपयोग कर एक पूर्णांक म...

AngularJS - ng-repeat to assign/generate a new unique ID -

I'm using a simple ng-repeat to create a list of countries. Each list has a hidden row / div that can be expanded and collapsed. The problem I am facing is that before I present Kangaroo in my application, I manually codify the element's ID manually Example: & lt; Li data-show = "# country 1" & gt; {{Country.name}} has a population of {{country.population}} & lt; Div id = "country1" & gt; & Lt; P & gt; Expand / collapse content & lt; / Div & gt; & Lt; / li & gt; & Lt; Li data-show = "# country2" & gt; {{Country.name}} has a population of {{country.population}} & lt; Div id = "country2" & gt; & Lt; P & gt; Expand / collapse content & lt; / Div & gt; & Lt; / li & gt; & Lt; Li data-show = "# country3" & gt; {{Country.name}} has a population of {{country.population}} & lt; Div id = "country3" & gt; & Lt; P & g...

java - JPA TypedQuery: Parameter value element did not match expected type -

I am using JPA 2.0 and getting the following code in the DAO layer: Public Zero Test () {string key = "status"; String [] Conditions = {"A", "B"}; & Lt; TestTable & gt; Results = Search (Keys, Conditions); } Public listing & lt; TestTable & gt; Search (string key, object value error) {string sql = "test ndf to testlet and jade nand." + Key + "in:" + key; TypedQuery & LT; TestTable & gt; Query = entityManager.createQuery (SQL, TestTable.class); Query.setParameter (key, Arrays.asList (valueArr)) / *** Error Line *** Return query.getResultList (); } In the above error line, it throws the following exception: java.lang.IllegalArgumentException: parameter value element [[Ljava.lang.String; @ cbe5bc] did not match the expected type [java.lang.String] Why is this expected type string while actually this string []? Please help! Note: This is derived from the normal routine and is a simplified code. I can no...

jquery - Avoid "ifChanged" event handler when setting checkbox via Javascript -

For the ICheck plugin, is there a way to avoid setting fire to a "handset" event handler when setting up a checkbox from javascript? You can create a variable Change unchanged and subscribe to event handlers. However, you can check whether the variable is true and if so, set it to false and stop the function. If it is not correct , then you can execute your normal code. JS Code: var ignoreChange = false; $ ('Input'). ('If changed', function (event) {if (change unchanged) {ignorechange = false; return;} // do stuff}); // When the checkbox changes ignore = change; Basically, whenever you set the variable Change unchanged to the correct, the next event call is ignored. It's quite a hack solution, though necessary, because i got no way to solve your problem iCheck library

php - how to list all questions that has no answer in online discussion forum -

I am creating an online discussion forum in PHP as my final semester project and I list all those questions I do not answer the answer in the answer page, the stack is like the overflow. But I do not know how to implement it; I search a lot on the internet but still I do not know how to list all the questions that do not have the answer. Below is my code: & lt; php @session_start (); Included ("include / user_header.php"); Included ("include / connection.php"); $ Query = "SELECT *" is not in question, but does not exist here (Selection * Answer from Answer Q & A = Question = Question); " $ Result = mysql_query ($ query) or die (mysql_error ()); ? & Gt; & Lt; Script type = "text / javascript" & gt; If (action == "pass_id") {document.frm_cms.action = "answer.php"; & Lt; -! Document.frm_que.myaction.value = Action; - & gt; Document.frm_cms.id.value = ID; document.frm_cms.submit (); } ...

facebook graph api - Since vs updated_time vs created_time -

I'm writing an app to collect Facebook posts that match a certain search term, and I'm only new or Updated post after article. Facebook.com/search endpoint I have concluded from debugging it that this special endpoint uses time-based endorsement (unless), then it is my process: Most recent p> However, I can not even see my newly created posts. I get some results, but they seem random why they match my search and not mine. For purposes, I am using a user-level login token generated using the FB Developer Tool, so I definitely do not want any permission to restrict my content from viewing. What gives? Edit: More tests show that I can randomly get some of my own posts, but I do not see any post or reason. Because it appears a post and not the other. For example, I just posted three posts and had another through my app. First and third can not be found anywhere I think that what you see here is To use the stability model Facebook When you view your f...

iostream - How do tellg() & tellp() work in C++? -

Why tellg () and tellp () always come together Are you And how can we differentiate them from each other? They do not. One indicates that the "received" cursor is in an input stream; The second indicates that the "put" cursor is in an output stream. They are similar but are not linked internally, so the basis of your question is basically defective.

php - CURL did not returns any thing if the URL contains Special charters -

I want to get details from the URL while working fine for the normal character url but ami in one of the URLs Special characters like ' ³³ ' include My URL sample is as follows: http://www.abc.com/aóvek -xyz-pqr / 1/8 / My php code is: $ ch = curl_init ($ my_url); curl_setopt ($ CH, CURLOPT_RETURNTRANSFER, true); curl_setopt ($ CH, CURLOPT_BINARYTRANSFER, true); $ Content = curl_exec ($ ch); Try with the following (taken from): $ encoded_url = preg_replace_callback ('#: // ([^ /] +) / ([^?] +) #', Function ($ match) {return ': //'. $ Match [1] ('/', Array_map ('crudelecode', explosion ('/', $ match [2])));}, $ my_url); $ Ch = curl_init ($ encoded_ril); curl_setopt ($ CH, CURLOPT_RETURNTRANSFER, true); Curl_setopt ($ CH, CURLOPT_BINARYTRANSFER, true); $ Content = curl_exec ($ ch);

javascript - listbox return wrong value in wordpress3.9 -

I used the listbox UI element in Wordpress 3.8, but it does not work in my new version (3.9) is. I have written this JS code to test it: (function () {var Icons; var icon = function {ID} {return '& lt; i class = "fa fa- '' Arrow-Circle -O-Right "," Arrow-Circle-O-Left "," Arrow-Circle-O-Left "," Arrow-Circle-O-Left "," Carat-Square-O-Byte "," Toggle-Byte "," Dot-Circle-O "," Wheelchair "," Vameneo-Square "," Try "," Adjust "," Anchor "," Collection "," Arrows "," arrow-h "," arrow-v "," asterisk "," ban "," bar-chart-o "," barcode "," "Bare", "Bell", "Bell", "Bell-O", "Bolt", "Book", "Bookmark", "Bookmark-o", "Briefcase", "Bug"] var menu = []; For (var i = 0; I ...

c - initializing a function externally -

I would like to return a function with a variable inside that I can initialize it inside the function that gives it Possible, or not? int get_char (char * c) {static circular_queue * cir; // It needs to be started in the function below if (circular_queue_empty (cir)) 0; Else * c = circular_queue_pop (cir); Return 1; } Int (* generate_get_char (circular_queue * cir)) (char * c) {// Circuit Return & amp; Do something to set get_char; } I am passing the pointer together in an API which I do not control so I can not change the format of get_char ; It is being said that there is a better way to do this because I am quite sure that the above is not possible. (I will not use a static global, but all I can think of doing). TY Variables with static storage allocations are started at zero by default Are there. Therefore, the following statements are effectively equivalent. Fixed circular_que * cir; // constant circular_queue * cir = 0 equals; // constant circular_queue *...

php - How can I validate configurations that live under the "parameters" root? -

I am working on a project in Symphony 2.3.x. I have a service defined: Services: myservice: Category: MyServiceClass Logic: [% settings%] In the logic of the service settings defined in a MyBundle \ resources \ config \ parameters.yml file : Parameter: Settings: Settings 1: 15 Settings 2: True Everything works great, but I validate this file Want to Therefore, I have this in the MyBundle \ DependencyInjection \ configuration file: class configuration tools configuration infraface {public function getConfigTreeBuilder () {$ treeBuilder = New TreeBuilder (); $ Routodeod = $ Treebuilder- & gt; Root ('parameter'); $ RootNode- & gt; Children () - & gt; Array node ('setting') - & gt; IsRequired () - & gt; CannotBeEmpty () - & gt; Children () - & gt; Integer node ('setting 1') - & gt; IsRequired () - & gt; Canobbeeplity () - & gt; Min (1) - & gt; End () - & gt; Boolean node ('setting 2'...