Posts

silverlight - What is the best way to copy / clone brushes? -

Before drawing a shape on a canvas, I have a preview that shows how the shape looks. I can adjust the opacity and then draw the shape. Then I would like to draw another shape with a different ambiguity. My problem is that by changing the opacity of the preview it also changes the opacity of the shape which I have already prepared. It has made me believe that I need to copy the used brushes to preview every time before attracting the size. There are many different brushes and, for example, shield brushes not only need to store shield prevention, but there is a new shield for each shield - the copied collection. Am I doing the right track down or should I do something else? Should I be copying or cloning? What is the best way to go an extension method? please pay attention. What you need is cloning, unfortunately, with Xmllriter / Reader, WpF will be easier in you to make it Silverlight In an extension method on the brush that makes a deep copy, it will work fine in your c...

wolfram mathematica - Changing values in nested lists according to elements in the list -

I have a list of values ​​in mathematics, for example List = {{3,1} , {5,4}} . If the second element does not reach a threshold, then how do I change the first element (3 & 5)? For example, if the second part is below 2 then I would like the first parts to go to zero. So list == {{0,} {5,4}} . Unfortunately, some of these lists are doing manually for a very long time, unfortunately there is not an option. Conceptually, in the normal way, in your case, code will be [13]: = lst = {{3, 1}, {5, 4}} outside [13] = {{3, 1}, {5, 4}} in [14]: = thr = 2 out [14] = 2 in [15]: = map [[if [# [[2]] The # symbol here stands for argument. You can read more on pure functions, double square brackets stand for extraction. You can make it a little more condensed by using level 1, which is shortened by @@@ : in [27]: = {if # [2] & lt; Thr, 0, #], # 2} & amp; @@@ lst Out [27] = {{0, 1}, {5, 4}} However, note that the first method is several times faster for large nu...

iphone - UIViewController class memory issue - presentModalViewController -

I have some memory problem with my iPhone application and I have no clue what is happening. , I noticed that the memory usage of the application is increasing continuously when one is going from one UIViewController to the other, I have used the "Mark Heap" tool from the "Allocation" tool and it has boundaries that only the object Those that are not distributed, I have UIViewControllers. To be more specific I have given my two UIViewControllers the first one named the puzzle VIPU controller and the second name is the option. When the app starts, the PuzzleViewController appears. I mark a heap here to set a baseline, and after that I press the "Options" button which will present the option UIViewController. I go back to the first one and I once again marked these stages of these steps After repeated repetition (like 20 times or so: D) I see that after every hipshot I have around 22 objects alive. Two of those objects are examples of my UIViewControll...

nhibernate - Problems with HasMany, Lazy loading and session scopes -

मेरे पास एक कंसोल अनुप्रयोग है जो NHibernate और ActiveRecord का उपयोग करता है। मैं निम्नलिखित अलग मानदंडों का उपयोग कर रहा हूं: अलग-अलग मानदंड = पृथक वर्गीकरण। सेवा के लिए & lt; & gt; (); मापदंड। जोड़ें (प्रतिबंध.लिंट ("समाप्ति", दिनांक समय। आज। जोड़ेंदिन (3))); मापदंड। जोड़ें (नया संयोजन ()। (प्रतिबंधों। इज़नल ("स्टॉप रेजयन")) जोड़ें। (प्रतिबंधों को रोकें। एसी ("स्टॉप रेजॉन", सर्विससटॉपआरिजन। वेलनेस))); मापदंड .जोड़ें (नया संयोजन ()। (प्रतिबंधों को रोकें। IseNull ("StopDate"))। जोड़ें (प्रतिबंधों। EqProperty ("StopDate", "End"))); और मैं ActiveRecordMediator के FindAll () विधि का उपयोग करके फ़ेचिंग का आह्वान कर रहा हूं। मेरे मॉडल में मेरे पास यह संपत्ति है: [HasMany (Lazy = सच)] सार्वजनिक आभासी ISet & lt; ServiceOrder & gt; सर्विस ऑर्डर ({वापसी सेवा प्राप्तकर्ताओं}; } सेट {serviceOrders = value; }} मैं निम्न लिंक् क्वेरी में उपयोग करने का प्रयास कर रहा हूं: सेवा ऑर्डर से सेवा ऑरडरटाटा सेव...

mapping - Hibernate query to return results of many-to-many DB relationship without the relationship being mapped -

Extract top 10 news from google news -

I try to locate the top N (10) as a query in the form of a Google news () I am not able to do this, but Google does not allow the server to query the server through scripts. I looked at the Google News API, but what I think is what it allows us to display "Google News results" on our website according to some websites. I want to say hyperlinks to news or point out the news. You can pull a feed using this URL on the basis of a query yoursearchterm & amp; Cf = All and Output = RSS This will allow you to get an RSS feed after which your application can be parsed and can be used. Although it is possible, I will examine the small print on Google's website because I think there are restrictions on what you can do with this data. I hope this will be helpful. You have to give credit to Google and credit sources and news sources.

c# - Array change event -

मेरे पास एक सरणी गुण है जिसे Value : सार्वजनिक स्ट्रिंग [,] मूल्य {प्राप्त; सेट; } मैं सेव () पद्धति को कॉल करना चाहता हूं जब सरणी के किसी भी मान (पूरे सरणी नहीं) बदल गया है। क्या इसे लागू करने का एक आसान तरीका है? वास्तव में नहीं Arrays बहुत आदिम प्रकार हैं और जब चीजें बदलती हैं तो आपको सूचित नहीं करते हैं। सबसे अच्छा आप कर सकते हैं एक कस्टम प्रकार बनाते हैं जो कि 2 डी सरणी की तरह काम करता है, लेकिन इसके अलावा यह एक इवेंट तब उठाता है जब कोई तत्व बदल गया हो । आपका वर्तमान वर्ग तब इस घटना की सदस्यता लेंगे और सहेजें () पर कॉल करें। कुछ अतिरिक्त टिप्पणियां: संभवत: आपको बेनकाब नहीं करना है सेटर, यह लोगों को बदलने की इजाजत देता है जो आप इंगित कर रहे हैं। आप संभवत: केवल प्राप्तकर्ता को बेनकाज़ करना चाहते हैं, ताकि वे मूल्य बदल सकें, लेकिन पूरे सरणी नहीं। मैंने जो भी उल्लेख किया है, उसके लिए एक प्रकार का हो सकता है, मुझे एक के बारे में पता नहीं है। यदि आप एपीआई को वैसे भी बदलने जा रहे हैं, तो यह आपके वर्ग पर एक सूचक को उजागर करने के लिए और अधिक समझ सकता है, फि...