Posts

Showing posts from June, 2015

Python Help please - creating basic functions (Ver 2.7) -

I've made progress on this question, but it always only gives the first value in the list. What am I missing in my code? Write a function called add_numbers that receives a list parameter, it returns the total number of all the numbers in the list from the beginning, until at least 10 is not found. If no number is found to be greater than or equal to 10, then it gives the sum of all the numbers in the list. def add_numbers (a): total = 0 i = 0 while a [i] & lt; 10: total = total + a [i] i = i + 1 total return is the second one: Write a function called make-list which receives Does a numeric parameter give it a number of data less than 0 to the numeric parameter. I know how to do this if all numbers are asked for numbers, but the list is confused. The last one is: Write a function called count_bricks which receives a numerical parameter. This function gives the number of bricks in the pyramid which is high in many levels. Each level of the pyramid has an...

c# - Read .html#XXX and display it on a webbrowser -

I am writing readied HTML in the local, but these ".html" files are internally split, whose "File" HTML # xxxxx ". I am displaying these files on webbrowser, but not accepting the given path due to" # ". I am reading an appellate book, its chapters are internally" # "Parsed by I get for every chapter, y It is a division of itself and this division is marked by #. This is an example of division & Lt; / NavPoint & gt; & Lt; NavPoint id = "np-3" playOrder = "3" & gt; & Lt; NavLabel & gt; & Lt; Text & gt; Content & lt; / Text & gt; & Lt; / NavLabel & gt; & Lt; Content src = "@Public @ vhost @g @ Gutenberg @ html @ files @ 42,248 @ 42,248 hours @ 42,248-h-0.htm.html # pgepubid00002" /> & Lt; / NavPoint & gt; & Lt; / NavMap & gt; to display: navpoint = toc.nav map [0]; String srcContent = navP.Src; WebBrowser1.Source = Path + srcCo...

php - How to prevent adding twice on booking system -

I have time for a booking system, where a user can book at a time which says one hour within a specific date is. My question is that when I open the site in two tabs in the past I can not handle the case and I try to book one time from one tab and then it is displayed on the calendar that the booking is done, but The second tab is not refreshing from the page and it still shows the time to be reserved and I can book it, so it shows me two, I mean I can open tabs as much as I can and can do it, how can I enable it to be booked only once at a certain date ??? You can write some scripts which will return the request, In the booking page, a simple Ajax query is made to find that the selected period is still available and it is being run by setTimeout () . If the request will show that the period has already been booked, you can inform the user by showing him the appropriate message and deactivate the form of the deed unless the valid term is chosen. This will also help you when s...

database - DataGridView and Record ID C# -

I think (mine) how SqlDataAdapter works but I need some explanation I have a DGV which I Use a column to display from a MySQL table; However, when I need to edit the records, I mostly require other fields and I do it in another Vanofha. So I think I need some best practices advice: Question 1: When binding to the data source: I need to have all the fields I want to edit as string query = "select * cusdata"; CusAdapter = New MySqlDataAdapter (query, ppdb.sqlConn); CusAdapter.Fill (mainSet, "cusdata"); Dgv_cusData.DataSource = mainSet.Tables ["cusdata"] Question 2: I have a lot of information on the web just about choosing the fields you want to display in DGV but if See, I edit the data that the adapter knows which record is being updated on the back-end? I think I am a bit confused about different approaches and I need some guidance. I need a datagrid view where I can display a single column (the name of the customer). I want to be able to ed...

python - Removing all alphabets and commas from a string -

