Posts

Showing posts from February, 2015

python - Axis limits for scatter plot - Matplotlib -

Image
I have the same problem, though the proposed solutions do not work for me. I am planning a set of data that is plotting this pattern of the main plot: Which is the conspiracy that differentiates Axis bounds (-1, 1) from both x and y, this marginal set with this part of the code Occurs: plt.figure () plt.show (data) ## Some margin L, R, B, T = PLT.exis () DX, DI = RL, TB Plat. Axis ([L-0.1 * DX, R + 0.1 * dx, b-0.1 * dy, t + 0.1 * dy]) In problem Ray has "complicated" plot which is why I made some changes. This is the code that creates it: def plot_quiver_singularities (min_points, max_points, vector_field_x, vector_field_y, file_path): "" "Plot Vilkshntaan vector field: Param File_path: save path data: ultimate Vector_fild_aks for the vector field X plant Plot: ultimate Vector_fild_y: vector fields to plot y components: ultimate Min_point minimum Rating One set (A S, Y): param max_points: a set of (x, y) maximum points area "" ...

javascript - How can I load PHP GET values using jquery .load() -

I'm trying to load data from another page. The data I am trying to load is a simple PHP $ _ GET value that was passed through the URL $ _ GET The value should be loaded when the following link has been clicked When I use the following href link only data loads: & Lt; An id = "pizza" href = "#" & gt; Pizza & lt; / A & gt; However when I use this href tag The content is not loaded I came to know that this is not loading because I set the content to be displayed only when the link is clicked in such a way. . & lt; Script & gt; $ ("#pizz") ("Click", function () {$ ("# item_description"). Load ("item-description.php");}) & lt; / Script & gt; The problem is that when I click on the link it starts a new XHTTP request and $ ("# item_description") Does not reach. Load ("item-details.php"); Because nothing is being clicked when there is a new XHT...

apache pig - Pig : result of json loader empty -

I am using cdh5 quickstart vm and I have such a file (not complete here): And I used this script: books = load 'data / book- ceded.jason', authors: Bags {T: Tuple (Author: chararray)}); Books' No-c Grade '. The script works, but the generated file is empty, do you have any ideas? In the end, only this schema works: If I add or remove a location different from this configuration then I get an error: " User_id ":" kim95 "," type ":" book "," title ":" adm press and edison-wesley "," authors ":" [["name" ":" Source: ":" Marshallo 79 "," Type ":" Modern Database System: Object Model, Interoperability, and Beyond "," Year ":" 1995 "," Publisher ""] "," Source " ":" Book "," Title ":" Inequality: Principle of majority and its application "," Y...

r - Perform analysis on the results of aggregate function -

temp & lt; - कुल (। ~ समूह द्वारा स्तंभ, डेटा = df [numCols], FUN = function (x) सी (एमईडी = माध्य (एक्स), एसडी = एसडी (एक्स))) मैंने डाटा फ़्रेम में कुछ स्तंभों की माध्य और एसडी की गणना करने के लिए डेटा फ़्रेम डीएफ पर समग्र फ़ंक्शन का उपयोग किया है । मैं आगे विश्लेषण के लिए माध्य और एसडी स्तंभों का उपयोग करना चाहता हूं। जब मैं कोशिश करता हूँ: temp $ med मुझे परिणाम नल के रूप में मिलता है। क्या इसके आसपास कोई कार्य है? मैं और विश्लेषण के लिए मध्य और एसडी स्तंभों का उपयोग करना चाहता हूं मुझे नहीं लगता कि आप $ पर कुल क्योंकि आपके उदाहरण में, परिणाम समूहबद्ध कॉलम द्वारा वितरित किया जाता है। चूंकि आप दो फ़ंक्शन लागू कर रहे हैं, इसलिए आपको कॉलम इंडेक्स का उपयोग करना होगा जैसे आप एक मैट्रिक्स होगा। यहां एक उदाहरण है & gt; Myfuns & lt; - फ़ंक्शन (x) c (MED = औसत (x), SD = sd (x)) & gt; (एजी और एलटी; - कुल (। ~ Cyl, डेटा = एमटीसीआर [1: 3], FUN = मायफंस)) # कैल एमजीजी। एमईडी एमजीजीएसडी डिस्प। एमईडी डिस्प। एसडी # 1 4 26.000000 4.509828 108.00000 26.8...

ruby - Automating browser actions on a headless server -

I'm looking for a Ruby solution to automate web records on a headless server (no xwindows) What do I need to do is export a file from the Daily WebAP and import it into another web app in another server. I have seen Selenium, Capoebara, Nokogiri, but I am confused with their differences / equality. Selenium needs to run a browser, which I can not do because there is no X to run in it, Noriking can use WebKit on a headless server, but it can not detect that it actually downloads / uploads files Why can it Any pointer will be appreciated. I will suggest. I'm not sure that you need something like this for this type of work like selenium . You should be able to complete this gem that is looking for you.

html - How to hide <h1> Title? -

