Posts

Showing posts from February, 2014

c# - Output parameters not updated after ExecuteReader() -

जब मैं cmd.ExecuteScalar () या cmd.ExecuteNonQuery () चलाता हूं, तो ऑब्जेक्ट पर आउटपुट और इनपुट आउटपुट पैरामीटर से अपडेट हो जाता है संग्रहीत कार्यविधि में परिवर्तन हालांकि सीएमडी के लिए ऐसा नहीं होता है। एक्सक्टेयर रीडर () यह SQL सर्वर और MySQL कनेक्शन दोनों पर हो रहा है क्या इस डिजाइन से व्यवहार है? अरे यह आपकी सहायता कर सकता है ऐसा प्रतीत होता है कि यह निश्चित परिस्थितियों में एक समस्या हो सकता है।

ruby - RubyZip - files from different directories have path in zip -

I'm trying to use rubypip to package some files, I currently have a method that is special Visually zips on directory and sub-directories def zip_directory (zipfile) Dir ["# {@ directory_ to_zip} / ** / **"] Reject {| F | Reject_file (f)} Do each. File_path | File_name = file_path.sub (@directory_to_zip + '/', ''); However, I want to include a file from a completely separate folder, I have the following method to solve: Zipfile.add (file_name, file_path) and end / P> def zip_additional (zipfile) additional_files.reject {| F | Reject_file (f)} Do each. File_path | File_name = file_path.split ('\\'). The last zipfile.add file (file_name, file_path) expired The file has been added, instead of giving the place, file the directory structure copies in the root of the folder. This is really annoying and makes working with it more difficult. How can I do this? thanks The full path for ZIP (or out) zip libraries, check that setti...

c# - Extension method on type -

Is there a way to create an extension method for that type? I am able to make them for examples. public static class MyExtensions {public static string test (this string) {return "test"; }} Public class test {static zero test it} {string.Test ()); // string will not compile the s = null; S.Test (); }} No, this is not possible. Extension methods can only be made for example

c++ - Most efficient way to store a mixed collection of doubles and ints -

I need to store ints and a couple of doubles (representing nominal and actual valuable data) in C ++. I have to explicitly assign them all to std :: vector & lt; Double & gt; I can store in , but it feels a bit wrong and does not get aesthetics bonus points. I could have cooked up something based on polymorphism, but I need to make the collection really efficient: collecting and retrieving the data in the archive should be as fast as possible. I find it difficult to decide whether such a solution would be more efficient. I have also come to know, which can be of help here. Additional information: The number of objects in the collection Briefly: I can clearly explain it in countless ways, but I'm not sure what a good solution would be when ( I) Efficiency is really important and (ii) I also want to write some good code. What is my best bet here? Edit, additional information: The collection represents a 'row' in a large data set; its elements represen...

javascript - Wrapping a div around the document body -

I am trying to dynamically wrap the body tags of a document in a DIV. Up to now, I have used the following code: document.body.innerHTML = '& lt; Div id = "wrap" & gt; + Document.body.inner HTML + '& lt; / Div & gt; '; This works, but there is an unwanted side effect that the other script is working on the same page (I believe because any object referencing the internal HTML is useless Can). What will be the best / most effective way to achieve and retain references using a pure javascript or prototype framework Thanks in advance! You do something like this: var div = document .createElement ("div"); Div.id = "wrap"; // Move the body of the body to this cover, while (document.body.firstChild) {div.appendChild (document.body.firstChild); } // Add the ring to the body document. Don.appendChild (div);

compilation - Ironpython 2.6 .py -> .exe -

I have already tried to use py2exe (not compatible with ipy) and pvc (from old time) . Can anyone tell me in the direction of a good compiler? You can use, the Python command-line compiler , which version 3.1 has been included in IronPython so that an executable python script can be compiled. You can find it on your hard disk at % IRONPYTONINSTALLDIR% \ Tools \ script \ pyc.py . Example Assume that you have a simple script test.py which prints something out of the console for you to command it with a command line Executable (assuming that the IronPython directory is the current directory and that is also test.py ): ipy.exe tool \ script \ Pyc.py /main:test.py/ target: exe Note: If you are using the form and do not want the console to open the window, The / target: winexe instead of / target: Want to use the exe . Click the result for two files, test.dll and test.exe . test.dll will include your actual script code, while test.exe is only a launcher f...

.net - C#/ASP.NET: Create Database Report? -

How do I go about creating a report that receives data from the database? I go to the third party tools, because a flexible reporting solution is itself a project, and possibly : Do not fit in your development program. There are several options for asp.net.

Catching " " exceptions in recursive C++ functions

Is it possible to capture stack overflow exception in the recursive C ++ function? if so, how? What will happen in this case zero (work) {try () {doWork (); } Hold (...) {doWork (); }} I am not looking for answers to specific OS. Just in general There really is not any portable way to do this A recursive function out of control will usually cause an invalid memory access when it will attempt to allocate a stack frame beyond the stack address space. Typically this will crash your program with segmentation fault / access violation depending on OS. In other words, it does not make a C + + exception that can be handled in a standard way by language.

sql server 2008 - TSQL rollup -return not null -

I am using the rollup clause and how do you show aggregation at different levels with null The different values ​​shown will show subtotal at each level of the rollup level eg rollup (year, month, week) . I want to roll it and still just want to see the highest level of aggregation. So I do not want to see any null value. Any ideas how can I do this? Submission MENZOT You only "aggragation of the highest level grouped like this: Select group (group id) = 1 then '#' group 'group' group as EDD, case when grouping (all -Group ID = 1 then '#' Also grouped by the group group group as sub-group ID, SUD (value), It will be displayed on zero.

Parsing the string in PHP -

How can I divide this line: My [wǒ] - ( Pronoun) I or me [nǐ] - (pronoun) you (second person singular); My [wǒ] - (pronoun) me or me 你 [nǐ] - (pronoun) you (second person singular); that [tā] - (pronoun) he or she we say, insert after each line of tag? Thank you! UPD was my bad, duration, but it was a mistake. The only obvious pattern we can see is that you have removed the dots "A foreign letter, a place And an opening bracket ". Note to that: Note that using this algorithm, line break lines will be replaced at the beginning. Do not forget the UTF-8 flag, and use UTIF-8 everywhere in your application or processing strings will be a mess. EDIT: If you ever want two rows at the beginning of the line break, then you can use it for that purpose: $ string = " I [wǒ] - (pronoun) me or you [me] [nǐ] - (pronoun) you (second person singular); He himself [tā] - (pronoun) he or she "; // the same pattern, but excluding the firs...

ruby on rails - How to set the default value for a datetime column in migration script? -

