Posts

Showing posts from June, 2014

debugging - Does DDD support Perl? -

Can DDD (Data Display Debugger) be used for Perl data structures? quote: What is DDD? Pearl Debugger , have a graphical front-end for Bash Debugger Bashd, GNU debugger remake, or Python debugger Footsteps

multithreading - C#: Thread-safe events -

What is the implementation under thread-safe? If not, then what am I missing? Do I need a unstable keyword anywhere? Or a lock somewhere in the OnProcessingCompleted method? If so, then where? Public abstract class process: IPCCs {Private Readonly Object Full EventLock = new object (); Private Event EventHandler & lt; Process Liquid Avent ARG & gt; ProcessCompleted; Event event handler & lt; Process end events arrow & gt; IProcess.Process Complete {add {lock (Full EventLock) process complete = value; } {Remove (Full EventLock) Process - = Value; }} Secure Fare OnProcessingCompleted (ProcessCompletedEventArgs E) {EventHandler & lt; ProcessCompletedEventArgs & gt; Handler = complete process; If (handler! = Null) handler (this, e); Note: I have a private event and clear interface stuff because it is an abstract base class. And the classes which are received from it, should not do anything directly with that incident. Class cover was added so that it is

asp.net mvc - What's the correct response to unauthorized HTTP request? -

I am writing a web application. I do not know what is the correct response for unauthorized requests, it is convenient for the user when The server responds with the 302 and redirects it to the login page. Although somewhere deep inside I think 401 is more accurate. I am also scared a bit if 302 can not be misinterpreted by search engines. How do you respond to your unauthorized requests? Edit I am using ASP.NET MVC. It is not important from the theoretical perspective. However ASP.NET forms use the authentication 302 approach. I also like the behavior when the user is guided after successfully login to the page on which he was requested. I'm not sure that this can be easily implemented from the 401 approach. Send a 401 response, and include a login form on the page on which you can return it with Come on. (This does not include a link just on the login page, include the entire form in the correct form.)

gnuplot syntax error when using python -

I'm just about finding out how Python and Gnuplot work together. I got an introduction and I wanted to execute it on my Ubuntu machine. Gnuplot gp = Gnuplot.Gnuplot (persist = 1) GP ('set data style line') # data set first (a quadratic) 1 [[0, 0], [1, 1], [2, 4], # 3 Data Set (single line) data 2 = [[0, 0], [1, 1], [2, 2], [3, 3], [3, 9], [4, 4, 4]] Plot 1 = Gnuplot.PlotItems.Data (Data 1, _ = "Lines", with Title = "Quadatic") plot2 = Gnuplot.PlotItems.Data (data2, with_ = However, I get the following error message: ./demo.py ./demo.py: line 2: syntax error near unexpected token `('./demo.py: line2:` gp = Gnuplot.Gnuplot (persist = 1)' ' Any ideas that might be wrong here? I have installed Python-GnomePlot to install gnuplot support for Python. Itemprop = "text"> Did you put a bangle in the first line? I.e.: #! / Usr / bin / python The interpreter is not executing the file.

internet explorer - IFrame Background Image not show in IE6 and IE7 -

I need help in Firefox or Opera is working fine ie i try to keep it in style file or inline style I do, but not the effect. Have you tried to permit on the Transparency Iframe = "correct" and the document body of the hair frame Background color to transparent? View the MSDN documentation on the permissions:

backwards compatibility - Java API break -

मेरे पास निम्न एपीआई है: सार्वजनिक इंटरफ़ेस MyApi {/ ** * कुछ काम करता है सामान। * @ थ्रेस माइ एक्सडेस्टेशन अगर हालत सी 1 * / पब्लिक व्हॉयड मेथड () मेरी एक्सप्शन फेंकता है; } अब मैं अपने एपीआई कार्यान्वयन में निम्नलिखित संशोधन कर रहा हूं सार्वजनिक वर्ग MyApiImpl {सार्वजनिक शून्य विधि ()) MyException फेंकता है (यदि (सी 1) { नया माइएक्सेशन फेंक ("सी 1 संदेश"); } ...}} द्वारा प्रतिस्थापित किया गया है: सार्वजनिक वर्ग MyApiImpl {सार्वजनिक शून्य विधि ()) MyException फेंकता {यदि (सी 1) {नया मेरा एक्सपेक्शन ("सी 1 संदेश"); } और अगर (सी 2) {नया माइएक्सेशन ("सी 2 संदेश"); } ...}} क्या आप इसे एपीआई ब्रेएटेज के रूप में मानते हैं? क्लाइंट का कोड अभी भी संकलित होगा लेकिन एपीआई जावा के द्वारा परिभाषित विधि अनुबंध का कोई और सम्मान नहीं है चूंकि मायएक्ससीपिटोन को "नई" स्थिति से फेंक दिया जाता है। यदि केवल मेरी एपीआई जार फाइल अपडेट होती है, तो क्लाइंट अनुप्रयोग अभी भी काम करेगा लेकिन क्लाइंट को अपवाद को पकड़ने के तरीके के आधार पर आवेदन व्

regex - Php parse links/emails -

I am thinking that there is a simple snippet that changes any type of link: from http://www.cnn.com & lt; A href = "http://www.cnn.com" & gt; Http: //www.cnn.com< / A & gt; From Cnn.com & lt; A href = "http://www.cnn.com" & gt; Cnn.com & lt; / A & gt; From www..cnn.com & lt; A href = "http://www.cnn.com" & gt; Www.cnn.com & lt; / A & gt; From abc@def.com & lt; A href = "mailto: mailto: abc@def.com" & gt; Mail: ABC @ def.com & lt; / A & gt; I do not want to use any PHP5 specific library. Thank you for your time. UPDATE I want to change the above text to change it. Please note that the href tags and text for episode 2 and 3 are different. UPDATE2 How does Gmail chat? She is pretty smart and works only for real domain names. Like A.ly works but CCB does not work. Yes,

How can I change identity property in SQL Server 2008? -

I have a table with no identity columns. Server 2008 is not allowed. So, how can I change the identity properties in SQL Server 2008? Under Tools -> Options -> Designer -> Table and Database Designer Need to rebuild the table to prevent unchecked change

md5 - Testing the robustness of a flash drive: dd'ing the drive till it fails? -

I have been given a cheap, branded 2 GB flash drive. As I have a big flash drive, I have decided to use it to test the strength of the flash technology. I am planning to write everything on 1 drive, check for accuracy, write 0, check and so on. I'll log the result, and later I'll look for the failures. I am looking for the most resource-saving technique to do this. In my current strategy, the Linux DD command is used for writing and reading, and compared to the results compared to files and zeros. Another way would be to write people and zero on the drive, and calculate the MD5 of its contents. This comprehensive IO reads and is a simple trade off between high CPU usage; I think I measure the time of each method and decide. Is there a better, more beautiful way to do this? Choose a random 32-bit number. Write that read every block in each block, re-run the new 32-bit number drive, hash algorithms like MD5 are CPU intensive. Since you really know the pattern and a

Copy MySQL table using backup -

I want to copy the content on the same table to another table on the same table. I do not want to change the name of the original or remove it. One option is to create a new table like an existing table and then INSERT ... SELECT. However, I think it can be the fastest to make a backup of my table mysqlhotcopy and then load it into another table. I'm not sure how I completed the second part of this - Shipment from a backup to an arbitrary table Foo. This is an overview: Your answer really depends on how large your desk is and how much you can stand while reading-lock time can be copied into a lot of 2 seconds. There is no way in which you cut it, you need to have some reading locks on the table, while reading it (to be constantly read in any way). InnoDB transactions can provide a way to get snapshots continuously without holding other authors. MyISAM or InnoDB will have very different backup strategies. with MyISAM There is a very quick way of doing wh

asp.net - JQuery output a dynamic control in a div -

How to handle the clicks of a checkbox to show another control in a dynamically single user control (ASP.NET) I am I do not know anything about the system you use ... / P> This user control stick on an empty blank page. When the checkbox is clicked, JQuery has the HTML content of the page user control and it is an asp: checkbox or an html input. ?

authentication - Can two different clients somehow share cookies? -

Set up here: I have a server-based application. Therefore, all the data is on the server (this is called server 'A') and users connect to that server using a desktop-based rich client. The rich client also gives the user the ability to connect to another server (this is called 'X'), which is completely unrelated to server A. Question: The user has logged into the 'X' client, and therefore the rich client has the right cookie to prove against the server X. Now, the user creates an invitation on server A, for which server A needs to go out and get some data from the server. Is it possible to deal in some way Server A was given to certify against Server X that Rich Client has already certified against Server X. Is there a way to share cookies (working as a second customer with Server A)? Or somehow the server has been returned to the authenticated request of a forwarded server X to the rich client and it resolves against the cookie in the rich customer. BTW, we

c - Bitwise operators and "endianness" -

Does everything happen with bitwall operation? Either transfer it or? I am working on homework in relation to Bitwai operators, and I can not make head or tail on it, and I feel that I have been given a lot of hunger on endlessness. This is, I'm using a small Andian machine (as most are), but does it need to be considered or is it a wasteful fact? In the matter of this matter, I am using C. Endianas is only loaded by data processor for the layout of data in memory, end The ending in is completely immutable. In terms of innings, bitwire operation, and similar performance you expect (regardless of the data being logically named as low-order bit), regardless of endlessness.

templates - What is the most useful way to document assessment of technological choices for a business problem? -

I would like to know that there are templates to do this in a clear and concise manner to give the summary of the application and its Internal work and how it meets business needs. I do not want to write a mythology, so I am looking for any new way to do this. Documenting about what exactly your system needs, you do not make a good choice. If you do not know what you want. There is a doctor-style approach. A decision matrix outline is a formatting formatting, but this is a good way to have better formatting, but not about software (it really does not matter).

oracle10g - Oracle: Does a 10g oracle client work with an 11g server? -

It is mutually present Currently, I am trying to use an instant client for Mac, version 10.2. There is no 11g version for Mac, based on now (to know the actual version of each platform you have to click on each link ... lame). I tried to connect to our Oracle 11G server, and it's just hanging forever, are they just incompatible, or something else is messing up? I would definitely say it should be. Uses SQL * Net Protocol which is essentially unchanged. Here's an example of connecting Oracle 9 to Oracle 10 server. Oracle @camie: ~ $ sqlplus "aurus / aureus @ THANOS_URS" SQL * plus: Release 9.2. 0.8.0 - Production on Thurs 25th June 05:55:57 200 9 Copyright (c) 1982, 2002, Oracle Corporation All rights reserved. Connect to: Oracle Database 10G Enterprise Edition Release 10.2.0.4.0 - 64 bit with production, segmentation, data mining and actual application testing options According to the "people" ... can talk to 11 11, 10, 9 10 at 11,10,9,8

Batch insertion of data to MySQL database using php -

I have thousands of data parsed from the huge XML to insert into the database table using PHP and MySQL. The problem is taking too much time to insert all the data in the table. Is there any way that my data gets split into a small group so that the process of convergence is based on the group? For example, how can one set a script that processes data from 100? Here's my code: foreach ($ item is listed as $ Key> $ item) {$ download_records = New DownloadRecords (); // Check if content is present for the first time! (! $ Download_records-> select-referencesSecondation ("WHERE Guid =". $ Guid. "")) {/ * Insert * /} and {/ * Update / / } * Note: $ itemList is approximately 62,000 and is still growing. using a loop? But the fastest way to load data in MySQL is to use commands, you can create a file to load through PHP, and then feed it to a different process (or in the original process). As for the final step) is to MySQL. If you can not us

winapi - WM_MOUSEHOVER in a global hook -

I have implemented custom tooltips for some controls in my application (MFC) but I want to make it normal for everyone Control. I am currently calling TrackMouseEvent in WM_MOUSEMOVE and then holding WM_MOUSEHOVER (both overwrite function window-off control). But in this way I would have to duplicate the code for every control, so my intention was to set a global hook for the events of the mouse and ask the control to display the message in the tooltip. The problem is that I am not able to capture WM_MOUSEHOVER in a global hook, this code is: hMouseHook = SetWindowsHookEx (WH_MOUSE, CallWandMouseProc, NULL, AfxGetThread () - & gt; m_nThreadID); HMainHook = SetWindowsHookEx (WH_CALLWNDPROC, CallWindProc, NULL, AfxgetThread () -> M_nThreadID); LRESULT Callback CallWandMouseProc (Int nCode, WPARAM wParam, LPARAM lParam) {if (nCode == HC_ACTION) {MOUSEHOOKSTRUCT * pwp = (MOUSEHOOKSTRUCT *) lParam; Trace (_T ("Message:% x hwnd:% xx:% dy:% d \ n"), wParam,

c# - How do I get the Current User identity for a VPN user in a Windows forms app? -

We are currently developing a Windows SmartClient that requires users to authenticate to use their ad group membership is. Now we need some users to join VPN. Can I get a group from advertising account identity and VPN login anyway? WindowsIdentity.GetCurrent () returns local user accounts instead of their VPN account information. The local account name is different that the advertising account is used for the VPN connection. Ie the user is on their home PC, and the advertising account to connect to the office by using their work. If their computer is in the domain and they log in under their advertising credentials, you are good WindowsIdentity.GetCurrent () will return true. If you are in the VPN network but not in AD, then you are out of luck. Try to run your program as an AD account. If you certify correctly in the "run as" dialog, then WindowsIdentity.GetCurrent () should be correct.

version control - Versioned File System like web interface -

I am trying to find a free software that will provide a web interface to a file system (so you add / remove Files / directory, possibly edit them) If possible, it should be varianting (only needs simple things: back to previous versions), and user management should handle. Can you point me to something like that? Thanks Update 1: I'm looking for a solution that will work on Unix (like Linux). Update 2: There is some trick like a dissection web interface on Apache server, sorry I can not find any user-friendly subversion web interface, do you? With this, users have been allowed to create new content. You want something that supports something called Web Distributed Authoring Version (see WebDAV) Apple The mobile management does this, as it does on httpd, as is the MS SharePoint. In fact, if you just want the functionality of WebDF for free, try Subversion and Apache.

java - In TestNG in @AfterMethod how can I know the test result? -

I have several testgag test classes that extend all of a base class AbstractIntegrationTest . In the Superclass, I have a Mehod common practice method which is brought after every test method and does some cleaning. What do I have to do in this method, eg if the test fails, then I want to dump a test file for further investigation. The problem is that I need to do this exactly in the commonAfterMethod because it roll-backs on the database and the data is later lost. Thanax Perhaps you can do something with a test listener instead ? See and.

c++ - How to split the strings in vc++? -

I have a string "stack + ovrflow * newyork;" I have to divide this heap, overflow, New York Any ideas ?? First and foremost, if available, I encourage this type of work: tokenizer Always use (see the great answers given below) Without access to promotion, you have a few options: You can use C ++ std :: You can use strings and can be parsed using stringstream and gateline (the safest way) s Td :: string str = "stack + overflow * newyork;"; Std :: istringstream stream (str); Std :: string tok1; Std :: string tok2; Std :: string tok3; Std :: getline (stream, tok1, '+'); Std :: getline (stream, torque 2, '*'); Std :: getline (stream, point 3, ';'); Std :: cout & lt; & Lt; Tok1 & lt; & Lt; "," & Lt; & Lt; Tock 2 & lt; & Lt; "," & Lt; & Lt; Tock 3 & lt; & Lt; Study :: Endel Or you can use a family of the Fractok family (if Unidod is the answer to an agnostic ver

javascript - How do you get the length of a string? -

आप jQuery में स्ट्रिंग की लंबाई कैसे प्राप्त करते हैं? आपको jquery की आवश्यकता नहीं है, बस yourstring.length का उपयोग करें संदर्भ और भी देखें।

c# - Get property name inside setter -

I want to preserve an asset between postback in an asp.net application. Currently doing this: public ININxX return to session [toString (+) + "My index"]; }} but would like something like this: public int MyMendex {get {return (int) session [toString () + # code_that_returns_property_name #]; }} The setter has been omitted, but it pushes the value in the session using the same string. Is there a way to use reflection, or a different better solution? public static id dummy {get {var propertyName = MethodBase.GetCurrentMethod (). Name Substring (4); Console.WriteLine (property); Return 0; }}

django jquery ready event not firing -

I have a project in Django, but for some reason basic jQuery is not working. & lt; Html & gt; & Lt; Top & gt; & Lt; Link href = "/ site_media / css / poll.css" rel = "stylesheet" type = "text / css" & gt; & Lt; Script type = "text / javascript" src = "/ site_media / js / jquery-1.3.2.js" /> & Lt; Script type = "text / javascript" & gt; $ (Document) .ready (function () {warning ('hi there');}); & Lt; / Script & gt; & Lt; / Head & gt; etc ... There is no firing incident created for any reason Jquery and CSS are definitely present (Firebug confirms this for me) on page There are no JavaScript errors. Am I missing something completely clear, or there is something subtle in Django so that the configuration needs to work with jQuery. Edit : In fact, Jquery does not work after importing any JavaScript! A & lt; Script type = "text / javascript&

python - Is Pylons enterprise-ready? -

I am a developer who is looking for an enterprise-ready web application framework for Python. My main concern is long-term support, comprehensive convenience set and reliability. I am experimenting with Pyleans and after my terrible experience with Ruby on the tracks on Windows, where I had to compile my own post-driver driver, Pilanes and Python were an accidental money is. I believe that Python is 'enterprise-ready' because of a very strong community and commercial interest, due to the number of 'available' libraries and their efforts to maintain some thresholds will be of Python 3.0 My concern for backward compatibility is: Do we all say the same for all 1937 pylons? One way to note, I think how SQLite is working on piles with DB2 so that I can automate the original CRUD functions, the current DB2 driver is quite useless, only SQLLMM 0.4 Supports Do you think IBM is committed to working DB2 with SBKLKme for a long time? Or do you feel that it is better to

performance - Is LINQ to Everything a good abstraction? -

The spread of new LINQ providers is really amazing and with a lambda expression, anonymous type and a few syntax sugars, There is an elegant combination that helps in easy reading. Everything is LINQ from the web services so far, as if it seems that someone can be IQueryable & lt; T is creating for everything but these data sources may have fundamental different performance, latency, availability and reliability features. It gives me a little bit of time to say that LINQ will execute those performance details Makes the developer transparent. Is LINQ a solid general purpose abstract or a RAD device or both? For me, LINQ is just a way to make a code more readable, and therefore more conventional LINQ standard methods Does nothing more than and integrates them into language (hence the name - language integrated question). This is a syntax element around common interfaces and methods - there is no "magic" here, and in fact LINQ-to-something (IMO) is considered a

asp.net - MvcTextTemplateHost not found -

I am trying to use a T4 template in my MVC project. It only suggests you to copy existing T4 templates and go from there to MVC in your solution. However, when I try to compile, I get this error: Compiling the error 1 compilation: The type or namespace name 'MvcTextTemplateHost' could not be found (whether you use the instructions or a Assembly references are unavailable?) I do not know which legislation it can live in, and this does not help with Google, does anyone know what assembly Should reference? Right click for each template, select property and custom tools property . It has worked for my projects.

localization - Distributing localized winforms app -

This is related to my initial post today: So now I have two different localization, An English, a Spanish. Now suppose that I have a big app, suppose it supports localization in 15 different languages. In the previous post, it was suggested that after adding the form to localization, I add some lines. Currently I'm clicking once to apply my application. I am trying to find a way to deploy without the app's 15 different flavors. Is there a way to see the localization of the current user and if it matches one of those languages, then I have written my screen to use it, otherwise used the default? The underlying localization system of the .NET framework already handles this fallback status. You can just install satellite DLL, which locates your form and controls and if the right user matches the locals, then the NAT will use it, otherwise it will fallback to the next parent guard locale. For example, if your app's default language is N-US but you have provided an N-

c# - Repeater with paging through ObjectDataSource -

Is it possible to apply custom paging to the repeater using ObjectDataours: EnablePaging = "True" max. Rowspermmentnatal = "max rouz" startAUNDEXAPAM MTN = "startrvindex" selectCoparamp = "total numberofproducts" & gt; Or I have to set all the values ​​back in the code and pass the parameter of the ObjectDataSource: & Lt; ASP: parameter name = "max rouge" dbtv = "int 32" default value = "10" /> & Lt; / SelectParameters & gt; Repeater does not support paging as and you do not use it objectstrokes can do .. . But if you want to paging, you have to handle at the code level ... I paging at the code level for the dentists because the donor does not even support paging ... If you need the code I can provide you .... call bind RPT method when you want to bind the repetitive data, note: handle this example, next, back, last, first button .... if anything is clear No, plz tell me pr

python - wxpython: How can I redraw something when a window is retored? -

In my wx.frame-based wxpython application, I have to draw some lines on a panel when some event is created by making a wx.ClientDC example Are needed when needed The only problem is that if the window is minimized and then restored, the lines disappear! Thank you! Only you should be pictured at wx.EVT_PAINT, so bind the event to init self.bind (wx. EVT_PAINT, self._onPaint) In _onPaint, use wx.PaintDC such as DC = wx.PaintDC (self) dc.DrawLine (0,0,100,100) < / Pre>

jquery - Integrate Galleriffic with Lightbox, how? -

Anyone have an idea how to interfere with lightfix 0.5 with lightbox? () When you click on the download button / text, I want to open the image in a lightbox. Gratings, Base To complete this, When the captions are loaded, call the lightbox function. To do this, you will need to do this in transition to the gallery: ... onTransitionIn: function () {$ ('#slideshow'). FadeIn ('fast'); $ ('#coptions') Feedin ('sharp', function () {$ ('# caption a. Lightbox') light box ();}); }, ... Hope that helps!

c# - What is a clean/intuitive approach to extending a sealed class in .NET 1.1? -

I'm in the process of architecting a library that will be used in many parts of the product and part of its work. The functionality is to increase which is not present in .NET 1.1, because we need to use it. Perhaps the best example of this is the String.IsNullOrEmpty method, whose functionality we depend heavily on heavily. In the string class the .NET is sealed; I have thought of using the adapter or decorator pattern to wrap up the original string and increase the functionality of the class, but I'm not sure what I'm trying to do, this is a very intuitive approach. I have also seen a similar question, but it again raises the issue which I have just mentioned. I can definitely use the functionality that uses the adapter, but I am not able to imagine it is for each string: bool IsEmpty = new StringExtensionAdapter (myXmlNode.SelectSingleNode (myXpathString)). IsNullOrEmpty (); If (AETT) {// do something} I do not like to dislike this view, but it seems that t

c++ - How to build a Visual Studio 9.0 solution from Cygwin and get build output? -

I am trying to set up an automated build system on Windows using signin. In addition to other things, it should be able to create many Visual C ++ solutions. I have a script that sets the required environment variable for devenv, and if I type 'devon' it brings the Visual Studio IDE $ devenv mysolution.sln / build debug There is no problem with the problem yet. I am also able to create a solution by writing from Basu's Bass prompt is that it is not showing me the output output. Actually, it also does not tell me whether the build is successful or No. The command just ends, and if I get back to the prompt, I can go to the output directory, and check whether it was made executable, but for a build system I would be able to grep for errors I like. What am I doing wrong? I can see the debug output when I run devvv in windows shell, but not in signin. Where is it being sent, and how do I return it? find and run sigwin. Com files? There are 2 devenv executab

c# - Adding one event handler to another -

I have a class that wraps another class and exposes many incidents from that class of wrapping. (For example it changes). I used the following code: Public event eventHandler Annievent; Public other class inner {get {/ * ... * /} set {// ... if (value! = Null) value.AnEvent + = AnEvent; // ...}} However, incidents were raised inconsistently. What's wrong with this code? - - Here are two problems ... First: Both In cases, you are raising the external event with the wrong sender Anyone subscribing to an event on the outside class will expect that those classes will be picked up from the sender of that external class. This is especially applicable to the wifier control or compulsive list, where sender is used to identify the object that would share a handler. Are there. It should be something instead: zero Inner_AnEvent (object sender, EventArgs e) {var handler = AnEvent; If (handler! = Null) handler (this, e); } The second (more modest) issue is that y

.net - Contract-First SOA with WCF -

Hello Stack Overflow Guru! This question is more for a special investigation, which, in practical situations, what people are doing in the community, more than a particularly targeted question. I have searched a lot about this, and when I have a lot of bloggers who support the contract's first service design and support some comments, I still have more practical information about implementing the contract - first Doing this in real-world environments with WCF, professional and opposition, etc. I have done some extensive research in SOA recently, primarily through the books of Thomas Erls, and one of the primary concepts is that it is contract-first design. My questions, or rather the questions, are as follows: How can you contact the contract - the first service design .NET and WCF? Does the contract generate both customer and service? (Anything that integrates with VS will be ideal) Contract-With the first design and WCF, what did you face the real world professionals

Easiest way to persist a data structure to a file in python? -

मान लें कि मेरे पास ऐसा कुछ है: d = {"abc": [ 1, 2, 3], "क्वार्टी": [4,5,6]} progammatically का सबसे आसान तरीका क्या है जो उस फ़ाइल में मिलता है I अजगर से बाद में लोड हो सकता है? क्या मैं इसे किसी अजगर स्रोत के रूप में सहेज सकता हूँ (एक अजगर स्क्रिप्ट के अंदर से, मैन्युअल रूप से नहीं!), फिर import बाद में? < P> या मैं JSON या कुछ का उपयोग करना चाहिए? मॉड्यूल का उपयोग करें। आयात अचार करें = {"एबीसी": [1, 2, 3], "क्वर्टी": [4,5,6]} एफ़िल = ओपन (आर'सी: \ डीपीसीएल ',' वाईबी ') Pickle.dump (d, afile) afile.close () # फ़ाइल को फाइल से खोलें 2 = ओपन (r'C: \ d.pkl ',' rb ') new_d = pickle.load (file2) file2.close () # मुद्रित शब्दकोश ऑब्जेक्ट फ़ाइल प्रिंट से लोड new_d

sql server - Set A Variable From A Table -

If I want to set a variable to a field in a table, I usually < Code> SELECT @UserIdToUpdate = userId from #NewUsers In this case there will be many results and I just want the first one so I tried to do it but it failed and invalid syntax top SELECT @UserIdToUpdate = TOP 1 #NewUsers from user-plus If this is the case, then I would just be the first example without the top. I can obtain? I think this will only take the first record? I know that this seems like strange thing to do, but the command is in a loop, so it will select a record, do something with it, remove it and select the next one. Alternatively, SELECT @UserIdToUpdate = (SELECT TOP It will work even when found in zero rows.

c# - Resize my image on upload not working - what must my buffer be? -

This is the code I received from I want the user to upload a photo and then resize ............. public sub Risfrem stream (byline image as Sevpth string, integer as by Val Maksswaid Saijyug, by Whal buffer system. as Aiosstrym) dim Intnvevthth fixtures integer dim imgInput as intNewHeight dim System.Drawing.Image = System.Drawing.I mage.FromStream (buffer) determines fixed image format dim fmtImageFormat as ImageFormat = imgInput.RawFormat '' As Integer = image as imgInput.Width original width and height intOldHeight get dim intOldWidth dim int = imgInput.Height, either landscape or portrait dim intMaxSide integer as (intOldWidth & gt; = intOldHeight) then intMaxSide = intOldWidth otherwise intMaxSide = intOldHeight end if (intMaxSide & gt; MaxSideSize) followed by 'new width and height set as dim dblCoef double In = MaxSideSize / CDbl (intMaxSide) intNewWidth = Convert.ToInt32 (dblCoef * int OldWidth) intNewHeight = Convert.ToInt32 (dblCoef * intOldHeight

.net - Is there any method to clean the website unused resources -

Is there any way to clean up unused resources? CSS No more than website Images which are not more than website Javascript function This Things are required when the website is completed and ready for deployment. is a Firefox add-on that will be used by unused CSS selectors.

c++ - Reading from a file not line-by-line -

Specify a QTextStream as a QFile and it By reading line-by-line is easy and works fine, but I am surprised that the performance can be insulated by first saving the file in memory and then processing it by line-by-line. Using sysinternals, I have encountered that the file is read in a section of 16 kb and since the process I started, it is not big (~ 2 MB, but many !), It would be a good thing to try to load them into memory Any ideas how can I do this? QFile is placed inside from QIODevice , which allows me in ReadAll () in QByteArray , but Then how to proceed QTextStream has a ReadAll function: Surely all you need? Or you can read all and QTextStream can take it as an input rather than a QFile.

database - Full Text Search primer? -

Do any good books / papers / articles (articles) get full text search (and maybe indexing in general) I understand What is happening behind the scenes of my applications, and I'm having trouble understanding why Sphinx and other external FTS drop MySQL / MyISAM into dust. To understand full text search from below, I suggest "managing gigabytes".

webdav for wsgi/python? -

I want to add WebDAV to it. It would be easy if I could find a simple WSGI component that applies WebDAV. I found, but it seems that the emphasis is on using the external configuration file. I want to control everything through a Python API. Any ideas? Thank you I recently picked PyFileServer for further development: < / P> After the config file is read, it is just a plain dictionary dictionary, which is given to the constructor of the WSGI application object, so it should be very easy to do what you want to do. I have not used the wifi yet, but you are invited to contact me or join the project: -)

reflection - Using Custom Attributes from Within Constructor - C# -

I want to use custom attributes on the field in the classroom. I want to use the attributes placed on the field during the field constructor. Is this possible? Edit 28.06.09 Below are some kind of pseudo-code class Viseshank { Int _intVal; Int _maxVal; Get specialty for public specialINTIS (// instant peninsula _maxwal = GetAttribute ("maxwale") }} class main () { [MaxValue (100)] Speshlistaiaianti; Public main () {sInt = new SpecialInt ()} } Sure it is possible that the attributes are stored in metadata and it can be easily accessible during the creation of an object. public square fu {[some] public int field 1; Public Foo () {FieldInfo fi = typeof (Foo) .GetField ("Field 1"); Some facts = (some object) fi.GetCustomAttribute (type (some object), wrong) [0]; // Close any custom attribute Fiield1}}

Javascript Window.Opener Object Null on .NET WebBrowser Control New Window -

OK, I have a pop up in the .Net Framework's webcure control that I capture with the Newwanda event handler I am Web browser w = new webbrowser (); SHDocVw.WebBrowser_V1 Web = (SHDocVw.WebBrowser_V1) w.ActiveXInstance; Web.NewWindow + = New SHDocVw.DWebBrowserEvents_NewWindowEventHandler (web_NewWindow); The new popup webbrosor is in a new form with a new example of control zero web_NewWindow (string url, int flag, string targetframeName, ref object PostData, String Header, Ref Bull Processed) {Processed = true; Web browser w2 = new webbrowser (); Form popup = new form (); PopUp.Controls.Clear (); PopUp.Controls.Add (W2); W2.Dock = DocStyle fill; PopUp.Show (); W2.Navigate (url); W2.DocumentCompleted + = New WebBrowserDocumentCompletedEventHandler (w2_DocumentCompleted); } My problem is that the window.Opera object is zero in the process The user uses that field to return that area to the original window and the form But fills some values. Is there any window to

java - What is the best way to serialize an EMF model instance? -

I have an Eclipse RCP application with an example of an emf model populated in memory, for the use of external systems that model What is the best way to store? During login time and may be later. The read and write model of the model is very balanced and can sometimes be a second time. I think Hibernate + Tiño + EMF will work well, but I want to know what the other options are. I am using CDO (Connected Data Objects) together with emf, do something similar . If you use examples of Eclipse Wiki, it does not take much time to run. Some warnings: 1) The data that changes frequently, you may want to use non-audio mode for your persistence. Otherwise, you will save the new version of your eObacked with each commit, retain the old ones too. 2) Every time you change your data, 3) Even if you choose to do this, you also have a flexible locking option. My application uses the Derby firmness, though it will be migrated in SQL Server long ago. Eclipse Live () is a 1-hour

sql server - Get the last day of the month in SQL -

I have to meet in the form of a date in SQL, on the last day of the month. If I have the first day of the month, then I can do something like this: DATEADD (DAY, DATEADD (MONTH, '2009-05-01', 1), -1) < / Code> But does anyone know how it is normalized, can I get any date for the last day of the month? This is my version; No string manipulation or casting is necessary, only one to each DATEADD , YEAR and MONTH function: announcement @ test date set @ test = gate-date () - or Select another date DATEADD (month, ((year (TTES) - 1900) * 12) + month (@ test), -1)

graphics - Drawing pies using PHP ImageMagick -

Is using PHP Image Magic a way to get results of GD function? I have looked around but have not found a satisfactory solution till now. I want to support it transparency, and I want to draw it. Your best bet is to use ImageMagick Draw ::. There is a mandate in it; Instead of specifying the center, you specify the border rectangle. To stop filling, you need to add an order before it, and perhaps after stopping filling.

Implementing document management with an ASP.NET MVC front-end -

I have implemented a website for a client who maintains editable articles Uses .net MVC and manages content by storing it in a 'content' table in the database and creating a simple admin section of the site, where the user can add / edit / delete the content and select where the site is located Will appear. Now the client has returned the complete document management features. They want version control, permissions, PDF export and simple workflow on all control materials. I am debating in my head how to do it. I came to know that where many people are WSS (Windows SharePoint Services) has been recommended. The thing is, I want to build myself the admin interface and want to make it easy for actually to use the customer. P> Will WSS allow me to do this? There is functionality for storage and version of WTOS documents, and workflow I do not think PDF conversion is not part of WSS, but you can use a third party tool. You can use the WSS UI for the adm

windows - C Runtime objects, dll boundaries -

What is the best way to design a C API for the DLO which is dealing with the problem of running "objects" Runtime is dependent (File *, Indicator, come back by Molok ...). For example, if two DLLs are connected to the second version of the runtime, then my understanding is that you can not pass from one file to another * securely with a DLL. What is Windows-dependent API (which is guaranteed to work in DLS)? The C API is already present and mature, but was designed by Unix POV, mostly (and still have to work on Unix). You have not asked for a C ++ solution for C. There are general methods for this type of object in C: Design the module API for not just requiring CRT objects in raw C. types Get the goods to pass - that means the user needs to load the file and just pass the pointer to you. Or, internally opened, read and closed, get a consumer who passes the fully qualified filename. One method used by other C modules, some sections of the MS cabinet SD an

PHP: direct call another PHP web applications without going through the usual HTTP call -

I have two PHP web applications. All applications are located on the same computer. Each application will run independently. Now, can I make a direct API call from one PHP app to another? I do not want to go through either the webservice or the normal HTTP call, which includes HTML responsiveness, I want to call App A from App B using direct method call, as if those two apps are the same application. How to do this? requirement or include to include the code in another PHP script Are there. If you have not done this before or have not designed it, then you may need to remove the function from your script (s), put it in a central file and include In all the scripts that need it (which, of course, they were originally!) Remember that included included its embedded HTML to include a file in another So you can Usually those PHP files can contain, for which only the functions are, which you are asking for to receive. Then you call the function, as it was written in th

linq - Whats the best SQL Query to get Related Items? -

I have a small site where I want to get related video based on tags ... best MS SQL To get related videos based on tags 2005 queries you can give LINQ queries that will be awsome Here is the database schema:. Create tab video (VIDEOID BigInt is not empty, title varchar (100) zero, tag varchar (max) zero, isActive bit zero) Insert video value (1, 'Bayonas Shakira - beautiful false Enter the video value (2, 'Beyonce ego remix', 'Bayonas, music, video', 1) in the video value (3, 'Beyonce ego', '', 'Shakira, Bayonas, music, video' Beyonce, Music, Video ', 1) What I want to do is watch the video with ID 1 on its tag Related videos should be shown on the basis and the most matching posts should be on top. In advance thank you Schema will tell you, denormalized with all tags for each video The tag is filled in string, badly designed for its purposes - there is no proper way to calculate a meaningful calculation in TSQL "e

c# - send mouseclick message in .net -

I would like to send a mount click from user control with user click when a control is selected in the user control. I have tried: private const int MOUSEEVENTF_LEFTDOWN = 0x02; Private Constant MoEEEEEETFLLTTP = 0x04; [DllImport ("user32.dll")] Private static extern zero mouse_events (UInt32 dwFlags, // speed and click option UInt32 dx, // horizontal position or UInt32 dy, // change vertical position or UInt32 dwData, change wheel movement / IntPtr DwExtraInfo // application defined information); Mouse_Auvent (MUEEINTNTLIFT, 0, 0, 0, new system. INTPTR ()); Mouse_Event (MoUEEEENFLLFTTP, 0, 0, 0, New System. INTPTR ()); But I have not had any success in getting the event happening on the parents. Perhaps there is another way to cascade down for a mouseclick? Thanks To trigger the click event, click Control. InvokeOnClick can use for your parent form. See this stack overflow for details

.net - Siverlight setup issue -

If I only use Siverlight application on server (Ather ASP.Net page or HALP page,. Using Windows Server 2008. Thanks in advance, George You do not need to install anything, just deploy files, however, if you are on IIS 6 (like Server 2003 scenario), then you have to type MIME type for the XAP files Need to do this (see how to do this). IIS7 should give the XAP files by default. Of course, you should also make sure that if your server is required Correctly configured for ASP.NET, but it is not related to Silverlight.

Drupal: route nodes links to a view -

Getting started with drupal (especially CCK and view), I'm sorry that this is a basic question. I have some fairly complex scenes that show some custom content types with an attachment below so that I essentially see adding multiple tables in one view. Assume that these pages are named / person / 64 , where the person is the name of the name and 64 is the node ID. I am displaying the node field in different parts of this view, on which you are clicked directly on the node. This is what I do not want to do. Instead I want you to move a node link in one view. Therefore, instead of / node / 128, I would like to rewrite it as / incident / 128. I tried to create a custom link in the view, but the correct parameter is not available to me. I can write the link as best I / Event / Eventual, but it will come in my attachment Does not work with arguments. What is a clean way to do this? Try adding a node ID as one of your fields and exit the display Check the box so t

can a GC be implemented with C++ raw pointers? -

I was thinking that the garbage collector can be implemented with full power of C ++ pointsers. Also, in languages ​​like Java, I can not specify the literal addresses for references. It is very flexible in C ++. I believe that there are both in C #, but then, in C #, the insecure indicator is the responsibility of the programmer. EITD :: People, if I am currently in C ++ Points, then what can be done in GCI or not? Pointer arithmetic is not a fundamental problem. GC's are all being fixed again, and the indicator is being done all the time. Arithmetic is another example of that. (Of course, if indicative arithmetic is allowed between the indicators pointing to different buffs, then this can cause problems, but it is not. The only arithmetic that allows you to display on the pointer pointing in an array It is the one who restores it within that array. The real problem is the lack of metadata. A GC should know what the indicator is and what does not If this value ha

java - How to find out which HTML button was pushed in my servlet? -

I am creating a registration form with two submit buttons. I should know what button was clicked in my servlet code is? Read the answers for . Then, in string button 1 = request.getParameter ("button1"); String button 2 = request.getParameter ("button2"); The value that is not pressed is the button pressed. Or, if you want to use the same name for two buttons, then you can set a different value & lt; Input type = "submit" name = "act" value = "delete" /> & Lt; Input type = "submit" name = "act" value = "update" /> then string act = request. Jack parameter ("work"); If (act == empty) {// no button has been selected} and (if act.equals ("delete")) {// delete button was pressed} and if (act.equals ("update")) {/ UPDATE button was pressed} and {// somebody changed the HTML and sent a different price! }

php - Good Image Resizing Framework -

I'm currently resizing images in PHP, and 2-2.2 seconds in my current code (not including upload time ) Let's replace an image in two sizes, one thumbnail size and one size in a medium size. Can someone recommend a framework or class that I can download, which will change the size of the images? Thanks I have used for a long time, and this is great Works.

wpf controls - How to make my WPF UserControl work with CompositeCollection -

I have a wpf user control that displays an IEnumerable items Source Dependency Property I bind this property to a ListBox control in my UserControl. I would like to know how a compositeclass is given, how can I do my user control work? Currently I'm using my control like this: & lt; My: uc & gt; & Lt; Mary: uc.ItemsSource & gt; & Lt; CompositeCollection & gt; & Lt; Collection archive = "{my binding}" & gt; & Lt; / Consolidate & gt; & Lt; Collection archive = "{my binding}" & gt; & Lt; / Compatibility & gt; & Lt; / CompositeCollection & gt; & Lt; / Mary: uc.ItemsSource & gt; & Lt; / Mary: UC & gt; I have to display the content of these collection contents in this list archive box, but do not count it through the container at this time. My listboxes are only two "System.Data.CollectionContainer" items Are there. [B] EDIT: [/ B] XAM designer informs me that "

c# - Parent window and thread affinity -

I have a WinForms application where I want to do some long-standing tasks, e.g. Copy Explorer 2 large files into parallel. For each of those long-running tasks, I'm starting a separate UI thread (which includes pumping messages / apps). Where I make an example. Run / Application.ExitThread I am thinking - due to the connection of the thread of windows - to package the main form handle in a HandleRef and pass it as the owner / guardian of the progress dialogue. Is the legal, which is on a different UI thread? I'm not entering secondary UI threads (no cross-thread exception exceptions in debug mode) to main window handles, only to give it to native function. Thank you. Yes, it's okay windows allow different thread windows to parent / child's relationship gives.

Facebook session is expired even though I am logged in to facebook -

I am using Rails with Facebook and when I connect to Facebook, then to register a new user For, I ended one session when I retrieve details such as first_name and so on. Note that when I browse facebook.com, I am logged in. But it seems like there is an old session of my app. How can you fix it? You probably have an older session from the previous session, try it:

php - How to log every single access to my website with 2 different domains -

I have two different domains that both point to my homepage in the same server. I want to log in to each entry on my homepage and login to know which domain I used to access my homepage, how can I do this? I tried mod_rewrite in apache and entered a mysql database with php but all i have is infinite loop. Any thoughts? Edit: From your reply, I see that I did not find what I want .. As far as I know that Google Analytics does not allow me to differentiate the domain, if they both point to the same site and also see this to me Does not allow that some files like images were directly accessed instead of my webpages. I just can not use the $ _SERVER ['HTTP_HOST'] reason as I said now, I want to log everything, such as images and all other files, every single request, even if it exists Not in For Webalizer, I have never seen that this difference is in the domain, it always configures the default domain in the account and uses it as root, it does not even display

java - Should we use type cast for the object.toArray()? -

स्ट्रिंग [] a = c.toArray (नया स्ट्रिंग [0]); सबसे पहले: क्या मुझे यहाँ डाली गई प्रकार की ज़रूरत है? (मुझे लगता है कि हमें (स्ट्रिंग []) c.toArray (); की तरह लिखना चाहिए, लेकिन मैंने इसे बस कास्ट कोड के उपयोग के बिना सिर्फ c.toArray () के रूप में देखा है। यह मान्य है? दूसरा: इसके अलावा हम क्यों new string [0] यदि आप प्री-जेनेरिक जावा का उपयोग कर रहे हैं, तो आमतौर पर केवल टाइप की ज़रूरत होती है। अगर आप Collection.toArray (T []) के लिए डॉक्स देखते हैं, तो देखें कि यह जानता है कि जिस सरणी को लौटाया गया है वह उसी तरह के सरणी के प्रकार के समान है। तो, आप लिख सकते हैं: सूची & lt; स्ट्रिंग & gt; list = new ArrayList & lt; स्ट्रिंग & gt ; (); List.add ("Foo"); स्ट्रिंग [] सरणी = list.toArray (नया स्ट्रिंग [0]); आप संग्रह को बताते हुए सरणी में पास यदि आप एक सूची & lt; OutputStream & gt; है, तो आप उस कन्वर्ट को एक Object [] में बदल सकते हैं। , एक स्ट्रीम [] या बाइटए RreOutputStream [] - जाहिर है बाद वाले केवल काम करने जा रहे ह

datetime - Where can I find documentation on formatting a date in JavaScript? -

I noticed that JavaScript's new date () function is very much in accepting the date in many formats It's just clever. Xmas95 = New date ("25 December, 1995 23:15:00") Xmas95 = New Date ("2009 06 12,12: 52: 39") Xmas95 = New Date (" New Date () While calling the function, I did not see any valid string formats anywhere. / P> This is a string Is to convert to a date. If we look at the opposite direction, i.e., the date object is converted to a string, so far I was under the assumption that kis in javascript There is no built-in API for formatting the date object in a string. Editor's note: The following approach is an inquiring attempt to work on a particular browser But not works normally; see answers given on this page to see some real solutions. Today , I'm played with the date toString () To clear and surprisingly it serves strings for the purpose of formatting a date. var d1 = new date (); D1.toString ('y

memory paging with D -

I am using D / Tango for indexing indexes, with no dictionary paging for memory (RAM) Which library is in memory and can go up to 10 GB while indexing? what kind of help do you need if you only assign memory The operating system will take care of paging automatically. If you want an on-disk structure, use a memory map file. / div>

java - Using a byte array as Map key -

Do you see any problems using a byte array as a map key? I can havehed by new string (byte []) and string but it is easier to use byte [] . The problem is that byte [] is equivalent to Object identification uses and hashode , so that byte [] b1 = {1, 2, 3} byte [] B2 = {1, 2, 3} will not match in a hashm . I see three options: Wrapping in a string , but then you have to be careful about encoding issues (you have to make sure that byte -> String -> Byte gives you the same bytes. Use the list & lt; byte & gt; (can be expensive in memory). < Li> hashode and equal . to use the contents of the byte array

Get Next and Previous Elements in JavaScript array -

I have a large array that contains non-sequential IDs, which looks like this: Photo List [8 9 7] = New Array (); Photo List [8 9 725] ['Imaged'] = '89725'; Photo List [89725] ['Image Size'] = '123'; Photo List [8 9 726] = New Array (); Photo List [8 9 726] ['Imaged'] = '89726'; Photo List [8 9 726] ['Image Size'] = '234'; Photo List [8 9 7 7] = New Array (); Photo List [8797] ['Imaged'] = '89727'; Photo List [8 9 727] ['Image Size'] = '345'; Etc. .... I am trying to find out, given an ID, how can I get the next and previous ID ... so that I can do something like this: & lt; Div id = "current" & gt; Showing you ID: 89726 Size: 234 & lt; / Div & gt; Get pre-next Obviously, if we are beginning or beginning the array, then we just have one message ... Why do not you add properties to 'Previous'? 'Next' for that array? Photo List [8 9

background - How to set the SystemColors.HighlightBrushKey in WPF with a Converter -

I'm trying to set up SystemColors. Highlightbrush is always a bit darker than the background of the selected row. Therefore use this code im: App.xaml: & lt; WPFTests2: SelectionBackgroundConverter X: main = "SelectionBackgroundConverter" /> & Lt; SolidColorBrush X: Main = "{x: Static SystemColors.HighlightBrushKey}" color = "{binding background, converter = {StaticResource SelectionBackgroundConverter}}" /> & Lt; /Application.Resources> Window 1 XML: & lt; Window x: orbit = "WPFTests2.Window1" xmlns = "http: /ssites.microsoft.com/winfx/2006/xaml/presentation" xmlns: x = "http://schemas.microsoft.com/winfx/2006/ Xaml "title =" window1 "height =" 300 "width =" 300 "loaded =" window_loaded "& gt; & Lt; Grid & gt; & Lt; List Box X: Name = "LB" Horizontal Alignment = "Statch" Vertical Element = "Statch&q

dependency injection - How can I get Castle Windsor to automatically inject a property? -

I have a property on my classes for the logging service. Private ILogger logger = NullLogger .Instance; Public illogger logger {return logger; } Set {logger = value; }} and I have this component in registration: container.edffiliate However, Windsor does not inject the logger - am I missing something? The lambda parameter for AddFacility is actually a creation callback (it is called when the function is not ), Not a factory Use it instead: container.adfabiliti ("logging", new logging functionality (logar implementation.log 4 net, "path_to_lignet config")); BTW Windsor uses property dependency automatically, whenever it may happen.