I believe this is the code, I want to hide on the front page, whether I hide a CSS Can I use code? I can only remove the "title" from the page, and it gets rid of it, but then the link has gone from the menu menu. & lt; H1 class = 'Page-Title Entry-Title' & gt; Forum & lt; / H1> Use display of CSS: & lt; H1 style = 'display: none;' Class = 'page-title entry-title' & gt; Forum & lt; / H1> A class hidden with display: none; Creating would be good as a property (you need to edit css instead of HTML). By the way, even though we are happy to welcome all new people, there are some rules about the questions of stack sites. One of these is that will have to demonstrate the least effort in trying to solve their problems on their own. A simple Google search could have solved this for you. Edit: If you can not edit HTML / CSS code, then inject JavaScript. var all = document.getElementsByTagName (...

in iOS8: UIPopoverController presentPopoverFromRect not work for keyWindow any more -

IOS8 में, [UIPopoverController presentPopoverFromRect] [UIApplication shared application] .keyWindow के लिए काम नहीं करता है मैं सबसे अच्छा समाधान के साथ आया हूँ सशर्त इसे संभालना है अगर आईओएस 7 पर, कुंजी विंडो पर यूआईपीओपॉयर नियंत्रक पेश करने के लिए हमारे द्वारा काम कर रहे कोड का उपयोग करें। अगर आईओएस 8 पर, निम्नलिखित का उपयोग करें: viewController.modalPresentationStyle = UIModalPresentationPopover; UIPopoverPresentationController * presentationController = viewController.popoverPresentationController; [प्रस्तुति नियंत्रक सेट Delegate: self]; PresentationController.permittedArrowDirections = 0; PresentationController.sourceView = [[UIApplication साझा किया गया अनुप्रयोग] कुंजीविंडो]; PresentationController.sourceRect = [[UIApplication साझा किया गया अनुप्रयोग] कुंजीविंडो]। बाउंस; [ViewController सेटप्रतिदित कंटेंटसिज़ः CGSizeMake (320, 480)]; [पेरेंटकंट्रोलर उपस्थित ViewController: दृश्य नियंत्रक एनिमेटेड: हाँ पूरा: शून्य]; यह समान रूप से कार्य करता है: self.popoverCo...

ios - Replacing (background) node gives weird result / nodes not visible on screen -

Image
I'm trying to get into iOS with Spritekit for iOS, and I Ios Ray Wanderleach Now I am working on a platform game, but when trying to do nothing in the book, I get some strange results Used to be. Actually, I have a work platform that loads the level from a JSON-file, and shows bricks / nodes in the background layer. I have to do several floors , so when a user jumps through a portal in the game, a new floor / level is loaded and placed in the same position on the screen (all floors have the same size ). I did not think I would have any problem with it, as if the user jumps through the portal then it is really easy. And I'm already loading a level to start, so at this time another load is going and it should not be difficult to change the original. However, it is proving to be very difficult. When I load the game, I call this method: - (zero) vs. world {_bgLayer = [Self generated sensor: [NSNumber number with Interfer: 1]]; _worldNode = [SKNode node]...

azure - Webjob giving an outofmemoryexception -

My webmobi is very low, it downloads 3kb data, then updates some information in my database, even though webmine starts An exception is thrown after and after information is being downloaded (or after) [07/27/2014 00:12:47 & gt; B2B 30D: ERR] Uncontrolled Exception: OutofMail Exception Any idea why this matter will be? I have run the exchange locally with the same data and it uses minimal memory, I have a maximum of 65 MB, but I do not think it is enough to create an exception (or Is there any limit on webibos?) My memory usage statistics (on the Azure Dashboard) 54% are 512 MB / hr (It looks like I'm using a lot, but still much more is available). File system storage 9 10 MB 1024% I am using a shared hosting plan mode. The database is not killed before throwing an exception, so this database is not a problem. Update - System Diagnostic information on Ezu using Diagnostic [07/28/2014 09:07:19 & gt; B2B30D: INFO] WorkingSet 64: 10.54297 [07/28/2014 09:...

javascript - Documentation for Request and Response objects in Node.js -

मैं अनुरोध पर पर्याप्त दस्तावेज़ ढूंढने में असमर्थ हूं और प्रतिक्रिया I आने वाले संदेश लागू करता है पठनीय स्ट्रीम कुछ तरीकों से अनुरोध और प्रतिक्रिया वस्तुओं के पास होनी चाहिए, लेकिन जिन तरीकों को मैं देख रहा हूं जैसे कि addListener () वहां नहीं हैं। मैंने इस प्रश्न को देखा मुझे यह बहुत उपयोगी लगता होगा यदि: 1) किसी के पास अच्छे दस्तावेज के लिए एक लिंक है अनुरोध और प्रतिक्रिया वस्तुओं के लिए उनके कॉल करने योग्य सार्वजनिक विधियों सूचीबद्ध 2) मैंने प्रश्न से देखा मैं ऊपर से जुड़ा हुआ है कि आप नोड.जेएस के खोल में अनुरोध ऑब्जेक्ट देख सकते हैं, लेकिन मुझे यह नहीं पता कि (जहां तक ​​मुझे पता है) के बाद से इसका उपयोग कैसे किया जाए एक createServer () विधि को पास कॉलबैक विधि के माध्यम से एक पैरामीटर अगर मैं खोल में अनुरोध और प्रतिक्रिया तरीकों तक पहुंच सकता हूं तो मैं उनकी सामग्री (कॉल करने योग्य विधियों सहित) देख सकता हूं। मैंने अभी जावास्क्रिप्ट शुरू कर दिया है और node.js इसलिए मेरी भाषा बंद हो सकती है, खासकर कॉलबैक विधियों के बारे में। कोई भी सुधार आपका...

html - :hover not working on stacked font-awesome icon -

I am trying to do something very simple when the horrible change in the font is painted from the color, inside I I'm looking at the icon (question mark) as I want, but the outer circle color is not changing. HTML and CSS below: // HTML: & lt; Span class = "more-info-toggle f-stack" & gt; & Lt; A href = "#" id = "more-info-sharing-toggle" data-toggle = "tooltip" title = "Why Share?" & Gt; & Lt; I class = "fa fa-circle-o fa-stack-2x" & gt; & Lt; / I & gt; & Lt; I class = "fa-fa-questions fa-stack-1x" & gt; & Lt; / I & gt; & Lt; / A & gt; & Lt; / Span & gt; // CSS: .more-info-toggle: hover {color: # 53AB46; } Any idea why the external circle color is not changing? Thank you. A typo should be: # more-info -share-toggle: hover {color: # 53AB46; } The ID was not matched, and it should be #.

How to run mysql commands from terminal? -

Last night I asked; And I started after the tutorial posted as a reply; I was just wondering how to log into mysql and run the command from the terminal. I tried mysql -u root -p and said that no order was found ... I know that I can create tables in phpmyadmin I like the ID but also use the command line should I just run the sql query in phpmyadmin?

java - In Spring MVC using jquery ajax with json, getting error : "unsupported media type" -

I am creating a Spring MVC application, in JSP I need to send the object to the controller and then return the object to jsp have to give. But I'm getting an "unsupported media type" error. Can someone help me? Below is my code: ** In Administrator: @RequestMapping (value = "/ addPerson", method = RequestMethod.POST, header = {"content-type = App / Jason "}) @ ResponseBodybody Public Ains Edson (@RequestBody person) {System.out.println (person.getName ()); Return person; } ** In JSP: $ .ajax ({type: "POST", url: "addPerson.view", data: JSON Encrypt ({name: "Adam", age: 30, city: "Paris"}), type of content: 'app / jason', success: function (data) {alerts (data. Name + "has been added") ;}, Error: Work (Excerpt, Error Type, Exception) {var errorMessage = exception Try it out: @RequestMapping (value = "/ AddPerson ", method = RequestMethod.POST, consumes = {" a...

java - Comparing a char with multiple characters -

के लिए (int j = 0; j & lt; str.length (); j ++) {if (चार [j] ] == (ए || ई || आई || ओ || यू)) गणना ++; } मुझे (a || e || i || o || u) का परिणाम पता है एक बूलियन है, इसलिए तुलना नहीं की जा सकती, लेकिन यह कैसे हो सकता है हम कई चरित्र उपस्थिति की जांच करते हैं? यह वह नहीं कर रहा है जो आप चाहते हैं कृपया एक स्टैक स्विच कथन का प्रयोग करें: के लिए (int j = 0; j & lt; str.length (); j ++) स्विच (str.charAt (j) ) {केस 'ए': केस 'ई': केस 'आई': मामले 'ओ': मामले 'यू': गणना ++; } या, क्योंकि मैं regex उत्साही हूँ, यहां नियमित अभिव्यक्ति का उपयोग कर एक दृष्टिकोण है! :) Matcher matcher = Pattern.compile ("[aeiou]")। मैटचर (str); जबकि (matcher.find ()) गिनती ++; बाद में इस कोड में एक गलती हुई थी,