नीचे तालिका निर्माण स्क्रिप्ट पर विचार करें: create_table: foo do | t | T.datetime: start_at,: null = & gt; झूठे अंत क्या वर्तमान समय के रूप में डिफ़ॉल्ट मान सेट करना संभव है? मैं एसक्यूएल कॉलम की परिभाषाओं के लिए रेल में एक डीबी स्वतंत्र समकक्ष ढूंढने की कोशिश कर रहा हूं ओरेकल सिंटैक्स start_at तिथि DEFAULT SYSDATE () MySQL सिंटैक्स start_at TIMESTAMP डिफॉल्ट CURRENT_TIMESTAMP OR start_at DATETIME डिफॉल्ट अब () आप इस तरह एक मॉडल में फ़ंक्शन जोड़ सकते हैं: पहले सेट करें: set_foo_to_now def set_foo_to_now self.foo = समय.अब अंत ताकि मॉडल वर्तमान समय को मॉडल में सेट कर देगा। आप कुछ एसक्यूएल भी डाल सकते हैं डेटाबेस स्तर पर डिफ़ॉल्ट मान सेट करने के लिए माइग्रेशन में कोड, कुछ ऐसा ही होता है: execute 'alter table foo change column start_at डिफ़ॉल्ट सेट आता है ()' कुछ सेट करना इस तरह से बात: create_table: foo do | t | T.datetime: start_at,: null = & gt; गलत, डिफ़ॉल्ट = & gt; टाइम। अब एंड टाइमएन फ़ंक्शन को माइग्रेट क...

python - Django inheritance: how to have one method for all subclasses? -

इस सवाल का पहले से ही एक उत्तर है: 8 जवाब मेरे पास एक मॉडल है बेसमोडेल और इसके कई उप-वर्ग चाइल्डमोडेलए (बेसमोडेल), चाइल्डमोडेलबी (बेसमोडेल), ... मल्टी-टेबल इनहेरिटेशन का उपयोग करना भविष्य में मेरे पास दर्जनों सबक्लास मॉडलों की योजना है। सभी उपवर्गों में विधि का कुछ कार्यान्वयन है do_something () कैसे मैं एक बेसमॉडल इंस्टेंस से डॉट कॉमिंग कॉल कर सकता हूं? लगभग एक समान समस्या (समाधान के बिना) यहां पोस्ट की गई है: एक सरल प्रश्न: मैं कैसे इसके किसी एक को बेसमोडल इंस्टेंस को हल करता हूँ सभी संभव उप-वर्गों को जांचने के बिना सबकेस उदाहरण? अगर आप सभी संभव उप-वर्गों को जांचने से बचना चाहते हैं, तो एकमात्र रास्ता मैं सोच सकता हूँ कि आधार वर्ग पर परिभाषित क्षेत्र में उपवर्ग के साथ जुड़े वर्ग नाम को संग्रहित किया जाएगा। आपके आधार वर्ग में इस तरह की कोई विधि हो सकती है: def संकल्प (स्वयं): मॉड्यूल, cls_name = self.class_name.rsplit ("।", 1) मॉड्यूल = import_module (module) cls = Getattr (module, cls_name) return cls.objects.get (pk = self.pk)...

php - Should I leave output_buffering On or Off in a Production Environment? -

I'm about to launch a website and I'm going to my php.ini so that all the settings for the output are ready . environment. I am debating whether I have to quit outbound_buffering or not, in the range of closed, or buffer (eg 4096). Is there any pro or con output_buffer to turn on or off? I have read that by shutting down the buffer off you will get some additional exposure, but before I make my decision, should I know something? Why leave it? Why leave it? Why leave it with buffer limit? This is a configuration against register_globals and magic_quotes_runtime it is not controversial that it should close it by default. Enable it, if you need it (this I do). As far as I know, there is no protective hole that is produced by doing this.

How much "unlearning" when I move to a PHP framework -

I'm aware of the benefits of using the PHP framework (though not the first hand, just SO read etc.) but I While using a "loose" framework, you control the new structure and you have to "unleash" many things and they have to learn again in a new way as if your New framework is required. Is it true, and which structure is the most flexible when it comes to this unmanageable aspect? It depends only on how you have learned something. It also depends on the special framework, adding some useful functions and suggestions, while others offer (or force) you use different types of development, Filestructures and Functions. For example, you can still do pre_replace ('[A-Za-z]', $ user.name), still work, but is_alphabetical ($ user name) same) will talk. You can still use the same task, but for some structures you need to recreate the structure of your program, while others use only the helpers, functions and database classes. To provide. I have he...

ruby - Manipulating a byte array -

I have a simple byte array ["\ x01 \ x01 \ x04 \ X00 "] I'm not sure how can I change just the second value in the string (I know that there is only one object in the array), while keeping the object a byte array . Some of these lines: ["\ x01 # {ARGV [0]} \ x04 \ x00"] I think the secret is that you have nested arrays: irb (main) : 002: 0> X = ["\ x01 \ x02 \ x01 \ x01"] = & gt; ["001 \ 002 \ 001 \ 001"] You can index it: irb (main): 003: 0> X [0] [1] = & gt; 2 You can assign it to: irb (main): 004: 0> X [0] [1] = "\ x05" = & gt; "\ 005" And what you want: irb (main): 005: 0> X = & gt; ["001 \ 005 \ 001 \ 001"]

usability - "Date of birth" validation: How far/much would you go? -

I am quite anecdote about form validation. So to create a validator for a "birth data" (DOB) field of one of my current projects for a job application form (platform / language is neutral in this context), to prevent 'foil' inputs needed. I used a date picker and restricted from the present day to a maximum of XX . XX makes sense for this scenario because no young person should apply for a job. Verification error message is: You seem to be very low for the job. Then I started to be brave If BAB is more than 120 years ago, then the message: "You can not be that old man !!!" If there is a DOB in the future, then the message: "You should be kidding, you have not been born yet !!!" Finally, I deployed without the last 2 , Even mysterious for my no-nonsense client I would like Similarly, for dates like "Date of Marriage", "Year of Graduation" etc., how far away / can you know? PS: As I was about to submit thi...

design - Flex charts gradient fill -

I am struggling to fill the shield of this. What is the tool that helps fill in the GrantIntter's assets? Finally I found this right. If you are interested in the code below & lt ;? Xml version = "1.0"? & Gt; & Lt; Mx: application xmlns: mx = "http://www.adobe.com/2006/mxml" & gt; & Lt; Mx: script & gt; & Lt ;! [CDATA [Import mx.collections.ArrayCollection; [Bindable] Public Works DummyData: ArrayCollection = New ArrayCollection ([{x: 10, y1: 2000, y2: 1200}, {x: 20, y1: 3000, y2: 1000}, {x: 30, y1: 2000, [X: 60, y1: 1500, y2: 1200}, {x: y2: 1500}, {x: 40, y1: 1800, y2: 1200}, {x: 50, y1: 2000, y2: 1400} 70 , Y1: 2000, y2: 1200}, {x: 80, y1: 1500, y2: 2000}, {x: 90, y1: 1500, y2: 2500}, {x: 100, y1: 1800, y2: 1700 }, {X: 110, y1: 2400, y2: 1200}, {x: 120, y1: 3000, y2: 1500}, {x: 130, y1: 200, y2: 200}]); ]] & Gt; & Lt; / Mx: script & gt; & Lt; Mx: panel title = "area chart" & gt; & Lt; Mx...

