Posts

Showing posts from March, 2014

c# - using RSACryptoServiceProvider or RSA in hosted environment -

I would like to use public / private encryption, where my web app is an XML document or one of the data using a private The piece will be key and it will be verified in the application using the public key, Is it possible that there are probably other possible solutions, then use the RSACRPRO service provider in hosted environments in NST 2.0 Is it possible? see here:

c++ - I have a server listening on sockets, whats a good approach to service CPU-bound requests with multiple threads? -

I have an application written in C ++, which encourages: uses ASIO requests on this socket Hears and does not have some CPU-bound work (for example, a disk or network I / O) for each request, and then responds with feedback. This application is a multi-core system, so I plan to process (at least) 1 thread per core in order to process requests in parallel. What's the best way to do this? Things to think about: I'll need a fixed size thread pool (i.e. 1 thread per CPU) If I have more requests than Threads Then they the server is currently single threaded: This client waits for the request Receiving the request once After this, it works, and writes back the response, then begins waiting for the next request Update: More specifically: I should use the mechanism to make sure that incoming requests are queued if the server is busy is? Which mechanism should I use to distribute the incoming requests between N Thread (1 per core)? I don t if you are actua...

user interface - How do you map GUI labels to database fields? -

The field for the GUI that displays several database fields is desirable: labels map so that GUI labels are not hard-coded Dynamically set blood ALCPTP: "blood alcohol%" height: "height (cm)" Age: "In years Age "Li> Monthly Scheduled:" Month in Prison " Where do you store these stars and how to map them to the database field Ia is? You can safely assume that users request constant change in these labels. You can use the meta table information about the area of ​​the table once you have There will be more uses for this table.

javascript - Trying to append to an element using js? -

I see all the & lt; Object & gt; HTML is trying to add a snippet of . I understand that I can access elements by tag name and I can change the element, but can I add to it instead? Also, I want to add it to the contents of each tag, not the end of the document which of these methods will work? No library is considered ... var elementToAppend = document CreateElement (tagname); // Set your tag name here // element on element and element on element here with // elementToAppend.attribute = value (example elementToAppend.id = "some_id") // You can then change the text of the text and the DOM methods / elements Can add element (createNextNode with createElement or appendChild) / or internal HTML (elementToAppend.innerHTML = "some HTML string") with var objects = document.getElementsByTagName ('object'); (Var i = 0; i & lt; objects. Lamps; i ++) {elementToAppend = elementToAppend.cloneNode (true); Objects [i] .appendChild (elementToAppen...

c - Guides for implementing a foreign function interface -

I am currently working on a scripting language that has no FFI yet. I want to know what is the most convenient way to get it, assuming that I want to write it like a quiet Geek - I want to write FFI only in the scripting language. The programming language for me is C for the interface. C. For the original I know that libdl.so is my best friend. Obviously this is not the only thing needed, but the most important thing of them is. I only have a few thoughts about it, what else do I need for it? I want to treat FII the same way that the Dragon is with CTIP. What do I need to know to get it so far? I know that there is some serious magic with data structures, I'll need to deal with it. How can I manage it so that I can make the biggest of that serious magic in scripting language? I used to use this kind of magic more than just foreign function interfaces. For example, I would like to send the c-binary data to the file. I think an appro hit answer is needed. Basically,...

configuration - UltiDev Cassini and <system.webServer> web.config settings -

MS Cassini Development Web Server is a good product that performs web requests in the same way IIS7 does. I Requests (event for static content) without exception. Net goes through the pipeline. All custom HTML modules can handle any requests. But sometimes you do not want to execute these modules for certain content (most often static content). In this regard, like MS Cassini IIIS 7 & lt; System.webServer & gt; reads web.config settings / does not believe. I am particularly interested in these settings. & lt; System.webServer & gt; ... & lt; Handler / & gt; & Lt; Module / & gt; & Lt; /syste.webServer> What a web server reads these settings (and a separate payment product upgraded from MS Cassini) and executes it as a web. Configure it says? Cassini does not behave like IIS7, but like IIS6. That's why you have to & lt; System.web & gt; sections to & lt; System.webServer & gt; Instead of : & lt; Sy...

objective c - Load image from url in iPhone, only if small -

मैं एक छवि लोड करने के लिए initWithContentsOfURL का NSData का उपयोग कर रहा हूं एक यूआरएल हालांकि, मुझे छवि का आकार पहले से नहीं पता है, और अगर मैं किसी निश्चित आकार से अधिक प्रतिक्रिया देता है तो रोकने या विफल करने के लिए कनेक्शन की तरह होता है। ऐसा करने का एक तरीका आईफ़ोन 3.0? पहले से धन्यवाद। आप कर सकते हैं यह सीधे एनएसडीटा के माध्यम से नहीं करता है, हालांकि NSURL कनेक्शन / एसिंक्रोनस छवि को लोड करके और कनेक्शन: didreive डेटा: का उपयोग करके आपको यह प्राप्त करने के लिए कितना डेटा प्राप्त होता है, इसका समर्थन करेगा। यदि आप अपनी सीमा से अधिक हो जाते हैं तो अनुरोध को रोकने के लिए NSURL कनेक्शन से रद्द करें संदेश भेजें। सरल उदाहरण: (प्राप्तडेटा को शीर्ष पर एनएमएसूटबलडेटा के रूप में परिभाषित किया गया है) @implementation TestConnection - (आईडी) init {[self loadURL: [NSURL URLWithString: @ "http://stackoverflow.com/content/img/so/logo.png"]]; स्वयं वापसी; } - (BOOL) loadURL: (एनएसURL *) inURL {NSURLRequest * अनुरोध = [NSURLRequest अनुरोध के साथउठरर्ल: ...

html - Can Search Engines Read CSS? -

I used the tag to indicate the importance of the sentence. However, this page disrupts style continuity, so I change it back with CSS. The result of this is that visitors are the same, but the search engine (SE) is obviously different, and this is what is upset about SE. Then my question can be read by CES, and with it Can the entire page be judged further? If so, my behavior is acceptable or not by SE. Thanks in advance! Yes, at least the searches are trying to determine whether you violate their rules , Such as hidden / duplicate content (such as attempts to display appropriately approved financial content in search engines, but in reality it is hiding the content to users and instead advertisements are displayed. ) Not sure That's how technology works well, but I can say that it's probably pretty much advanced now to understand your site including CSS structure.

Python 2 CSV writer produces wrong line terminator on Windows -

csv.writer के अनुसार डिफ़ॉल्ट रूप से '\ r \ n' lineterminator का उपयोग करना चाहिए। खोलने के साथ सीएसवी आयात करें ("test.csv", "w") as f: writer = csv.writer (f) पंक्तियाँ = [(0,1,2,3,4), (-0, -1) , "बी", "सी", "डी", "ए", "बी", "सी", "डी", "ई"), ("ए", "बी" -3, -4) "ई")] print author.dialect.lineterminator.replace ("\ r", "\\ r")। प्रतिस्थापित करें ("\ n", "\\ n") लेखक। लेखक (पंक्तियाँ) प्रिंट लेखक। ("\ N", "\\ n") यह प्रिंट करता है कोड> \ r \ n \ r \ n के रूप में अपेक्षित लेकिन, सीएसवी-फ़ाइल बनाई गई lineterminator '\ r \ r \ n' 0,1,2,3,4 0, -1, -2, -3, -4 का उपयोग करता है ए, बी, सी, डी, ई ए, बी, सी, डी, ई क्या यह एक बग है या मेरे सीएसवी। लेखक के उपयोग में कुछ गड़बड़ है? पायथन संस्करण: सक्रिय Python 2.6.2.2 (सक्रियस्टेट सॉफ़्टवेयर इंक) पायथन 2.6.2 पर आधा...

