Posts

change webView Font size with Setting Bundle ! [iPhone SDK] -

I want to replace my UIWebView with setting the bundle. What is the property for webview font? I know my code is wrong! if ([default boolForKey: @ "big_font"]) {myWeb.font = [UIFont fontWithName: myGhazal Size: 32.0f]; } Else {myWeb.font = [UIFont fontWithName: myGhazal Size: 18.0F]; } Refer to a CSS style sheet in your HTML document or style information Regards.

Python: Find identical items in multiple lists -

I have a list of arbitrary list, for example: [[1] , 2,3], [3,4,5], [5,6,7], [7, 8, 9]] Now I have a list that includes everyone Elements that are present in more than one list: [3,5,7] How do I do this? Thank you! Just like you would do it by hand: For the seen = set () repeated = set (): I (L) in the set: if I saw: repeated. Add (i) other: seen.add (i) By the way, there is a liner (without the count of imports) that some people were demanding (should be less efficient than other approaches) reduce itertools by import (* Set. Inion, (strmp (set.intsection), combination (map (set, L), 2)))

Does flash always post a "Filename" parameter when doing a file upload? -

I have tried two flash upload components, swfupload and uploadify, and generate posts with both "filename" parameters My problem is that the service I am posting is a strictly set of permitted parameters, and the file name is not one of them. So, is it possible to remove this parameter from this post? Reveals that you can change uploadDataFieldName by default "fileedata" , upload () method. Do not say anything about the file name parameter in the docs, so I think this number is not.

c# - Is implementing a singleton using an auto-property a good idea? -

I have recently found out about auto-property and they like a lot. At this time I am trying to use all the places where I can. Actually, not just able to use them everywhere, but to see how well they work in most situations. Now I'm making a singleton and thought: "Hey, try here's auto-properties." Public Class Mistlington {Receive public status maslingington mieslington; Private set; } Private Missington () {} Static MyStington () {MyScillton = New MyStyling (); }} So my question is: "Is it good to implement a singleton?" I'm not asking if a singleton is normal good idea. I will not do this personally. I do not like to use automatically implemented properties with a private setter, which you do not ever call, where you want a readworthy property supported by only a readable variable to read. To be more clear about what you mean, there is only one more line of code: Public sealed class MySstonington {Personal Static Readable Maisin...

excel - Axapta V3 - how to access worksheet.pagesetup properties from x++ -

Does anyone know how to use PageSetup appellants of an Excel worksheet via COM from the X + code I can do all the formatting necessary for a custom report but can not use the PageSetup object. Any suggestions / suggestions would be appreciated. # define.xlDialogPageSetup (7) static zero job212 ( Args _args) {COM doc =; // Here is the Excel document COM object com app; Com worksheet; COM page setup; Com temp; Int FituposeWide = 5; Int Fitptigetol = 0; COMVariant cvZoom = COMVariant :: createFromBoolean (wrong); COMVariant cvWide = FitViewWide? COMVariant :: createFromInt (FitupsWide): COMVariant :: createFromBoolean (wrong); Comviriet CVTil = FitTapGetol? COMVariant :: createFromInt (Fitopsplates): COMVariant :: createFromBoolean (wrong); ; App = doc.Application (); Worksheet = app. ActiveSite (); PageSetup = Worksheet.Page set up (); PageSetup.Zoom (cvZoom); PageSetup.FitToPagesWide (cvWide); PageSetup.FitToPagesTall (cvTall); // это для демонстрации того, что получается ...

asp.net mvc - Redirect problem -

मुझे क्लाइंट साइड में यह कोड है: $। Post ('& lt; % = Url.Action ("Action_Name", "Controller_Name")% & gt; ', {serverParam: clientParam}, रिक्त, रिक्त); और सर्वर साइड में यह कोड: [एचटीटीपी पोस्ट] सार्वजनिक कार्यवाही कार्रवाई_नाम (स्ट्रिंग सर्वरपरम) {वापसी दृश्य (); } मैं वर्तमान में एक दृश्य में हूं और जब मैं एक बटन पर क्लिक करता हूं तो मुझे Controller_Name / Action_Name / serverParam । पोस्ट के बाद मुझे एक्शन मेथड में भेजा जाता है लेकिन मैं अभी भी पुराना दृश्य देखता हूं, Action_Name ( Action_Name.aspx मौजूद नहीं है) (मैं mvc 2 का उपयोग कर रहा हूं) सबसे पहले, आपको "पोस्ट / रीडायरेक्ट / गेट" पैटर्न का अनुसरण करना चाहिए जिसके बदले एक दृश्य के बदले एक रीडायरेक्ट परिणाम लौटाया जाए। एक सफल पोस्ट लेकिन यह वास्तव में आपके द्वारा पूछे जाने वाले समस्या को हल नहीं करेगा। यह एक AJAX पोस्ट कर रहा है, एक "नियमित" पोस्ट नहीं। इसलिए ब्राउज़र रीडायरेक्ट द्वारा एक रीडायरेक्ट प्रतिक्रिया का सम्मान करने वाला नहीं ह...

multithreading - Interview Question on .NET Threading -

Can you describe two methods of synchronizing multi-threaded write access on a class member? Please anybody can help me what that means and what is the correct answer. When you change the data in C #, some instructions like some of the same operations seem to have many instructions You can compile in the following categories: Public category number {Private int A = 0; Add Public Zero (int b) {a + = b; }} When you create it, you get the following IL code: IL_0000: nop IL_0001: ldarg.0 IL_0002: dup // Value of private variable 'a' on stack IL_0003: ldfld int32 Simple.Number :: a // Push the value of argument 'b' on stack IL_0008: ldarg.1 // Adds the top two values ​​of the stack together il / 20009: Add / / Set the value to 'A' at the top of the stack IL_000a: stfld int32 Simple.Number :: One IL_000f: ret Now, say you have a number object and two threads its add method is called this way : Nanbrkaed (2); // thread 1 number.Add (3); //...