Does C# have an equivalent of Java static nested class? -

I am converting Java into C # and the following is the code (see About Its Use). One approach might be to create a separate file / square, but is there any C # IDM that preserves the intention of Java code? public square fu {// fu fields and functions // private static class SGroup {Private stationary map & lt; Integer, s group & gt; IdMap = new hashmap & lt; Integer, S group & gt; (); Public SGroup (int id, string type) {// ...}}} Take a look at this I'm especially looking at In other words, Java Inner Class is syntactic Chinese, which is not available for C #. In C #, you have to do it manually. If you want, you can make your own sugar: class OuterClass {... innerclass newInnerClass () {return new innerclass (this); } Some Functions (Zero) () {Innerclass i = this.NewInnerClass (); I.GetOuterString (); }} You want to write in the new O.इन class (...) in Java, then you can either New in C # Inner class (...) or new innerclass (O, ...). Yes,...

php - Can't Consume Web Services -

I am trying to use Google Maps Web Services or even Yahoo Maps to use PHP. When I run it, I do not get anything, all HTML and prints come in, but absolutely nothing from Google service. When I gave my friend the code to run on my local PC, it looked fine and was showing the map. But it seems that I have trouble at the university. Is it behind a proxy? What could be the issue? Apart from this, the host can not be reached outside the university. If it Getting stuck on simplexml_load_file , and you are trying to use the simplexml_load_file to get a remote file, and your secure mode in the university (like mine) It will fail, you can not get in safe mode such as a remote file, through you cURL You should Ksmel and then use simplexml_load_string . It will also explain why your friend can do this and you can not

java - i have developed an application using tomcat5.0.28. when i try to execute it it was shoing the following exception -

javax.servlet.ServletException: सर्वलेट उदाहरण org.apache.catalina.valves.ErrorReportValve.invoke आवंटित करने में त्रुटि (ErrorReportValve.java : 118) org.apache.coyote.tomcat5.CoyoteAdapter.service (कोयोटएडैप्टर.जावाअर्थ 60) org.apache.coyote.http11.Http11Processor.process (Http11Processor.java:799) org.apache.coyote.http11.Http11Protocol $ एचटीपीपीकनेक्शनहैंडलर .processConnection (Http11Protocol.java:705) org.apache.tomcat.util.net.TcpWorkerThread.runIt (PoolTcpEndpoint.java Tell77) org.apache.tomcat.util.threads.ThreadPool $ नियंत्रणपरिवर्तनीय.रुन (ThreadPool.java:683 ) Java.lang.Thread.run (थ्रेड.जावा। 3434) मूल कारण java.lang.UnsupportedClassVersionError: Catalog1 (असमर्थित प्रमुख। युग संस्करण 49.0) java.lang। क्लासलोडर.डिफ़िन क्लास 0 (नेटिव मेथड) java.lang.ClassLoader.defineClass (क्लासलोडर.जावा पेडरजन) java.security.SecureClassLoader.defineClass (SecureClassLoader.java:123) org.apache.c Atalina.loader.WebappClassLoader.findClassInternal (WebappClassLoader.java:1634) org....

cocoa - Binding a table column containing NSPopUpButtons -

I have a table in which one uses a NSPopUpButtonCell I am trying as much as possible, I think That is not the way to get the way I want to properly bind everything. Here's what I'm trying to do: I have an NSArrayController that is called 'field value' from a managed object context. It is used to populate a popup menu for each item (i.e. the list of available options). I can force it by selecting cell in IB and arranging my content / objects / values ​​by 'field value' and 'reserved' objects and 'field value'. Orgates. Name as appropriate (to get the object and visual title represented). Then I want to bind the column in such a way that the value selected in each row comes from an array in my controller class, again made visible (and edited only) by another NASRRE controller. So far, I have managed to set it up so that there is a list of available fields in each popup menu, and that the default value is selected in each of them, in fact,...

design patterns - Infrastructure: models as an external to an application to avoid stored procedures -

मेरा विचार: मैं विभिन्न कारणों से संग्रहित प्रक्रियाओं को तुच्छ जानता हूं: लागत, स्केलेबिलिटी, और संगतता। लागत: मुझे एक अच्छा माइस् SQL सर्वर की लागत के लिए 2-3 अच्छा हल्के वजन वाले वेब अनुप्रयोग सर्वर मिल सकते हैं। स्केलेबिलिटी: यकीन है कि मैं क्वेरी परिणामों को कैश कर सकता हूं, लेकिन जब मैं संग्रहीत कार्यविधियों का उपयोग कर रहा हूं तो मुझे कैश की जा सकने वाली किसी भी बेहतर ग्रैन्यूलरिटी का मौका खो देता है और इससे हमेशा अनुप्रयोगों का उपयोग करने के लिए संबंधों का इस्तेमाल होता है MySQL (जो कि संग्रहीत प्रक्रियाओं को फिर से लिखने के लिए MySQL से कुछ और करने के लिए धन मिला है?) संगतता: कुछ बिंदु पर list_foo_widgetsByUser () संग्रहीत कार्यविधि की आवश्यकता के अनुसार फिट नहीं हो सकता ग्राहक # 123 यह list_foo_widgetByUser () के हस्ताक्षर को संशोधित करने के लिए आत्मघाती होगा ... तो फिर मुझे एक नया sproc cl123_list_foo_widgetByUser () लिखना होगा और इस तरह से मादा या एक घृणित डीबीए की ओर जाता है। मेरा समाधान: मॉडलों को एप्लिकेशन के रिपॉजिटरी से बाहर निकाल कर उन्हें बाहर...

iphone - How to add AdMob ads to a UITableView -

I'm trying to add an AdMob ad to a table view. I would like to show that in every 10th cell (eg, in the free version of the Reddit app you have it). I tried to follow the adobe documentation but I had no luck and I am sure there is something missing in me. Can someone shine some light in a simple way to do this? Thanks! I originally used code like this: Int line = [indexpath line]; If (0 == (line% 10)) {// or 9 == If you do not want ads on the first cell! Fixed NSString * MyIdentifier = @ "AdCell"; Cell = [tableview decomputer reusable cell identifier: mydifter]; If (cell == blue) {cell = [[[UITABLE VIACL ALLOC] InitVithframe: CGRxeroRece Identifier: MyDenFIFEER] AutoEques]; } [Cell.contentView addSubview: [AdMobView requestsAdvitt Delegate: self]]; } And {// make their normal cells}

java - Spring @Transactional merge and persist question -

