Posts

Showing posts from April, 2010

delphi - Pre-sorting analysis algorithm? -

It is a famous release with the query that when the data is in the set or in almost ordering order, the performance is very bad In this case, the summation sort, which is usually very slow, is easily the best option. The question is what is to use. Whether an algorithm is available to run through a data set, a comparative factor is applied, and returns a report on how the data set is running in a sequential way? I like Delphi / Pascal, but the examples are not very complex, so I can read other languages. As you expect, many ideas go into this means of mean-of-three techniques That the worst case behavior of Duchessert is not for sorted data, but rather for less obvious cases. is quite exciting, because it quickly avoids the worst condition of the Quadratik. Instead of its natural question, "How do I find that the data is almost-sorted", it effectively asks itself as it is, "Is it taking too long?" If the answer is yes, then it goes from quicksource to

python - Do dicts preserve iteration order if they are not modified? -

If I have a dictionary in Python, and I repeat it once more, and then again, what I have not inserted, removed or updated any item in the dictionary, should be preserved? (But I could see-up) what's here dict.items () says: dict.items () Return of a copy of the key (value, value) of the dictionary. If the item (), key (), value (), etirts (), eterrese (), and iTevilViews () are said to have no interference in the dictionary, the lists will be consistent. . I think it's fair to believe that if you do, the ordering of that order will not change.

selecteditem - Getting previously selected item in select box with jQuery -

