Posts

Showing posts from April, 2010

java - Using List collection makes Hibernate throw stackoverflow error -

I have three domain objects, one parent object with the two children, the parent object with the two children There is a lot of relationship, and therefore there is a collection of guardian items in both children, whereas parents are references to the objects of both children. Parents Pre> parents of the public class {other children other children; Some children some children; / * Other methods and attributes * / @ManyToOne (fetch = FetchType.EAGER) Public SomeChild getSomeChild () {this.someChild; } Public Zero Set Some Children (Some Children Some Children) {this.someChild = someChild; } @ManyToOne (fetch = FetchType.EAGER) Public other children meet other infants () {this return.otherChild; } Public Zero set other infant (other children other children) {this.otherChild = otherChild; }} Kids Public category SomeChild {Private list & lt; Parents & gt; mother-father; / * Other methods and attributes * / @OneToMany (fetch = FetchType.LAZY, mapped = "som

assembly - INT 0x13, AH=0x41 Passed, but INT 0x13, AH=0x48 Failed [solved] -

I apologize in advance, but this is another question about the code going to a boot sector. I was able to successfully call [8.17 Check Extension Current (FN 41h)] without any problem; I saw a sign in BX, my version number in AH is 0x30 and the interface support in CX is Bitmap 5. However, when I call [8.24 Check Extent Present (Fn 48-H)] with DS hard coded 0x07C0 and SI Hard to 0x0200 coded, 512 byte status after the boot sector sign In, and the original drive number in DL. The original drive number 0x80 is in any way and when I work hard for that value, I still get the flag set carrying it and the AH is returned as 0x01. Then I am putting this code in the 8 GB boot sector of the USB flash drive. I suspect that due to small drive I could not use the LBA routine so I could not understand it on my own and I did not find in the specification whether 8 GB Threshold is complete or not. Thank you. Resolve: Expanded disk parameter buffer size should be coded in the memory space

php - Data insert and Image Upload -

I am trying to insert some data from the text area in MySQL and upload an image to a specific folder I can save my name in MySQL but when I submit it, only text area data (Tituli, Parmajjatja) is inserted into the database, the image is not uploaded and the image name is not entered in MySQL. The form code is: & lt; Form role = "form" method = "post" action = "shtolajm1.php" enctype = "multipart / form-data" & gt; & Lt; Div class = "form-group" & gt; & Lt; Textarea class = "form-control" rows = "3" name = "titulli" & gt; & Lt; / Textarea & gt; & Lt; Textarea class = "form-control" rows = "10" name = "permbajtja" & gt; & Lt; / Textarea & gt; & Lt; Input type = "file" name = "files []" style = "margin-left: -5;" /> & Lt; Button type = "submit" name = "submit" class

mysql - Rails: A way to check for duplicate item in DB? Affiliate data feeds -

I have a problem with related data feeds For example, Amazon or other e-shop From Partners For example Amazon : Product Title: iPhone 5: I'm trying to import my product data, but want to avoid duplicate. 16 GB black and another store uses the product title: iPhone 5 16 GB . They should be listed as a product, now imagine that I have 10 stores in the sale of iPhone 5. Of course, they have many more parameters, but I still need algorithms to prevent this from happening. A similarity of product parameters like matching algorithm. Does anyone have experience with it and can tell me what kind of algorithm can be advised for this scenario? A detailed list of parameters Thanks a lot! This can be done by EAN number, but if this number is not provided. Before developing an alogorithm, you need to define business rules. If you have a situation, where all the features are left without the title, then you can try sub-string (partial of another) or fuzzy match

mysql - php flourish fActiveRecord store store two times -

I am using my php application to flourish for my database functions. Now I have a problem that the store system always saves new datasets seriously in the database. $ o1 = new version (); $ O1- & gt; Set Warsi (Rand (1, 99 99)); $ O1- & gt; Save (); Var_dump ($ O1); I get the link output from var_dump. The version is a child class from the unsupported, a child class with a besodel factive record. Save my method: Save public function ($ forceCascade = false) {if (original :: getCreatedAt () === null) parent: : Set CreedAut (Time); Parents :: setLastModifiedAt (time ()); Parents :: Shop ($ forceCascade); } Public function set set () {return false; } Public function setLastModifiedAt () {return false; } Public function setId () {return false; } Public Function Store ($ force_cascade = false) {return false; } Can anyone help or know if there is no problem? Ive noticed that the flourish is not programmed for a long time ... (sorry for bad english: /) EDIT: Ive

Download file with AFNetworking in swift -

I want to download Firefox from URL, which is fast in fast networking, and showing download progress . I have this code, but it does not work: function downloadPdf () {var request = NSURLRequest (url: NSURL (string: "http://www.sa.is/media /1039/example.pdf ")) Session = AFHTTessionManager () progress: NSProgress? Var downloadTask = session.downloadTaskWithRequest (request Progress: & amp; progress destination: {(file self.pathUrl, reaction)}, CompletionHandler: {response, Localfile, error println ( "feedback \ (response)")} ) downloadTask.resume ()} var pathUrl: NSURL {var path = NSSearchPathForDirectoriesInDomains (.DocumentDirectory, .UserDomainMask, true) [0] string var = NSURL (string: path.stringByAppendingPathComponent ( "file.pdf") as the URL) Println (url .path) return url} What do I do wrong? itemprop = "text"> issue path url is the property calculated after .path ), you will see that your URL is not valid.

javascript - using apply to pass in an object for the this keyword -

I'm trying to teach myself Javascript, but I think it's stuck on a basic basis. My reference book says: " This can be applied to pass in an object to indicate the keyword." I start with: var a = 50; Var foo = function () {return.a; } When I do foo () , then I would like 50 then I apply Try as follows: foo.apply ({a: "blah"}); When I do foo () again, I still get 50 and blah was not as expected. It appears that apply was not successful in the keyword {a: "blah"} objects . I am almost certain that I am misunderstood what can help you with explanation? apply () method does not modify function by any means; It only makes a function call with the specified it . You can use bind () to create a new function, which always calls the original with the specified this : var myFoo = foo.bind ({a: 'blah'}); MyFoo ();

Text-file class python -

इस सवाल का पहले से ही एक उत्तर है: < / P> 4 जवाब यहाँ समस्या मैं हूँ पर काम कर रहा है: एक क्लास टेक्स्टफ़ाइल विकसित करें जो टेक्स्ट फ़ाइल का विश्लेषण करने के लिए तरीकों को प्रदान करता है। क्लास टेक्स्टफ़ाइल एक कन्स्ट्रक्टर का समर्थन करेगा, जो फ़ाइल नाम (स्ट्रिंग के रूप में) के रूप में इनपुट के रूप में लेता है और संबंधित टेक्स्ट फ़ाइल से जुड़े टेक्स्टफ़ाइल ऑब्जेक्ट को इंस्टाल्ट करता है। टेक्स्टफ़ाइल को तरीकों का समर्थन करना चाहिए nchars (), nwords (), और nlines () जो क्रमशः अक्षरों, शब्दों और रेखाओं की संख्या को क्रमशः देता है। इस समस्या पर मेरा प्रयास है: class textfile (): def __init __ (स्वयं, फ़ाइल नाम): self.file = open (filename) def nchars (self ): लौटें लैन (self.file.read ()) def nwords (स्वयं): सामग्री = self.file.read () शब्द = content.split () रिटर्न लेन (शब्द) def nlines (स्वयं): content = self File.read () वापसी content.count ('\ n') मेरे सारे तरीके काम करने लगते हैं हालांकि, जब मैं दो तरीकों को लगातार चलाता हूं, पाठ-फाइल दूसरी विधि के

Jersey 1.18 client with jaxb -

I am trying to use the Jersey 1.18 client to get XML data from the rest of the web web service and then it I am doing unexpected use of jackbys. The problem is that I do not know how to forward the data directly to jerseys from jersey and the code looks a little frightening. Client Client = Client.Create (); WebResource webResource = client.resource ("http://something.com"); Client response page response = webResource.accept ("App / Jason") .get (ClientResponse.class); If (response.getStatus ()! = 200) {New Runtime Exception ("Failed: HTTP Error Code:" + response.getStatus ()); } String output = response. Gate entity (string class); JAXBContext jaxbContext = JAXBContext.newInstance (person class); Unmarshaller unmarshaller = jaxbContext.createUnmarshaller (); StringReader Reader = new stringreader (output); Person person = (person) unmarshaller.unmarshal (reader); Is there another great way to do this? I'm using Jersey 1.18 because the latest

ruby on rails 4 - js.erb file is not executing content -

I am creating Rails 4.1.4 web application and in one of my views I am sending a form through Ajax I am). I've created a file named index.js.erb and this content is: $ ('# search_results'). Html ('& lt;% = j ("# {rendere (" admin / customer / result "}}). Html_safe%>;); \ n \ n \ n Going blank Thank you for all help! try $ ('# search_results') .html ("& lt;% = j (render "Administrator / Client / Results")%>;);