New for Spring and here @ StackWarflow I have a stand-alone inventory & amp; Distributor Business Sales Tracking App (Apache Pvot / Spring / JPA / Hibernate / MySQL) So far, I think everything is CRUD, so I want to plan a base class with everything @translegal. Then there is a problem to save me from my normal way. Is there any difference in merge and merge method from EntityManager to Spring? I tried to walk and both were saved to add and update and it worked fine (I think every time I call, the spring is automatically healthy method // Sleeping questions are being seen to save, is it correct?). @ Transaction related public abstract class generic DOA {protected EntityManager em; // em holder + @stensecontact / setter public sound save (tt) {// if (TGID (== faucet) // new // // em.persist (t) Create; //} else // update // {em.merge (t); //}}} And with BTW, having such a setup, I will not have much compromise in the right performance? To prepare the report (which d...

asp.net mvc - Can Dependency Injection delay creating objects required? -

मैं अपने asp.NET MVC अनुप्रयोग के साथ कुछ निर्भरता इंजेक्शन ( StructureMap ) के साथ खेल रहा हूं । महान काम करता है। बनने के लिए स्ट्रक्चरमैप सबसे ग्राजी कन्स्ट्रक्टर के माध्यम से DI का उपयोग कर रहा है (मुझे उम्मीद है कि मुझे उस अवधारणा को नाम दिया गया है), मैं इस धारणा के तहत हूं कि यह एक उदाहरण बनाता है तो, क्या यह एक डि फ्रेमवर्क को बता सकता है (इस मामले में, यह स्ट्रक्चरमैप है लेकिन मैं उत्सुक हूं अगर यह किसी अन्य के लिए कर सकता है। नेट डि फ्रेमवर्क) जब निर्माता को कहा जाता है, लेकिन आवश्यक होने तक उस ऑब्जेक्ट के निर्माण को विलंब करने के लिए उदाहरण बनाने के लिए नहीं? कुछ आलसी-वस्तु निर्माण या कुछ चीज़ों की तरह सॉर्ट करें ... सिंगलटन-> सशन / अनुरोध मैपिंग का समर्थन करने वाले सभी डि फ्रेमवर्क आम तौर पर "असली" ऑब्जेक्ट के बजाय एक प्रॉक्सी ऑब्जेक्ट इन्स्तांत करते हैं जब एक सिंगलटन ऑब्जेक्ट को एक सत्र स्कॉडेड ऑब्जेक्ट तक पहुंचने की आवश्यकता है। "वास्तविक" उदाहरण का निर्माण आम तौर पर पहली बार स्थगित किया जाता है कि प्रॉक्सी पर एक विधि लागू की जाती ...

.net - shrink or compact in Sql Server CE? -

I am using Visual Studio 2008. And I'm new on sqlce. I am checking the SDF file and if the SDF is not present, then I create and then insert 5000 rows in my SKD. If SDF is present, then first I remove the rows of all the tables and then put these records in the existing tables. After joining, I am compacting the database. By the way, compacting lasts for about 13 seconds. I know that there is a way that calls briefly. Shrink and compact DB make small but which of these should be used in this scanner? How can I do compact less time? I do not need to back up the SDF and after the compact, I read the topic removing the old SDFI, but I can not decide whether I should use it. please see: Excerpt from: SqlCeEngine / ISSCEEngine: Wide Compact Summary The difference between the two is very similar to internal and external memory fragmentation From to: By transferring empty and unallocated pages at the end of the file, empty space in the database was empty, and then ...

video - Digital picture processing on iPhone -

I want to write an application on the iPhone which: Make some digital processing on the video Send some graphics via TV-out Can you please tell me whether it is possible on top of iPhone 3G or 3GS? is? Can I get access to every pixel in video capturing through an iPhone camera? Private access points both live video recordings and. They are not well documented, so you will not find much about them and you will not be able to submit anything they use in the App Store. Video capture in real time will probably eventually become a public part of SDK, but television is probably less likely at this point.

NHIBERNATE: How to map a collection into the DB using Mapping.Attributes -

I have this product class which I have taken from examples of navigator use (but I made some amendments in it) Want to be able to map a square and all its references in DB [NHibernate.Mapping.Attributes.Class (lazy = true)] Public class product {{NHibernate.Mapping.AttributesIID (name = "id", type type = typef (guide)) ] {Receive Public Virtual Guide ID; Set; } [NHibernate.Mapping.Attributes.Property] Public Virtual String Name {get; Set; } [NHibernate.Mapping.Attributes.Property] Get the Public Virtual Ent Category { Set; } [NHibernate.Mapping.Attributes.Property] Public Virtual Bulb closed {get; Set; } [NHibernate.Mapping.Attributes.Map (name = "item")] Public Virtual Dictionary & lt; Guid, SubItem & gt; Product {Received; Set; }} Where subitem is defined as: [NHibernate.Mapping.Attributes.Class (lazy = true)] Public class subtitles {{NHibernate Mapping. Features. (Name = "id", type type = typef (guide))] {Receive Public Virtual Guide I...

ruby on rails - typewatch jquery callabck not updating html -

I am using the typeWatch plugin to monitor a text field and I want to send callback to an administrator, its After a divin view is killing the event controller but I can not find the device to update the content: $ (function () {$ ("#start_date"). TypeWatch ({highlight: true, callback: end}} function end (date) {$ .post ('/ matches / watch', {'date': date, complete: function (request) {$ ('# watch' ). Effect ('highlight', {color: "# C3FF29"}, 2000);},});}}); #match_ Controller def clock @preview_start_date = params [: date] response_to do | format | format.js end-end # watch.html.js $ ("# clock"). Html (& lt;% = @ preview_start_date% & gt;); Any help? Try it out: $ ("#clock") .HTML ('& lt;% = @ preview_start_date% & gt;'); And it also indicates that You are returning JavaScript from your controller: $ Effect ('highlight', {color: "# C3FF29"}, 2000); ...

Omitting optional tags of html -

I just read from Google. I always thought that the closing tag is important to keep HTML tags clean and machine-readable . But they suggest contrast. What do you think about it? Google is in some unusual position to provide so many copies of their main search pages that the page Any small savings in size are added soon. This means that removing close pages and whitespace and reducing your pages is economical, at the cost of making it difficult to maintain them. You are not Google; It is unlikely to pay the amount for you. You will notice on the Google page you linked that they do not miss the recommendation of the tag, because it is not one of the important pages Google offers. is. Compare the extreme mining of the front page of www.google.com. Use Compression to Geese / Disfill and you will get a higher minimum transfer size than before; Reducing markup is a frustrating measure, unless you're not serving the load, there will be a premature optimization.

activerecord - How to turn off auto_increment in Rails Active Record -

क्या ActiveRecord में auto_increment फ्लैग के बिना प्राथमिक कुंजी बनाना संभव है ? मैं नहीं कर सकता तालिका बनाएं: blah,: id = & gt; गलत क्योंकि मुझे कॉलम पर प्राथमिक कुंजी इंडेक्स होना है। मैंने देखा लेकिन उपयोगी कुछ भी नहीं मिला। क्या स्वत: आयतन के बिना प्राथमिक कुंजी बनाना संभव है? इसे आज़माएं? create_table (: table_name,: id = & gt; गलत) do | t | T.integer: id,: options = & gt; 'प्राथमिक कुंजी' अंत

linux - Sorting and extracting of dirnames -

ऐसे कई निर्देशिकाएं हैं, जैसे web001 web002 .. वेब 123 ... मैं इस सेट से अधिकतम-संख्या निकालना चाहता हूं ... num = "निकाले जाने वाले के साथ -नाम / डायनाम नाम ... ... पूंछ '" मेरे पास कोई विचार नहीं है ... धन्यवाद अगर आप चाहते हैं नंबर: ढूंढें-प्रकार डी-नाम वेब \ * | सॉर्ट | पूंछ-एन 1 | कट- d'b '-f2

Bind handler to Ajax Sys.Component.propertyChanged event -

"When you create a client component class, you define the properties that you want to access the page developers Hope you can increase SIS components.Property changes the events of change in set accessors for the properties of your component. Pages that use the component developers will not notice the property's event to their own handler code To run A can force A when the property value changes. "From Does anyone know how to pair a handler for converting a person who enters a property into a property Seen for age, but no such example can be found, how it will show. I did this work eventually, just at the moment it was not clear. The Sys.Component.propertyChanged event is only one instance when your Ajax Object changes any property. When the event is picked up, it gives the name of the property that was changed. To use this property, we need to pass a handler for the event converted in property while creating an object: function app load handler (sende...

php - Getting product details using Amazon API -

I've got the following code to output a list of items from Amazon, but I'm not sure that specific products How to use (with summary, review, etc.) Any help would be appreciated. & lt ;? Php function makeAWSUrl ($ parameter, $ associate_tag, $ access_key, $ secret_key, $ aws_version = '2009-06-01') {$ host = 'ecs.amazonaws.com'; $ Path = '/ onca / xml'; $ Query = array ('service' = & gt; 'AWSECommerceService', 'AWSAccessKeyId' = & gt; $ access_key, 'AssociateTag' = & gt; $ associate_tag, 'Timestamp' => GMDET ('Ymd \ TH: I: s \ z '),' version '= & gt; $ aws_version,); // Merge any option that was given in the if_array ($ parameter) {$ query = array_merge ($ query, $ parameters); } // case-insensitive, sort the natural order on the array key ksort ($ query); // signable string $ temp = array (); Forex Currency ($ query = $ as query => $ v) {$ temp [] = str_replace (...

linux - How to extract archive from this script (using tar) -

I do not know exactly how to unpack a built-up archive. I'm giving you the full script A Debian-based distribution named Univalense uses this to backup many files in the tar archive. The real collection is packed in a function. The main content where they make the actual tar file: cat "$ TMPDIR / freeinfo.txt" & gt; & Gt; "$ TMPDIR / Installinfo.txt" 2 & gt; / Dev / null echo & gt; $ TMPDIR / endtag.txt echo "%%%% OXBACKUP _ $ {DATE} _HEADER_ENDTAG" & gt; & Gt; "$ TMPDIR / endtag.txt" BACKUPINFO = "$ BACKUPINFO endtag.txt" cat 2 & gt; / Dev / null & lt; & Lt; EOF & gt; "$ TMPDIR / Installinfo.sh" BACKUPHOSTNAME = "$ hostname" BACKUPDOMAINNAME = "$ domain name" BACKUPBASEDN = "$ ldap_base" BACKUPTIMEZONE = "$ (cat / etc / timezone)" BACKUPLANG = "$ (echo $ locale_default)" BACKUPPSAMBADOM = "$ Windows_domain" backpac...

java - How does the toString(), ==, equals() object methods work differently or similarly on reference and primitive types? -

कैसे toString () विधि, == ऑपरेटर कैसे करता है, और बराबर () विधि अलग तरह से या इसी तरह संदर्भ और आदिम प्रकार पर नियमित प्रकार के लिए (स्ट्रिंग सहित): == वस्तु संदर्भों की तुलना करता है। यह परीक्षण करता है कि दो वस्तु संदर्भ समान हैं; अर्थात यदि वे समान ऑब्जेक्ट को देखें। बराबर (ऑब्जेक्ट) परीक्षण अगर यह ऑब्जेक्ट एक दूसरे के बराबर है क्या "बराबर" मतलब इस बात पर निर्भर करता है कि वस्तु का वर्ग समानता को कैसे परिभाषित करता है java.lang.Object वर्ग परिभाषित करता है बराबर (अन्य) हो यह == अन्य , लेकिन कई वर्ग इस परिभाषा को ओवरराइड करते हैं। toString () एक स्ट्रिंग के लिए वस्तु का एक सरल रूपांतरण प्रदान करता है परिणामी स्ट्रिंग का प्रारूप और सामग्री वर्ग विशिष्ट है, और ( java.lang.Object अनुबंध के परिप्रेक्ष्य से) कोई गारंटी नहीं है कि यह सार्थक होगा। (सच्चे) आदिम प्रकार के लिए: == प्रकार के मूल्य की तुलना करता है, और बराबर () और toString () परिभाषित नहीं हैं जावा आपको एक प्राचीन मूल्य पर किसी विधि को कॉल करने की अनुमति नहीं देता है। ...

iphone - Converting a date (string) into another date format (string) -

I'm happy if there is any one can help me, a newbie question. For example, I have an NSMutableArray: {JobID = 109302930; Subject = "test theme"; Submit = "2009-09-15 17:27:34"; } Now I am trying to create a square in my table view and want to group my records on the basis of "formatted" data. For example, 16th May'09 ========== Item one item b 18th May'09 =========== Item C Item G 20th May'09 ========== Item Jade Item K I (from an XML data source) after this NSMutableArray with function (NSString *) elementName namespaceURI: (NSString *) namespaceURI qualifiedName: (NSString *) QName {currentElement = [pic] [NSString alloc init]]; If ([elementName isEqualToString: @ "subject"]) {[item setObject: currentSubject forKey: @ "topic"]; } And if ([elementName isqualToString: @ "job_id"]) {[item set object: current jubbed farke: @ "job image"] ;; } Else if ([elementName isEqualToString: @ ...

gwt anchor tag not anchoring -

ब्राउज़र एंकर को क्यों स्क्रॉल नहीं करता? url: this.anchor1.setName ( "myAnchor1"); this.add (this.anchor1); this.anchor2.setName ( "myAnchor2"); this.add (this.anchor2); this.anchor3.setName ( "myAnchor3"); this.add (this.anchor3); क्या ऐसा इसलिए है क्योंकि पेज लदान समाप्त होने के बाद एंकर बनाया गया है, इसलिए ब्राउज़र एंकर को तब तक नहीं देखता है जब इसे स्क्रॉल करने का प्रयास होता है? इसे आज़माएं: this.anchor.setName ("myAnchor"); this.add (this.anchor); Location.hash = '#myAnchor'; और हाँ, आप सही हैं, पेज लोड के बाद आपका लंगर बनाया गया / डाला गया था, ठीक है .....

Preferred way to copy JPG files from a remote server using PHP -

I am using PHP to copy JPGs from my remote server to my own server. Is it best to use only the copy () function, or is JPG-specific work better? For example: $ copy = copy ($ remote_url, $ dest_file); -OR - $ img = imagecreatefromjpeg ($ remote_url); $ Copy = imagejpeg ($ img, $ dest_file); Imagedestroy ($ img); What would be the best option in terms of speed and memory weight? Apart from this, will there be any difference in image quality as a result? I should add that this script is needed to copy large numbers of photos (usually hundreds, but sometimes it can be one thousand thousand). Thanks, Brian If you want a copy, copy () its better. Using GD library functions (imagecreatefromjpeg / imagejpeg) to compress the image at the end (maybe, probably not smart, but probably). If you have images. PNG or something, you want to use GD (or ImageMagic)

c# - ASP.Net - Displaying a collection of controls -

I am creating a simple form I have created two simple classes, questions and question questions. Then I can make a question about some sub-classes, eg Private List & lt; Question & gt; With general questions, multiple checkbox questions, different behaviors and markup. Question is the property of the collection of questions in question, like - _ Question = New list & lt; Question & gt; (); Public listing & lt; Question & gt; Questions ({return} ask questions;}}, such as SurveyForm.aspx - & lt; uc: question id = "ucQuestionSection" Runat = "server"> & lt; uc: simple question id = "QLastName" runat = "server" questionTax = "last name" /> gt; & lt; / Question & gt; & lt; / UC: QuestionSection & gt; with my question. - & lt; / div> which is loaded on this question by QuestionSection.ascx.cs Secure Zero Page_Init (Object Sender, EventArgs E) {foreach...

streaming - Ruby CGI Stream Audio -

What I want to do is to use a CGI script (written in Ruby) to use the file system (audio, special ) And stream it in the browser. In this way I am doing so by now, 'config' ENV ['REQUEST_URI'] = ~ / \? (. *) $ / F = $ config [: mdir] + '/' + $ 1.Ur_decodeF = file. OpenF, 'RB' print "content-type: audio / mpeg \ r \ n" #TODO: MME type print looks "\ r \ n" #Outputs file while blk = f.read (4096) $ stdout It's not right, there are security holes (highlighting the entire file system ..), but it does not work right. Blk $ stdout.flush end f.close This is reading the correct file, and as far as I can tell, it should output to 4k blocks as if it should be Using Safari, if I go to URL, it will show a question mark on the audio player. If I use wget to download it, then it appears to work and is about the right size but is corrupt. It starts playing fine, then the cranks, and then closes. How should I go about doing this? Do...

linux - How can I get the "full" makefile if a Makefile contains "include"? -

Is it possible to get "full" messaging if the makeup file "contains"? For example: # contains content of the makefile here INC1.i contains inc2.i clean: rm -rf * #here inc1.i The contents of ABC are: Touch ABC #here Content of Inc2.i def: Touch DF How can I get a "full" makefile? Because when the makefile contains other ink, and the ink file also includes another sub-ink ... it is very difficult to read! I have to get a "complete" makeup file: ABC: touch ABC def: touch DF clean: rm-rf * While using GNU make, I often find useful output from make -p More than what you were asked).

bit manipulation - what is the correct way to process 4 bits inside an octet in python -

I am writing an application to parse some network packet in a packet field, the protocol version number is in octet, so 4 high bits are 'major' and less 4 'minor' versions are. Currently I am parsing them in the following way, but I am thinking that there is a superb or more 'python' method of doing this: v = ord (data [17]) = (V & amp;; int ('11110000', 2)) & gt; & Gt; 4 small = V and amp; Int ('00001111', 2) You can type binary written words like this For your example, I want to use Hex v = ord (data [17]) key = (v) 0b1111000 & Amp; 0xF0) & gt; & Gt; 4 minor = (V and 0x0 F) You may also want to use the module to break the packet into its components

asp.net mvc different validation rules for different actions -

What is the best practice to validate my model for various tasks, for example, to create and delete Separate verification rules? For example P> Valid use of person, name, age and email is not in use. Delete person believes that a person is a parent No business logic determines that parents can not be terminated How can I get these two different recognition scenarios? As I understand you want more control over your verification rules. You can manually add verification rules as described here: It gives you complete control over how you organize validity, which tasks, etc. The rules that add.

git - How do I show the changes which have been staged? -

I made some changes; How can I see all the files I staged for the next commitment? I know, but I want to see the real defenses - not only the names of the files that have been staged. I saw that Man page says Git diff [--options] [-] [...] This form is yours by In view of the changes made in relation to the index (the forum for the next commitment) in other words, there are differences that you can add GIT to the index but you are still not. You can step through these changes using git-add (1). Unfortunately, I can not understand a lot about this. There should be some easy one-liner for which I can make nickname, okay? This can only be done: git diff - cached - cached means cache / change) against current HEAD . There is an option for - stepped - cached . Edit To clarify the above statement, - staged and - cached HEAD does not indicate , the only difference with the HEAD is if you select the cherry that git add --patch (or git add -p ), then...

Silverlight PRISM loading an external XAP module -

I'm not sure that this is possible, but I am currently loading most of the modules from within the main application assembly , I am now trying to load external XAP modules. I have something like this: ModuleInfo themeModule = New ModuleInfo (); ThemeModule.ModuleName = "Theme_External"; ThemeModule.ModuleType = "Theme_External.me_External_Module, Theme_Xnet, version = 1.0.0.0, culture = neutral, public keynote = zero"; ThemeModule.Ref = "file: //Theme_External.xap"; Theme Module Initialization = initialization.mode.edendemed; Catalog.AddModule (themeModule); I realized then that you can not use that referee because it uses local file access that is not available in Silverlight. The only reason it was working for me was a direct reference to the theme project that I needed to remove Can I do something with the establishment of the current PRISM? Thank you for What Dave said ... And if it is not clear, you want to make only one cha...

ms access - What is the appropriate data type to use for storing numbers with leading zeroes? -

In Access 2003, I need to display numbers in such a way as to keep the leading zero: 070000 What data types should I use for this? of a string (or text, or varchar, or whatever your RDBMS uses) Use and pad the character you want ("0") that you need.

java - Applet HttpUrlConnection Chunked Response problem -

I have an HTTP protocol with an IIS 6.0 server applet. I server response data discarded, but sometimes (some browsers ) I have a problem pasting the server's answer in a few buffers, and when the server closes the connection through timeout then it reaches me. url = new URL (urlStr); Hook = (HttpURL connection) url.openConnection (); Huc.setDefaultUseCaches (wrong); Huc.setAllowUserInteraction (true); Huc.setDoInput (true); Huc.setUseCaches (wrong); Huc.setRequestProperty ("Pagera", "No-Cash"); Huc.setRequestProperty ("cache-control", "no-cache"); Huc.setRequestProperty ("Finished", "-1"); Huc.setRequestProperty ("content type", "text / html"); InputStream = huc.getInputStream (); ... while (TrunkStop) {while (errorConnection & amp; trunkStop) {connectToServer (); If (errorConnection) {sleepThread (); }} While (! Error connection and trunktop) {readData (); } ...} ... zero read data () {if (...

C++ template programming question expected `;' before ‘it’? -

मैं पॉलिसी-आधारित टेम्पलेट प्रोग्रामिंग का प्रयोग करने वाला एक छोटा सा कोड लिख रहा हूं। इस कार्यक्रम में, एक सीडीईकेयर वर्ग परिभाषित किया गया है और इसकी नीति क्लास के रूप में इसे डेकेयर पॉलिसी का उपयोग किया जाता है। हालांकि कंपाइलर ने शिकायत की कि "अपेक्षित`; ' इससे पहले 'यह' " सीडीकेयर भाग के बारे में कोई सुझाव? #include & lt; iostream & gt; # शामिल करें & lt; vector & gt; # शामिल करें & lt; नक्शा & gt; # शामिल करें & lt; उपयोगिता & gt; Int main () {} struct cathom {}; वर्ग CStateUpdater {सार्वजनिक: आभासी शून्य UpdateState (CAtom * patom) = 0; }; संरचना सीडीकेयर पॉलिसी {typedef std :: pair & lt; अहस्ताक्षरित int, अहस्ताक्षरित int & gt; indexpair; Std :: map & lt; इंडेक्सपेयर, डबल & gt; mDecayRate; सीडीकेयर पॉलिसी () {mDecayRate.clear (); } ~ सीडीकेयर पॉलिसी () {}}; टेम्पलेट & lt; वर्ग DecayerPolicy & gt; वर्ग सीडीकेयर: सार्वजनिक डिकैयर पॉलिसी, सार्वजनिक CStateUpdater {सार्वजनिक: आभासी शून्य UpdateSt...

algorithm - Converting a decimal number into binary -

I am currently reading Charles Petzold's book 'Code'. Here's how to convert the decimal number to binary using the following templates: [] [] ÷ 128 ÷ 64 ÷ 32 ÷ 16 ÷ 8 ÷ 4 2 ÷ 1 [] [] [] [] [] [] [] [] [] [] [] [] [/ code> In this book, his explanation about the use of templates Read: "Keep the entire decimal number (less than or equal to 255) in the box in the upper left corner, first divide that number (dividend) by the separator (128), as Has been indicated Enter the quotient (box located in the lower left corner) in the box below, and the rest of the box to the right (the second box on the top row). This first balance is the dividend for the next calculation, which uses a divisor of 64. The template Keep in the same way through the medium. Keep in mind that each quotient will be 0 or 1. If the dividend is less than the separator, the quotient is 0 and the derivative is only dividend if the dividend is The equalizer is equal to or equal to The q...

sql server - dynamic tsql in sql 2005 -

हाय मैं निम्नलिखित गतिशील sql का उपयोग कर रहा हूँ: declare @ cmd nvarchar (4000) सेट @ सीएमडी = 'चयन करें' 'exec msdb.dbo.sp_update_job @job_id =' '' '' + कन्वर्ट (नवरेचार (255), जॉब_आईडी) + '' '' '', @वरियर_ लॉगिन_नाम = '' '' सा ' लेकिन यह सब कर रहा है exec ..... के रूप में छपाई कर रहा है ....... मैं परिणाम निष्पादित करना चाहता हूं, न सिर्फ उसे प्रिंट करना। मुझे क्या करना चाहिए? सादर मानजॉट कैसे के बारे में: DECLARE @sql NVARCHAR (अधिकतम); SELECT @sql = COALESCE (@sql, '') + 'EXEC msdb.dbo.sp_update_job @job_id =' '' + CONVERT (एनवीएचएआरएआर (255), जॉब_आईडी) + '' ', @वरियर_ लॉगिन_नाम =' 'ए' '; ' से msdb.dbo.sysjobs; EXEC sp_sqlexec @sql; ध्यान दें कि sp_sqlexec अनडॉप्लीकेशन और असमर्थित है ऐसा करने के लिए एक समर्थित तरीके से, सिर्फ एक कर्सर क्यों नहीं बनाते हैं, इसका पालन करना और डीबग करना बहुत आसान है (लाल का कोई समुद्र नहीं है ...

inheritance - How can I call a masked function in C++? -

Assume that I have this C ++ code: zero example function ( ) {// # 1 cot and lt; & Lt; "I want to call the function." & Lt; & Lt; Endl; } Class ExampleParent {// I have no control over the public of this class: zero example function () {// # 2 cout & lt; & Lt; "I do not want to call the function." & Lt; & Lt; Endl; } // other stuff}; Class examples: Groups: Public for example {Public: My job is zero () (example) function (); // How to get # 1? }}; I have a succession from parent class to customize some of the functionality in the frame. However, parent class global exampleFunction is the one I want to call. Is there a way I can call it with myFunction ? (The time function Do the following: : exampleFunction () :: If you include # & lt; ctime & gt; , you name it as a std : To avoid these problems, keep everything in the name space, And by using the global namespace.

ruby on rails - ASP.NET MVC AjaxHelpers recommended usage -

It seems that I want to specify UpdateTargetId to present HTML content of AJAX response to all incoming instances I see. How different is this rail world in the world, where the response content contains the JavaScript code that connects the page. Rail conference seems more powerful. What is the recommended use that makes the ASP.NET MVC approach powerful? What are its advantages? ASP.NET is not equal to RJS generator in MVC, though it may be. Therefore, rail conferences outside the box are more powerful, but IMHO is suspicious that if it is good to return to JavaScript via asynchronous functions (like Jason and XML).

multithreading - python Queue get()/task_done() issue -

कतार के मेरे उपभोक्ता पक्ष: m = queue.get () कतार कार्य_ऑन () & lt; बाकी प्रोग्राम & gt; प्रश्न: क्या task_done () प्रभावी रूप से m कतार बंद पॉप करता है और कतार पर उपभोक्ता को जो भी ताला लगा है उसे रिलीज करना है? मुझे बाकी कार्यक्रम के दौरान m का उपयोग करना होगा क्या यह सुरक्षित है, या मुझे कॉल करने से पहले मुझे इसे कॉपी करने की आवश्यकता है task_done () ? P> नहीं, queue.get () कतार बंद आइटम चबूतरे ऐसा करने के बाद, आप जो भी चाहें कर सकते हैं, जब तक कि निर्माता इसे पसंद करता है और अब इसे स्पर्श नहीं करता। queue.task_done () को केवल कतार को सूचित करने के लिए कहा जाता है कि आप कुछ के साथ किया (यह विशिष्ट आइटम के बारे में भी नहीं पता है, यह कतार में अधूरा वस्तुओं की गणना करता है), ताकि queue.join () जानता है कि काम खत्म हो गया है।

javascript - How to prevent form submiting before DOM is ready? -

I am using javascript to validate the form, but then restrain the case Can not do when the form is submitted before the DOM is ready I tried: But the form can still be submitted. Before submitting a dome, check before posting to stop a post. & lt; Form method = "POST" onsubmit = "return handle ()" & gt; & Lt; Input type = "submit" / & gt; & Lt; / Form & gt; & Lt; Script & gt; Function handles () {return IMDR; } Var imReady = false; Function set read () {imReady = true; } // Edit: Add this line window.onDomReady = setReady (); & Lt; / Script & gt;

.net - WAP + NUnit + WebConfigurationManager Pin -

I have started using NUnit to write test cases for my asp.net web application project yet . Brings the connection string to a "section" defined under the "config files" of the "config file" code written for getting some database values. It works fine on the Web browser during the normal execution of the project, but when I use the same method through a test case, the Web Configuration Manager .tatched () always gives blank space. Initially I was not able to access the WebSettings section of web.config, but when I copied it to the Web.config file in the Bin folder but still "section" inside "Configuration" Not able to. Please suggest. By default NUnit will look for a config file which is in the same name as the test included Are there. So if you have some Test.dll, then NUnit will select some Test.dll.config. So for the standard this trick is to match the dll name pattern to make a copy of your app.config. I think the we...

.net - Is Mono really cross-platform? -

The government mono project website says that mono works successfully on Windows, Linux and Mac OS X. is it true? I want to build applications that work at least on Windows and Linux. Is it possible with mono? P.S. I know that similar topics are already present (e.g.), but they may be outdated Yes it's possible. It usually works very well, but I do not think there are any large / medium scale applications on mono that you can browse one. As Mono is a subset of the real thing (.net), to maintain the best compatibility, you have a mono-supported platform (eg Linux), once this works once you do a lot It can be more certain that it will work on the net. I am saying this because although it is very consistent with NAT, mono is not as it seems that completely compatible with the entire NET pile I stumbled across many of those on development and many of them. I hope your project does not have many .NET dependencies like me.

java - Hibernate enum mapping -

I need to map the enums which can not implement the interface from the already existing database, which can be used in the same table Stores @Enumerated (EnumType.STRING) . class A {As the owner class using the name of HasName; } Interface name {string matching (); } Enum X implies HasName {John, Mary; Public string getName () {return.name (); }} Enum Y uses HasName {Tom, Ann; Public string getName () {return.name (); }} How should mapping be controlled in this case? To implement the interface all the values ​​do not change the database as separate values, but I'm not sure how objects should be retrieved from DB (I need a custom mapper, What is enum using a specified ANM classes? Does this Hibernate basically support this functionality?). It is possible custom UserType (such as) and use it from its mapping & lt; Property name = "type" no-null = "true" & gt; & Lt; Type name = "at.molindo.util.hibernate.EnumUserType" ...

python - Problem with Twisted and threads -

Some of you who are more experienced than using twisted, maybe I decide to use threads together - But I did this :). And now I am in any kind of trouble - I have an application server listening for client requests and every time a new client connects, it spans the other thread that I might close correctly Because the server closes after some time of heavy use, the processing request is fine, I have 3 different types of threads, and this happens to one of them - this is that I Do not believe that the right way to do this, because Thredkjoind () is not working and cat / proc / & lt; Pid & gt; By stopping / status , the server always stops working by doing threads: 43 . So I'm looking for And yes, I know about this question: And perhaps many others "Twisted way" twisted.internet to do anything outside the reactor loop (aka spelling threads) is. Threads.deferToThread For example: twisted.internet import threads def sthToDoInSeparateThread (): re...

authentication - PHP, Prevent users from accessing a page while not logged in? -

How can I stop the user from accessing a page when I'm not logged in? I want him to be redirected to the login page. I know that there is something to do in the session. This works like this: Start a session : Session_start () Session ["user"] == Zero, redirect to login page, and continue. In the login page, Post this form on the login page Check against your authorization service (like the table in my SQL) if the user is authorized If so, the session ["user"] = $ username, redirect the user to the page. If not, then prompt for the password Of course, all this is very simple, in your session, you can keep a complex user object, or anything. Best wishes coding

visual studio 2008 - Local commits pushing to a central server -

We use force at work and it is encouraged to do it regularly (I am fine with some ). However, I would like to run some such activity, which I can work locally on the work which is in progress and it is not necessary that the compilation is being done / and since then it is my regular commitment to the Central Pearlforce server Brings it. > My question here is two times, first is closed, nobody knows that Visual Studio has many source control binding (ideally I want to be autonomous as possible - hey, I'm lazy) :) And secondly, is there a tool that allows me to do something simpler, "Check the current head of the Mercurial repository to strengthen". I remember that GIT allows you to do something like this, and I'm completely trying to get it out. If I'm not making anything clear or thinking about it completely wrong, please tilt me;) Cheers In the interest of its idea it is not so personal as it woul binds D "off-line development" shou...

.net - C# InvalidOperationException AND Cross-thread operation -

In the form of my windows I have a text box and a button, text box "tb_logbox" is a multilingual text box. To create a background worker that calls the function "i.e. logtime timer." When I compile and run it, Visual Studio throws a non-functional operation exposition. Actual error I'm not getting cross-thread operation valid: Control reached 'tb_logbox' from thread another thread that it was created. The following sample code indicates what I am trying to do. Private Zero Button 1_Click {Object Sender, EventArgs E} {try {var bw = new BackgroundWorker ()} Bw.DoWork + = ExecuteOperations; Bw.RunWorkerAsync (); } Hold (exception before) {tb_LogBox.AppendText (environment. NewLine + "= @ =" + east. "" + "Pre source); }} Private Zero ExecuteOperations (Object Sender, DoWorkEventArgs e) {var FuncCall = New LogTimer (); Tb_LogBox.AppendText (EnvironmentalNew + FuncCall.DnT ()); // line is getting error on me} Public class LogT...

JQuery UI Datepicker, reverse the order of the year in the dropdowns -

I have a datekeeping with Changee: True. The 'Year' drop down shows the title as 2009, then compared to the next year, down from the title of 2008, 2007, 2006 and so on in 1999 and counting towards the top I want to reverse this order Unable to find an easy solution for? I would not recommend editing as the original UIDticker.JS has been suggested because your changes are expedited Will be lost because you or any other developer file changes when a new version is released. It is not practical to remember what is being optimized to reapply. Instead, you can override the existing _generateMonthYearHeader method in your own separate JS: // store is original so we can call it under our overriding method $ .datepicker .generateMonthYearHeader_original = $ .datepicker._generateMonthYearHeader; $ .Datepicker._generateMonthYearHeader = function (inst, dm, dy, mnd, mxd, s, mn, mns) {var header = $ ($. Datepicker._generateMonthYearHeader_original (inst, dm, dy, mnd, mxd, s...