I have a large list that contains many elements that look like this: 'A.21,48; B6 4, 91; C 9, 5, 125; D.139,166; E. 175,200 ' I want to strip all the letters and ; . Include the letters and the list that lists the ['21', '48', '64', '91', '95', '125', '139', '166', '175 ',' 200 '] I tried to use it: import re list.append (re.sub ("\ D" / Code> But it results in a list like this - ['21 48 64] 95 125 139 166 175 200'] Since a lot The big file is working inside the loop, so a line of code will really be helpful. Thanks Text "> You can re.findall () : & gt; & gt; import re & gt; & gt; Gt; Strs ('21', '48', '64', ' , Re.sub using '91', '95', '125', '139', '166', '175', '200]] () : gt;> ('21', '48', '64', '91...

Disable automatic printing in Python interactive session -

I am going to organize a Python workshop to teach some early level programmers in my college Python. I am looking for a way to modify the default behavior of Python interactive sessions so that the expression results do not print automatically. For example, take the following interactive session: wil @ calcifer: ~ $ python python 2.7.3 (default, 1 August 2012, 05:16:07) at [gcc 4.6.3] Linux2 For more information, type "help", "copyright", "credit" or "license" & gt; & Gt; & Gt; X = 5> and gt; & Gt; Y = 7> and gt; & Gt; X + y12> gt; & Gt; & Gt; First_name = "test" & gt; & Gt; & Gt; Last_name = "person" & gt; & Gt; & Gt; First_name + last_name 'TestPerson' & gt; & Gt; & Gt; This will apply the use of the print statement to avoid confusion later on. This is not important, but I was surprised that I could not find any setting anywhere fo...

css - Background image not staying fixed in IE8 (anythingSlider) -

The link referenced in the text below: If you preview the CSS for the div with the class "AnythingNavWindow", you can see a background image that is being used to put the shadow effect, while viewing the thumbnail view of the thumbnail slider, next to the thumbnail view of the thumbnail slider OK, unfortunately, when viewing in IE8, to see additional thumbnails in the slider The use of sliders stays shadow moves with the thumbnail. Every other browser handles the background image properly, which should not be stable with the thumbnail slider. The actual transition of the thumbnails is being done on a parent container, not with the class "container" class, not the parent container, so I'm not sure why this is happening. I do not believe this is an issue with the slider, but there is an issue with CSS. Here's a JSfield ready to tamper it with: div.anythingNavWindow {width: 616px! Important; Background: URL ('http://www.massgeneral.org/asse...

c# - Search through a list or an array for existing string -

I need an array or list that will include the name that will add the user. I also need to do an investigation which will not allow the name to be added, if that name is already present, I know it should be very simple, but I can not find a solution. I think if it can: List.Contains (name)) Or: if (array (name)) this It is as easy as that! List and T [] both IList & lt; T & gt; Apply the interface with your method. Assuming that you are happy with an accurate match, of course. If you need some more complex, then I might use it from LINQ to Any for example: if (array.Any (x => x .tartsWith (name))

onclick - jquery not triggering on click -

I'm starting to insert some amateur jQuery into my JGro project, and I'm having some trouble. The HTML head section of the file looks like this: link rel = "stylesheet" href = "{{STATIC_URL}} / stylesheet / foundation.missings" & gt; & Lt; Script src = "{{STATIC_URL}} JavaScript / modernizr.foundation.js" & gt; & Lt; / Script & gt; & Lt; Script src = "{{STATIC_URL}} javascript / jquery.js" & gt; & Lt; / Script & gt; & Lt; Script src = "{{STATIC_URL}} javascripts / foundation.min.js" & gt; & Lt; / Script & gt; & Lt; Script src = "{{STATIC_URL}} JavaScript / app.js" & gt; & Lt; / Script & gt; & Lt; Script src = "{{STATIC_URL}} javascript / jquery.foundation.tabs.js" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" & gt; $ (Window) .load (function () {$ ('# slider'). Class ();});...

ruby on rails - Deploy "WAR" with Tomcat issue -

मैं उपयोग कर रहा हूं: उबंटु 12.04 जेआरयूबी 1.7 2 पटरियों 3.2.12 टोमक 7.0.26 मैंने सफलतापूर्वक रेल सर्वर कमांड और 127.0.0.1:3000 पर मेरे डेमो एप्लिकेशन के साथ काम करता है। मैंने warble मणि और प्रयोग warble मेरे अनुप्रयोग निर्देशिका में .war फाइल जो मैंने तैनात किया है। दुर्भाग्य से, जब मैं 127.0.0.1:8080/depot / का उपयोग करके अपने आवेदन तक पहुंचने की कोशिश करता हूं, तो मुझे निम्न त्रुटि मिलती है: org.jruby.exceptions.RaiseException: ( NameError) जावा कक्षा com.ibm.db2.jcc.DB2 चालक को org.jruby.javasupport.JavaClass.for_name (org / jruby / javasupport / JavaClass.java: 1227) पर लोड नहीं कर सकता ............ ....... टॉमकेट का उपयोग इस तरह से, क्या मेरा अनुप्रयोग दूरस्थ पीसी से दिखाई देगा? क्या आपने स्थापित किया है टॉमकेट में db2 डेटाबेस ड्राइवर साझा संसाधन फ़ोल्डर? या वे। के भाग के रूप में तैनात हैं? सरल जवाब नहीं है 127.0.0.1 स्थानीयहोस्ट के लिए हमेशा मार्ग; आपको बाहर की दुनिया को बेनकाब करने के लिए TomCat कॉन्फ़िगरेशन में एक...

ruby - How are these methods like create_table available in the Rails Migration class? -

How the methods and classes are defined in Ruby, and how to read an API document, this is a question. In short: how the create_table method is defined / imported / inherited, so it is available in the code in ActiveRecord :: migration : Create Class Products & lt; ActiveRecord :: Migration Def up_table: products do | T | T.string: name ... Coming from the world of Java, I was hoping to provide links to base classes or mixes where everything was defined. But if I look at the migration page, I see some handwritten documents, but there is no link from the most detailed, official definition of create_table . I used Google to find it in ActiveRecord :: ConnectionAdapters :: SchemaStatements , but even seeing the source code of two files: I do not think how to create_table to migrate . Itemprop = "text"> These methods are dynamically created in this class: They are dynamically adding to the CommandRecorder class The lines are then: Class mig...

Twisted and python list concurrent access -

I have twists in the python with current access to the list. I have a twisted class that adds data to a list , And a method called every 4 seconds, this method is the element of the list and performs some operations. I am afraid that both of the same list can cause stability problems both from the dew periodic and both of the data obtained. Here's the code: ossStorage = [] def ossPeriodic (): I in Ostorage: ossStorage.remove (i) db.insertDataToDb (i) reactor. Thalator (4, Osperodic) Class OSS (Protocol): Received DIF Data (Self, Data): Account = Pickle. Loads (data) ossStorage.append (account) DEIF Main (): ossFactory = Factory () ossFactory.protocol = OSS ReactorListen TCP (50000, OSSFFT) Reactor Collator (4, Osperodic) Reactor.Ran () Should I use lock or something similar? Thanks! Are you using thread? If not, you do not have concurrent access to the list. Generally using an application thread does not use twisted. Asynchronous nature of Twist executes every even...

how to ensure data integrity using the function storeFile() of the php driver of mongodb? -

I ask my questions here because I have not yet found any further information. Reference: - replicaSet architecture with 3 servers. - PHP as the main language - The average size of the photo is around 2Mo - Usage: function of PHP driver in Mangode () using lots of gallery store files I'm worried about storage during and after primary server. If I store a full file of 80 MO using the store file, then the customer directs the query to the replication set, which begins with storing the data. If now, the writing operation has ended 60%, and if the primary fails, then what would be the writing task? I know I'll get an exception, who tries to try me again for the operation. But what about the data already written? Do I have an existing file in the database, which is part of the original picture and thus corrupted? Or, it works like a transaction, and so if there is an error, then the Mongodb withdraws the operation and throws an exception? Link to my group on Goog...

c# - Return column based on record in FK table -

Image
There is a successful query to show to my vendors, but what I wanted to add now shows a column that Which vendor is selected or not (displayed as a checkbox column) These selections are stored in vendors, in which the selected FK profiles are included in the ID and username they have selected. So when the current user sees vendors then there will be matches for some vendors and not for others. How do I modify the query? Note, where the above stream is to be completed only to the vendors selected by the current user, but for all the vendors I want, when displayed with the right / wrong (checkbox) column for each vendor they choose pay attention. Public IEnumerable & lt; BrowseVendorModel & gt; BrowseVendors () {IQueryable & lt; BrowseVendorModel & gt; ViewModel = _db.VendorProfiles. Include ("seller selected"). Select (S = & gt; New Browser Window Modal {ProfileID = s.ProfileID, Name = s.Name, CompanyName = s.CompanyName, City = s.City, State = s S...

c++ - Deque Implementation -

I have a question about the code found on the Internet that uses the deck to get the maximum of the element - #include & lt; Iostream & gt; #include & lt; Deque & gt; using namespace std; Zero Test (Ent Ar [], Int N) {std :: deque & lt; Int & gt; Qi (N); Int i; For (i = 0; i & lt; n; ++ i) {while ((qi.mpt)) and arr [i]> gt; = arr [qi back]) kupp_back (); // Remove from Qi.push_back (i); } Cout & lt; & Lt; Arrivals [Qi.front ()]; } // To test the driver program for work, int main () {int arr [] = {12, 1, 78, 90, 57, 89, 56}; Int n = sizeof (arr) / sizeof (ARE [0]); Test (ARM, N); Return 0; } My question is how is Qi.front () giving the correct index when I have not done any Qi.push_front ()? But the following code will give me a 0 zero test (ent ar), int n {std :: deque & lt; Int & gt; Qi (N); Int i; {Qi.push_back (i) for (i = 0; i & lt; n; ++ i); } Cout & lt; & Lt; Arrivals [Qi.front ()]; Sorry, if I'm fe...

ios - How to create and display labels to show the X/Y values when you click on a Shinobi chart? -

If a point is clicked in a Shinobi chart for ISO, then I create and show labels with X and Y values I'm trying to I have found the first part of the answer here : (zero) sChart: (Shinobich *) Chart Toolbox selectionfosource: Point to the SChartSeries * series: (SChartDataPoint *) Datapoint on pixel corrupt: (CP point) pixelpoint {nslog (@ "x value:% @", datapoint.exlue); NSLog (@ "y Value:% @", Datapoint YValue); // Here you can create a label to show x / y values ​​or even add an annotation) I can create text strings with it: [NSString stringWithFormat: @ "Zodiac:% @ to% @", Datapoint YVALUE, datapoint.xValue]; But how to design this NSString by creating labels and using Shinbee charts? Why not use the previously provided ScrartCrossHair class instead of where users put the tap Do you worry about it? You have to enable crosshairs for each of your series - in this way you can only meet with a crosshairs on the subset of your series ...

ios - Can I get the Unity3D engine version in Xcode and how to do a conditional compile based on the version? -

I am working on plugins in Unity 3D for iOS. For some reason, I need to specify some code in local code (.xm) to be compiled before Unity 3D 4.1 and the second should be compiled after Unity 3D 4.1 (Containing). Maybe something like this: #if UNITY_VERSION & lt; UNITY_4_1 // Some of the codes can be compiled before Unity4.1 # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # "Compile the Unity Engine version based on Xcode" version? Any suggestions would be appreciated! EDIT: Maybe I two for different version. I can write MM files and delete one of them. But I do not think this is a good idea ... It is not absolutely clear what you do Are you trying to build your original code by injecting into the XCode project which creates unity? Or are you building your original code in a library which is included by Unity during the building? There is no way to know about AFAIK XCode, from which time you are ...

php - preg_match(): Unknown modifier '@' -

इस सवाल का पहले से ही एक उत्तर है: 4 जवाब मैं अपने फ़ंक्शन का इस्तेमाल करता था ereg के साथ (चेक करें कि वहां एक @ प्रतीक है), ईरेग ("^ [^ @] {1,64} @ [^ @] {1,255} $ ", $ ईमेल) लेकिन अब इसे नापसंद किया गया है मुझे क्यों preg_match ("^ [^ @] {1,64} @ [^ @] {1,255} के लिए तय किया गया है) मुझे एक त्रुटि preg_match () प्राप्त हो रही है: अज्ञात संशोधक '@' } $ ", $ ईमेल) ? आपको अपनी अभिव्यक्ति के आसपास जोड़ना होगा। / P> preg_match ("/ ^ [^ @] {1,64} @ [^ @] {1,255} $ /", $ ईमेल) I दृढ़ता से सुझाव है कि आप के बारे में पढ़ने शुरू करें।

scheme - Append to List Variable with Racket -

I want to add an integer to a list that already exists using the racket. Here's the code I have. (define countBlackPegs gameList playerList) (define blackPegs' ()) (if (equals? (Car player list) (car gamelist)) (set theory in me if statement Should be able to re-examine the separate part); (timeless) (0)) list each time) and then list the black pags that statement Combine it with the appropriate value on the basis. Unfortunately I have not worked with every endfound function correctly. Any help would be appreciated. If you set set! ) A list that already exists, to add a new element to the beginning, do something with these lines: (set! Black pags (cons 1 blackPegs)) Or to add a new element at the end: (Set! Black pags (Add black pags (list 1))) However, warns that this style of programming is not recommended in the plan, you want to try to avoid changing changes A - is like a functional programming style.

android - How can I setText() (TextView) when the TextView is in another layout? -

मेरे ऐप में 2 लेआउट (मुख्य लेआउट) और (वरीयता (प्रीफ़ेस) लेआउट)। जब मुख्य गतिविधि भार, मैं सेट सेट करेंटेंटव्यूव (आर। लेटाउटमैन); - मुख्य लेआउट मुझे वरीयता लेआउट में एक TextView के लिए पाठ सेट करने की आवश्यकता है, लेकिन यह कभी भी सेट नहीं हो जाता। लेआउटइनफ्लेटर कारखाना = getLayoutInflater (); फुलाएँ = फैक्टरइनफ्लैट (आर। लयआउट। प्रीफ्स, रिक्त) देखें; TextView eSerial = (TextView) inflate.findViewById (आरआईड.एडिटटैक्सेसरियल); MSerial = "टेस्ट"; eSerial.setText (mSerial); जिस तरह से मैं वरीयता पृष्ठ पर जाता हूं वह एक मेनू के साथ होता है और फिर पाठ लोड करने में कोई बदलाव नहीं होता मैंने खोज की है और अभी तक कोई जवाब नहीं मिला । कृपया मदद करें। धन्यवाद। जब मेनू आपकी प्रीफिक्स गतिविधि बंद कर देता है, तो आप मूल्यों के साथ दृश्य को पॉप्युलेट कर सकते हैं। User1853479 ऐसा करने का एक तरीका बताता है, जो किसी इरादे के मूल्यों को जोड़ना है। यह मानते हुए कि आप भविष्य के रनों के लिए इन प्रीफ्स को स्टोर करना चाहते हैं, तो आप उस विशिष्ट रन के लिए कोई भी सेट भी कर सकते है...

jquery - Dynamically created checkboxes elements are not call function assigned -

I have a set of checkboxes in the field cover (div). When you check one of them, the linked area cover will be shown, and then link the wrapper in the link area. I want to remove a checkbox in the linked area cover, when I uncheck them, even then the checkbox must be unchecked in the area cover. I have (on) ; tried the method but it does not even call it on the method it is not working. I have a demo thanks. :) Use document.on . $ (document) .on ("change", '# linked_areas_wrapper input [type = "checkbox"]', function () {

javascript - What are some ways to sort and load posts into a dynamic php template -

I currently have two projects, on which I am working, is a small flash game site which Practices and understands some concepts and a blog / game Dev Ads Hybrid. My question to you is that what would be the most effective way of loading the posts, so that I can prepare a page with the specified entries on them and sort them based on those categories which will later define me. It may just be my ignorance, but it seems unable to store each file in a file because there will be enough to store there. An example of an original game "post" from the small flash game site, in fact it's a divisor for everyone, and I can add something like a tag system to sort it later. & lt; Div class = "sports" & gt; & Lt; A href = "games / game.php? Game = somegame" & gt; & Lt; Img src = "images / somegame.png" & gt; & Lt; / A & gt; & Lt; Div id = "content" & gt; & Lt; A href = "games / game.php? Game...

ruby - rails rename table with id_seq -

मैं तालिका का नाम बदलें rename_table: posts,: messages लेकिन रेल ने पोस्ट_id_seq और posts.id संशोधक उत्पन्न किए हैं: db = # \ d + posts तालिका "public.posts" कॉलम | प्रकार | संशोधक | भंडारण | विवरण आईडी | पूर्णांक | नल डिफ़ॉल्ट अग्रिम ('posts_id_seq' :: रेगक्लास) | सादे | सूचकांक: "posts_pkey" प्राथमिक कुंजी, बीटीआरआई (आईडी) नाम बदलें तालिका कैसे ठीक करें? रूबी 1.8.7 रेल 2.3

cocoa touch - iOS framework for manipulating sound file -

I want to convert a recorded sound file to another data format or graph that is equally different with another file The comparable / manipulateable data format may be that there is some sort of fourier conversion. Does iOS offer some frame work for the same? I know the original audio structure, the audio tolbox framework, I do not think these two structures will help in my need. So nobody knows how to do this. Your starting point may be. He said, it will not be wrong to have this, which includes FFT stuff.

spss - Missing data & single imputation -

I have a complete ozone data set that includes some missing values. I have to blame my data to make a single indecision I would like to use SPSS Before I leave my data, I want to simulate the random data pattern with 5%, 10%, 15%, 25, to evaluate the accuracy of the methods used to disappear % And 40%. How can someone randomly create missing data patterns using SPSS? In addition to that someone can tell me how to get performance indicators such as: Full error, coefficient of determination and root mean square error, so that the best method for estimating the missing values Can be investigated. Unfortunately, my current SPSS does not have any incorrect data analysis, so I only give some general advice. Can i ago: Data patterns for your missing: just go to data - & gt; Select cases - & gt; Removal of random sampling and the desired cases and then run the Impitation. The values ​​you specify should be provided by the SPSS, if you use their intent module, there is a m...

Verticle Carousel jQuery -

I am trying to create a carousel, my first try is to try it first. Holds HL, 2 images of each light both the width of 242 px and the height = 81 px deposits Only 3 of the many lanes should be visible (i.e. 6 images Vizyla, as one has 2 images, Float: Each is left.) UL: The block is set to display, whose width is 242px. HTML is fully displayed but the carousel does not work, as I know that I need to calculate above the cleverness, which is a lack of imitation. & lt; Div id = "home_carousel" & gt; & Lt; Ul & gt; & Lt; Li & gt; & Lt; A href = "# img1" class = "inline cboxElement" & gt; & Lt; Img src = "picture / home-truck 1.jpg" & gt; & Lt; / A & gt; & Lt; A href = "#" & gt; & Lt; IMG src = "picture / home-truck 1.jpg" & gt; & Lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; & Lt; IMG s...

php - Making a function undefined when called by url -

Using Codeigniter, I call [my controller] a public function from the URL which is basically the general behavior of the framework. I am passing 3 criteria as $ a, $ b, $ c and when the function is executed, it checks the parameters and goes according to it Now, the problem is that I do not Wish that my function should be called by URL, when it is said it should go to 404 page. I know that it can be obtained by adding private or protected , but the real problem is that it is only through one of its own functions Should go and not directly by the URL . Any solutions are welcome. The HTTP path block works but when I pass the parameter, the function is executed which is a security problem. How to block access to any idea? You can use routing to block any of the http traffic that controller / method And redirect to the 404 page. In your routes.php file in the Config folder, add the following $ route ['controller / private_method'] = '{your 404 Controller} ...

Add joomla SEF Translate Module or component to php,html web site -

I want to add Joomla SEF translation module or component to my php, HTML website page. How can I include this module and how to run it? Please tell someone thanks advance To install a component in Joomla , Go to the admin interface (back-end) and open extension manager (under the extensions menu) should be the default page installation manager in the Extension Manager. If it is installed correctly, you should see the SEF component listed under the component menu. Configure it as necessary (instructions can be found on the component provider's website.) Then open Module Manager (under the Extensions menu) and create a new module (if it is not already) . Select SEF from the list, create a title, fill all public information, and specify the correct value under the tab menu assignment. Save it and close it. Your SEF module should now appear on your website (and to customize the SEF module, see the SEF Translation website.

iphone - How to swipe left or right to push or pop ViewContrller in iOS -

I want to swipe the loud controller in my app to push or pop, I know that I I can add a swipe signal but when I swipe the screen, I want the current view controller to be followed with my strong gesture, and the next view controller just pushed it with the swipe. How can I do this, thanks! is not possible with the UIA controller ; You must create your own navigation controller (must be very simple), which includes a UIPanGestureRecognizer . Edit for iOS 7: You can probably have a UIScreenEdgePanGestureRecognizer .

Cropping an image in matlab -

Image
Is it possible to crop an image with a particular curve? For pre-I want to extract the finger image from this image, but I do not want to crop it with a rectangle You need a binary mask and the mask is shown on the alpha map Here is how to apply it in the form of s = 100; H = imagesc (rand (s));% Some garbage% shows a circular mask dummy = meshgrid (-s / 2: s / 2-1). ^ 2; Distance squared from center mask = sqrt (dummy + dummy ') & lt; 20;% 20 is the radius of your mask% that you go here, set the image horizontally (h, 'alphabeta', mask); Exporting it to PGN will serve as a job. So in your case, you need to make your own mask, that means your bitmap image or parameter space (as I did it with the above cycle).

javascript - Canvas vs. img - performance -

I tried to find some relevant sources of it and found nothing. So, my questions are quite simple. Is Canvas Faster than IMG? I will use the object as image (PNG, GIF) or canvas. The object is used only once, Multiple use of the same object, for example an icon on the administrator, Multiple use, for example the companies logo. I am interested in memory usage, performance in the browser and the speed of loading. Edit # 1: The canvas is designed by JS and it will be similar to the image in the IMAG tag. no, img fast, easy and canvas is used to show an image img tag , so if you have to do this, a img Use tags. Multiple uses should not make any difference because the image will be downloaded only once. If you need some animation or interactivity, then it's time to consider canvas . / div>

osx - How can I capture the screen with Haskell on Mac OS X? -

How can I capture the screen with Haskell on Mac OS X? I've read but I'm working on Mac Mini, so Windows solutions are not implemented and GTK solutions do not work because it only captures a black screen. In Mac, GTK only captures black screen. How can I capture with the screen ?? | And OpenGL? Only with some luck. OpenGL is primarily a drawing API and the contents of the main framebuffer are not undefined until they are made ready by OpenGL. OpenGL could be abused as the graphics system manages the framebuffers of its on-screen window: after the window without predefined background color / brush, its initial framebuff content is just what the window creates on the screen. If a OpenGL event is created at the top of it, then framebuffer has its own off-screen framebuffer with a combination of OpenGL to make screenshots with every window correction and the content of the screen is composite at the end. If you use the method mentioned above, which is an initial mem...

How do I save a program using Python Idle? -

I have Mac version 10.6.8 and I have installed Python 3.3 with idle yet. I am new and this is my first program language which I am learning, no previous experience. I am using the Wikibooks guide for a new programmer, I have done "Hello World", but after that it talks about saving - & gt; File - & gt; save as. I'm stupid but I do not see this feature or area where I can choose the file. I have a screenshot but can not be posted because I do not have representative digits. file name it Save Your file will be saved with .py extension, which is a Python script file.

php - Change image colors with GD -

I want to know about the manipulation of images in PHP and want to write some code to edit photos. I'm reading about the imagefilter () function, but I want to manually edit the callers. I have a little image with imagefilter to seperate an image Imagefilter ($ image, IMG_FILTER_GRAYSCALE); Imagefilter ($ image, IMG_FILTER_COLORIZE, 55, 25, -10); Imagefilter ($ Image, IMG_FILTER_CONTRAST, -10); I want to do this, but without the image file (); it's possible? I understand that it is getting color in the image and then can change it and paint it again; I have this to get the image color: $ rgb = imagecolorat ($ out, 10, 15); $ Colors = imagecolorsforindex ($ out, $ rgb); and prints it: array (4) {["red"] => Int (150) ["green"] = & gt; Int (100) ["blue"] = & gt; Int (15) ["alpha"] = & gt; Int (0) } Can I edit those values ​​and integrate them into the picture? I appreciate any help: books, tuto...

perl - Why isn't require("filename") working? -

I inherited some of the Perl code that runs on the Linux server only. I'm in the process of running it on Windows XP, ActiveState Perl 5.16.2, and a BitTime WAMP stack. (Note: this setup is already running on my Perl.GG program, so it's a working setup.) Anyway, "Main" Perl program - let's call it main.cgi - this Statement is: / P> is required ("extra / stuff_1.cgi"); When main.cgi runs, an error occurs: c: / bitmap / sin2 / cgi-bin / extra / stuff_1 .cgi did not come back true value in C: / bitman / sin2 / cgi-bin / main.cgi line xx Now what's strange: ending with stuff_1.cgi 1 it happens; (I.e., this is the last line of the file)! I have also commented on code in functions within stuff_1.cgi - which works with most documents, eg. sub-func {return & Lt; EOF; ... EOF} Add it to the bus sub joke # # layer & lt; & Lt; EOF; # ... #EOF} etc. And still "do not return the right value" is still ther...

asp.net mvc - Checking object access using ActionFilters -

I am using the BaseController class with a custom mechanism, overriding overting () I use this base for all my controllers The controller class is used as a convenient way to check the id route value when it is passed to the controller. This has worked fine ... I check an ID value, and if it is present then I check to see the name of the controller which determines the type of object that is from ID Is related. But then ... I have started getting errors, when a partial view is called in controller B and the same ID is introduced in the filtercontext, which is used for the parent controller / view it was done. For example, say I have a URL of local host / project / description / 5 where the project is controller and action has been taken with id = 5. The controller "Notes" is called due to partial view and this time my mechanism has begun for controller "Notes" and the original "Project" ID. The user is allowed access to project id = 5, but note Id ...

css3 - container not getting displayed -

I am relatively new to JSP and HTML. I have been asked to create a GUI for one of my projects which was in Pearl, however, I have a problem with the container. Actually, each container displays results obtained from the file in the form of radio buttons, it works fine. But suddenly, one of the containers started to disappear, but suddenly, one of the containers started to disappear. Any help would be greatly appreciated. Thanks in advance :) & lt;% @ page language = "java" contentType = "text / html; charset = UTF-8" page encoding = "UTF - 8 "Import" = java.io. *, java.net. * "% & Gt; & Lt ;! DOCTYPE HTML PUBLIC "- // W3C // DTD HTML 4.01 Transcription // N" "http://www.w3.org/TR/html4/loose.dtd"> & Lt; Html & gt; & Lt; Top & gt; & Lt; Title & gt; Two-gm & lt; / Title & gt; & Lt; Style type = "text / css" & gt; Body {background color: white;} H3 {color: ...

rest - Response string is blank in loopj for Android -

Here is the code that I have used loopj for async Http requests. AsyncHttpClient LoopjClient = New AsyncHttpClient (); Persistent cookiestor lupazkiyicaster = new persistent cookie store (this); LoopjClient.setCookieStore (loopjCookieStore); Request Perm LoopJam = New Request (); LoopjParams.put ("username", user name); LoopjParams.put ("Email", Email ID); LoopjParams.put ("password", password); Log D. (Tag, "RRRRRRL"); LoopjClient.post ("http://www.example.com/", LoopJarrum, new non-HTTPHPPRESpensHandler () {@OverWide Public Voed On Seewes (Int Kashmir, String Response) {Super. Onsuits (K, Response); Log D. (Tag, "RRRRRR" + response);}}); and my server response strings are just following HTML tags {"authentication": {"success": wrong, "USERNAME": " Unregistered "," USERID ": 0}," ALERTBOX ": {" Show ": True," Message ":" Message:...

runtime - qt QTranslator reuse -

I have found that QT documentation is not very important on some aspects of translation. I am trying to understand their behavior with the use of testing. Error. The final goal is to make changes to the translation on runtime, but I am very confused about the extent to which the curtustoliter object can be reused. Consider this (where 'A' is the main example of the application): QTranslator translator; Translator.load ("mytranslation_cz"); An.installTranslation (& amp; Translator); (...) a.removeTranslation (and translator) Now the translator was removed from the application, but what happened to the translator object? In my tests when it was done again after the next code translator.load ("mytranslation_fr"); An.installTranslation (& amp; Translator); This did nothing in the main () and crashes the app when it calls from widgets (using the main app from the pointer). That's why I doubt that I will need to create a translati...

jquery - Disabling text boxes on submit and enabling on reset -

Using the Zebbri, the text box needs to be submitted when the text is submitted and clicking on the text button, the text The value should be clear in the box and enabled. Code: & lt; Table width = "75%" & gt; & Lt; TR & gt; & Lt; TD & gt; & Lt; H: output label value = "actual card number" & gt; & Lt; / H: outputLabel & gt; & Lt; / TD & gt; & Lt; TD & gt; & Lt; H: Output Label value = "hidden" style = "font: 13px / 15px aerial, non-serif! Important;" & Gt; & Lt; / H: outputLabel & gt; & Lt; / TD & gt; & Lt; / TR & gt; & Lt; TR & gt; & Lt; TD & gt; & Lt; H: Input text id = "actual card" style class = "input-lesson-bx" & gt; & Lt; / H: inputText> & Lt; / TD & gt; & Lt; TD & gt; & Lt; H: Input text = "pseudo-card" style class = "input-text-bx" & gt; & Lt; /...

LINQ "equals" operator on nullable foreign key in NHibernate parent/child relationships -

background My model looks like: (writing field instead of simplicity properties) public square unit {public long id; The name of the public string; Public body guardian; } Required FNH Mapping Map (x = & x; x.Name). Not. Elevated () Unikuke ("hair"); Reference (x = & gt; x.Parent) .Cascade.None () UniqueKey ("child"); The table 'unit' (id is not empty, the name is VARCHAR (255) not blank, PRNIID bit count, unique key ID (ID) (Name, parent_id)) And it's okay. I do not want to disagree among the children of the same institution (hence the two institutions of different parents can be the same name) Well, keep in mind that Parent_id Faucet What do I have to do? I want to apply a check, instead of catching an exception before inserting a new unit in DB, I have to set a query (but I think this reduces the performance ...) to check whether the same Parents of a name and a new exception are present, so that the civilian exceptio...

javascript - passportjs authentication using google apps email id -

I'm trying Passport Js with a google app email id to authenticate me using gmail.com email id But if I'm an email id, google.com/a/companyname.com, then how can I prove it? This is my code var express = require ('express'); Var app = express (); Var passport = requirement ('passport'); Var GoogleStrategy = Required ('Passport-Google') Strategy; Passport.use (New GoogleStrategy ({returnURL: 'http://10.3.0.52:3000/auth/google/return', realm: 'http://10.3.0.52:3000/'}, function (identifier, profile, Done} {User.findOrCreate ({openId: identifier}, function (mistake, user) {done (err, user);});})); App.get ('/ auth / google', passport.authenticate ('google')); App.get ('/ auth / google / return', passport.authenticate ('google', {successRedirect: '/', failure redirection: '/ login'})); App.get ('/', function (rik, ridge) {res.writeHead (200); res.end ("connect");}); App...

php javascript json parse escape characters -

I currently have a webpage which requires the use of javascript to parse the variable from php. I work like this: data.notices = JSON.parse ('& lt ;? php echo json_encode ($ notice)? & Gt;') ; However, when there are single or double quotes in the $ notice variable, javascript console return errors. How can I get the variable properly? This code does not return the error gt; asdasd' 'adi ad') ;? & Gt; & Lt; Script & gt; Data = new object (); Data.notices = JSON.parse ('& lt ;? php echo addlashes (json_encode ($ notice))? & Gt;;;; & lt; / script & gt;

iphone - Load UIImage form NSData in UIWebView and center it -

Image
So I basically get NSData of UIImage and I UIWebView I do this to display: [self.view addSubview: webView]; WebView.delegate = self; WebView.scalesPageToFit = Yes; WebView.backgroundColor = [UIColor darkGrayColor]; Then I load it in the image like this: NSData * image02Data = attachmentToLoad.attachment_data; [WebView load data: image02 Data MIMEType: @ "image / jpg" text encoding name: zero baseURL: zero]; And I'm getting results that I really do not want: As you can see, the image below leaves a white bottom line beneath the UIWebView . How do I make the size of UIWebView equal to that image? Did you see this post? I think you really want

excel vba - Using the cell value as the cell range for calculation -

I'm new to VBA I'm currently working on a verification tool I already created by my predecessor. The issue on which I want clarification is choosing cell category based on the result of a formula in another cell. For example, I need to find the standard deviation of 800 points in 1000 digits, column B I use STDEV.S () in the formula, with a range of two cells in the bracket. However, the range of two cells is getting different, because the user can select and change the range. The selection of the range by the user is printed in a cell, upper limit in C16 and lower limit of C15 are called. Consider the C16 at 950 and C16 has 150 values, in that case, how do I insert the formula for stdev.s ()? Thanks in advance for the help. Assume that your data is in column B and your range is in C15 and C16 Sub-Pasteformamula () Dim Strawfootout String Stroformu Tupest = "B" & amp; Range ("C15"). Value & amp; ": B" & amp; Range ("C16...

excel vba - How to delete Solver(SOLVER.XLAM) code -

After opening several examples of macro / code written, I suddenly get stuck with a code that seems safe. Solver (SOLVER.XLAM) is doing this notation and I would like to remove it from my system. I do not think this is a relativant code. Can anyone tell me what should I do? I have already installed something to remove the password but Solver is still asking for password and I can not get rid of it! itemprop = "text"> Solver Excel is add-in If you want to delete it, then Excel Application & gt; Options & gt; Add-ins & gt; Search for 'Go to' button and gt; Uncheck the solver on the list like press something (I can not give you the exact path because I have the Polish version of Excel). Trying to open Solver's VBA code is not good because it There is allegedly copyright. Besides, I do not think Solver creates any disadvantages while working with Excel or VBA.

c++ - Lack of warnings on loop counter -

I'm having trouble understanding why the following code does not warn: Unsigned test = 0xffffffff; For (unsigned char I = 0; i This is in Visual Studio 2010, but GCC is apparently either Does anyone know the warning? From a language perspective, there is nothing to warn about it i to unsigned int in & lt; is evaluated. And it's perfectly well defined to grow a unsigned char that it wraps around zero. The fact that this code bothers is unfortunate but it is not clear what rule the compiler will need to implement to find such an object. Thank you for @ing in the comments below: You can meet GCC to warn about the fact that this comparison is using the flag Always evaluate on the right. Update 2: Obviously the above option does not work in this case (I do not have a 'modern version of GCC' ...)

javascript - Stray, An body.. and Cannot recover -

Image
Getting these errors from W3C Line 41, Column 143: Stre End tag body. one ?? .t 1_02.gif ',' images / part1_03.gif ',' images / part1_04.gif ',' images / part1_05.png ') "& gt; one? ??? line 41, column 143: one Body start tag was viewed, but an element of the same type was already open. a ?? t1_02.gif ',' images /Part1_03.gif','images/ Part1_04.gif ',' images / Part1_05.png ') "& gt; a???? Line 41, Column 143: Can not Recover After the Last Error Any other errors will be ignored. one ?? .t1_02.gif ',' images / part1_03.gif ',' images / part1_04.gif ',' images / part1_05.png ') "& gt; How can I fix it, and My code is: I've checked the code for you and tagged This error occurs due to closing. You have not closed the img tag properly. The valid tag is: img tag.

identifier - How to retrieve unique identification from computer? -

What can I remove to remove it from a computer? MAC address, hard disk serial number, then? I do not have any code to show you now, but I did the same way Commanding CPU id and hard drive serial number, in this way you get a unique number; Try this;

php - $.ajax success function returns null -

I have a basic login form set and I am sending two variables (login + password) using the AJAX request A separate page which, accordingly, checks status and gives back. ('Submit', function () {var key = $ (this), url = "textlogin.php", type = that.attr ('method'), data = {}, that.find ('[name ] '(Value (index, value) {var key = $ (this), name = that.attr (' name '), value = that.val (); data [name] = value;}); $ .jax ({url: url, type: type, data: data, breakthrough: work (feedback) {if (response == "") {$ ('# login_err'). Html ("its tap");} and {$ ('# Login_order') .html (feedback);}}}); refund;}); is not working and the success function always returns empty space. The code was working fine until I logged AJAX and jquery dialog . I tried: 1. Setting up content-type 2. Setting dataType 3. Using $ .post and what not. Here is sample code for Ajax. $ Ajax ({Url: "login.php?", Dat...

c# - map one to one with multiple primary key columns entity framework code first -

2 प्राथमिक कुंजी कॉलम के साथ 2 तालिकाओं Ihave। उनकी संरचना है: पब्लिक क्लास एक्स {सार्वजनिक इन्ट आईडी (get; set;} पब्लिक इंट लाइन {get; सेट;}} पब्लिक क्लास वाई [पब्लिक इंट आईडी (get; set;) सार्वजनिक int line {get; set;}} वे एक से एक रिश्ते से संबंधित हैं। कैसे मैं पहले संस्था ढाँचा कोड में 2 तालिकाओं को मैप कर सकता हूं तालिका वाई वैकल्पिक है लेकिन तालिका X की आवश्यकता है। उन्नत में धन्यवाद। सार्वजनिक वर्ग X {[कुंजी, विदेशी कुंजी ("वाई"), कॉलम (ऑर्डर = 0)] सार्वजनिक इन्ट आईडी {प्राप्त करें; सेट; } [कुंजी, विदेशी कुंजी ("वाई"), कॉलम (ऑर्डर = 1)] सार्वजनिक एंट लाइन {प्राप्त; सेट; } सार्वजनिक आभासी वाई वाई {प्राप्त; सेट; }} सार्वजनिक वर्ग वाई [(कुंजी, कॉलम (ऑर्डर = 0)] सार्वजनिक इन्ट आईडी {प्राप्त; सेट; } [कुंजी, कॉलम (ऑर्डर = 1)] सार्वजनिक एंट लाइन {प्राप्त; सेट; } सार्वजनिक आभासी X एक्स {get; सेट; }} कुंजी विशेषता के साथ आप कह रहे हैं कि यह गुण आपकी तालिका की चाबियाँ होगा। विदेशी कुंजी विशेषता को जोड़ना, एएफ को जानकारी देता है कि किस नेवीग...

Path too long error when trying to run Java/Eclipse app on azure emulator -

I have a Java web application, which I try to use Eclairs and Ezur SDK and Eclipse plugins on Azure . Now when I try to run an application in the esior emulator. I get the following dangerous error: [windowsazurepackage] cspack.exe: Error: The specified path, file name or both are too long I must have a fully qualified file name less than 260 characters, And the name of the directory should be less than 248 characters. I am using Glassfish 3 and Java 1.7 JDK. I have tried to fund the folder, so this is as low as possible. But nothing seems to help, it seems that the glassfish or Java SDK is a result of very deep folders. I am surprised that MS has not solved it in 2013! The following question seems the same. But the answers given are not helping, and I do not know how to give the original question in mind. Respond to Martin Savki's comment, log in it. And as you can see that the path I am using is very little. I also tried to make a presentation, and used another dr...

asp.net - modalpopup extender with iframe is not working -

I'm using a modal popup to display a different page in a popup and the parent page is not editable My code is & lt; ASP: Button ID = "BTN model popup" runat = "server" text = "" visible = "false" /> & Lt; Asp: ModalPopupExtender ID = "btnModalPopup_ModalPopupExtender" behavior ID = "btnModalPopup_ModalPopupExtender" runat = "server" PopupControlID = "ModalPopup" BackgroundCssClass = "ModalPopupBG" DynamicServicePath = "" enabled = "" TargetControlID = "btnModalPopup" & gt; & Lt; / ASP: ModalPopupExtender & gt; & Lt; Div id = "modalopopup" runat = "server" & gt; & Lt; Iframe id = "iframePopup" runat = "server" width = "700" scrolling = "yes" height = "500" & gt; & Lt; / Iframe & gt; & Lt; / Div & gt; and the code behind iframeP...

vba - Excel Macro for updating "change date" makes Excel crash -

I have a file in which I have several tables with field "last change:". If any change is made in that table, the field will need to be updated in the current date. I implemented a macro which it was supposed to do, but unfortunately it disables the "reverse" (strows + z) function was very annoying, so I have edited the macro in such a way that Reverse-functionality will work again. My macro now looks like this: Option Clear Public Makers Private Sub Worksheet Tags (Bye-Bypass in the Range) If not, then this workbook. Read only after application.Onando "Rev. Change", "Wiederherstellen" Merker = Room (3, 2) = (3, 2) = Ending if sub-sub-widerstellen () cell (3, 2) = Mercur and all When I apply this macro, excel as soon as I make changes in the document, crashes, is there anything invalid in my code? I'm really thinking because there is no error message or wrong behavior, but only the application is crashing Thank you for the eve...

Multithreading in Java: Wait until two buttons are pressed? -

I am currently writing a small application with swing-interfaces that contain a group of buttons. Now my problem is : After starting the application, one method is said that I want to wait to press two buttons and then proceed normally. I have two threads, one main thread and one that is designed to wait until just two buttons are pressed. For the button I had added an AppLunistener in general, which increases one variable from one and calls a method which makes the variable two, when the variable is two. So here's my code: int counter = 0; Fixed thread thread1; Fixed thread thread 2; Public Static Zero Main (String [] Elggs) {EventQueue.invokeLater (new Runnabal () (non-public) {try {thread1 = new thread ()} {@Override Public Zero Run () {MainFrame Frame = New Mainframe () ; Frame.Seasible (true); start ();}}; thread 1. start ();} hold (exception e) {e.printstaxtrace ();}}}); } Public Mainframe () {// Other stuff and similar listeners JButton button1 = new pocket (); Butto...

amazon web services - Properly setting DeleteOnTermination on an existing EBS volume using boto -

Digging through the code (for example, consider), I have found that I read using this feature I can: example.block_device_mapping ['/ dev / sdz']. Delete_on_termination ... and toggle using it: example.modify_attribute ('Blockdevicemapping', ['/ dev / sdz = 1'] ) #Toggles for example Modify_attribute ('blockdevicemapping', ['/ dev / sdz']) # Toggle Off But it is one-symmetric and I think I'm missing some high level functionality . It should not be more like: block_device_type = instance.block_device_mapping ['/ dev / sdz'] block_device_type.delete_on_termination = True block_device_type.save () # I This API ? You set this setting on and off formatted string '% s =% d' list. Switch to & gt; & Gt; & Gt; & Gt; & Gt; & Gt; Inst.modify_attribute ('blockDeviceMapping', ['/ dev / sda1 = 0']) I verified after every attempt to change the setting using the...