I have an item HTML selection box, on which I want to know what was selected before changing the item Selection of items. Until the change is removed, it is too late: $ ("select"). Change (work () {var str = ""; $ ("select option: selected"). Each (function () {// This is the current selected item (new) str + = (this) .text () "Docs" Docs says that 'The change event sets a fire when a control input loses focus and its focus is revised by obtaining a focus . ' However, the 'blurred' event does not seem to be the perfect organizing event and there is no incident of "onFocusLost" type. Is it a cross- a lot of hoop jumping Browser compatible ways without? The value should be captured before this change as soon as the user opens the selection menu, Will be caught, but in reality they choose something before they. $ (document) .ready (function () {$ ('select'). Focus (function () {var theValue =

C#: Are nullable types (int?) objects? -

I understand that there are no objects in type C of the value, that is, they do not get from the system. Object. Assuming this logic puts my logic at this point, like int?, Are things that they inherit from the object? If so, do they subject all rules and constraints to other things, or do they have special rules governing their behavior? Just as a reference, this question comes from the investigation of the functioning of the null cooperative operator. wrong - value types are objects, but they are not identical to the reference types Behave - instead of pass-by-reference they are pass-by-value, Nullable & lt; T & gt; (which is T? ) is a straightforward, and therefore comes from System.ValueType and System.Object. In the C # compiler, there is a magic that makes it difficult, in the same way, it behaves according to meaningless relationships as a reference type, but they always keep per-value criteria.

security - Displaying PDF to user -

We are providing a web form from which users fill their personal information; Some of them are sensitive information (SSN, birthday, etc.). At user submissions, data is prefilled in a PDF which is made available through a link. We are building PDF in the folder that has allowed write to the website. How can we create and add PDFs in this folder with the naming scheme (using GUID?), Such that PDF file location is not estimated to any other user Can someone write in URL and Access PDF? The PDF folder may only have exclusive rights for the user, but this can be a different question as to how it has been completed. (The number of users is unknown because it will be open to the public). Any thoughts on this? In a nutshell, we need to allow the user to see a PDF of data recorded in preventing more savvy users to understand the location of PDF files, allowing access to other files. Thank you! Trying to obscure the path in a file is not really making it safe I access the ope

events - wpf detect open window -

In my WPF app (CSRAP) I have an event handler that will open a new window (window B) when triggered Applications and some data displayed. However, when the event resumes, the new window (window B) is still open, so I do not want to create another instance of Window B, but to update the data displayed in the current instance. So the question is, how is it that the window b is already and if it is not already already open only, otherwise update the data? I got the application. Present. But in some way that is not working for me yet, you can create a LoadWindow () method in WindowB, which you can call to load (or refresh) << div class = "text- Post "itemprop =" text "> ) data & amp; Whether a window is already open or not, whether it works when this window closes, does it take a representative to call: Private operation ParentCallbackOnClose; Public Zero LoadWindows (Action ParentsCallbackOnclosus) {// Load data (Data contact or whatever set up) P

iphone - Why is scaling down a UIImage from the camera so slow? -

[Update: Last call for creative ideas here! My next option is to ask for the apple, I think.] Yes, this is a lot of pixels, but in the graphics hardware 1 on the screen, the quad with 1024x1024 texture is capable of creating too many pictures / sec 60's, so in reality the way to reset a 2048x1536 image to 640x480 should be in less than 1.5 seconds. So why is it so slow? Does the underlying image data give the OS returns from the peer, which is not ready to be pulled in some way, so that it switches into some fashion that the GPU can not help with it? My best estimate is that it should be changed from RGBA to ABGR or something; Can anyone think in such a way that it is possible for the system to understand the system to give me data quickly, even if it is in the wrong format, and I will work with you later? As far as I know, there is no dedicated "graphics" memory in the iPhone, so there should be no question of moving image data from one place to a

.net - Reliable(durable) distributed logging engine -

Trying to find business logging structures for distributed systems. This setting has to allow .NET applications to be logged on a remote server, which can then be collected in the central location. If possible, the central location should store messages in a SQL Server database. Requirements: Be able to initiate the entry of messages on a remote server, even if the network bar prevents the instant messaging message for central location < Li> Removing messages at a central location, in order to prevent any degradation in the performance of ASP.NET applications or web services, should be controlled by any other process than running the .NET application. The final delivery of messages for the central location assures that when the remote server is rebooted in the event of a network reboot, the logging message should be distributed until the remote server and normal network conditions were restored Go. Perhaps a very simple solution can continue to write local logs

algorithm - Text difference patch -

Trying to write a piece of code that will allow the user to type in the text box which is then saved on the server goes . When the user writes some more text in the text box, then I should only want the difference to be sent to the server Is there any difference algorithm for JS that I can use to only send information about the difference I am So it should basically be able to tell the difference between the two text boxes. This language can also be agnostic and I can turn it off. Thank you for your time. > UPDATE In simple words, I have a text area that saves text in every x second in the box. To save bandwidth now, I only want to send the difference with the last saved revisions (which I can put in a variable. Initially it will be empty). Now JS will see the difference between the last revision and the current state of the text box and a change list will be prepared to send to the server. Update 2 Something like www.etherpad.com Google DiffMatchPatch has

c - How to compute the output? -

How to calculate the output for recursive functions? I know that Rickson invokes a stack, but some qualification is confusing while solving the question. Looking at the following code snippet: #include & lt; Stdio.h & gt; Zero fun (int a) {if (a> 0) {fun (a); Printf ("% d", A); Fun (- a); Printf ("% d", A); } Return; } Int main (zero) {int num = 5; Fun (number); Return 0; } This is not a house work, but I am unable to resolve such a question in the examination situation. (Theoretical Examination Without Compiler) What is the standard way to resolve such questions? Please explain with a small example. Any pointer or some web link in the right direction will be welcomed. Take a pen and paper; Attract the functions of the function with parameters - you will have a kind of binary tree track the execution and write all the relevant data on the page. This will also help you understand the functionality. The branches included in recurring

java - Decoupling backing store with Spring Web MVC -

This is a design pattern question, so let me explain it as a simple example of the Address Book app. First of all, some assumptions 1. It seems to be acceptable to use DB domain objects as a backing store for spring MVC forms. Changes in your app 1 made me JPA-mapped person object with different attributes. Using the DAO pattern I have created a firm object that can get, store and remove all the databases from people. Besides, I have a factory law, make it, so I can get the object of a person. Using this DAO object I make a simple web front end, all are good. In Walking 2 I need to support many storage types, so I create an interface for the person, which has many implementations, and an interface for the DAO firmness, again with several implementations . In addition, the person was extended to receive multiple addresses. Interface eyeshadow {public string getName (); Public listing & lt; IAddress & gt; GetAddresses (); } However, I have a problem to update the

java - Use default KeyMap of native OS -

While using the non-default system and feeling, we will have different keymaps. For example, I am using Mac OS X and use and feel the subsets (see and feel non-default system). Mac OS X should be "Meta + A", but to use subStance, we need to type "ctrl + a" (and many more such as "next word", "previous word", "end line," start line "etc." ), So we did not feel like Mac OS X using the non-default system and feel (the look and feel of the material) was not felt. / Div>> Nearly work A less elegant solution, you can apply a key pressed method to override the default "ctrl + a" behavior Attempt to add the listener (Please note that adding the following sample "ctrl + a" not only adds support for "meta + a": @ override Public Zero Key Pressed (Last keyEvent e) {// d Get the default Toolkit shortcut mask ("Meta" for OSX) .inf keymask = Toolkit.getDefaultToolkit (). G

windows - Options for Syncing iPhone App with Desktop Application -

What are the options for syncing the iPhone application's data with a desktop application on a Mac OS X or Windows? iSync (Mac OS X only) "Cloud" You can sync directly via WiFi, for example, you can sync from the Bento iPhone app on the WIFI desktop app Allows to

SQL Server 2008 Failover Cluster on Cluster Shared Volumes? -

Anyone can reason that SQL Server 2008 does not use cluster shared volumes for failure cluster databases and log files can do? It seems that using CSV should reduce the failure time and reduce the complexity of the cluster group configuration (physical drive resources will no longer need to "fail"). I think, but 100% are not sure, Microsoft bans the fact that on CSV what might happen. Of course, you put the VHD there, this is the whole thing. And VHD may contain database data and log files - who knows what's inside "VHD" However, I do not know what you are trying to do CSV is there, so a single segment (i.e., a single LUN on a SAN) is separated by different cluster members. - Can be shared with different files. Specifically, information about VM definition and VHD creation. Earlier, one had to put VM definition and VHD in different LUNs, so that it could proceed individually. There was nothing "wrong" with the other than the complexity

How to get the columns names along with resultset in php/mysql? -

क्या यह ठीक है? $ i = 0; जबकि ($ पंक्ति = mysql_fetch_array ($ परिणाम)) {$ resultet [] = $ पंक्ति; $ कॉलम [] = mysql_fetch_field ($ परिणाम, $ i); } तब प्रिंट करने का प्रयास करते समय & lt; tr & gt; & lt; th & gt; & lt;? Php $ कॉलम [0]? & Gt; & lt; / Th & gt; & lt; th & gt; & lt;? Php ईको $ कॉलम [1]? & Gt; & lt; / th & gt; & lt; / tr & gt; मुझे एक त्रुटि मिली कैच करने योग्य घातक त्रुटि: वर्ग stdClass का ऑब्जेक्ट स्ट्रिंग में परिवर्तित नहीं किया जा सकता फ़ंक्शन का प्रयास करें। उदाहरण के लिए: & lt;? Php $ DbLink = mysql_connect ('स्थानीयहोस्ट', 'यूएसआर', 'पीडब्ल्यूडी'); Mysql_select_db ('परीक्षण', $ dbLink); $ Sql ​​= "काटेबल से चयन करें"; $ परिणाम = mysql_query ($ sql) या मर (mysql_error ()); // एक तालिका के शीर्ष लेखों के रूप में स्तंभ नामों को प्रिंट करें "& lt; तालिका & gt; & lt; tr & gt;"; के लिए ($ i = 0; $ i & lt; m

swing - while loop ignore the event listener -

So when I try to change the background of the GUI crash to run this code and gets trapped in an infinite , Listeners. Here's the code: private panel getPanel1 () {if (panel 1 == blank) {panel1 = new panel (); Panel1.setLayout (new gridoutout ()); While (frame.isVisible ()) {panel1.addMouseListener (new Java.wt.event.MouseAdapter () {public void mouseClicked (java.awt.event.MouseEvent e) {frame.setVisible (false);}}) ; Int r = (int) (mathematics. Randem () * 255); Int g = (int) (monastery. Rhythm () * 255); Int b = (int) (Math.random () * 255); Color C = new color (R, G, B); Panel1.setBackground (c); Try {Thread.sleep (4000); } Grip (Interrupted e1) {e1.printStackTrace (); } Panel 1.addMouseListener (new java.awt.event.MouseAdapter () {public void mouseClicked (java.awt.event.MouseEvent e) {/=panel1.setVisible(false); frame.acceptive (false); * / system Exit (0);}}); }} Return panel 1; } Rather than ending the program or ending the background change event, it displays the

multithreading - Event Dispatch Thread meets the Java Memory Model -

It was already I asked, where the answer was: is related to many fields Accessed by thread, it should be unstable or final, or arrive with synchronized blocks only. Otherwise, the assigned values ​​can not be visible to other threads. Also, anything that manipulates pixels on the screen should be run from it, though it is handled transparently when using color / paint again. Therefore, in my opinion, we need to worry about the memory model because the screen running on the phantom is somewhat simpler in the form of animation. My question is, it is correct to understand, and for example the sun tutorial example. (Wrong) You know, I think that you can be a point here. The TumbleItem code uses worker.isDone () to see if the work is completed or not. However, I do not think that it causes a complete "synchronize". My reading of the JDK 1.6 code is that uses swingworker. ISDIN ( ) FutureTask which is a sync Uses a vaporous state with attribute for the

c++ - How to use boost::function_types::parameter_types with ClassTypeTransform -

An example provided in the boost library has been done with the HPP and I am trying to find out that How to use this parameter_type correctly To parse the class member function signature, parameter_type requires a classType transform. I want to parse the signature of the member function, but I can not find any doctor about this lymda expression. Type Transformform MPL - to Transform Lambda Expression Class if F is a member function pointer Which page is from me, really There is no sample code using it and I was hoping that someone knows how to use it to parse the member work signature. classtranslation is used only to modify the first argument type Is parameter_type & lt; & Gt; A member function applies to the pointer type. Default add_reference & lt; _ & Gt; , for example: parameter_types & lt; Void (x :: *) (int) & gt; :: type - & gt; Some white & lt; Zero, x &, et & gt; Parameter_type & lieutenant; Zero (x :: *)

How to move an element around DOM tree without affecting related javascript? -

In this case I have an iframe that has an editor, mooEditable. I clone the element with the ID, destroy the old one and insert a new one where it is needed. JavaScript component no longer works at this level. If there is a normal way of doing this, then it will be great if you share it. TIA Maybe you can show a summary of what you do? Specifically, what does "destroy the old one" mean? It uses jQuery, but if you want you can code bare metal: var item = $ ('# luggage ID') ; Items to move // ​​var to $ ('# new-div'); // container to get it item.remove (); Want.append (item); You may have problems moving the iframes (not sure). If so, and if you are just swapping two items, then move the other.

php - Question about an array in gallery2 -

I am working on an amendment from a topic in the "gallery2" open source project. Here is the code that I am looking for: for anyone familiar with this, in the SearchShowAll.tpl file in the search module in the module section of your download <. Code> & lt; Ul class = "giInfo" & gt; {Result from $$ result.fields item = area} This is a clever foreach loop and it grabs this data Title: BB 08 PR 6-340 Summary: Keywords: a hillbilly cat; Gavin Jordan; Margo Hazell Description: Owner: Gallery Administrator However, I want to get it title: and display it, none of the other stuff. I do not know how the array looks and how to get a special value in the smart feature and also unsure about this gallery. I used the section tag to exclude it. I was also referring to Array Value as wrong. {section name = field loop = $ result.fields max = 1} & lt; Li & gt; & Lt; Span class = "ResultData" & gt; {$ Result.fields [fi

MySQL count rows performance -

It is better to calculate the total number of records for a storage From TBL select pk = 1 or mysql_num_rows < / Code> at Receiving the array and selecting "Total" value from from count (*) to TBL as a total Get where pk = 1 ? The latter can take the price directly from PK's index, whereas in the east almost certainly A table scan is required (unless every single column is not part of an index, and still, it has to get value from all indexed) How are you connecting to DB? Based on this, there is a large amount of data transmittance to get the count. Here can help you in this situation, it will tell you that selection is optimized.

How to create installer in different language using Visual C++ (window programming); -

I have window applications in Visual C ++. I am not using MFC, I have different languages ​​(French , Italien, German, Dutch, Spanish), anyone can help me in the above work. thank you in advanced. If you do not create an installer with VC ++, you create it with an installer Tools, such as, have multilingual support.

multithreading - Erlang and processes -

I'm very new to Arlong and I'm currently reading Armstrong's book, chapter 'Concurrent Programming'. I am trying to run a list of processes, if any number is prime (inexperienced method). But my code runs as if there was no process, both methods have the same duration. Where am I? shell.erl: c (a list of% primes)% NUMS = [102950143,102950143,102950143,102950143,102950143]. % Time start now =) (now) when: fwrite ("monothread ~ n"). If it is a major list to test each number: foreach (fun) (n) -> gt; RESULT = prime: is_prime (N), io: fwrite ("result n = ~ p ~ n", [RESULT] ) End, NUMS). Display% duration io: fwrite ("duration n = ~ p ~ n", [timer: now_diff (now (), now1) /1.0e6]). % Time starts now = (2) when: fwrite ("multithread ~ n"). For every number, a new process is created and if it is a main list then: foreach (fun) -> gt; ProcId = prime: start (), io: fwrite ("count: procId = ~ pn = P ~ N ", [Proc

javascript - Update elements by class in each Prototype selector result -

ठीक है, इसलिए मेरे पास इस तरह की एक HTML संरचना है: & lt; div class = "सामग्री" & gt; & Lt; div id = "a1" वर्ग = "आलेख" & gt; & Lt; p & gt; सामग्री & lt; / p & gt; & Lt; p & gt; सामग्री & lt; / p & gt; & Lt; p वर्ग = "जानकारी" & gt; & lt; / p & gt; & Lt; / div & gt; & Lt; div id = "a2" वर्ग = "आलेख" & gt; & lt; / div & gt; & Lt; div id = "a3" वर्ग = "आलेख" & gt; & lt; / div & gt; & Lt; div id = "a4" वर्ग = "आलेख" & gt; & lt; / div & gt; & Lt; / div & gt; लक्ष्य प्रत्येक आलेख को संसाधित करना है और इसके बारे में जानकारी p तत्व में जानकारी जोड़ें तो मुझे लगा कि मैं इस तरह से सभी divs के माध्यम से पाश होगा: $$ ('। लेख')। प्रत्येक (समारोह (आइटम, सूचकांक) {var info = $ (आइटम) Info.update ('& lt; a & gt; link & lt; / a & gt; &am

c++ - How can you remove the last character from a wchar_t*? -

How can I remove the last character of wchar_t * and resize accordingly? For example, to "test" and to bring it down in "Tess" How about Str [wcslen (str) - 1] = '\ 0' Make sure the string is at least 1 character long ago!

operating system - iPhone - why only one application at a time -

I tried to find an explanation for this question, but could not. I am new to iPhone development and I was wondering why the iPhone can not allow more than one app to run / run at a time? I am pretty sure that this is a design feature rather than a lack of functionality. Will someone tell me in technical / non-technical terms why you can not run more than one app in the iPhone. Thank you very much. Here 'why: on discussion boards related to other smartphones such as Android , Users are asking such questions as "Why does my battery sometimes run really fast?", And "Why does my phone slow down and slow down?" Essentially received answers from the society are clear: go to the task manager on the phone and stop some external programs you are running. It is not a difficult thing for a lucrative user to manage your available resources. On the iPhone, Apple decided that they evaluate the overall experience with flexibility, and so they decided to li

Cons of Oracle Database -

ओरेकल का क्या बुरा असर हो सकता है? निजी / छोटे-समय उपयोग के लिए ओरेकल मुफ़्त है लेकिन बड़े उपयोगकर्ताओं के लिए ओरेकल जल्दी से बहुत ही बढ़िया हो जाता है। ओरेकल कॉन्फ़िगर करना आसान नहीं है। बड़ी कमाई वाली कंपनियां आम तौर पर कर्मचारियों पर पूर्णकालिक ओरेकल के व्यवस्थापक रखती हैं। यदि आप ओपन सोर्स कोड के साथ बहुत अंतर कर रहे हैं, तो ओरेकल बिल्कुल लोकप्रिय नहीं है। आप MySQL और PostgreSQL के साथ घर के करीब होंगे। ओरेकल को स्थापित करने के बाद, आपको लगेगा कि आपका पीसी अब आपकी नहीं है यह बहुत बड़ा है और बहुत सारी मेमोरी और प्रदर्शन नालियों में है।

c# - How to do Autocomplete in search desktop program -

I am programming a search desktop program to search for words and sentences in SqlServer 2008 DB. I want to do it like Babylonian: When the user starts to type the first letter, then the program should suggest the first N words starting with that letter. And when he completes a correct word, then the program should suggest the first N sentence to include the term. I wrote the algorithm for the search engine but used the thread to start the previous steps, so that I can see a new thread on every key press event I saw slowerness in this approach is? My goal is to make it like Babylon, it is fast in autocomplete. Why not run your algorithm on the same thread on the same database I think every key is a thread overkill is. What you can do also get rows from table X, then instead of going back and forth of the database, run an algorithm against them (not sure if you are already doing this).

php - incompatibility issue: use which web browser for developement? -

I have a Mac. I wonder what browser (Safari or Firefox) would like me to develop my prototype, Firefox or Safari Should be used for? Because I've found that they will have different effects. Certain things working in Safari do not work in Firefox and vice versa. Can someone advise me how to deal with incompatibility problems. The foundation has worked very well in my work using Firefox. In my experience it's "closest" to the standards and there are wonderful plug-ins for web-development. If your main problems are CSS incompatibilities then you can make it the fixes of each browser when you can get it in FF.

soap - python soappy add header -

मेरे पास निम्न PHP उदाहरण कोड है: $ client = नया SoapClient ("http : //example.com/example.wsdl "); $ H = सरणी (); सरणी_पश ($ h, नया सोपहिडर ("http://example2.com/example2/", "h", "v")); $ ग्राहक & gt; __ setSoapHeaders ($ ज); $ S = $ client- & gt; __ साबुनकल ('ओप', $ डेटा); मेरा प्रश्न: SoapHeader () और __setSoapHeaders () भाग के लिए SOAPpy समकक्ष क्या है? संबंधित प्रश्न यहां लाइब्रेरी का उपयोग करते हुए एक उदाहरण है (SOAPpy का एक विकल्प) ऐसा लगता है कि कस्टम हेडर को wsdl में परिभाषित नहीं किया गया है। Suds.client आयात से suds.class आयात ग्राहक से आयात करें एलिमेंट क्लाइंट = क्लाइंट ("http://example.com/ Example.wsdl ") # और lt; tns: h xmlns: tns =" ​​http://example2.com/example2/ "& gt; वी & lt; / tns: h & gt; टीएनएस = ("टीएनएस", "http://example2.com/example2/") एच = तत्व ('एच', एनएस = टीएनएस) .सेट टेक्स्ट ('वी') client.set_options (सोपहेडर्स

tsql - How to let SQL Server know not to use Cache in Queries? -

Just a general question: What is a query / command that I can not give to SQL Server Especially use the cache while executing the query? I am looking for a query / order which I can set instead of the configuration setting. Is there no need to do this? dbcc free interception all cached process execution plans This will remove all subsequent processes, so that it can be re-compiled. Each time it was called by adding "RECOMPILE" to a process definition, the reason for compiling the process would be the reason. I do not believe that there is a way to clear the process cache of the same process execution plan (in SQL 2005 or earlier), and I doubt you can do it in 2008 too. Are there.

user interface - Too much control is bad. But when? -

I remember reading a law (well, probably not exactly law), but in software design, Without actually giving it the option of a basic and an advanced mode, the control is sometimes backfired and the user does not have to use any of the options in the first place because they are too much, did I read it correctly? If so, can anyone tell me a more formal source? me The rule is that in many cases, the user really does not care about small details, just give them a sensible choice. An Joel Spolsky article may also be relevant -

asp.net - if a secure page does a postback, will the postback continue to be on secure page? -

I am using the ASP.Net Wizard, and it does postback to go to the next step of the wizard, or something And I should have this specific page secure (securing the whole site is not an option). Will postback keep "https"? If you have a wizard page with an https url and Action goes to the same page, then the POST will also be safe.

Startup Code for Loading COM Object for WCF Service -

I currently have a WCF service that uses a COM DLL for its service. The COM object is loaded only once and is saved by singleton. The problem is that for the first time the COM object is loaded for 19 minutes. The WCF service is hosted through a Windows service, I am thinking how can I load a COM object singleton through the startup of the Windows object. Protected Override Zero Ostart (String [] ARG) {if (host! = Null) {host.Close (); } Type service type = MyService; Host = new service host (service type); Host.Open (); ObjectConn.getInstance ()} When I try to add a singleton load to the onset of Windows Service Startup, it always fails. I would like to ask if I am the proper way to add the startup routine for the object. For example, I tried to install singleton loading in the Mement service, but it is called only with the first call for web service operation / method , Which makes me call the first service call weird. I read about dependencies, but I think the added beha

perl - Line numbers with template toolkit -

I am using the Pearl Template Toolkit to create C files. I am very careful to # line instructions in my C code I want to be able to include the error message from the C compiler to the correct location (template file) instead of the wrong location (template output). However, I do not know how to do this. The only outcome I received from Google was an unanswered message on the Template Toolkit Mailing List. I can visualize a torture solution like reading the template file and adding a line number, but someone has a trick or to get the line number of the original file in any template toolkit. A Wise Way? I look like a template: the location method of the parser gives a suitable line # line, but There is no function that is included in the output to include it. You have to expand the Template Toolkit to do this.

C#: How do I check if a DataGrid is empty? -

अगर (grdMass.DataSource == "") {cmdRelease.Enabled = false; } और {cmdRelease.Enabled = true; ; } यह जांचने के लिए कि क्या कुछ रिक्त है आप देख सकते हैं कि आइटम गुण रिक्त है या नहीं। grdMass.Items.Count == 0

growl - Ruby system command not working outside console -

I am trying to run inside Ruby script if I use the terminal to execute the script then it Works fine i system ("growlnotify test -m message") . If I use textmate to run script or gittool (the last goal of the script), then it never runs the moving part, another part of the script runs using textmate or gitcode, but only uses the terminal By causing Groove to launch the Information Window. Anyone before using this tool? what code> / usr / local / bin / growlnotify

c++ - Error "SysError 0 during open of "AUResources.r"" When Compiling an AudioUnit -

XCode creates the default AudioUnate project in Shell, there is a line below your AUEffect. R file: #include "AUResources.r" When compiling under Mac OS X 10.6 Snow Leopard, the following error in this line Note: During the opening of "AUResources.r" SysError 0, this error is completely open in the open project, That is, this is a bug in the XCode project template. Why? The Xcode has targeted its project template on the 10.5 platform, in which a different processing path 10.6 10.5: / Developer / Example / CoreAudio P> To decide: < Ol> Get information on the AUPIG folder in your project source, and change the path to your OS / build target in the correct Core Audio / Audio Usenet / AUPIS folder. Get information about each file in the Public Utility Project folder and hide the path to the correct path for your OS. Yes, they all. Add the appropriate CAAutoDisposer.h file to the public utility project folder. Original d

asp.net mvc - Using MS MVC and DDD, How and where to define a MVC ActionMethod parameter class that involves an entity, a value object, and a few extra fields? -

I'm just on the verge of "ah ah"! When it comes to domain driven design coding Question How and where to define an MVC Action Mathi parameter class, which includes a unit, a value object, and some additional fields? The unit and value object class is defined in my repository. Do I: To apply other classes (to get all the properties of one class), create a custom class in the repository, and add additional Add some more properties for the field? Create an Entity / Well Object Poko class in a repository and create a composite class referencing these objects in my Controller class, then use it as the ActionMethod parameter type? Something else? The request form only collects certain customer class areas, mailing addresses, and some form attributes, such as how we find materials are not important, only they contain information about several Pokas. I know that MVC will match the properties of Poko in the parameters of the post form as in the following: Th

jquery - sending back json string with echo problem -

I use json_encode to return data via jquery from jquery via AJAX. And I have noticed that Jquery only allows to use an echo in php. If I use the echo json_encode ($ array); .... and then another echo json_encode ($ array2); In the same php file, then it will not work. Or if I use the echo json_encode ($ array); And then another echo "Hello"; Am I right? The problem is that when I use $ users = mysqli_fetch_assoc ($ login_user_result); The php file in AGX is called together with echo json_encode ($ array); It does not work, it correctly sends the $ array, but sends it along with the other code due to the above line. But I have to use mysqli_fetch_assoc to get data from the database. Is there work to do around this? Edit: Here is the AJAX call I used: $ .ajax ({url: "static / js / ajaxcall_login.php" ("# login_box." "). Val ()}, datatype:" Jason ", success: function (data) {................})}; I did no

java - TCP Connect takes X100 longer than ping -

I have a Java process on the machine that communicates with TOMcat on machine B. through TB ​​I connect TCP (Only sync-sync / AX exchange) takes the order of 100 ms continuously, while a ping request takes 1 ms (the service is on the same LAN). Could there be a delay in setting up a TCP connection? How do I optimize it? Note that: This is not yet a 3-way handshake, The server is a very strong The machine is and is not subject to load. The connection request is for an IP, not a hostname, so no DNS lookup is included. In fact, it is not relevant because I measure the time of SYN left machine A. It seems that the problem is not in the client or server itself, on the client and server Put two packet dumps: The client sees the time difference between 100-150 ms to see the SYN and obtain the SYN / ACK. The server sees only time difference of 20ms between receiving SYN and sending SYN / ACK. Therefore, the problem should be in some intermediate layer (router / f

VOIP in C#, asp.net or Java -

Can you give people the idea of ​​applying some good resources / VoIP to C # .net, asp.net or Java Are there. Why am I specifying 2 different language platforms, we still want to take a call. Actually we are not ahead of the idea that the concept is more important to us. We are going to apply a white board and there is a requirement of the client VOIP conferencing, chat image sharing and uploading capability in the White Board. PDF files should be please help this is very important. Thank you in advance I think developing your software or something Should look like this. Developing software is not very difficult. First of all, are you planning to write your entire application or just buy and integrate the components? I advise you to shop around for the components and just integrate because VOIP is not complicated. Here is a link to Java that supports VoIP

java - jdbc connectivity error -

While installing database connectivity with Java applications, I have one. Trying to run the Msg file that failed to load the msg msg "main class failed to clear the obvious attribute of c: \ program files \ sqljdbc_2.0.1803.100_enu \ sqljdbc_2.0 \ enu \ sqljdbc4.jar How can I move forward? Do not run the .jar file. This is a library instead you need to refer to it as your When running a class file like java-cp c: \ program files \. \ Sqljdbc_2.0 \ enu \ sqljdbc4.jar {yourclassfile} If you can run a .jar file, such as it is configured. However, a JDBC .generator will not get the proper configuration and you should think about it (say) similar to DLL.

Print out jQuery object as HTML -

Is there a good way to print a jQuery object in the form of a net object? ex: & lt; Img src = "example.jpg" & gt; & Lt; Script & gt; Var img = $ ('img') Eq (0); Console.log (img.toString ()); & Lt; / Script & gt; toString () does not work in this way I need HTML parallel string, that is: & lt ; Img src = "example.jpg" & gt; If you need to print the object in HTML format, then use this extension Or Update Update link and add another link's code: $ .fn.outerHTML = Function () {// IE, Chrome & amp; Safari will comply with non-standard external HTML, all other (FF) returns (! This.length) will have to fall for cloning? It: (this [0] .other HTML || (function (L) {var div = document.createElement ('div'); div.appendChild (el.cloneNode (true)); var content = div.innerHTML; div = Null; return content;}) (this [0])); }

asp.net mvc - Am I wrong in wanting to roll my own Authenticate / Authorize system given the following requirements? -

In my pet project, I have to have a user system with the following requirement: I want to use DI (through use) to give the necessary dependencies in my user model It should be easy to plug in Without a lot of trouble, it is important to be tested. Anonymous users must support a lot like SO I want certification and authorization It needs to be protected I know that I'm putting some techniques before some activities here , But as it is a pet project and I want to learn some new things that I think it is appropriate to include them as requirements. Halfway in my own rolling, I realized that I might have to face some syndrome. I really do not like how the unnecessary complex current user framework in asp.net, it's actually mostly just about all the more complicated stuff about security which is now giving me some doubt what to go to it And will be able to roll your own? If not, how would you go about completing all the above requirements with the existing o

browser - No access to developer tools in Opera without a connection to Internet -

I have seen that when in offline mode (computer is not connected to the internet), developer tools (AKA Dragonfly) Not accessible When choosing them from the menu, the opera thinks for a while that a connection displays error. Is there a way to use the developer tool without connecting to the Internet? As stated in the Dragonfly documentation, it should be constantly cached in the cache. But if it is not, you can try to download the actual release of DragonFlu from your computer, open it and give it to the Opera: config # Developer Tools. Add Developer Tools to the URL (which is to paste in the location bar, but SE does not want to output it as a link because I do not have http in front of it). Here's the link: while describing the article

Selenium RC test: error when Run as JUnit Test, no error when Debug as JUnit Test -

I have a problem: when I try to run a JUnat test case via the eject, debug mode As a JUnit Test), it runs perfectly well (I step on every statement), but if I run it normally, not in debug mode (use as run as a genus test Doing), testes run for some point And then some html using time Xpath fails when trying to find the element page, ie div, td I in the page using what element Xpath examiner that he checks to see if it is present. What could be the possible reason for this? Did anyone face anybody like this? It seems that the investigation is under progress in comparison to the application under test. You need to make sure that you use waitForPageToLoad wherever the page loads. In addition, if your AJX is used at all, then to ensure that Elements should not be immediately apparent for the survival rather than throwing the 'element' error, but this waiting period should be clear.

flex - have any idea how to set the layout? -

I want to use two buttons to control the list / one element on the left side < P> But I got something I use " Requested column number = 6" "to set the list width, so in the design model i only know that this list can display 6 elements, but I do not know how much that width will be. So I use "HGroup" to set the layout, the main code is like this & Lt; / S: Group & gt; & Lt; S: group & gt; & Lt; Component: SmoothScrollingList Detector = "{myProvider}" itemRenderer = "myitemdrender.FriendPageItemRender" id = "Friend's Lease" mouseDown = "Friend -List_MouseDownHandler (Event)" & gt; & Lt; Component: Layout & gt; & Lt; S: use horizontal layout, requested column = "6", virtual layout = "true" /> & Lt; / Component: Layout & gt; & Lt; / Component: SmoothScrollingList & gt; & Lt; / S: Group & gt; & Lt; S: group &

sql - Efficient Pagination from Join in Django -

I have a problem here and with a paging and paging. I have 3 models: Tag TagRelation I betweent many relationships to manage tag management Now with the pad and tag table (with the feature of te ManyToMany field), when I am in the pad and tag table, I give something like this ... Pad.name tag.name etc ------------ --------------- Pad 1 tag 1 ... Pad 1 tag 2. .. .pad2 tag3 ... Now when I create a paginator () object from these results it's clearly incorrect per page Items count I must iterate through all the results and thus generate a dictionary ... [{name: 'pad1', tag: ['tag1', 'tag2']}, {name: 'pad 2 '....] ... and use the pgnitor on it to get the correct page. What is the best way to deal with this problem? I can do a DB query for each pad object on the current page, so that he can get the tag, but I think the server must kill sooner or later (should be presenting). Content may also result in a lot of system memory costs

java - Void, value, or other? -

I'm working on spaghetti monster (unfortunately not of the variety of flights), and I have a question about fair Is design I am in the process of taking a huge static java method which gives an object and divides it into reusable (and readable) components. Right now, the method reads an XML document, and then adds summary and detailed information from the document to "data module", and the data module then comes back in method. GetSummaryData and getDetailedData method in breaking my code, I saw that I did the following: dataModule = getSummaryData (xmlDocument); SetDetailedData (xmlDocument, Data Module); (Add context, add detailed data to the data module within the method) The main fact of this is that the detailed data is based on summary of business logic It is necessary that the data is properly parsed, and the fact is that many of the applications involved in changing the front end of the application to change the structure of the data module. Is t

redirect - PHP uppercase to lowercase rewrite optimization? -

I am using this PHP code to redirect uppercase of any form in the lowercase of the URI. There are three exceptions: If there is no redirect in "adminpanel" or "search" in the URI, even if it is already lowercase then there is no redirect Do you want to improve the function in PHP Looking for a method? $ trailed = $ _SERVER ['REQUEST_URI']; $ Pos1 = strpos ($ trailed, "adminpanel"); $ Pos2 = strpos ($ trailed, "search"); If ($ pos1 === Wrong & amp; amp; $ pos2 === False & strlen ($ trailed)! == strlen (preg_replace ('/ [AZ] /', '', $ trailed)) {$ Trailed = strtolower ($ trailed); Header ('http / 1.1 301 permanently move'); Header ('location: http: //'. $ _SERVER ["SERVER_NAME"]. $ Trailed); Go out; } I think this URI will fail to redirect to a mixed case case . What is this intention? Also, if the string component of string component is being compared to line 4 on string 4 and

visual studio - VS.net 2008 issue with asp.net pages -

I'm having trouble using the source view of asp.net page in VS.NET 2008 IDE. I'm not using the Design scene at all, the IDE hangs every now and then a while, when I use intellisense in it, and I scroll through the page, please highlight some of it at the time of editing the HTML page and such an e These issues do not appear while editing the .px page with the HTML editor, which can be configured using the Tools -> Options menu option. This normally helps to make your visual studio a little faster Could. I'm not sure about the exact reason behind the outline of your visual studio. I suspect that there is something with graphical interface like toolbox and so on. Thanks

Unable to push code to git remote -

I am trying to connect remote using Remote from remote and trying to reach that remote, but I am getting the following errors: / P> Fatal: 'adoshi_01': unable to chidir or does not have a git archive and deadly: remote end In the unexpectedly kept < the steps were followed: Firstly, from git / repos / scripts Code> home / adoshi / repos / scripts After doing this Devs / adoshi watched There were no entries for the folder and script and I am still wondering why I then used the git add Attempted to add files using , then git commit -am "expanded message" git remote Remote added using adoshi_01 git01.dev:/home/git/devs/adoshi/scripts/ - The thing to note is that is not a script folder in git01 < Li> tried to use git push adoshi_git01 master - but I got an error again I think the main issue here at = 0 < Code> git01.dev:/home/git/devs/adoshi/ , " script " f The folder was not created even when I cloned

Bluetooth discover devices type question -

How can the Bluetooth server identify the detected client - type them, for example, the detected device is Blackberry or Is the iPhone the device? You can use the device address to find the manufacturer. Here is the list for lookup:

.net - Specifying and displaying columns of a DataGrid in WPF declaratively using a binding? -

Is there a way to declare datagrid columns using a binding? (And to determine the 'column properties' using this binding?) Ideally, I would have a list of objects (such as rows) for the database and one of their properties (or a list of items of a certain class) Or whatever) with a name and value. I would like that the DataGrid to automatically create these additional columns without some extra code. Is this also possible? The array holding additional values ​​can change over time, but the list will be identical for all objects. It would be possible (and clean) to provide the datagrid with a separate list just to create the columns. But for this, I'll need column sort or something ... The only thing I can do was create a sub-section of Datagrid ... Any thoughts? Edit: The issue is getting it without any code ... The danger of being contentious ... I think this is an example where the scene actually requires some code "boost", and 'no code-

html - Integrate a mp3 player into a page with no reloading issue -

Is there a way to integrate a Flash mp3 player into an html site where one can not stop playing a reloaded music Or it can make it start from the beginning I would not like to use AJAX for the rest of the site because this is not SEO friendly, and pop-ups are not a good solution as every browser now blocks them. AJAX can be SEO friendly until you create different URLs for those pages The inside of which you are dragging. One solution I have seen is to use a pop up player, and they can easily unblock.

functional programming - Pros. / Cons. of Immutability vs. Mutability -

Well, I think this direction is clear, about which I am trying to reason on this. Whenever possible, there are many things about Constantes in these days, concurrent programming in the Java book says a lot about it. However, all this is what I have read. I am not personally coded in functional languages, personally. And it seems very surprising to me that it is possible to work comfortably with irreversible things. Theoretically, this is definitely possible. But, from a practical perspective, there is a very comfortable experience. Or what should I develop for a new type of argument (FP) so that I do not need such a change? I appreciate that when you are unchanging objects. Already it is making a community wiki ... for all those who are interested in closing this question or marking it as subjective etc. Etc ... * Many functional languages ​​are pure (mutation and side effects allowed Please). For example, F # is for example, and if you look at the low level construc

scroll - Fancybox - Scrolling / page position -

I am trying to scroll an anchor automatically when a faxbox opens iframe: www.example.com / Posts # header It does some kind of work, but it scrolls in the wrong position, either too far or too far (most of the ways are too far). I scroll the jQuery scrollow but scroll it in the wrong position, as well as "pop out" the page from the faxbox to the entire window. How to get this job, would be grateful for any suggestions on this!

xml - How to cache a jquery Ajax request and parsing -

I am creating an image which is the image gallery, but with many images (archives of documents To browse); Display the "last" and "next" link on the left and right sides of the first image: < P> The previous and next links are obtained from an XML file that lists all the images in the sequence; About 1000-2000 images (one XML file per set) in each set are to avoid viewing the predecessors and the following of future elements, I have included the names of each previous and next images as the property of each image. Then the XML file is basically: & lt; List & gt; ... & lt; Image back = "ww.jpg" next = "yy.jpg" & gt; Xx.jpg & lt; / Image & gt; & Lt; Image back = "xx.jpg" next = "zz.jpg" & gt; Yy.jpg & lt; / Image & gt; & Lt; Image back = "yy.jpg" next = "aa.jpg" & gt; Zz.jpg & lt; / Image & gt; ... & lt; / List & gt; What

iphone - Button background setting -

It's almost embarrassing to ask this question, but I do not get the answer in any document. I have a UIButton in a scene in the IB, I had set the background of the button in Color, the identical inspection shows the half-black, half-white rectangle for the background of the original rectangle button. I can not find any way to set the background in the original settings. Does anyone know this? Thanks in advance for any help. John Donor half black, half white means an alpha value. Click on the color, and in the bottom part of the color picker, you can set the alpha. To get the original value back, set it back to 0%.

synchronization - Synchronizing 2 databases -

I have a database of MySQL and other databases that run on MS SQL MySQL is the backend database of my website running on Joomla I have an ERP to run my shop. This ERP is made in a net by a third party. Every time a user orders on my website, a table named order is updated. Order details in my ERP in my orders table Should be done. The table structure in the two databases is completely different, so I'll do the mapping myself. My questions are: How often should I transfer data from my database? For MS SQL? Someone has suggested that I can write a web service which would periodically pump data in my table in ERP, so I started thinking about the Nasap server service. Is this the right way or is there a better way of doing this ?? I must also obtain inventory related information from my ERP in my MySQL database also. 1: It depends on how much your data The bar is changing, and how often you need to sync (i.e., depending on your business). 2 & amp; 3:

In Ruby on Rails, how can I convert html to word? -

मैं HTML में शब्द को कैसे रूपांतरित कर सकता हूँ धन्यवाद। मुझे किसी भी समाधान से अवगत नहीं है जो कि यह करता है, यानी HTML को Word प्रारूप में कनवर्ट करें। यदि आप का शाब्दिक अर्थ है, आपको पहले नोकोगिरि जैसी कुछ चीज़ों के द्वारा HTML दस्तावेज़ को पार्स करना होगा। अगर आप का मतलब है कि आप अपने मॉडल ऑब्जेक्ट्स में आउटपुट डेटा बनाए रखना चाहते हैं, तो HTML को विश्लेषित करने की कोई आवश्यकता नहीं है! जहाँ तक Word को आउटपुट करना है, मुझे डर लगता है ऐसा लगता है कि आपको सीधे ओएसएल के माध्यम से माइक्रोसॉफ्ट वर्ड के चलने वाले उदाहरण के साथ इंटरफेस करना होगा! आप के लिए त्वरित Google खोज शुरू कर देंगे: गुड लक!

java - database sharing between two servers -

My current set is a dedicated server with Java, the Hibernate app running on TotalCat, Apache HTTP Server, MYSQL. I need to get another server to share the load, but first using the same database on the server Backend processing (excluding DB transactions) is time consuming, Therefore second server for backend processing). Will this setup have any unwanted results? Is this optimal setup? My apps have been updated / deleted and there is transaction control like this: beginTransaction (); . Save GetSession () (obj); //sessionFactory.openSession().save(obj); As long as you update the database on a shared table, only one of the apps is OK. You definitely do not want to: App1: Delete / update table 1. Records 24Ap2: Delete / Update Table 1 Records 24 Because when hibernation writes a record one of the procedures will notice the data has changed and throwing an error and replacing it as a classic Hysenbagh is really difficult to reproduce is. On the other hand, responsib

What languages other than Python have an explicit self? -

It seems a bit odd that Python clearly self is the first argument for everyone Need to pass in the form of Class Functions Do some similarity in other languages ​​require? Clearly, do you mean "clearly passed each class as an argument in function "? If so, then Python is the only one I know by hand Most OO languages ​​support this or by themselves in any form , But most of them always help you as the self first argument.

EDIFACT macro (readable message structure) -

I am working within the EDI area and would like some help with an EDIFACT macro to make EDIFACT files more readable . / P> The message looks like this: data'data'data ' I would like to change the macro for the structure: < / P> data 'data' Pls let me know how to do this Thanks in advance! BR Jonas If you only want to see the file in a more readable format, Try downloading This is a great tool for that purpose, it supports X12, EDIFACT and TRADACOMS standards, and it's free.

PHP display problem? -

For example due to an array, four values ​​are displayed four times four times, I just want to assume a Bar display How can I fix this problem? Note that the echo works perfectly before. Here is the code. if (count ($ array) == 1) {echo $ array [$ x] "a value has been entered"; } Else {echo fonts (",", $ array). "You have entered a more value;} because $ x Clearly, the first element of the array is not an indicator. Use the correct index or if you do not know what it is, just use it: if (count ($ Array) == 1) {echo reset ($ array). 'One value is entered'; else {echo implode (',', $ array) 'you entered more than one value';} to see what it really contains , May be helpful in dumping the array: print_r ($ array);

xslt - Display XSD-defined default value of attribute using XSL -

I thought it should be easy to find, yet after some searching I found it to be clearly defined Would be good for In my XSD I have defined an enum derived from the string. In a complex type I have defined and the attribute that refers to this enum, with a default value. In my XSL I want to display the default value of this attribute for elements whose properties are not explicitly set. XSD: & lt; X: complex type name = "foo" & gt; & Lt; Xs: attribute name = "bar" type = "response_code bar-type" default = "default" /> & Lt; / XS: complexType & gt; & Lt; X: simple type name = "bartype" & gt; & Lt; Xs: restriction base = "xs: string" & gt; & Lt; Xs: calculation value = "default" & gt; & Lt; XS: Annotation & gt; & Lt; Xs: documentation xml: lang = "en-us" & gt; Default bar & Lt; / Xs: Documentation & gt; & Lt; / XS: Annotatio