postgresql - Joined SQL query MAX aggregate with condition -

I am having trouble with SQL queries here my schema is represented on SQL Bedle: The problem is that I want to return the row of data from the invitation table and both of them were created as well as new events along with 'sent' event_type and 'seen' event_type date. I can get all the data and work, but there is a problem with the previous session. Is there any way I can use a condition in a MAX total work? Like maximum (SELECT events.created_at WHERE event_type = 'sent') If not, how do I write the correct subhead? I am currently using Postgresql. Thank you. You can use a case statement inside Max as you did with the amount given below For the maximum created_at , select event_type = 'sent' i.id, i.name, i.email, max. (The case when last known as e.event_type = 'sent' then e.created_at end) as the last_cent_on, sum (in case when e.event_type = 'sent' then 1 and 0 termination) as_count, sum (case when e.even...

javascript - How do I trigger an inline search/autocomplete when I type [ -

I am thinking in terms of a wiki that what I am trying to achieve is that a text editor From the inside, when a user typed [ , then in line, based on user input, [ and later ] . What do I need to do when a user opens a brace [ , then it means that they are about to make a link to another article on the site, to make it easier for them to go looking for links I do not need the editor to write articles as they type, this behavior can be seen at least in SharePoint. I'm sure there should be some library that gets it, but I have to find out what to look for and I end up with the full text input, which I want to target I'm not doing Any help would be appreciated.

c# - SkipWhileIterator method implementation understanding -

I'm reading that CLR can take it, for example, what is happening when implementing the SkipWhile method. : IList & lt; String & gt; Numbers = New list & lt; String & gt; () {"one two three four five"}; Var results = numbers While skip (number = & gt; number = thumb == 3); result. Toolist () (Number => console WrightLine (number)) for; CLR will do these steps: The C # compiler uses an anonymous method ( to be a method & lt; main & gt; B__1 number = & gt; number. length == 3 ) in compile time. As a definition of & lt; CLR left time Main & gt; Using the b__1 method will instal an example of multicast delegate . Using the CLR original list, give an example of the SkipWhileIterator iterator, and & lt; Main & gt; B__1 Due to suspended execution, SkipWhileIterator CLR does not call toList call or ForEach method To repeat through the uses, CLR runs the toList method to SkipWhileIterator on Ski...

Submit Button Event Tracking in Google Analytics -

I can not get event tracking to work on a submit button press on the site. The relevant code is type button class = "BTN-valid valid contact-BTN" "submit" onclick = "_gaq.push (['_ trackEvent' 'Clutchquality', 'submit']); "> This syntax is correct? Are you using the right analytics object (i.e. _gaq GA)? It will depend on whether you are using Universal Analytics (Analytics .js) or Classic Google Analytics (ga.js) in your snippet. But I have seen conditions where the user has _gaq and gaob Jects have been mixed syntax-wise, this looks correct. More info on event push syntax can be found here. Hope this will be helpful.

tomcat - Grails _Events.groovy not working on production server, works on dev though -

I want to mapped the external directory as a resource for the application posted on tramcat. I have already gone through the thread and tried several ways: I added _Events.groovy and it is my god machine (Windows 7), but when I deploy it on the production server, it does not map the external folder to the reference root. import org.apache.catalina * Import org.apache.catalina.connector. * Import org.apache.catalina.loader.WebappLoader Event Configuratom cat = {TOKKET - & gt; Println "changing tag setting ..." string imageDir = '/ usr / imgs'; If ('window') is included in the system (properties) ['osnames']?. ToLowerCase (?)?. {ImageDir = 'c: / usr / imgs'; } Println "Product Image Image:" + imageDir; Def context = tomcat? .addwebapp ('/ imgs', imageDir) def loader = new WebappLoader (tomcat.class.classLoader) loader.addRepository (new file (imageDir) .toURI () .toURL () .toString ()) Loader .container = contex...

How to use openssl crypto lib? -

Can someone give me good "how" or manual advice about this specific cryptography about algorithms or large books Matches subtle articles to use. I am trying to find something in between, which will allow me to start this Liberation quickly. Can someone give me good "how" or manual advice? You can find a cassette spray on the web. The manual is located online. The same manual is installed locally, and you can access it via man pages. For example, you can find information on cipher with cipher (1) you can search it online, or type man 1 cipher . You can also see here. Block cipher is covered and MAC is covered. There are some books, but these are just a few dates. They are still good references because the submission is still in use (now there are only more stuff). See and. Finally, when you do not get any information about anything, the last line source code is almost all the functionality is revoked in different sub-commands. For example, t...

ruby - How to convert GET parameter to another format in Rails? -

I have a simple form in my train app, which can be used by all user's invoice Filter by: / P> & lt;% = form_tag invoices_path ,: method = & gt; 'Get'% & gt; & Lt;% = text_field_tag: Date, Parameters [: Date]% & gt; & Lt;% = submit_tag "search"%> & Lt;% end% & gt; When a user enters a date in their preferred date format, e.g. 27/07/2014 , I get this code in the / invoices? Date = 2014-07-14 to be shown as, because it can be handled very easily and also better than / invoice = date = 25% 2F07% 2F2014 Looks. What does convert have a GET parameter like this? Thanks for any help. First of all, the date is prettifying on customer , because you first Want pretty values ​​to show in the query parameter. form_tag can be provided with onsubmit callback: & lt;% = form_tag invoices_path ,: Method = & gt; 'Get': OnSubmit = & gt; 'Validate the return (this)'% '& gt; ...

How do I use the Android clipboard from F# in Xamarin? -

I'm writing an Android app with Xamarin and F # and clipboard manager to copy some text to the clipboard Need to use. The best way to do this in Java is to: android.content.ClipboardManager clipboard = (android.content.ClipboardManager) getSystemService (context.CLIPBOARD_SERVICE ); Android.content.ClipData Clip = android.content.ClipData.newPlainText ("text labels", "text to clip"); Clipboard.setPrimaryClip (clip); What is the best way to express this code in F #? Thank you! I think I found a solution: clipboard Use = This.GetSystemService (context.ClipboardService):? & Gt; Use the Android.Content.ClipboardManager clip = Android.Content.ClipData.NewPlainText ("textlabel", "text to clip") clipboard. Primary clip and lift - clip where refers to this a activity is

ios - FBLoginView button with sharp corners -

I am using the FBOOVIN view in an iOS app. Can I change the button of FBLoginView faster than the round corner? You will need to use a custom button for this, you will see FBLoginView and Must have to work within the constraints set by third party libraries. However, if FBLoginView uses a layer Conradius to round internally, you can observe the visual hierarchy and To get sharp edges, set the corner radius of the offending scene to 0.0 .

css - Stretching divs to bottom with a responsive grid -

This is the page I'm working on: me nav side bar Need and main content area to stretch (or beyond, with content) in the browser, evenly, whether they are empty or some other content in another Other I put a border on the surrounding container and it is not even pulling I am very new to the fluid grid and I think that the position: N With relative with height: 100%; Blowing the grid system and height: 100%; Nothing does alone I am hunting through thread for answers but nothing related to responsive design is available. Keeping this in mind, it is set up that when the content is longer than the browser, the picture on the right is fixed, while scrolling to the left. Any help would be greatly appreciated. Thanks in advance! @ Media screen and (minimum-width: 1241px) #main {min-height: 85%; // & lt; ---- Extract low-height: 600px; // & lt; ---- INSERT} does not count as content for the image box, which you set to the minimum-height = 85%, a...

string - PHP Escape ampersand when printing -

In my Flash website, I type the variable's $ trunk , and then via PHP I $ trunk and capture it using my flash program. The problem is that sometimes the most text received in the database is an ampersand, "and", and while using the print "$ trunk" it is very poorly messed up And results will not be printed at all, which causes errors in the Flash program. Using mysql_real_escape_string ($ trunk) will not work because this function can not escape from the ampersand, and nothing has been done using html_entity_decode . So, how can I avoid ampersands in strings?

multiprocessing - How can I do an atomic write to stdout in python? -

I have read in some sources that print is not a command-thread and secure solution, instead of Strong> sys.stdout.write command, but still it does not work for me and writing STDOUT is not atom. is a small example (this file is called parallelExperiment.py): Multiprocessing import pool DF output (msg) from import and import import: msg = % S% s '% (msg), Os.linesep) sys.stdout.write (msg) def func (input): Output (UIPID:% d input \ "% s \"'% (os.getpid), Str (input)) has got the DEF Execution Function Inperral (FunkCanM, Input List, Maxoperalism):% d size with the resemblance of% d '% (funcName .__ name__, lane (input list), maxpartarianism) U'Executing function% s) par AllelismPool = Pool = Max PayPalism) Boolean Publish List = Parallelism Map (funcName, inputsList) ParallelismPool.close () output (u'Function% s size% d executed with the maximum likelihood of% d input% d '% (funcName .__ name__, lane (inputsList), maxParallelism) # if...

php - Getting Cannot modify Error at wp-admin in inspect element -

Yes, inspect Google Chrome's element source tab, also check on Firefox. I search everywhere for the solution, but none of the things could be useful. My Wordpress theme then shows that inspect mode in WP-admin wp-admin / admin-ajax Php? Action = df_dynamic_css and ver = 3. 9.1 wp-admin / admin-ajax.php? Action = df_dynamic_js & amp; Ver = 1 But in the body section in DF Dynamic CSS / * = ============== ================================================== ========= Body ======================================== ================================== / body {background color: #dddddd; } & Lt; Br / & gt; & Lt; B & gt; Warning & lt; / B & gt;: header information can not be modified - headers have already been sent (output / home / ***** / public_html / wp-content / themes / dialy-theme / lib / css / dynamic - Css.php: 45) & lt; B & gt; / Home / ***** / public_html / wp-content / themes / dialy-theme / lib / css / fonts.php & lt; / B & g...

javascript - Html in-page hidden text that isn't shown until link is clicked -

New types of HTML. I am looking for an animation that when the image is clicked, it plays an animation that opens half the page text and stuff. Something like this: If you want to do this, you can actually get a Jquery javascript (www. Jquery.com) Javascript framework I find it particularly easy to learn. What do you want to do: & lt; Div style = "display: none;" Id = "mytext" & gt; Your text & lt; / Div & gt; & Lt; One onclick = "$ ('# mytext'). Show ()" & gt; & Lt; / A & gt;

magento - Fatal error: Call to a member function join() on a non-object? -

I am creating a slideshow and I include my slideshow table and my images in the table through this slide Unfortunately, this error is happening: Call the "Fatal Error: Any Non-Object" when the member functions are included: Here is the code : $ Diaporama = Mage :: getModel ('dioroma / dioporama') - & gt; Meet compilation (); $ Diaporama-> Join (array ('Images' = & gt; 'Diaproma / Images'), 'Main_table.id = Images', Arrays ('*')) - & gt; Set order ('status', 'esque'); $ Diaporama-> Load (); Return $ diaporama; Does anyone see where I am wrong? Update: OK, now my first problem has been solved, I have successfully displayed data on my block. I still have a problem in my query because I only got the first image data of my slideshow to know that I have 2 tables: Diaporama: - ID - Title - Disclaimer Diaphragm_is: - ID - diaporama = array ('id') - 'title' descrip...

mysql - Prestashop: how to define multiple primary keys with ObjectModel -

I am defining new entities while increasing the object model. I have a table with two such primary keys: create table `ec_product_order_attachment` (` id_product` int (10) unsigned tap, `id_order_attachment` int (10) unsigned zero, Primary key (`id_product`,` id_order_attachment`) engine = InnoDB default charge = UTF8; It seems, I can not define a table with 2 primary keys in the object model. Do you know any way to do this? Update (Solved) User PrestaShop-Developer Com gave me a good suggestion. I resumed the Order_Attachment custom unit class, and it's working just fine. So just for documenting, I copy-paste my finished class. Just to say, I have created this class for a custom module that adds a tab to the Admin Edit product page, so that the ability to save special attachments can be added that orders will be sent with complete mail. That's why I need 2 new tables: Order_Actactment and Product_order_actment to link products for special order. class order-...

java - Game Programming - & Logical Operator and .getRGB() Method -

I have two questions related to the code given below: pixels = image.getRGB (0, 0, width, height, zero, 0, width); For (int i = 0; i & lt; pixel height; i ++) {pixels [i] = (pixels [i] and 0xff) / 64; } My first question is, what is the last argument, which is set as a width, in the .getRGB method. The second is (pixels [i] & amp; 0xff) / 64 , because me & amp; Operator did not face nor did I know that 0xff means, I think, however, that it has to do something with changing RGB value. This is for a 2D game, I am trying to make a book according to what I am currently reading. Here's the full code: Thanks! For the final scansize parameter, see: Start-Y) * Scanis + (X-StartX)]; This is intended to allow your destination array for the width that is different from the removable part. & amp; The 0xff operator is removing only the blue component of the ARGb pixel value, because the bits in pixels are arranged in su...

linux - Bash separation of line with newlines instead of spaces -

Image
I have made two of the following commands: In the past, I listed the contents of the directory and It was stored in it variable The second shows the contents of a variable I have now decided That I want to separate listings, not with spaces, but with Newline, I do the following: Why do I get a mess? It is worth noting that when I changed the command, I did the work: Can anyone please explain, why 0x20 or 32 (I also tried this number) in this case Bash is not treated as space ? tr simply does not recognize hex but octal will work: tr '\ 040' '\ n' and an easy way to show your files shop-to Nologlob ## Optional Printf '% s \ n' * *

php - Order by CASE ASC -

PDO (mysql database) for the first time using CASE in I'm trying to order a date I am, but only when not on 0000-00-00 (it may be) but it seems that the case all ignoring together .. I'm doing wrong? $ sql = 'SELECT * mytable from WHERE groupid ='. $ Groupid Based on the order when grouped! = "0000-00-00" then group Aided 'ASC'; $ STH = $ conn- & gt; Query ($ sql); If & ($ STH- & gt; rowCount () gt; 0) {while ($ row = $ STH- & gt; fetch ()) {// Lines output}} Other {echo '& lt; P & gt; No dates found & lt; / P & gt; '; } What do you want to do with zero-date rows? After them the other lines? then the query using SELECT * mytable the WHERE groupid = $ groupid ORDER by groupdate = '0000-00-00', groupdate groupdate = '0000-00-00' is a boolean expression and 1 for matching rows gives 0 for non-matching lines. 0 comes in ascending order before 1. Non-zero rows are sorted by gro...

javascript - jquery plugin and a Click button -

I think it should be easy, but I failed to do it. I own plugin is a (function ($) was {$ .fn.Update = function () {console.log ( "click");}}}) () ; And on this page, I want to use it: & lt; Script src = "~ / scripts / my.plugin.js" & gt; & Lt; / Script & gt; $ (Function () {$ (".btnUpdate"). Click (function () {// TODO: add function with plugin update ();});}); But I'm getting a reference error: The update has not been defined and it has been seen that when the page loads, I will not go inside the function, I only $ .fn Using .update and touch directly using $ you jQuery Can add a new method for selected elements of. $ .fn.Update (); or $ ("..."). Update (); $ (foo) .Update () , $ (foo) code> will Update function You get an not updated error because you do not have any Update function (which has been announced globally), but $ .fn.update

java - What's wrong with my regex -?\\d{2}\\.?\\d{6} -

I am trying to extract the URL longer and longer: source: ... sensor = False & center = -15.842208999999999% 2C-48.0, 23,084 and zoom = 17 & size = 256x256 and language = hi & customer = google-map-frontend and signature = hbey3U4lycTNgX48asW8MODjJLM I regexes I'm not good at, so I went to the tester regex () and this regex coded -. \ D {2} \ \ d {6} (for Java) that this result (which is in production, it is regexpal .com): -15.842208 ... -48.0, 23,084 So when I do this (in Java): (element For element: NewsHeadlines) {if (element.toString (.) Contains ("https://maps.google.com")) {list & lt; String & gt; Lista = get_matches (element.attr ("content"), "-? \\ d {2} \\. \\ d {6}"); }} Public Stable List & lt; String & gt; Get_matches (string s, string p) {// return of all matches of p p for first group in returning expression list & lt; String & gt; Matches = new arrelisted & lt; String & gt...

python - Extracting url from style: background-url: with beautifulsoup and without regex? -

मेरे पास: div class = "image" style = "background- छवि: url ('/ अपलोड / चित्र / खिलाड़ियों / 16113-1399107741.jpeg'); " मुझे यूआरएल प्राप्त करना है, हालांकि मैं कैसे नहीं कर सकता regex के उपयोग के बिना ऐसा करना क्या यह संभव है? अब तक मेरा समाधान regex के साथ है: url = re.findall ('\ (' (*। *) '' \) ', सूप ['शैली']) [0] आप पैकेज का उपयोग करने का प्रयास कर सकते हैं। इस तरह से कुछ काम करना चाहिए: bs4 आयात से आयात cssutils BeautifulSoup html = "" "div class =" image "style =" background-image: url ('/ uploads / images / खिलाड़ियों / 16113-139 9107741.jpeg '); "" "सूप = खूबसूरत सूप (html) div_style = सूप। (' Div ') [' शैली '] शैली = cssutils.parseStyle (div_style) url = style [ 'पृष्ठभूमि-छवि']> gt; & gt; & gt; Url u'url (/uploads/images/players/16113-1399107741.jpeg) '& gt; & gt; & gt; Url = url.replace ...

c++ - WIC use specific codec -

I am working to convert cuff files from cameras to WIF format such as canyon and nickon in the form of a quarrel. I found an example using a file name to create a WIC factory object. // Create a WIC decoder ////////////////////////////////// //////////////////////////////////// IWICImagingFactory * piFactory = NULL; IWIC bitmapdicoder * piedecoder = faucet; // COM Imaging Factory. HRESULT hours = CoCreateInstance (CLSID_WICImagingFactory, Zero, CLSCTX_INPROC_SERVER, IID_IWICImagingFactory, (LPVOID *) & amp; piFactory); // Create decoder if (SUCCEEDED (hour)) {hours = piFactory-> JPEG Lossless Decoding / Encoding & amp; piDecoder for CreateDecoderFromFilename (L "test_raw.cr2", Zero, GENERIC_READ, WICDecodeMetadataCacheOnDemand,); } The file has the ".cr2" extension for Canon, as I know there are at least 2 different codecs for CR2 files, one from Canon and one from Microsoft This is to ensure that a specific codec is used. How can I do this? ...

image - Android SQLite cursor null -

I am dynamically creating a PDF file using the iText library. In the PDF file I insert the picture taken from the database, but if the image is not present then the file has not been created. Is there a way around this when the cursor result is zero? This is my query: string sql2 = "Logo logo select from logo"; Cursor c3 = db.rawQuery (sql2, null); If (c3.moveToFirst ()) {byte [] blob = c3.getBlob (c3.getColumnIndex (LogoTable.LOGO)); Bitmap B1 = Bitmap FrontenderDesidedAbayAttray (Blob, 0, Blob.Lamp); } C3.close (); Db.close; ... A part of my helper class @Override Creating a Public Zero (SQLiteDatabase DB) {DatabaseHelper.db = db; Stringbuilder builder = new stringbiller (); // tabla logo maker = new stringbiller (); Builder.Append ("Make Table {0} ("); Builder.Append ("{1} Integrate Primary Key Entitentment"); Builder.Append ("{2} Blob"); Builder.Append (" ); "); Db.execSQL (MessageFormat.format (builder.toString (), Log...

java - JNDI lookup is not happening when we bind object in one project and look up from second -

I have two Java projects, in Test1 and Test2 Test 1 In the project I have a servlet with the following code Initial Consultant Initial Contex = New InitialContact (); Class.forName ("com.mysql.jdbc.Driver"); Connection Connection = DriverManager.getConnection ("jdbc: mysql: // localhost: 3306 / lntdb", "root", "root"); InitialContext.bind ("conn", connection); Response.getWriter () println ("bound to JNDI" + initialContext.lookup ("Cone")) ;. `Connection object with The above code is binding MYSQL database JNDI name conn , Since then, the Test2 project is trying to regain the connection object. Test 2 is also a servicelet with code below Initial Contex = New Initial Context (); . Response.getWriter () println (initialContext.lookup ("Java: Computer Application / env / Conne")); But I'm getting an exception stack trace below javax.naming.NameNotFoundException: Name [Conn...

php - symfony2 & doctrine orderBy/DQL error -

मेरे पास 2 संस्थाएं निर्धारित हैं: राज्य इकाई शहर इकाई मैं राज्य इकाई का चयन करने के लिए और स्वचालित रूप से शहर इकाई में शामिल होने और राज्य के नाम से परिणाम आदेश की कोशिश कर रहा हूँ। हालांकि, मुझे यह त्रुटि मिलती है: [सिंटेक्स त्रुटि] लाइन 0, कॉल 74: त्रुटि: अपेक्षित शब्दशः, 'बी' ' मेरा कोड क्वेरी बना है: $ statesQuery = $ this- & gt; getEm () - & gt; createQueryBuilder (); $ StatesQuery- & gt; चयन ( "सेंट"); $ StatesQuery- से ("कोर बंडल: राज्य", "सेंट"); $ राज्यों- & gt; बाएं जोन ("कोर बंडल: शहर", "सीटी"); $ StatesQuery- & gt; addSelect ( "सीटी"); $ राज्यों- & gt; आदेश बाय ("st.name", "ASC"); $ StatesQuery = $ statesQuery- & gt; getQuery (); $ राज्य = $ राज्यों- & gt; getResult (); यदि मैं आदेश को विधि से निकाल देता हूं तो मुझे निम्न त्रुटि मिलती है: [Syntax error] लाइन 0, कोले -1: त्रुटि: अपेक्षित सिद्धांत \ ORM \ Query \ Lexer :: T_W...

python - How to use %pythonappend and %pythonprepend to access argument and return values in SWIG? -

% pythonappend का SWIG दस्तावेज और % pythonprepend बहुत संक्षिप्त है । मैं सोच रहा हूं कि उन अजगर ब्लॉकों में रिटर्न वैल्यू और इनपुट आरब्यूज़ का उपयोग कैसे करें। उदाहरण के लिए, यहां SWIG दस्तावेज़ से एक उदाहरण है: % मॉड्यूल उदाहरण // पट्टी को अजगर कोड जोड़ें ()% pythonprepend Foo :: बार (int)% {# %}% Pythonappend Foo :: बार (int)% {#do सी + + कॉल%} वर्ग के बाद कुछ Foo {सार्वजनिक: इंट बार (int x); } इनपुट तर्क x और बार के वापस आने वाले मूल्यों को कैसे मुद्रित करें? इनपुट तर्क प्राप्त कर रहा है: प्रिंट (आर्ग्स) वापसी मूल्य तक पहुंच: प्रिंट (वैल) चेतावनी: मुझे मिल रहा है उत्पन्न जवाब .पी फाइल को पढ़ने के द्वारा दुर्भाग्य से, तर्क और वापसी मूल्यों तक पहुंचने के लिए कोई आधिकारिक समर्थन नहीं लगता है। यह तरीका आपके कोड को भविष्य के स्वगोल विज्ञप्ति में तोड़ सकता है।

Azure map drive system error 53 has occurred -

I am trying to map a virtual machine to a storage account in Azure. I am following the following which gives details of how your accessor files are accessed from within VM. You can create a new storage account so that it has access to the new Azure file, then map a drive in the VM via Net Usage: Pure Access z : \\ tempstorage.file.core.windows.net \ upload / u: tempstorage mykey I'm getting: The system error has occurred 53 . The network path was not found. I have made the container public and can access the files located through the URL: https: //tempstorage.blob.core Windows.net /upload/example.jpg Any ideas why I'm getting system error 53? Please note: The above URLs are an example and not a link to a readable location. You must ensure that you have previously enabled the folder as a share See step 3 on this blog: If you do not do this, you will not be able to map it to a virtual machine using the 'net usage' command.

Applying a formula to an entire table in R -

Hello all I have come back with another issue concerning R. So the problem happens in this way, the performance table of players is in a soccer match with different players, the number of failures calculated about each player, goals, etc. .. I think the player's rating I want to apply a formula to measure: player_reating = (target + 0.5 + assistant + 0.5 * shots at target - 0.2 * officially done - 0.8 * red card - 0.4 * Yellow card + 0.2 * saves) The output needs to appear in the table with the data in the form of a new column, assuming that the player is called player_violence before: name is Yellow.card A 0 B 0 2 C2 1 after: The name of the target Yellow.card Player_rating 1 0 15B 2 2 5C2 1 26 thanks From the table, I consider it a data frame. Here I have created a dummy data frame with the field you specified. df I've taken an intermediate item m , you can leave it.

html - Notepad++ Codefolding - Everything but the header is under body tag? -

इस सवाल का पहले से ही एक उत्तर है: 8 जवाब मूल रूप से, & Lt; html & gt; टैग में मेरे पास & lt; head & gt; , & lt; body & gt; , और & lt; footer & gt; उन के तहत मैं divs और जो कुछ भी है Codefolding का उपयोग करके, मैं बस & lt; html & gt; हो सकता है, और बाकी सब कुछ छुपाएं। अगर मैं उस का विस्तार करता हूं, तो मुझे & lt; head & gt; , और & lt; body & gt; पाद विस्तार करने की कोई योग्यता नहीं है यदि आप शरीर का विस्तार करते हैं, तो आपको पाद लेख विस्तार करने की क्षमता मिलती है एक अन्य बात यह है कि, HTML समापन टैग & lt; body & gt; टैग के नीचे छिपा हुआ है इसकी कोई बड़ी समस्या नहीं है, लेकिन यह वास्तव में परेशान है क्योंकि मुझे यह सब संगठित करना पसंद है। सहायता की सराहना होगी। ऐसा लगता है जैसे आपने गलत मिलान वाले टैग्स, या शायद टाइपो क्या आपने एक नया दस्तावेज़ आज़माया है जो सिर्फ & lt; html & gt; & Lt; शीर्ष & gt; & lt; / head & gt; & LT; बॉडी & gt; & lt; / body ...

android - Intellij idea usb device debugging app doesn't load on phone -

I have the Nexus 4 and all the necessary drivers installed (the phone is recognized with the "ADB device" command) . When I try to debug my Android app with the idea of ​​intelligent on USB, I get this output: Waiting for the device is the target device : Uploading the local path to the lge-nexus_4-xxxxxxxx file: C: \ Users \ Public \ Document \ Java Project \ Test GDX Project \ Android \ Build \ APK Android-Debug-UnAnlank.APK Remote Path: / Data / Local / Tmp / Com.testgdx.game.a Ndroid But does my phone ever load anything? Edit: Once the app is manually installed, USB device debugging starts working suddenly. of a separate USB cable (i.e. the original cable and cheap 0.99 $ cables) Trying to use. For some devices, some cables are not compatible for debugging purposes

android - WebView prevent reloading in RetainInstance fragment -

I'm having a problem preventing a webview from reloading, as well as keeping it inside a piece Really set the set The paths I have tried: SaveInstanceState (does not pass on rotation due to maintaining a bundle) a custom bundle that is saved on onSaveInstanceState and In maintaining the webview context, it is restored and attempts to add it back You can do this very easily because you already maintain this example, in this detachment you can see the WebView Do Drb the place and said it (Ondestoryuwu the fragment) to separate it from parents. If it is non-blank, then simply return it to the curvature () for example: the public class enhances the webfiguration slice {Private webview mWebView; @ Override Public ViewCreative (LayoutEfter Inflator, View Group Container, Bundle Saved InstantState) {if (mWebView == empty) {mWebView = New WebView (getActivity ()); } Return mWebView; } @ Override Public Empty OnDestoy View () {super.onDestroyView (); If getRetainInstance (...

c - ProjectEuler' 8: solution works for example but can't find answer -

I am learning and trying to improve my skills, through which the project is practicing with owl. I'm left with This is my code: #include & lt; Stdio.h & gt; #include & lt; String.h & gt; # Include & lt; Stdin # ADJ_GRAB4UIT64_T max_prod; // takes a four array and has changed int array int * arr_atoi (const char nos []) {static int c_ints [ADJ_GRAB]; Int nos_len = Stellen (number); Int z; For (z = 0; z How many adjacent points you can modify while modifying ADJ_GRAB If you run it with four, as in the example of the problem, the product is 5832 (which is the right product), but if you run it from 13, the product is not correct. Thank you. Part 1: The number of bits Your Solutions integer suffers from overflow Mathematics on a int , which is likely to be a 32 bit number. By scanning the problem spot, I came across: 9 * 7 * 5 * 3 * 6 * 9 * 7 * 8 * 1 * 7 * 9 * 7 * 7 == 8,821,658,160 == 0x2_0DCF_D230 Which is 34 bit unsigned) Number. Pa...

Android Camera Use with Tabbed Navigation -

I am using this tab navigation: From the Android Developers site However, I am unable to use a camera in any simple way, because the on-activative result is never called. Apparently this works fine for pieces, but possibly because the example of sliding tabs collars uses nested pieces (I think?) With the sliding tabs collarfragment (?) Such new pieces: piece composition () {ContentFragment return new instrument (MT, Mindicator roller, MDVEdveloper); } So my activity features are never called. I have tried every variation in calling it that I can get the suggestion. I have found some incredibly suspicious code in initial activity which now looks at the piece and it passes through the request code, result code and data, all of which are closed or tap (maybe another problem ). Is there a way that I can do a smooth, tabbed navigation and be able to use the camera? I have not included any special code because it's just a base code that I mentioned with just a few calls...

javascript - What is the meaning of the "t" in the code and what does t(window) mean? -

I am trying to learn jquery / javascript by looking at the source code of some websites. I am a bit unsure about the syntax used there: ! Function (t) {"strict experiment"; Function e () {var e = parseInt (T (window) .scrollTop ()), n = 10; E & gt; En? A.addClass ("new-class"): (a.removeClass ("new-class"), T (".class"). RemoveClass ("fclass")) // more code ...} (JQuery) , I really do not really know what exactly that t means. Is this "this" or just a commodity? And what does T (window) mean? I thought it should be something like T. Windo? Since there is no T function Thanks! Saldtch T is the context of jQuery that Object within the scope of the function Notice how the function is called: ! Function (t) {// "t" is jQuery object} (jQuery); The function is defined and then immediately applied with the parameter jQuery . Therefore, when the function is applied, the parameter is being passed...

vbscript - HTA and VBS dynamic list and opening file in list -

Firstly new and generally programming here. I am trying to create an HTA that can load different VBS scripts from an external folder so that it can be made more modular. I am trying to open VBS from my dynamic list. How do I open a file in my dynamic list? And how can I pass a variable in the file as well? I currently have this: & lt; Html & gt; & Lt; Top & gt; & Lt; Title & gt; My HTML Application & lt; / Title & gt; & Lt; HTA: Application APPLICATIONNAME = "My HTML Application" ID = "MyAlation" VERSION = "1.0" /> & Lt; / Head & gt; & Lt; Script language = "VBScript" & gt; Deputy Window_OnLoad for dim FolderPath 'folder dim objFSO dim objFolder dim colFiles dim objFile dim objOption FolderPath = "% PathToScripts%" set objFSO = CreateObject ( "Scripting.FileSystemObject") objFolder = objFSO.GetFolder (FolderPath) set colFiles set go to = objFolder.Files colFiles...

Mysql order by timestamp (and keep event at top of results if date is within two weeks) -

Image
I am writing a query that pulls data from different tables (user activity stream) ' Events EventData 'below is the actual date of the event in YYYY-MM-DD - Timestamp is the time posted. I write your query by ordering timestamp but push event to top if event date two weeks? select events.user_id, to do within the events. Eventdate_us, events.start_time, events.event_title, events.description, events.venue, events.add1, events.city, events.country, events.website, 'zero' update_msg, 'zero' buy_selling, 'zero' Users.user_id = events on the left as in the form of 'events' as stock_type, events.timestamp as timestamp, source, users.contact_person, users.company, users.pic_small, users.pic_large. Timestamp DESC limit 30 based on user_id command users should add that this is part of some union calls to get everything I need the query below I'm trying to get what (event within the top two weeks) - I eventdate_us = '2014-07-31'...

ios - How do prevent iAds from resizing my view, and how do I turn iAds on/off from an SKScene? -

मेरे व्यू नियंत्रक में, जब मैं सेट करता हूँ self.canDisplayBannerAds = YES; बैनर विज्ञापन स्क्रीन के निचले भाग में iAd दृश्य को फिट करने के लिए मेरे एसकेसीन का आकार बदलता है। इसके कारण चीजें घूमती रहती हैं और अलग-अलग प्रदर्शित होती हैं (मेरी पृष्ठभूमि के कुछ हिस्सों को देखने से बाहर कर दिया जाता है) इसके अलावा, मैं अपने ViewController के 'CanDisplayBannerAds' संपत्ति को एसएसकेसीन से कैसे बदलूं, जिससे कि यह केवल उचित समय पर दिखाया जा सके, मैं अपने दृश्य के शीर्ष पर विज्ञापन कैसे दिखा सकता हूं? ? मुझे आपके प्रश्न के पहले भाग के बारे में निश्चित नहीं है, मुझे लगता है कि अगर आप चारों ओर बेला क्या इस आदमी का समाधान आप इसे प्राप्त करने में सक्षम होंगे। दूसरे भाग के लिए मुझे लगता है कि एसकेसीएन में canDisplayBannerAds bool को बदलने के लिए आपका सबसे अच्छा विकल्प NSNotificationCenter का उपयोग करेगा, ये दो संकेत आपका व्यूडिडलोड विधि [[एनएसएनटिफिकेशन केंद्र डिफ़ॉल्ट केंद्र] AddObserver: स्वयं चयनकर्ता: @ सिलेक्टर (शोबैनर) नाम: @ "शो बैनर" वस्तु: शून्य]; [[N...

How do I set background color in libgdx? -

I am trying to make the background a sky blue with RGB of 135,2206,235. When I run it, the background is not expected. Public Zero Render () {Gdx.gl.glClearColor (.135f, .206f, .235f, 1); Gdx.gl.glClear (GL20.GL_COLOR_BUFFER_BIT); Batch.begin (); Batch.rara (img, 0, 0); Batch.end (); } glClearColor uses range from 0 to 1 Therefore, you need to continually split by 255 F and map from the 0 - 255 range: Gdx.gl.glClearColor (135 / 255f, 206/255f, 235/255f , 1); Be careful when dividing 2 integers, if you do not convert any float (or double), the integer division will be used and the result is 0 (255/255 = = 1)

postgresql - Knex migration not working, whats wrong? -

I can not migrate the database with knex up command, it fails. knex.migrate.latest ({}) end (function () {knex.destroy ()}) I get an error. Probably special type error: Undefined schemabullder dgg aim. Then there is no function on (CWD / node_module / knox / lib / interface.js: 25:10) schemabuilder dgg. Goal (anonymous function) [as bind] (cwd / node_modules / knex / lib / interface.js: 71: 21) on Migrator_PG & Lt; Anonymous & gt; (Cwd / node_modules / knex / lib / migrate / index.js: 93: 6) on Migrator_PG. & Lt; Anonymous & gt; On Migrator_PG & amp; Lt; Anonymous & gt; (Cwd / node_modules / knex / lib / migrate / index.js: 138: 15) on Migrator_PG.migrator._migrationData (cwd / node_modules / knex / lib / migrate / index.js: 154: 10). ; (Cwd / node_modules / knex / lib / migrate / index.js: 22:15) From the previous event: On the function. Promois $ All [at all] on (cwd / node_modules / knex / node_modules / bluebird / js / main / promise Migrator_PG...