c# - Single linq query for complex data structure : Dict<int, Dict<str, _class>> -

We look at the following structure first (I tried to simplify it, just what type of query I need) class name address {public string name {get; Set; } Public string address {get; Set; } Public name address (string asam, string sdres) {name = sName; Address = sAddress; }} Fixed zero main (string [] args) {dictionary I want to query the following data structure using a single linq query. Let's say I want to find the person who lives in New York and its key is also not the integer key (_dictionary key), but the string key (in this case - "third") is what I want to know . Is it possible to know the special name in string key and single linux query? If so, then what is that question? Note that this iterates (instead of using the index) , But it works: var found = (External from outside _dictionary in outer. Here's where the internal value. Address == "New York" Select New {external} = External .key, infra = inner, key, name address = inner va...

security - Saving application data in Windows XP when "Run As" is 'protecting the computer from unauthorized activity' -

I am trying to create it, so I can save data from my program when user gets started using Idioton Are going on I think I can actually write in a folder and I can read it back later. I've tried 'All Users', Application Data, My Documents, etc., but to no avail. Any idea how and where should I save and read data when Windows XP is keeping my application executed by 'unauthorized activity'? When the "security" checkbox is checked, you can not actually write anywhere ( Registry or filesystem) and this is a kind of point. Most programs do not even go with this option being checked. Under the hood it uses the SAFER API For more information, check

eclipse - Read remote properties -

First of all, greet everybody! ( I am making an Eclipse RCP app that needs to be inspected some .properties Some plugs are numbers that are located in the address in the duration. I want to know, if there is an easy to read them the way, for example I know that in my plugin * org.anyname.myplugins. mypluginthatrocks I have a file name myawsomeproperties .properties *, how do I open it and string getInProperties (string fileNameOrPath, string myPropertieId) zero setInProperties (string fileNameOrPath, string myPropertieId, string myPropertieValue) or string getInProperties (file file, String myPropertieId) zero setInProperties (file file, string myPropertieId, string myPropertieValue) or type If you mean any other what I mean ... thanks in advance ^^ Well, if this is just plain old property, then there is a good old man who will do the trick. However, if you want it to be like, IMHO, a little bit cleaner, and more oriented Eclipse mind, I suggest that y...

c++ - How to Use GetCORSystemDirectory()? -

हैंडल प्रोक; HMODULE एचडीएलएल; एचडीएलएल = लोड लाइब्रेरी (TEXT ("mscoree.dll")); अगर (एचडीएलएल == नल) cout & lt; & lt; "निर्दिष्ट नाम के साथ कोई डीएलएल" & lt; & lt; endl; Else {cout & lt; & lt; "डीएलएल हैंडल" & lt; & lt; एचडीएलएल & lt; & lt; endl & lt; & lt; endl; Cout & lt; & lt; "प्रक्रिया का पता प्राप्त करना ..." & lt; & lt; endl; Proc = GetProcAddress (एचडीएलएल, "GetRequestedRuntimeVersion"); यदि (Proc == NULL) {फ्री लाइब्रेरी (एचडीएलएल); Cout & lt; & lt; "प्रक्रिया लोड असफल" & lt; & lt; endl; } और {cout & lt; & lt; "प्रक्रिया का पता यहां पाया गया:" & lt; & lt; प्रोक & lt; & lt; एंडएल & lt; & lt; endl; LPWSTR सेंट; DWORD * dwlength; ; डीडब्ल्यूडब्ल्यूएस सीसीबीफर = MAX_PATH; HRESULT एचआर = GetCORSystemDirectory (सेंट, सीसीएच बफर, डीव्लैम्बिल); अगर (एचआर! = नल) {printf ("% s", एचआर); } फ्री ...

user interface - java gui - overlapping panels? -

I'm just trying to make this little simulator in a GUI, I have two main components - a map, most Take a window, and a control panel on the right hand side. Now, I would like to add a time slider under the window (not just under the control panel, running under the map) I can do it in the Runner class (which starts the main window), but it logically controls Room should be related - it removes all relevant events. Is there any way to do this? Should swing components be used and how should I wrap them? Thank you very much for your help Receive the desired results very easily You can use the border layout to do; E.g. JPNL PNL = new zpn (new border layout ()); Pnl.add (mapPnl, BorderLayout.CENTER); Pnl.add (controlPnl, BorderLayout.EAST); Pnl.add (Timer PNL, Border Layout. SOTH); If you are adding more components to your higher level JPanel , then I think that in GridBagLayout Recommends because it offers more flexibility. The fact that your control and timer rela...

sql server - Is accessing rows with varbinary data via LINQ causing a timeout? How to fix? -

मेरे पास SQL ​​में अनेक तालिकाओं हैं एक नियंत्रण (एक सामान्य CRUD ऑब्जेक्ट की तरह) और एक अटैचमेंट है। एफके के माध्यम से अनुलग्नक संदर्भ नियंत्रण (कई अनुलग्नक हो सकते हैं) संलग्नक भी शामिल है, अन्य बातों के साथ एक नाम और फ़ाइल डेटा के साथ एक varbinary स्तंभ। LINQ के माध्यम से, नियंत्रण एक संलग्नक संपत्ति है। मेरे पास एक नियंत्रण दृश्य (एमवीसी) है जो मौजूदा अनुलग्नकों की सूची सहित बहुत सारी जानकारी प्रदर्शित करता है यही कारण है कि सूची एक सहायक विधि के माध्यम से किया जाता है: सार्वजनिक स्थैतिक स्ट्रिंग FileBox (इस HtmlHelper सहायक, स्ट्रिंग नाम, IEnumerable & LT; Models.Attachment & gt; फ़ाइलें, bool लिखने योग्य) {...} यह समारोह संलग्नक के माध्यम से लूप और लगाव के नाम के साथ एक बिना क्रम वाली सूची बाहर लिखते हैं कभी कभी, मैं एक टाइमआउट त्रुटि मिलता है, और यहाँ कि त्रुटि का एक टुकड़ा है। System.Data.SqlClient.SqlException: टाइमआउट की समय सीमा समाप्त हो गई है। समय समाप्ति अवधि का संचालन पूरा होने से पहले समाप्त हो गया है या सर्वर प्रतिसाद नहीं दे रहा ...

java - Struts 1 MessageRessources - argument -

क्या ऐसा कुछ करना संभव है: & lt; बीन: संदेश बंडल = "MyBundle" key = "mytext.text" arg0 = '& lt; इनपुट प्रकार = "टेक्स्ट" नाम = "टेक्स्ट" मान = "& lt;% = num%>"' / & gt; मुझे पता है कि यह एक HTML तत्व को पारित करना संभव है, लेकिन मैं एक इनपुट बॉक्स के साथ "" "उस चर के वास्तविक मूल्य के बजाय" मुझे क्या याद आ रही है? आप टैग अटैचमेंट के लिए स्ट्रेट के साथ टैगलेट को जोड़ नहीं सकते हैं, जैसे कि आप स्क्रिप्टलेट का मूल्यांकन नहीं किया जाता है इसलिए कोशिश करें कि: & lt;% स्ट्रिंग s = "इनपुट प्रकार = \" text \ "name = \" text \ "value = \" "+ num + "\" "% & Gt; & Lt; बीन: संदेश बंडल = "MyBundle" key = "mytext.text" arg0 = "& lt;% = s% & gt;" / & gt; ध्यान दें कि आपके द्वारा प्रदान किए गए उदाहरण के रूप में इनपुट टैग बंद नहीं किया गया है।

c# - SQL Server - Guid VS. Long -

So far I have c # "Guid = Guid.NewGuid ();" The method to generate a specific ID that can be stored in some of my SQL Server database tables as an ID field, which Linq to SQL has used to inform me that for indexed reasons, using a GUID Have a bad idea and should use automatic incremental length: Will the speed of my database transaction be used? If so, how do I go about creating unique IDs that are of that type? Regards, Both sides and cons are entirely dependent That's how you use those cases. Just above the bat, if you need those identifiers that can work in many databases, then you need a GUID. Some tricks with long (manually separate each database into different seeds / Increment), but they do not scale well. As far as the index goes, the index will be much better inserted. The cluster (clustered by the default primary key, but it can be modified for your table), since every entry There is no need to reorganize the table after. As far as concurrent in...

action filter - ASP.NET MVC - Access a controller property in an ActionFilter -

I use Unity to instantiate a new class in the controller constructor and save the injection class in an asset inside the controller. I am doing Then I want to use an action filter to see if there are some properties in the injection class that I accept it inside the constructor. So is there any way to use the actionfilter to validate the properties of the injection class? In advance thanks something like this ?: Public class valid ActionFilterAttivat: ActionFilterArrbit {Public Override Zero Onset Exposing (Action Accepting Contact Filter Context) {var YourController = filterContext.Controller YourController; If (your controller == empty) {new invalid operation expiation ("this is not your controller !!!"); } // This is your controller - here you can verify that your property is = yourController.YourProperty; // UPDATED ********************************************************* Property Properties of the Controller Property = filterContext.Controller.GetType (). (...

collections - Magento: Select the top ordered products -

I need a block where I can display my "top sellers", but I do not know how I choose the collection I can do Need "Adapter to Select"? See this thread from the Magenta Forum - you have a lot of questions:

presentation - Interesting data for demos -

For presentations / demos for programming tools and languages, I think the data is made more interesting so that the data Could get better presentation / demo The reverse Northwind / AdWords Works emphasizes the use of the demo, saying how boring is. The problem is that from where to get enough interesting data in the public domain, what is in a decent format? I am using data dumps, but the bigger they are, the harder it is to actually get into a usable format like a relational database Is there any good place for interesting figures? What about it? It may not be too complicated.

php - Unexpected T_STRING in for loop -

यह मेरा कोड है: $ today = date ('ym-d') ; ($ I = 1; $ i & lt; = 10; $ i ++) {$ var_b [$ i] = दिनांक ('वाईएम-डी', स्ट्रटोटेम ('-'। $ I। 'दिन', स्ट्रॉटोमेम ( $ आज))); $ Var2_b [$ i] _name = दिनांक ('डी', स्ट्रॉटोमियम ($ var_b [$ i])); त्रुटि संदेश: पार्स त्रुटि: वाक्यविन्यास त्रुटि, एक्सपेक्स XXX में xxx \ index.php में अप्रत्याशित T_STRING $ var2_b [$ i] = दिनांक ('डी' , स्ट्रॉटोमेम ($ var_b [$ i])); आपका समापन कहां है } ? (यह भी याद रखें कि सरणी अनुक्रमणिका 0 से शुरू होती है)

c# 2.0 - C# ?: Conditional Operator -

मेरे पास सी # 2.0 स्रोत कोड का यह उद्धरण है ऑब्जेक्ट मान FromDatabase; दशमलव परिणाम; ValueFromDatabase = DBNull.Value; परिणाम = (दशमलव) (valueFromDatabase! = DBNull.Value? ValueFromDatabase: 0); परिणाम = (valueFromDatabase! = DBNull.Value? (दशमलव) valueFromDatabase: (दशमलव) 0); पहला परिणाम मूल्यांकन एक अवैध कलाकार अपवाद फेंकता है जबकि दूसरा नहीं है। इन दोनों के बीच अंतर क्या है? अद्यतन: यह प्रश्न था। महान प्रश्न के लिए धन्यवाद! यहां बहुत सारे भ्रामक उत्तर दिए गए हैं। मुझे अपने प्रश्न का उत्तर देने का प्रयास करने दो। आइये इसे सरल करें: वस्तु का मूल्य = जो भी; बूल की स्थिति = कुछ; दशमलव परिणाम = (दशमलव) (स्थिति? मान: 0); कंपाइलर अंतिम पंक्ति की व्याख्या कैसे करता है? संकलक द्वारा सामना की जाने वाली समस्या यह है कि सशर्त अभिव्यक्ति का प्रकार दोनों शाखाओं के लिए संगत होना चाहिए ; भाषा के नियम आपको किसी एक शाखा और दूसरे पर आदान-प्रदान करने की अनुमति नहीं देते हैं विकल्प ऑब्जेक्ट और इंट हैं हर इंट ऑब्जेक्ट के लिए परिवर्तनीय है, लेकिन हर ऑब्जेक्ट int को परिवर्तनीय नहीं...

javascript - Search result links from Google Custom Search not working when viewed in IE6 -

When looking at search results from Google CS in IE6, currently the community site I work on is of this problem . For example. Attempting to click on any result does not come to provoke the browser to follow the link. It is surprising that clicking or opening click or open in a new window do both work Has anyone seen something like this before? Any ideas about fixing it? Here is a possible solution: Change: var a = encodeurcomponent || Escape; with: var a = encodeIC object; or: var a = escape; On Note that the specific IE6 version: 6.0. I tested your example page with IE6 version: 6.0. 2900.5512.xpsp_sp3_gdr.090206-1234CO There was no problem loading the results and subsequent result links. If the above does not help, make sure that Navigate subframes to different domains is set to Enable . See for more information. Hope it helps!

actionscript 3 - Check Folder as Write access,Air app ,Flex -

How can I write applications in the air to write folders in my application? I need to test that folder as a permission to write ... var file: file = file. Desktop Directory Posts ("TxtFolder / DataFile.txt"); I have to check "TxtFolder" write permission ...? Before saving the file (DataFile.txt) .. How can I do this in Flex Air Thanks in advance ... You can handle the event that is dispatch when you do not have permission to write in the directory.

c# - Asp.Net Conditional URL Role Authentication -

I want to restrict access to a specific url unless the user is a member of 2 different roles. In this situation, I want to provide access to this URL only if the user is reporting both the reporting and role in ASP.NET, what is the way to do this? & lt; Location path = "testpage.aspx" & gt; & Lt; System.web & gt; & Lt; Authority & gt; & Lt; Allow roles = "Reporting, Archived" / & gt; & Lt; Deny users = "*" /> & Lt; / Authorization & gt; & Lt; /system.web> I want something like this: & lt; Location path = "testpage.aspx" & gt; & Lt; System.web & gt; & Lt; Authority & gt; & Lt; Allow roles = "Reporting and archiving" /> & Lt; Deny users = "*" /> & Lt; / Authorization & gt; & Lt; /system.web> It's ugly, but you can get it from You are currently using the role provider (SqlRoleProvider, WindowsTok...

I need to write an Access 97 .mdb file -

I have an Access 97 from a SQL Server 2005 db. Data needs to be exported in MDB file. The client needed is Access 97 because the system in which they are importing it requires the Access 97 file format (I did not initially get it). Any suggestions on how to sql or To write access files from Net (or VB6 or Ruby or Python ..)? Thank you in advance, li Whatever access version you have installed, Need to be exported in the access file (unless it is 2000 to ... 2003; Access 2007 97 does not have to be written to access files). I think you already know how to do this. Then you can create an access object through COM and ask it to convert your new .MDB file to a new Access 97 database. In VBScript, the code looks like this (if you're using VBA, VB.Net, or other language, adjust as needed): const acFileFormatAccess97 = 8 dim app set app = CreateObject ("Access.Application") app.ConvertAccessProject "y: \ mydatabase.mdb", "y: \ mydatabase97.mdb"...

c# - How do I get the nth element from a Dictionary? -

साइफर = नया शब्दकोश & lt; char, int & gt ;; सिफर। जोड़ें ('ए', 324); साइफर.एड ('बी', 553); साइफर। जोड़ें ('सी', 9 15); कैसे 2 तत्व प्राप्त करने के लिए? उदाहरण के लिए, मुझे कुछ पसंद है: मुख्य वैल्यूपेयर जोड़ी = साइफर [1] जहां जोड़ी में ('b', 553 ) एक सूची का उपयोग करते हुए कॉप के सुझाव के आधार पर, चीजें काम कर रही हैं: सूची & lt; keyvaluepair & lt; char, int & gt; & gt; साइफर = नई सूची & lt; कीवालपेअर & lt; char, int & gt; & gt; (); साइफर.एड (नवा किवाल प्वायर & lt; चार, अंतराल & gt; ('ए', 324)); साइफर.एड (नया चाबीवैलपेयर & lt; char, int & gt; ('बी', 553)); साइफर.एड (नवा किवल्यूपियर & lt; char, int & gt; ('सी', 9 15)); चाबी वैल्यूपीयर & lt; char, int & gt; जोड़ी = सिफर [1]; मान लें कि मैं सही हूं कि आइटम सूची में शामिल किए गए क्रम में बने रहें, मुझे विश्वास है कि मैं केवल एक सूची का उपयोग कर सकता हूं सुझाए गए के रूप में एक छाँया गया स...

Any testing tools that can test a PowerBuilder app and a webapp? -

I'm working on developing a webapp that will replace an existing PowerBuilder app. They should be equal to the functionality, and the PB App requirements have gone for a long time. So the best way to check is to input the same data in the same screen, and compare the output if PB output and the webapp output are similar, then it is functionally equivalent. Is there a testing device / framework that can do this? HP QuickTrO is an IBM Rational Robot 2 device that supports both Web Testing and PowerBuilder applications. You want to see the Test Tool Forum again.

How to use Pixel Tracking across domains in PHP -

I understand the basics of pixel tracking, I am able to insert a pixel that references an image on my tracking domain The other gives websites to the other. However, how can I increase the actual pixel count on my tracking domain? Is there a log that tells me every time that the pixel image was served? Am I able to do something like this: & lt; Img src = "http://www.foo.com/serveImage/getImage.php?id=5123" /> Then get the getImage page based on that ID, which leads to image and service growth? Or is there a better way to achieve this? Thank you in advance. If you just want to output GIF, this is a quick easy way, just make sure that your The script does not come before or after: header ("content-type: image / gif"); Header ("content-length: 43"); $ Fp = fopen ("php: // output", "wb"); Fwrite ($ fp, "GIF89a \ x01 \ x00 \ x01 \ x00 \ x80 \ x00 \ x00 \ xFF \ xFF", 15); Fwrite ($ fp, "\ xFF \ x00 ...

caching - ASP.NET MVC, Cache individual User Control -

मैं ASP.NET MVC के साथ एक व्यक्तिगत उपयोगकर्ता नियंत्रण कैश कैसे करूँ? मैं भी VaryByParam आदि समर्थन की आवश्यकता है जो आम तौर पर एएसपीएक्स आउटपुट कैशिंग के साथ आता है। मैं पूरी कार्रवाई को कैश नहीं करना चाहता हूं, हालांकि मेरे उपयोगकर्ता नियंत्रण में से केवल एक दृश्य में है। एक उदाहरण अच्छा होगा :) धन्यवाद! फिल हैक ने इसके बारे में अच्छा लेख लिखा है, इसे डनआउट छेद कैशिंग कहा जाता है

c# - passing variables into another form -

I am developing a window app in C #. I have used three decimal variables: counter , narrow , and wide which store different values ​​depending on some calculations . On clicking on a button, a message box displays these three decimal values ​​and then exits the application. Now I want to add another form I have three labels in which these variable values ​​should be shown. Please explain, how can I pass those variables in the next to display in different labels? new form ... public class calculation content form: form { Public counting field () {} Public Decimal Counter {Set {labelCounter.Text = value.ToString (); }} Public Decimal Broad {Set {labelBroad.Text = value.ToString (); }} Public decimal margin {set {labelNarrow.Text = value.ToString (); }} Private Zero OkButton_Click (Object Sender, EventArgs E) {// This form will close (similar to the right click on the message box) DialogResult = DialogResult.OK; }} Then within your existing form button click handler...

iphone - Problem with NSSearchPathForDirectoriesInDomains -

I'm trying to work on directories Unfortunately I found a non-writeable directory on running NSSearchPathForDirectoriesInDomains. What do I get: / user / me / library / application support / iphone simulator / user / document when I run examples of other people : / user / mine / library / application support / iPhone simulator / user / application / 6958D21C-C94B-4843-9EEF 1-70406D.CA3A3 / Document is writeable. The snippet of code used NSArray * path = NSSearchPathForDirectoriesInDomains (NSDocumentDirectory, NSUserDomainMask, YES); NSString * document directory = [path item overindexx: 0]; NSLog (documentsDirectory); Why do I need to get the same long directory structure? The document path for your app is GUID , and the expected behavior is. Not sure what your code looks like, but the path to your app's documentation directory should be something like this: NSArray * path = NSSearchPathForDirectoriesInDomains (NSDocumentDirectory, NSUserDoma...

trigger in sql server 2000 -

I have a trigger that wants to update the logout time [within an hour of log time, random logout generate time, seconds] to very different, I get how that functionality, please help me here trigger far: using trigger TestDB GO dbo.usage_reports_Dummy2 AfterInsertTG After making the form @pk_id declared as integer, @mbid AIT In the letter, @ Login_taiti as Ditiitiiim, @ Logaut_taiti as date, @ IP AS Viaaraaraar (255), Viaaraaar (255) as @ Satr_aidi; Select @pk_id = pk_id, @member_id = member_id, @login_time = LOGIN_TIME, @logout_time = logout_time, @ip = IP, @session_id = session_id usage_reports_Dummy2 If (@logout_time zero) start ??????? Thanks for thanking Eric for taking some time and thinking about the formula, I answered the mark because it is in accordance with my conditions select here last code: Create putting TRIGGER trgInsert dbo.usage_reports_Dummy2 instead as dbo.usage_reports_Dummy2 (member_id, LOGIN_TIME, logout_time, IP, session_id) member_id , LOGIN_TIME,...

c++ - Linker problem on VS2005 with VC++ -

Here is the scenario: Platform: VS 2005 and Language VC ++ The situation is: only 1 assembly is CMPW32, there are 2 projects in it: 1 is a DLL project given the name of CMPD 32 and the other is a driver which they call the XP project, they share the same debug folder under the main assembly folder We do. I am able to export some functions successfully from DLL. The driver project reaches one of these export jobs (first of all, I do not think if I need functions export to use them for projects in the same assembly, then I can only include header files and my thoughts I can use.) The following are some lines of code from some files that may be useful for analyzing your problem: // main.cpp file from the driver project that is the driver. Exe #pragma to generate a comment (Lib, "winmm.lib") #include & lt; CM.h & gt; Include #include "conio.h" #include "CMF.h" #CBI_F _T ("c: \\ CannedMessages.en-US") int_tmain (int argc, TCHAR * ...

scope - Javascript var hoisting issue -

I have a very simple javascript function that kills MS SQL Server and returns some records. There is a room that I want to display only in the top table row when it is unique. I believe my problem is because the variable which I assigns within the loop does not work because the price is not used to compare it with the previous records. Here is the code function search index () {var termcounter = ""; Flyout HTML = "& lt; Table & gt; '; Var adOpenDynamic = 2 var adLockOptimistic = 3 var conn = New ActiveXObject ("ADODB.Connection"); Var connectionstring = "Provider = SQLOLEDB; Server = XXXXXXXX; Integrated Security = SSPI; Database = YYYYYYYYYY;" Conn.Open (connectionstring) var rs = New ActiveXObject ("ADODB.Recordset") rs.Open ("SELECT field1, field2, field4, field4, field5 to dbo.table;", conn) if (rseof) {flyoutHTML + '& Lt; Tr & gt; & Lt; Td align = "center" & gt; No Records Found...

web applications - SmartGWT TreeGrid Selection -

I have a SmartGWT web app that uses a datasource with a tree grid. I would like this grid to select the tree saved values ​​in a cookie. I have got the value to save in the cookie correctly, although I tried many different ways of picking tree grids to choose these values. And I can not get it to work. I'm trying to do this on my entry point in the onmoduleLoad method I tried: Cookies set cookies to set cookies ("Selected UIIT", Treegrid.Get selected path ()) And then when the page is reloaded: TreeGrid.setSelectedPaths (Cookies.getCookie ("selectedUnit") When I could not find it to work, I tried to store the ID only, selected items: cookie cookies ("cookies") GoedAttribute ("id")) and then attempt to overload it to find that record and select it: TreeGrid.selectRecord (TreeGrid.getTree (). ("Id", Cookies.getCookie ("selectedUnit")) This does not work either, so Finally, I tried to store a treeg...

html - Stretch image to fit in td -

I want to spread an image in my TD cell. How to do it It has a tab image which looks like this. ________ |. I need to keep this image in the first TD cell in which the text 'aaa' will come in the center of this image. You can not stretch the background image without using CSS3 CSS3 contains the background-size property for which you take a 100% image of 100% container but for CSS3 is not supported in all browsers. You can use an image tag and you can give width and height 100% to achieve it.

VS 2008 SP1/SQL SERVER 2008 SP1/TFS setup PROBLEM! -

I have about to pull my hair out if I have to reset everything again! If I install Visual Studio 2008 SP1, then TFS and when I try to install SQL Server 2008, I have an error message that is asking me to install SP1 of Visual Studio . After seeing Instantly on Google and SO, I have not tagged TFS's mysterious problem as SP1, which is failing the establishment of SQLSER 2008. So I uninstalled everything on my half day and then started installing all those apps. Now my boss is asking me to do some analysis and reporting, bilateral ... which requires new plug-in of SQL Server. You have estimated my problem: SP1 error is still remaining after a well established VS SP1 / SQL server / TFS. Is anyone's solution? Finaly have found me a solution ... to actually install TFS befor SQL Server 2008 (even one update) if you uninstall SQLSERVER Uninstall Microsoft Visual Studio 2008 Shell Integrated Mode , this is the component that is included in Visual Studio but SP1 is not ...

sql - How to make result set from ('1','2','3')? -

I have a question, how can I assume that the result can only be set to list the prices For example, I have such values: ('1', '2', '3') and I have to make a SQL that gives such a table: 1 2 3 Thanks. [edit] Sorry for the wrong question. Actually there is no integer in the list, but there are strings in it I currently need ('A', 'BB,' CC). [/ edit] The best way I found is by using XML Used to be . ( SELECT items.extract ('/ l / text ()'). From the table (XML Format (extract (XML type ('' 'Replice' (AA, BB, CC ', Wish I can take credit, but regret .. P> What does this actually do is convert the list into XML document and then parsing it back.

c# - How to get height of horizontal scrollbar in a ListView -

Can anyone tell me how do I get the height of horizontal scrollbar in the ListView in C #? Is this standard similar to the horizontal scrollbar, if there is a Windows function that comes back to it? Basically I'm using ListView with OwnerDraw and want to know how big my client area is, which does not include column header area and horizontal scrollbar area. Thanks

.net - Return JSON wrapped in a callback function from a WCF REST web service -

I have a web service that is returning to JSON, but now let me give callers permission to specify a callback function Want to modify it goes back to: JSON data specified function (Jasonan Data); The way I'm returning to JSON, just returning an example of an object and doing its serialization magic, if I only return a string, then I can add the name of the function and the bracket around the data but if I return Ends with quotation marks, because it is a string and I do not want those people. So how can I go about it? The reason for this is that we want developers to call our API to use dynamic script tags, as explained See: This is a wrapping encoder on Code> JasonEpncoder WCF JSON Encoder for wrapped encoder Most call represents Outgoing message with callback method Override WriteMesage for pad. JsonBehavior is used to enable JSONP encoding for that operation. The query parameter URI with the callback function name is specified as the property of the CallBac...

c# - Detect if a page is within a iframe - serverside -

How to find server-side (c #, asp.net mvc) Can i Thanks This is not possible, though. & lt; Iframe src = "MyPage iframe = yes?" & Gt; & Lt; / Iframe & gt; And then check the server side if the query string with iframe = yes or the referrer header sent by the browser.

c# - Winform form closed event -

I have 2 forms, main and child when a button is clicked on the main button, the child form loads . Can I catch up primarily when the child's form stops from subscribing to the child's closure event? Yes you can, it is very straightforward: Private Zero LoadChildForm_Click (Object Sender, EventArgs e) {ChildForm Form = New ChildForm (); Form.FormClosed + = New FormClosedEventHandler (ChildFormClosed); Form.Show (); } Zero ChildFormClosed (Object Sender, FormClosedEventArgs E) {// Some useful}

C# books or web sites for C++ developers -

I am looking for web sites or books that will help C + + develop developers. So far, the best I've found. Frankly, when I learned. It was difficult to understand the C ++ background in many ways, I found that trying to fit C + mentally in C # actually works against me - not for me. I do not pay attention to C + + trying to find C # for developers - just to try good resources, C # well, expansion C # and .NET framework books in general There, and your C ++ background will help you understand the details just a bit better. Learning C # will be about learning about the frameworks, hoping to work, and forgetting many + habits habits I recommend some detailed books which are not focused on the initial topics, such as That and I also think that C + / It was probably the most valuable resource to think in C # / .net - it's true how the structure is, and how to write code, which other C # developers want to maintain. There are guidelines, but the book is very helpful, it...

c# - WCF Using UserName Authentication with Message Security -

I am developing an ASP.NET application that will be calling (widely) WCF services. Now, I'm clearly melting in some kind of mentality because for my life, I can not wrap it around my head. I am using ws2007 HTPBI bidding with message security and client credential type along with the user's name. WCF is using ASP.NET subscription provider to validate user credentials. All this works well but I have to explicitly add user details in the call: Var service = new MyService.MyServiceClient (); Service.ClientCredentials.UserName.UserName = "my_username"; Service.ClientCredentials.UserNane.Password = "mypassword"; .... etc ... service. Close (); Now, from the login page, this is easy because the user has given us his username and password just now when I need to call any other service with the user's credentials. I am not comfortable in accumulating passwords for use later on the road. Am I clarifying something? I have read about tokens etc., bu...

PHP Frameworks - Layout Dynamic Menu -

I am developing a website in PHP and I would like to use an MVC framework to do this because I Want to gain experience PHP framework? I have seen Zend, CakePHP, and CodeIgniter and I can not find an intuitive way to complete it. What I need to do is the layout which will be for example: I am looking for a framework that can do so without many hacks because it will be easy to complete with my perspective. This will pull the menu, content, and ads with different controllers and ideas, and of course dynamic content. I do not want to put the menu view in every scene ... Maybe it's easy and I'm going wrong about it? Any help is appreciated. Thanks The symphony you can see is a mix of concepts to use. Layout - This is the main frame used to decorate a page. Template - This main view is linked to the URL Controller. Pieces - Lightweight and uses the data you passed. Component - If you need access to the model, the code is divided between the present...

c# - How do you get file details in a SharePoint ItemEventReciever in the ItemAdding Event? -

I would expect something like this to work but ListItem, BeforeProperties, AfterProperties all null / empty. I file names and file contents need public class MyItemEventReceiver :.) SPItemEventReceiver {public MyItemEventReceiver ({} public override void ItemAdding (SPItemEventProperties properties) {SPListItem items = properties.ListItem; Bool fail = item.File.Name.Equals ( "fail.txt"); If (fail) {properties.ErrorMessage = "file failure is valid"; Properties.Cancel = true;}}} I can not use ItemAdded as it is asynchronous and i need to be synchronous, i stop uploading and send message to user Can be shown. For example would appreciate any suggestions, what is possible to override Upload.aspx? you must have the files uploaded which can use the HttpContext to retrieve HttpFileCollection. it will only work to upload personal files through the web UI multiple file Uploading, or saving directly from the office, will not create an HttpContext. Try somethi...

c# - Best way to test if a Type is a collection -

I have a method that accepts the parameter obj type of system. Object Now I want to know whether the actual type is obj: A collection type (IEnumerable). Anything else The first method I have thought of: if obj is (isnumerable) // obj is a collection But System.String implements IEnumerable, and I do not want to treat string as a collection . The way I thought it was a test for icocolon instead of ininmereble, because IEnumerable is more than a possible archive, a real one leaves this string out, but it also shows Icon-Off-T This is because it does not inherit IClippin (the nominal cable T-T is only compatible with the general collection abstraction that is compatible with the rear - it receives the INIMRAMABLE). So I think the best way is this: if (obj string is) // if there is no archive (oz is IEnumerable) // archive th / No collections Is there a better way? I think you are making it a bit confusing. If you really want to use IEnumerable, but l...

flex3 - Unable to select custom item renderer (flex) -

Hi I have created the following item render in MXML, but when I use it in the list for some reason I can not select it Am I doing something wrong? & lt; Mx: hbox xmlns: mx = "http://www.adobe.com/2006/mxml" horizontal ScrollPolicy = "off" & gt; & Lt; Mx: script & gt; & Lt ;! [Cdata [import com. PBSMDIA.Compci.domain. CLAVENT Calligraphy type; [Bindabal] Private Vaier Calvert Type: Calant Type; Override public function set data (value: object): zero {if (value! = Null) {calEventType = value as CalEventType; ColorBar.setStyle ("background color", calEventType.eventColor); }}]] & Gt; & Lt; / Mx: script & gt; & Lt; Mx: image source = "{calEventType.icon}" /> & Lt; Mx: label text = "{calEventType.name}" selection = "true" /> & Lt; Mx: HBox height = "100%" width = "100%" horizontal alliance = "true" padding right = "20" & gt; & L...

oop - Recommend some open source web frameworks for a fun project -

I keep in-house business software for a living. The techniques included here include Java, Straits, Spring MVC, JSP, Wickets and some others are included. I think it's time to take the time and learn something new. I'm hoping to show myself with a project that can code to write, in fact, can be fun (in some aircraft of the universe), and I have had some of my previous life I have not done anything in years which I can not ever love or do not have fun. I'm thinking of being a fantasy-game-style web site - obviously, in relation to very small features and everyone I was hoping that I would get some recommendations for the latest or clean settings Which will allow me to complete such a project. My goal is to work on the actual development process rather than hacking a bunch of nonsense already in the dirty application on a daily basis. Land. Apart from this, I will try to follow best practices and make good, clean, understandable code, which does not stagger in the idea ...

php - Question regarding MVC: SubClass for DB activity -

I just recently had OOP & amp; Now using MVC and this template engine: Where have I placed my DB calls, but I'm curious about a question (I'm using a basic database wrapper class). We have seen two ways. Category Cart / ** * Item count in cart * @ Layer intern / Public counting counting function () {require_once (DATABASE. 'Cartext.php' ); $ Info = User :: getInfo (); $ Count = CartExt :: inCart ($ info ['0'] ['userid']); Return $ count; } Then in the class cart / ** * User cart count * @ Ultimate intra * return int * / public static function inCart ($ shopperID) {$ Db = Database :: getInstance (); $ Query = $ db- & gt; Execute ("Selection from Listing" where shopperid = '$ shopperID' "); $ Count = 0; While ($ line = $ db--gt; get all ($ query)) {$ count ++; } Return $ count; } With big functions, I can see the benefit of separating two, but as a later example, it is very similar to brain, or worse: Ba...

python - Why isn't Django returning a datetime field from the database? -

For my first Django app, I'm trying to write a simple bid collection site (looks bash.org) , Really simple methodology, just to get my legs wet. I am using sqlite as my database because it is the easiest to setup. Here's my only model: class quote (models.model): text = models.TextField (); Upvotes = models.IntegerField (default = 0) downvotes = models.IntegerField (default = 0) active = models.BooleanField (default = False) date_published = models.DateTimeField (auto_now_add = true) Really a simple extension template to dump more information: quote: {{quote.text}} & lt; Br> Upvots: {{quote.upvotes}} & lt; Br> Downwots: {{quote.downvotes}} & lt; Br> Published: {{qoute.date_published | Date: "FJ, Y, G: I"}} When I go to the extension page, everything is output properly for the given object, (Except blank), I have checked the database and verified that it is stored from time to time in that column of that object and it shows the ad...

Java NIO: What does IOException: Broken pipe mean? -

For some of my Java NIO connections, when I have a SocketChannel.write (ByteBuffer) Calls, it throws a IOException : "broke pipe". What causes "broken pipes", and, more importantly, is it possible to get it from that position? If this can not be fixed, then it seems that it would be a good sign that an irreversible problem has occurred and I should close this socket connection. Is this a reasonable assumption? Is there ever a time when it happens IOException , while the socket connection is still properly connected in the first place (instead of failing at some point in some work)? On one side note, it's wise to always call SocketChannel.isConnected () a SocketChannel.write () before attempting And if so, then I can also assume that the connection is "broken" and should be closed if both SocketChannel.isConnected () and SocketChannel.isConnectionPending () Both false ? Thank you! What causes "broken pipes", and m...

php - MyspaceID login system -

I would really like to integrate the MySpace ID platform on my site, rather than letting users enter my site Even with the time MySpace ID, I plan to use it 1 time on the signup process so that they can get permission to import profile data from MySpace to my network. I have been given attention that any good example code is doing any kind of myspace integration, did anybody do this and care about sharing any information on this issue? MySpace is an open-end provider. What you are looking for is an OpenID consumer library. This is the first result on Google, though there are many more: Do not use this people MySpace, but Google, AOL, Yahoo, Flickr and many other sites for you Sign in I use it regularly even the stack overflow uses OpenID sign in. smart Ware!

c# - XmlTextWriter: Allows Unicode? -

I am using XmlTextWriter to save some configuration elements for my program (this is only 10-15 string value That's the reason I'm using 'XmlTextWriter'). My code looks as follows: XmlTextWriter author = new XmlTextWriter ("FILENAME.XML", blank); Author.WriteStartElement ("config"); Author. Write element string ("paragraph 1", absolute 1); Author. White Element String ("Para 2", Ultimate 2); ... Author. Right-handed element (); Writer.Close (); I would like to permit paramax values ​​to include Unicode; nothing is fancy - these values ​​come in user input data from the courses, and I get the system working fine globally Wish (Chinese, Japanese, Hebrew, Arabic, etc.) I am not parsing the data, I want to present it the next time the program loads. What is the way to achieve it? The manufacturer has the second parameter. Default encoding if left left is UTF8.

mfc - How to increase a cells height and width in ListControl -

How can we increase the height and width of a cell in the list Write a custom list control (boss drag). Set the message height to MEASUREITEM_REFLECT Method: MeasureItem (LPMEASUREITEMSTRUCT lpMeasureItemStruct)

java - Reimplementing mkpasswd -

On Linux I used the mkpasswd to generate random passwords for use on OS X I do not have this order, instead of entering my VPS every time, I wanted to implement it using Java. What I have to do is to choose random 4 lowercase letters, 2 upper case letters, 2 symbols (/., Etc.) and 2 numbers. Then I'll make a vector and turn it around too. Do you think this is sufficient enough randommaking? Yes, it is. If you are using: An example of this class is used to generate a stream of pseudo-random numbers. The square uses a 48-bit seed, which is modified using a linear congruential formula. (See Donald Knuth, The Computer of Programming, Vol. 2, Volume 3.2.1.) Random Algorithms implemented by the class use a protected utility method which supplies up to 32 pseudorandom bits on each inococation. Can do . Edit In response to a comment: / ** * creates a new one Is Random Number Generator This constructor * considers the seed of a random number generator to give it ...

Possible preg match miss format in php -

I have this code: // get $ data = $ _POST data [List ']; Echo ($ data); Echo ('& lt; br & gt; then & lt; br & gt;'); $ Data = str_replace ("\ t", "", $ data); Echo ($ data); $ Matches = array (); $ User = array (); Preg_match ("/:. +?) ((?: [AZ]) (?: [0- 9] + :) {3} [0-9] +) ([0- 9] +) \ / ([ 0- 9] +) ([0- 9] +) \ / ([0- 9] +) / ", $ data, $ matches); List (, $ user ['base'], $ user ['location'], $ user ['economy'], $ user ['maxecon'], $ user ['ports'], $ user ['maxports'] ) = $ Match; $ Base = $ user ['base']; $ _SESSION ['base'] = $ base; $ Location = $ user ['location']; $ _SESSION ['location'] = $ location; // interrupt $ econ = intval (($ user ['econ']), 10); $ _SESSION ['econ'] = $ econ; $ Maxecon = Interval (($ user ['max' ']), 10); $ _SESSION ['max' '] = $ max action; $ Port = interval (($ user [...

ASP.NET MVC - Combine Json result with ViewResult -

Can I return a JS results that includes a render view? I need to return it to me This can also be helpful when I need to return two (or more) visual results from a verb inside the Jason object. Thank you! You can also render a partial ViewResult for a string, and then pass this string You can see in this post. I have created an extension to make it easier: Public Stratic Class MvcHelpers {public static string RenderPartialView (this controller controller, string viewname, object model) {if (string. IsNullOrEmptE (viewName)) viewName = Controller. Controller Consort. RouteData.GetRequiredString ("Action"); Controller ViewData Model = model; See {ViewEngineResult viewResult = ViewEngines.Engines.FindPartialView (Controller Controller Contains, Viewing Name) using (Var sw = new stringwriter ()); Var viewContext = New ViewContext (Controller Controller Contains, Visual Protection, View, Controller Viewdata, Controller.Tempadata, Self); Scene View. Render (Vis...

actionscript - Is Aviary a Flex application? -

I wonder if www.aviary.com web applications have been created through Flex framework. Does anyone know? I can not use aviary.com (some DNS problem) right now but if you reach the SWF Can you put it in "my flex"? Tool: This uses a device called SWFdump (part of Open Source Flex SDK) to read compiler metadata out of the SDF.

ruby on rails - Where are required gems defined? -

In my Rail application, I have once entered the authlogic-oid and ruby-opid . Now I am getting rid of them and I removed my gems and their config.gem lines from my environment.rb . Although my application works, I can not migrate any database because I get the "missing essential gems" error. If I run Rock Gems: Install These gems are reestablished Where are the gems stored in the context? The standard way of defining a gem dependency is in the environment configuration, usually for any environment In the environment.rb file, some gems can also be referred to as anti-environment. Check the environment files in config / environment . Also make sure that some files do not include the classic Rubyzms gem command gem. Finally, the investigation of these gems is not necessary for other gems or plugins used by your application.

c++ - scanf() causing strange results -

I have a code that presents an interesting question (in my opinion). / * Power picks number for integer powers / / #include & lt; Stdio.h & gt; Double power (double n, int p); Int main (zero) {double x, expo; / * Is the original number and the result of expo * / int f; / * XP is exponance that is being extended to x * / printf ("Enter a number and positive integer that \ n the first number to be raised. \ N Enter q to leave \ n"); While (scanf ("% lf% d", & amp; x, & amp; x) == 2) {xpow = power (x, exp); Printf ("% 3g power% d in% .5g \ n", x, exp, xpow); Printf ("Enter the next pair of numbers or q to leave. \ N"); } Printf ("Hope you enjoyed your electric journey - bye! \ N"); Return 0; } Double Power (Double N, Int P) {Double PA = 1; Int i; For (i = 1; i & lt; = p; i ++) {P * n; } Return Pau; } If you see the numbers to be entered in order of numbers then floating point number and then decimal number (ba...

multithreading - Multithreaded JDBC -

What is the best way to handle JDBC with many threads? There are several threads in my database together. With a single connection and statement I get the following error message: org.postgresql.util.PSQLException: This result is offset. Should I use multiple connections, multiple descriptions or is there a better way? My initial thought was to use a statement per thread that guarantees a set result set. You should use a connection per task if you use connection pooling Can not use ready-made statement prepared by the connection. All object connections created by the connection (ResultSet, PreparedStatements) are invalid for use after returning to the pool. So, it's the same public zero getSomeData () {connection conn = datasource.getConnection (); Preparedness; Try {st = conn.prepareStatement (...); St.execute (); } Finally {closed (cents); Conn; }} In this case all your DAO objects do not take connection, but Datasource Object (java.sql.DataSource) which is a...

appending string in existing string in sqlite3 manager fro firefox? -

Hello, I have to do something like that. I have 4 rows with unique ID1, 2,3,4 all four rows include some strings like option 1, option 2, option 3, option 4 Now, I want to add option1, "b" to option2 and so on, so there is no way i can do this with a query. I'm adding these to several rows manually It is not quite clear what code You want to choose to include the field in somestring , but for example, "Caesar's Cipher" (1 'A' returns, 2 returns' B '' etc.) based on id field, as your question suggests, then it should work: preset SET somestring = (substr ('abcdefghijklmnopqrstuvwxy Z ', id, 1) ||') '|| Somestering) WHERE id & lt; = 26; ... is definitely not for more than 26 lines, since then the argument should change and we can not explicitly estimate how you want to expand it (Id modulo 26 + 1, just use more characters than small letters, or ...?) Because you do not tell why you want to do this. ...

validation - Check well formatted email address -

मेरे पास इस तरह ई-मेल की एक टेक्स्ट फाइल है: 10: info @ Example.com; dev@example.com 12: john@host.com; "जॉर्ज & lt; g.top@host.com>" 43: jim.p@web.com।; Sue-allen@web.com ... मुझे यह देखना है कि सूची में अच्छी तरह से स्वरूपित प्रविष्टियां हैं क्या आप किसी भी उपकरण या वेब-सेवा को जांचने और मुझे अवैध पतों की सूची देने के लिए जानते हैं? अपडेट प्रिय सभी, आपके इनपुट के लिए धन्यवाद। मैं वास्तव में एक बुनियादी synatx जांच की तलाश में था, इसलिए मैं राय के विचार के साथ रहना होगा (मैं इसे जावा के साथ करेंगे)। धन्यवाद। मैंने एक सरल पर्ल स्क्रिप्ट लिखा है जो इन पतों को मान्य करने के लिए ईमेल :: पता मॉड्यूल का उपयोग करता है : #! / Usr / bin / env perl ईमेल :: पता; जबकि (& lt; & gt;) {chomp; @ जोड़ = विभाजन / \; /; मेरी एड्रेस (@ एडर्रेस) से पहले करें (यदि (! ईमेल :: पता- & gt; पार्स ($ पता)) {प्रिंट $ पता, "\ n"; }}} आपको बस मॉड्यूल को स्थापित करने की आवश्यकता होगी। इसका मुख पृष्ठ है:

iphone - Does someone know what's the magic behind the Render-Tree? -

Layer-tree and presentation-tree are very clear. But there is no render-tree. Since this is a private API and Apple does not speak a lot about it, I still want to know more about what someone is aware of what is happening there. I went to google and their documents came, for which I thought " Documentation is a definite answer to that choice! " : | If Apple is not telling you, you think that you are going to find a lot about it. It has also offended me, as you have taken my interest

Java Performance - ArrayLists versus Arrays for lots of fast reads -

I have a program where I need to make random access to 100,000 to 1,000,000 such as the inventory object less time Is read in a cellular automata-such as possible for a program (as in milliseconds) I think the update algorithm I am using is already optimized (keeps track of active cells efficiently, etc.). The list needs to be changed, but this performance is not as important as it is, I am thinking that the difference in the timeline is read in such a short time, if there is a difference in the use of the array instead of the Ariel, Does not fall. Currently, I am using array list. EDIT: I forgot to say: I am just storing the integer, so another aspect is using the integer cover class (in the case of Arrestist) vs INS (in case of Arrays ) Does anyone know that to use ArrayList will actually need 3 indicator lookup (for an ArrayList, for an underlying array, and for an integer-> int) where the array is only 1 (array Need address + offset Fraction)? Will hotspot optimize additio...

c++ - Python Properties & Swig -

I am trying to create Python binding for some C ++ code using swig. I seem to have a problem in trying to create Python properties from some accelerator functions: class player {public: zero entity (existence * unit); Unit * unit () console; }; I tried to create a property using the Dragon Property function but it seems that the wrapper classes that generate swig are not compatible for at least the setters. How do you make properties using Swig? Oh, this is hard (and fun) SWIG does not it @property identifies as an opportunity to generate: I think it will be very easy and recognize many false positive if it has not been carefully done though, since SWIG does not create it in C ++ , It is still quite possible that it is in Python using a small metaclaces. So, below, suppose we have a math class that we set and get an integer variable called "Pi" then we can use this code: Example.h #ifndef EXAMPLE_H # defined EXAMPLE_H class math {public: int pi () cons...