ios - Map device tilt to physicsWorld gravity? -

I am creating a "marble" maze game to learn the spritekit basics. I want to map the gravity of the game to the inclination of the device. I am trying to understand how to do it, but I am only able to map the Y axis successfully: class func receipt (motionManager: CMMotionManager) {var vec = CGVectorMake 0, 0) If the attitude = motionManager.device Motion? .attitude? {Let's do = CGFLOT (-attitude.pitch * 2 / M_PI) // It works, it gives 1/1 when the device is vertical (1 when the Home button is inverted) x = CGFloat (attitude.roll * 2 / M_PI) // This does not work for physics. World.gravity = CGVectorMake (x, y)}} I can map the Y axis, which is called "up" or " Down "(relative to portrait mode) though I do not understand how to map the X axis (pull from the edge of the device). For example, when the device should be (0,0) when placing it flat on the table (x, y), and also should be (0,0) even when it is placed below the screen. Roll Return -1

ios - How to write tests to UIActionSheet and its button -

I am trying to write unit test for my visual controller This is the first view controller of my app and top left hand There is an 'Account' button on the corner. Pressing it will be presented an action sheet, for which there are now two buttons: Logout Change the passcode I want to To write a test for this functionality: Pressing the 'Account' button should display the action sheet. Action sheet will have two buttons: 'Logout' & amp; 'Change passcode' Pressing the 'Logout' button should cause the user to log out. Pressing the 'Change Passcode' button should present the passcode view controller in passcode mode. / Li> The problem is that if I trigger the account button in my test, then it will try to present an action sheet which fails because under the test the controller's view Not a part of the window, and this means that I can not write any of the other tests. are proposed, but they need to make a po

email - How to set up the SMTP settings for the ASO servers (Rails)? -

I'm trying to set up a mailer using my email, which is a small orange < Customer Support Contact Li> There is no luck yet. It works properly when configured for Gmail ... So the problem is that my SMTP settings Non-SSL version (In Initial): # setup_mail.rb ActionMailer :: Base.smtp_settings = {Address: 'Mail Mydomain.co', Port: 26, user_name: ENV [" EMAIL_USERNAME "] Password: ENV [" EMAIL_PASSWORD "] Authentication :: plain, # Also tried: Login and: cram_md5 enable_starttls_auto: false, # correct also tried, and This is the SSL version: # setup_mail.rb Action Mailer :: base.smtp_settings = {address: 'lagertha.asmallorange.com', Port: 465, user_name: ENV ["EMAIL_USERNAME"] Password: Any help deeply appreciated ! / Div>

display category taxonomy on wordpress -

I found this code at designorbital.com. This code is working great, but my problem is how can I display those custom feilds? Please help people !!! I am starting with WordPress & Lt; P class = "description" & gt; Enter a custom order value. & Lt; / P & gt; & Lt; / Div & gt; & Lt ;? Php} function category_form_custom_field_edit ($ Tag, $ classification) {$ option_name = 'category_gig_order_' $ Tag- & gt; Term_id; $ Category_custom_order = get_option ($ option_name); ? & Gt; & Lt; Tr class = "form-field" & gt; & Lt; Th scope = "line" valign = "top" & gt; = "Category_custom_order" & gt; for label Value & lt; / Label & gt; & Lt; / Th & gt; & Lt; TD & gt; & Lt; Input type = "text" name = "category_custom_order" id = "category_custom_order" value = "& lt ;? Php echo esc_attr ($ category_custom_order)? Es

sql - Excel - Export data -

Assume that I have an Excel file (sheets used in most of those chairs and bunch of macros) I have Is a sheet where I connect to SQL Server to capture live data. I am saving Excel and connection files in a folder. Can I save this file as .xls instead of that macros file format? Now that I know, whenever I open the file, Excel calls the SQL query and populates the sheet (which is based on other magazine macros) Is this true? Need to open Excel to get data populated / refreshed? Now, if I want to program an auto export / PDF, is it possible? Do I Need to Open Excel File Manually? Wait for Excel to connect to SQL and get data / refresh data. Save as PDF? Perhaps someone can find a lot of help in understanding that excel and lt;> sql connection work (after opening the file in axle and opening the file in y / o excel). Thanks

sql - Order by count on multiple associations -

I have a post model I a post has several comments, some are favorite, and there is a column on the post model Which is called the scene. I want to order posts on the basis of all these 3 digits. How can I achieve it? You want that anyone can use find_by_sql to write SQL. sample code: post.find_b_sql ("posts.id, select posts.title, comments (separate comments. Id) as comments_cnt, count (count Different favorites .post_id = posts.id favorites Join favorites.post_id = posts.id by group posts.id, posts.title order by max (posts.views) + comments_cnt + favorites_cnt DESC ") Edit: For the other dbms, only the above code work for sql_lite or db2: Post.find_by_sql ("posts.id's Select, posts.title, count (separate comments id) forms as comments_cnt Leave the comment left on comments as favorites_cnt from the counting (different favorites.id) posts. Post_id = posts.id left to join favorites on favorites. Post_id = posts.id by group posts.id Posts by pos

Python Unicode Does not support character U+25BE -

A problem was crashing me throughout the day, where Python returns 3.4.1 < P> Unicode encoded error: 'Morap' codec can not encode character '\ u25be' in position 1075: Character map undefined shows that U + 25 bee is ▾ black below -Small small triangle I am trying to read the file in which this little boy happens and no matter what I do, it does not work. Code relevant to L: full = "" F = open (src, 'r', encoding = 'UTF-8'): full + = l print (entire) The print will throw the above error, I have tried to encode it to ASCII: l.encode ('ascii', 'ignore') And still nothing. Am I unable to decode the wrong file? If it helps, it's also a webpage, and using the urllib.request module gives exact results. I'm using Windows 7 if it makes a difference. / P> I think you are printing on the Windows console in the Windows console UTF-8 (and for this Bad support) is not the default, but you can c

How to download a file to assets/www/ in android app? -

After Then, I'm writing an Android app and I want to display it in WebView, so I found it displayed Is property / www and all that is a simple local .html file to do, but seems like I want to change the information, maybe some, how can I download the file from the application Say, dropbox and add it to property / www What? Just like anything: if (isOnline ()) {Downloads ("https://dl.dropboxusercontent.com/u/0000000/index.html", "property / www") } Else {Toast.makeText ("No Internet connection, this information may be outdated", Toast.LNNHHLLG). Show (); } I have written and worked the online () function, just download function is required, but I'm not sure where to start from Edit, I've tried this so far: if (isOnline ()) {url try the URL {= new urRL ("https: // db .tt / WyAqN9r0 "); BufferedReader = new in BufferedReader (new InputStreamReader (url.openstream ())); String FILENAME = "tutortrusthandbook.html&q

javascript - How to show a busy indicator for a long non-ajax operation? -

I have a function running on the customer for 2-3 seconds (no AJAX calls). I am trying to show a "busy / processing" animation due to this operation. The simple code is as follows: var ajaxContainer = $ ('.spinner'); // show $ (AJAXContainer) Show (); // long operation var items = GetItems (); $ .EEEE (item, function (index, value) {PROCESSIM (value.edemID);}); // hide $ (ajaxContainer) .hide (); But it does not work as expected. The result I am getting is that the operation runs without showing the spinner. However it shows when the operation ends. I told you a few posts online that can be done using windows.setTimeout () . But since this operation is based on a dynamic number of items, I do not want to set a specific time limit number in advance. Instead, I would like to show the spinner on the start of the operation, and then hide it when it is over. Is there a great way to achieve this? I think you need to add the callback parameter to the

Deserializing a list of values from JSON using C# -

मेरे दो वर्ग हैं जो इसका उपयोग करते हैं: class B {int a {get ; सेट; } Int b {get; सेट; } सूची & lt; ए & gt; लिफ़ाफ़ा {प्राप्त; सेट; }} वर्ग ए {string c {get; सेट; } स्ट्रिंग डी {get; सेट; }} मैंने एक JSON डेटा स्रोत को deserialized किया है और आयातित डेटा कक्षाओं में वास्तव में मेरे पास 3 वर्ग A ऑब्जेक्ट्स मेरे JSON में और एक B है तो मैं अपनी वस्तुओं के मूल्यों को कैसे प्राप्त कर सकता हूं? मैं कक्षा बी गुणों के मान को testOfB.a (पाठ्यक्रम के deserialization के बाद) द्वारा प्राप्त कर सकता हूँ: < / P> बी testOfB = JsonConvert.DeserializeObject & lt; रूटऑब्जेक्ट & gt; (testjson); लेकिन मैं testOfB.listofa का मान कैसे प्राप्त करूं? मुझे यकीन है कि मुझे foreach लूप का उपयोग करना चाहिए (मुझे कुछ अन्य पदों में कुछ उदाहरण मिले।) लेकिन इसमें से कोई भी मेरे लिए काम नहीं कर रहा है मैंने ऐसा कुछ करने की कोशिश की: foreach (वस्तु [] में ए) {??? } क्या मैं बंद हूं? कोई भी मदद वास्तव में सराहना की जाएगी! संपादित करें यहां JSON मैं deserializi

java - Sort 4 numbers without array -

I have a practice where I will put 4 numbers in ascending order and then without using the array must descend>. I can only use the loop and if the statement I have done it with 3 numbers, but now with 4 numbers I am unable to think about logic. Float is great = 1, great 2 = 0, great 3 = 0, great 4 = 0; Int a = 7, b = 5, c = 6, d = 0; // descending (a & gt; b & amp; amp; amp; nbsp; c) {great1 = a; Great 2 = b; Great 3 = C; } And if (a & gt; b & amp; b> c) {great1 = a; Great 2 = c; Great 3 = B; } And if (B & G; A and A and A> C) {great 1 = B; Great 2 = A; Great 3 = C; } And if (B & G; A & A & A & l; c) {great 1 = B; Great 2 = c; Great 3 = A; } And if (C and G; A and A & gt; B) {great 1 = C; Great 2 = A; Great 3 = B; } And {great 1 = C; Great 2 = b; Great 3 = A; } One Usage: int tmp ; If (a & gt; b) {tmp = a; A = B; B = TMP; } If (C & gt; d) {tmp = c; C = D; D = TMP; } If (A> C) {tmp = a; A = C; C = TMP; } If (b

html - Image squashed as browser width decreases -

Image
I am really stuck on this browser sizing issue, where every time I decrease the width of the browser, this image And then the image is not exactly right. Here is the code: $ (document) .ready (function () {var myCounter = 0; $ (cycle ("break"); (Crearement, Next Element, Opts, Forward) {// Here we set the number to set the timeout for two seconds; Returning the wrong for the strange number slide, we make those slides / default timeout values ​​(4 seconds) Receive myCounter ++; return my quintor% 8; 50: 2000;}}); // ed doctor ready // cycling $ (document) begins Other functions for .ready (function () {$ (this) .find ('.llds') AddClass ('active'). Cycle ('resume');}); I have been struggling for so long and have to do it on the website above. css .slides {status: fix ;; Z-index: -1; Top: 0; Left: 0; Margin Top: -75px; } .slides img {status: fixed; Top: 0; Width: 100%; Z-index: -1; Margin Top: -75px; } #bigimage {width: 100%;

html - Bootstrap based webpage is not responsive on mobile devices -

I recently created a "responsive" webpage with bootstrap . The strange thing is that when I check different proposals on my computer, I can see that the page is truly responsive. When I checked it on my phone, the text was small , the navigation menu did not change in its sensitive mode when I decrease the browser window to the resolution of the phone It works perfectly (the way I checked it on my Galaxy S3 and WP8, I'm pretty sure this problem is in all mobile devices). I've come across a cross-product called viewport , but using it is very difficult to understand. Can anyone help in this problem? How can I fix it? Thank you all! Add it to your html: & lt; Head & gt; ... & lt; Meta name = "viewport" content = "width = device-width, initial-scale = 1.0" & gt; & Lt; / Head & gt;

c - What does "char *t = s + len" mean? -

I am going through a programming book and I am wondering what a line of code is Below is a function that takes a character array and prints backwards. void print_reverse (Char * s) {size_t len ​​= strlen (s); Char * t = s + len -1; // I do not know what this line is doing (T & gt; = s) {printf ("% c", * t); T = T - 1; } Puts(""); } Assume that s is the string "PaxDiablo" is stored in memory at the place 1 as follows: s | V + --- --- --- --- --- --- ------- + + + + + ---- + | P | One | X | D | I One | B L O | \ 0 | + --- --- --- --- ------ Address: 1 2 3 4 5 6 7 8 9 10 expression t = s + len - 1 (where lane is 9 in this case) set T to s for eight characters. st | | VV + --- --- --- --- --- ------ | P | One | X | D | I One | B L O | \ 0 | + --- --- --- --- ------ Address: 1 2 3 4 5 6 7 8 9 10 In other words, it gives you the address of the last character in the string. The rest of the code then goes back t

python - module error on sublime text 2 -

For some reason I can not load modules for beautiful themes on beautiful text. 2. When I type: I get the following error from BS 4 import I get the following error: Imported: Any named module BS4 I I use UnCondition and it works fine on the line Line and Ipathaan notebook, but I would prefer to use Sublime Text 2. I'm really unaware. Any help will be very much appreciated. Sublime text is using a different Python interpreter (hence, different site-packages directory, individual packages installed separately.) You can edit the build system that uses it, though. If you go to the Package Directory of Sublime Text and get Python Directory, then there should be a file named Python.sublime-build and the content should be something like this: {"CMD": ["Python", "-U", "$ file"], "file_reg x": "^ [] * file \" (... *?) \ ", Line ([0- 9] *, "Selector": "source.python"} Make a copy o

ggplot2 - R raster plot non-continuous color scale -

Image
OK, so I'm getting an epic brain on it, so any help would be appreciated. I am plotting the data using raster and ggplot. Below I am an example to produce that figure: r = raster (ncol = 18, nrow = 18, xmn = -120, xmx = -80, ymn = 10, ymx = 45) outline = as.data.frame (map ("world", xlim = c (-120, -80), ylim = c (10, 45), Plot = wrong) [c ("x", "y")] = map (geo_path (aes (x, y), inherit.aes = FALSE, data = outline, alpha = 0.8, show_guide = FALSE, color = " Gray ") lat = runif (10, 10,45) lon = Ranif (10, -120, -80) data = ranif (10, -3,2) xy = cbind (x = lan, y = lat) dummy = Rasterize (xi, r, field = data, fun = Cited) dummy .df = as.data.frame (dummy, row.Name = NULL, alternative = true, xy = TRUE, centroids = TRUE) colnames (dummy.df) & lt; -c ("lon", "lat "Data") Ggplot (data = dummy.df, AES (x = lawn, y = axis)) + gOm_tile (AES (fill = data)) + scale_colour_brewer (palette = "set1") < /

foreach - C++ for_each algo and string -

I am trying to loop through every letter of the string, for_each, Std :: unordered_map & lt; Std :: string, unsigned int & gt; Dico; Std :: for_each (str.begin (), str.end (), [& amp;] (std :: string l) {if (dico.count (l) == 0) {'anything is here}} However, I have received an error message: Error 2 error C2664: 'zero' anonymous-name space ':: & lt; lambda2 & Gt; :: Operator () (Std :: string) const ':' const char 'parameter 1 of' std :: string 'can not be changed I < Code> char l However, it can break the dico.count (l) instead, I for loop I use I have seen that solution worked, however, I wonder why for_each will not work here. Std :: unordered_map dico; "[" a "] = 1; deco [" b "] = 1; [ C "] = 1; Std :: string str (" abcd "); Std :: for_each (str.begin (), str.end (), [& amp;] (four l) {std :: string s ( 1, L); // if is fixed (dico.count (s) == 0) {

How does one add annonation on a Google Scatter Plot? -

I can do this in a field chart, but for my life it can not be found to work on a scatter Could plot Is this possible? Google's tutorial is incredibly short and mysterious: The first paragraph in your link: P> They are currently available for line and area charts.

javascript - Regular expression to match content within curly braces without nested braces breaking it -

I currently use the {([^}] *)} content within a set of curly braces I'm matching , but this work stops when I close the other curly braces inside it. I basically want to work with double crisp braces as any other lesson and it is nested except that grouped group, not a separate match or sub-match ( Not recursive) . {& lt; Div & gt; Works & lt; / Div & gt; } {& Lt; Div & gt; {{Failure}} & lt; / Div & gt; } Here I have a live example: Any suggestions or advice will be appreciated. I think you are looking for: {{{{{{{^ {^ {}} | {{^ ^}}}}) *)} Pattern description: { ((?: # Non-capturing group [^ {}] # # or {{[^}] *}} # There is no string within the double string bracket) # or more than zero times)} The idea of ​​using one more efficient way to do this: {({? {^ {}] | | {{[^}] *}} ) *)} Unfortunately, Javascript does not have this feature but you can make it a f Which can be used by the fact that the content of a look

ruby on rails 3 - How to specify Has_many order -

मैं Has_many रिश्ते में विशिष्ट आदेश कैसे निर्दिष्ट करूं? श्रेणी GolfCourse & lt; ActiveRecord :: बेस है_माध्यम: course_nines समाप्ति वर्ग CourseNine & lt; ActiveRecord :: बेस के लिए सम्बद्धता: गोल्फ़-कैरेज़ का अंत प्रत्येक गोल्फ़ कोर्स में दो CourseNines होंगे और मैं एक निर्दिष्ट / असाइन करना चाहूंगा < कोड> कोर्सन जैसा कि पहले / सामने और दूसरा वाला जैसा कि second / back जैसा होता है। धन्यवाद! यह प्रयास करें: कक्षा गोल्फ़ कोर्स & lt; ActiveRecord :: बेस है_मैं: कोर्स_एनंस डीफ फ्रंट_एनइन ऑर्डर ("बनाया गया एसेट")। पहले () # या जो लॉजिक आपको अंत डीईएफ़ back_nine ऑर्डर ("created_at desc") चाहिए। पहले () # या जो लॉजिक आपको अंत एंड एंड यह उदाहरण मानता है कि हर गोल्फर कोर्स के लिए आपको हमेशा 2 नैन कॉरर्स होंगे। संभावित रूप से ऐसा करने के अन्य तरीके हैं लेकिन आपको कुछ और विवरण देना होगा कि आप क्या करना चाहते हैं

wordpress - How to use Python to login and detect error if the combination is wrong -

I want to connect to my site using a python script and find out when login fails. For example, when the login is incorrect, the URL is not ahead of wp-login.php / wp-admin / and gives you this message: Error: The password you entered is the username Wrong Is Your Password Lost? I want the method to detect two types of errors: 1-The URL is not changed. 2-Error message and this is my code so far to find the error message: import urllib2 import re html_content = urllib2.urlopen ('http://example.com/login' ) .read () Match = Re.findall ('Error', html_content); If LAN (match) == 0: print 'log in error' and: 'login login successful' Thank you guys for someone ^ _ ^ Please note that while working with Python for Web Dev, it is most convenient to use the already established framework, such as That flask that worksheg (simple and efficient). I recommend that you are reading here on Python Web Development And if you are unfamiliar with t

c++ - Mixing abstract class inheritance with instantiated templates -

OK, I know - due to complexity-virtual template methods are not allowed. However, keeping this in mind: // something.h class absClass {public: // ... // Instead of changing the application class fun method Define different // overloads can be used: Virtual Zero Fun (class A) = 0; Virtual Zero Fun (Class Bb) = 0; }; Class Impulse: Public Esp class {public: // ... template & lt; Typename T & gt; Zero Funny (tt) {/ * Whatever} // Declaration is Zero Funny (Class A); Zero Fun (Class Bb); }; And then we set the specific acceleration of the method in the module? // something.cpp #include "something.h" // instantaneous zero zero :: funny & lt; Class A & gt; (Class A); Zero Freedom :: Funny & lt; ClassB & gt; (ClassB t); Is not it going to work? I am getting errors (irrespective of whether they have. Or CPP). // ---- something.h class absclass {public: // // Instead of changing the method of the application class, define different // ov

javascript - read google spreadsheet for changes in data -

Want to read a Google Drive spreadsheet and create a list of events for any changes to my webpad so far I can author my app in JavaScript to read the list of files in my directory. function printfile (fileId) {var request = gapi.client.drive} .files.get ({'fileId': fileId}); Request.execute ('title:' + resp.title); console.log ('Description:' + resp.description); console.log ('MIME type:' resp.mimeType) ;}); } / ** * Recover a list of file resources. * * @ Ultimate {function} callback function, to call when the request is completed. * / Retrieve functionalphilues (callback) {var retrievePageOfFiles = function (request, result) {request.execute (resp) {var i = 0; result = result .concat (resp.items); var nextPageToken = resp. NextPageToken; (I = 0; i & lt; resp.items.length; i ++) {console.log (resp.items [i]) if (resp.items [i] .id == "xxxxxxXxxx") { PrintFile (resp.items) [ii]. Id); Break;}}}); } Initialitialize {gap}: {'path&

Dynamic 3D array argument in cuda -

I am trying to use dynamic 3D array arguments in the kernel function in the kernel function, but I can not do good. __GLOBAL_WIRED Kernel (3D array pointer) {// do something} int main () {integer NUM_OF_ARRAY; Const int ROW; Const intCAL; ANR AR [NUM_OF_ARRAY] [ROW] [KAL]; // Maybe I should use CudaMalloc3D or CudaMalloc3DArray Dim3 Grid (,,,); Dim 3 blocks (,,,); Colonel & lt; & Lt; & Lt; Grid, Block & gt; & Gt; & Gt; (?); } I looked at Robert's answer but I think my case is slightly different. If the array's line and cal are set at runtime, how can I allocate that memory to the pointer of the Cuda and kernel functions? I tried using cudaMalloc3D or cudaMalloc3DArray, but I can not do well because I have never used before. Is there any dynamic 3D array logic? This would be helpful for me thanks. For all the reasons suggested in previous connected answers and elsewhere, it is not necessary to handle 3D arrays A good way to make a b

php - Put minimum price order condition on single product in store -

I am in my shopping website OpenCart and I want to put some conditions on special products in my store. For example: I have a product in my store and I want to position it on low order. Terms: You need to order at least $ 50.00 in order to be able to buy it Could you please tell me what is the correct way to do this ? There is no default method for this, AFAIK you have to write a simple VQMod, which in the cart operation The order will check the order sub-object on add.

java - VI SDK Cluster Memory -

मुझे वीआई जावा एसडीके प्रोग्राम का उपयोग करते हुए क्लस्टर आरक्षित मेमोरी और प्रयुक्त मेमोरी प्राप्त करने में सहायता की आवश्यकता है, मैं नीचे दिए गए कोड का उपयोग कर क्लस्टर की कुल स्मृति प्राप्त करने में सक्षम हूं। क्लस्टर कॉम्प्युटर संसाधनों crs = (ClusterComputeResource) mes [i]; ClusterConfigInfo clusconfig = crs.get कॉन्फ़िगरेशन (); ComputeResourceSummary सेमी = crs.getSummary (); डबल मेम = सेमी.गेटटोटलममीरी () / 10 99511627776 डी; डबल राउंड = मठ। (मेम); स्ट्रिंग str = String.format ("% 1.2f", मेम); डबल totalmemory = Double.valueOf (str); System.out.println ("क्लस्टर NAME" + crs.getName ()); System.out.println ("क्लस्टर मेमोरी" + कुलमूल्य + "टीबी"); क्या कोई भी मुझे क्लस्टर के आरक्षित और इस्तेमाल की जाने वाली स्मृति प्राप्त करने के लिए आगे मार्गदर्शन कर सकता है। कृपया अग्रिम में मदद और धन्यवाद। < P> दस्तावेज पढ़ें, डेटा ऑब्जेक्ट में एक और प्रॉपर्टी है जिसे प्रभावी मेमोरी: प्रभावी स्मृति संसाधन (MB में) ) वर्चुअल मशीन

Vim's "hit-enter" mode. Using ; of `:map ; :` without clearing displayed contents. -

क्या कोई भी मानचित्र हिट-एन्टर मोड से काम करता है? : सहायता हिट-एन्टर करें पढ़ना, स्क्रीन को साफ़ करने के बिना कमांड लिखना जारी रखने का एकमात्र तरीका है, यह : के साथ कमांड शुरू करना है। लेकिन वहां हम पढ़ते हैं: - & gt; उस आदेश को प्रारंभ करने के लिए ':' या अन्य सामान्य मोड कमांड वर्ण दबाएं क्यों नहीं nnoremap; : लागू होते हैं? ("अन्य सामान्य मोड कमांड वर्ण [s]" क्या हैं?) मैं पिछली कमांड से प्रदर्शित सामग्री को खोए बिना एक नया आदेश शीघ्रता से प्रारंभ करना चाहता हूं I मैं प्रदर्शित सामग्री खोए बिना नेता कुंजी का उपयोग करने में सक्षम होना चाहता हूं उदाहरण के लिए, ; ls & lt; Ret & gt; , तब ; या आपके & lt; नेता & gt; कुंजी को आज़माएं यह बुरा नहीं है, मैं इसके बाद : का उपयोग कर सकता हूं, बस सोच रहा हूँ कि मैं hit-enter-mode पर अधिक नियंत्रण प्राप्त कर सकता हूं। nnoremap जीबी: ls & lt; CR & gt ;: b & lt; स्पेस & gt; क्या आप चाहते हैं कि "कैनोनिकल" तरीका है।

java - How to iterate a list of objects in jstl inside jsp -

I am trying to replicate the list of objects in my JSP using jstl. I want a dropdown with ultimate values ​​for each of the ultimate names. jsp code: & lt; C: if test = "$ {fn: length (ListOfParams) gt}" & gt; & Lt; H2 & gt; Yo yo & lt; / H2 & gt; & Lt; C: forEach var = "param" item = "$ {listOfParams}" & gt; & Lt; H3 & gt; $ {Param.paramName} & lt; / H3 & gt; & Lt; Select name = "$ {param.paramName}" id = "$ {param.paramName}" square = "target"> & Lt; C: forEach var = "listOfParamValue" item = "$ {param.listOfParamValue}" & gt; & Lt; Options & gt; & Lt; C: out value = "$ {listOfParamValue}" /> & Lt; / Options & gt; & Lt; / C: foreach & gt; & Lt; / Select & gt; & Lt; / C: foreach & gt; & Lt; / C: If & gt; Administrator code: DTEJob dteJob2 = new DTEJob (); DteJob2.se

javascript - AngularJS specifying multiple values for attribute of custom directive -

I have a directive in AngularJS & lt; Chart & gt; I'm creating a x-series and y-series in this one One requirement is that these attributes Several criteria should be taken, such as x-series = "xData1 xdata2 xdata3" and y-series = "ydata1 ydata2 ydata3" . How do I resolve different values ​​of X-series and Y-Series features? I can do this by dividing it by the location of scope.xSeries and scope.ySeries but I should know that if angular is a better way of specifying the attribute with multiple values Offers. For example, you can pass an array. & lt; Chart Wi-Series = "Mayer" & gt; & Lt; / Chart & gt; // $ scope.myArray = ['ydata1', 'ydata2'] in the controller; // In the Director field: {'y-series': '=' // This will force left-directional data for array}

Print the value of button into text -

Well ... I want to include the value of the button when I click on the button, but JS 'undefined' me 'For the button it looks like I want to make a calculator, yes, but the first step in creating the calculator is to insert the value of the buttons into text. & lt; Html & gt; & Lt; Top & gt; & Lt; Meta charset = "UTF-8" /> & Lt; Title & gt; My calculator & lt; / Title & gt; & Lt; Style type = "text / css" & gt; & Lt; / Style & gt; & Lt; Script type = "text / javascript" & gt; Function action () {/ * This is to test the function to run the warning ('successful!'); * / Var val = document.getElementsByName ('num'). Value; Document.getElementById (/ * 'result' or 'answer' * /). InnerHTML = val; } & Lt; / Script & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Input id = "results" type = "text" read /&g

cordova - No phonegap folder added to sencha touch project -

Image
I downloaded the Touch Touch 3.2 and Cena CMD I got this command to generate a punch Touch project generate sencha application map map Then I run this command to add phonegap to sencha touch project Sencha phonegap init com.mycompany.myapp myapp I do this like this: But when I say "Sync Phone Inapp Com. Map map " Yes, the CMD window only shows this text "Senka CMD v5.0.0.160". When I open my map folder ("Chenna generated application map mypap" is generated). I do not see any new files / folders. Do not work "sencha phonegap init com.mycompany.myapp myapp"? p / s: When I type the CDCatch project and type "Syncha PhoneGet Init Com. IIM Companion.map Map" This enhances this error. < Div class = "post-text" itemprop = "text"> I think there are many ways to use the PhoneGap API for sencha applications. The way I used to do is first copy cordova.js file in ur application and app.js

objective c - iOS location data in UIImage metadata isn't handling negative CGFloat/double -

After making some difficult efforts, please send me your UIImage EXIF ​​using the CLLocationManager Found GPS data injection. It was really a terrible experience, I personally do not recommend it. I am using the code below to write an image in the property's library, and the metadata's log output of my NSDictionary ([5] .key printing details: {GPS} [5] Print details of: Price: {Height = "-1.606232"; Latitude = "49.86973495227272"; Latitude Ref = N; Geometry = "-125.1198035572889"; Underline RF = W;} Here The save method is: - (zero) saveToCameraRoll {NSUserDefaults * defaults = [NSUserDefaults StandardUserDefaults]; // Capture that 'Metadata' var NSDictionary * Metadata = [default (_ImageMetadata); From this next line, NSDictionary fraction;; (_imageToSave) {ALAssetsLibrary * Library = [Elassette Library New]; [Library List Image ToSwit Photo Album: [_Vitotes Save CImme] Metadata: Metadata CompletionBank: ^ (NSDLL * Esset url,

audio - Sound does not play when going to another view controller (iOS) -

on the button to press "back to the menu" there is a sound that should be played, but not because of the sound moving to the main visual navigation controller I have to do it waits for the sound before going back, but it does not work, what should I do If (appDelegate.disabledSoundEffects == 0) [Self PerformSelectorOnMainThread: @ Selector (Playbootsound) with Op Ekt faucet Prticshauniton: true]; playButtonSound method that sound is clearly plays that I address it in case there'm wrong dispatch_queue_t dispatchQueue = dispatch_get_global_queue ( DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); dispatch_sync (dispatchQueue, ^ (void) {NSBundle * mainBundle = [NSBundle mainBundle]; NSString * FilePath = [mainBundle pathForResource: @ "clickSound" ofType: @ "MP 3"]; NSData * fileData = [NSData dataWithContentsOfFile: filepath]; NSError * error = nil; self.audioPlayer = [[AVAudioPlayer alloc] initWithData: fileData error: & amp; error], if (self.audioP

javascript - Change default selected text color on webpage content -

When we select any content, it will display blue in the webpage for selection. How can this default color change on the webpage with other custom colors? You can try the code below: < Pre> :: selection {background: # ffb7b7; / * WebKit / Blink Browsers * / - :: -Move-selection {Background: #FFB7B7; / * Geo Browsers * /}

webpage - can't access viarible in the target php files -

सबसे पहले मैं एक साधारण होटल .php लिखता हूं & lt; div role = "main "Class =" ui-content "& gt; & Lt;? Php $ info = $ _GET ['टाइप']; // अच्छी तरह से काम करता है $ info get num = 1; ? & Gt; & Lt; h3 वर्ग = "ui-bar ui-bar-a ui-corner-all" & gt; आदेश & lt; / h3 & gt; & Lt; div वर्ग = "ui-body ui-body-a ui-corner-all" & gt; & Lt; form action = "sendmail.php" विधि = "जाओ" & gt; & Lt; ul डेटा-रोल = "सूचीदृश्य" डेटा-इनसेट = "सच" & gt; & Lt; li वर्ग = "ui-field-contain" & gt; & Lt; लेबल = "नाम" & gt; नाम & lt; / label & gt; & Lt; इनपुट प्रकार = "टेक्स्ट" नाम = "नाम" आईडी = "नाम" vlaue = "" डेटा-साफ़-बीटीएन = "सच" & gt; & Lt; / li & gt; & Lt; li वर्ग = "ui-field-contain" & gt; & Lt; लेबल = "फोन" & gt; फो

c# - How to make an event which gets triggered in another class -

Event PluginEvent is triggered when a plugin is added to my code for PluginManager I also want to get the events triggered in the test class . Somehow I can not solve this problem, the event has only begun in the PluginManager class . I read some articles about how to create events and so on, but I got more confused PluginManager class public Square PluginEventArgs {public PluginEventArgs (strings) {text = s; } Public string text {get; Private set; } // readonly} public class PluginManager {// Declare Delegate (while using non-normal pattern). Public Representative Zero PluginEventHandler (Object Sender, PluginEventArgs E); // Announce Event Public Event PluginEventHandler PluginEvent; Protected Virtual Zero RaiseSampleEvent (String Message) {If PluginEvent! =) PluginEvent (This, New PluginEventArgs (Message)); } Public Plugin Manager () {PluginEvent + = PluginManager_PluginEvent; SomeMethod (); } Zero PluginManager_PluginEvent (Object Sender, PluginEventArgs E) {// Tri

android - Draw on a large canvas, scroll it, save it, reload it ... works, but only the viewport part is saved -

My program can draw 2D size on a canvas, the result can be scrolled, when I save the result Only viewport image is saved. I use a scene and drag it to the canvas Saving drawing / updated result: set drawing caches (true) ); BuildDrawingCache (); Bitmap BMP = bitmap.creditbetaMap (this.getDrawingCache ()); SetDrawingCacheEnabled (false); // bitmap I can save a file in bm.compress (bitmap.compress format.png, 90, new fileoptputstream (new file (file path)); When I use a large view / canvas, I get errors, which is not quite big in my drawing catcher. When I use a regulator view / canvas shape, there are almost all drawing clips outside the viewport. ==> Can I draw on a bitmap and immediately drag that bitmap onto the canvas of the scene? So, after some drawing, the initial bitmap is updated with the newly added drawing? Happy, there is a simple solution to this question Make a big bitmap with size; Create your cached canvas = new canvas (big bitmap); First

C++ hangUp after removing unused variables -

This simple code is introduced in Dev ++++++++++++++++++++++++++ Code> a is not used. After I remove them or comment, hang the program. Why? #include & lt; Iostream & gt; #include & lt; Vector & gt; using namespace std; #define N 10 * 1000 * 1000 bool p [N]; Int f [n], a [n]; Of vector & lt; Int & gt; Prime number; For int (i) (int i = 2; i & lt; = n; i ++) if (! P [i]) {for (int j = i; j & lt; = n; j + = i ) P [j] = true; // or = 1 primes.push_back (i); } System ("PAUSE"); Return EXIT_SUCCESS; } You are reading / writing after the limit of P Sir. In the memory, after the P [N] array F [N] array, then [N] array arrives. So when you're trying to write P [N], actually the F will be written [0]. When you remove F and an array, you will write something from the vector & lt; Int> primes My guess is that vector is a square so that you make some important screws when your code will be stationed at Jammu == n, at the

javascript - JQuery hasClass - why does it always return false in this case? -

I have a span with a background image, which I want to make between the click plus plus minus background image I am I want to add and remove the class 'Open' to do this: My period looks like this ... And my JQuery looks like this ... $ (function () {$ ('expand'). ) {If ($ (this) .hasClass ('open')) {$ (this) .removeClass ('open');} and {$ (this) .addClass ('open');}})}} ; The behavior I am getting is that this class will add 'Open', but after repeated click it will not be deleted again. Logging in to the console has been shown that if my statement is always evaluating false. I have considered using the toggle class but have not done so because it is working once, hide the content block. Edit because people are focusing on my CSS, I will also provide it. (SASS / SCSS): . Expand {Background: URL (/images/plus-minus-orange.gif) Top Center No Repetition; Display area; Height: 21px; Margin: 0 auto; Width: 22px; & Am

oauth 2.0 - How to log out both server and client same time in OAuth2? -

When the success of authentication, after logging out to the customer or server, between the client and the server to remove the token accusation How to exchange? Enter the same time between the client and the server in that account, thanks to every body!

html - fixed menu aligned to left -

Image
I was working I've set a certain menu at the top of the page so that users can see on the menu at any time without scrolling. I have added CSS to the menu class to reduce width. # Masthead {margin: 0 auto; Width: 86%; } Now I'm receiving th effect menu when scrolling down to the bottom align. I have tried # masthead.fixed-header {margin: 0 auto; Width: 86%; } But it does not seem to do any work. Please any help please help make this the center of the page. Thanks! simply add : 0; In your CSS, to # masthead.fixed-header (line 649) > # Masthead.fixed-header {status: fixed; Top: 0; Correct: 0; Left: 0; Minimum height: 35px; Box-Shadow: 0 0 7px RGBA (0, 0, 0, 0.1); -MOZ-BOX-SHADOW: 0 0 7px RGBA (0, 0, 0, 0.1); -WebKit-box-shadow: 0 0 7px RGBA (0, 0, 0, 0.1); }

php - Pagination link in codeigniter is not working properly -

Pagination link looks fine But when I select Link 2 the result is not being displayed and the url is being changed to / kkci / searchresult / users / 1 , instead it Should be changed to / kkci / Searchresult / users / 2 . When I select the next numerical link data, it is not being received. I am posting my code below, please go through it and help me. The thing is that when I click the number 2 of the paging link echo var_dump () shows the result is empty and and I echo $ data-> gt; ; No value is available for email I am not able to get a reply through Google but the problem of page load occurs when I select the paging link But it is not working. New to CI, I ask CI friends to help me display the results for endorsements page 2 and 3. In total, I have 3 records which I am showing a record for page. Controller: Public function user ($ border = 1, $ offset = 0) {$ this-> Load-> Helper ('url'); $ This- & gt; Load-> Library ('session&#

javascript - Angular routing with bootstrap carousel issue -

I currently have a problem that is unsure about how to solve it or it can be solved I am currently using Kajal JS and Bootstrap 3.0. I am using routing within my angular project, but on my page I have 3 navigation buttons which used to load various instructions clicked on the navigation button (note that this is not using routing, What was it selected). I have a bootstrap carousel in each of these three directions. My problem is that when I click to navigate through the carousel images, it connects the name of my carousel to the URL and takes the routing inside. . I have another way in my routing as seen below: otherwise ({templateUrl: home.html '}) So when The URL is listed in exchange for any other thing, it will default to the home view, so when a user clicks on the carousel and the carriage name is added to the URL then it is missed in the home view. If the URL is linked to this carousel, then I do not want any way to crush it like this, if it is related to this carou