Posts

Showing posts from September, 2011

Is this C implementation of Fisher-Yates shuffle correct? -

There is a single implementation of Fisher-Yets that I want to use in a deck-shifting routine. Am I doing it correctly (n = length of the array)? Note: To make a makeup-loop for modulo bias (see) it adds up the process slightly upwards and eliminating it if you do not care about low-bit prejudices. It is possible. J, TMP, Upper_bound; Srand (time (zero)); For (i = n - 1; i> gt; i--) {upper_bound = RAND_MAX - ((RAND_MAX% (i + 1)) + 1); Do {j = rand (%)% (i + 1); } While (h & gt; upper_bound); Tmp = array [ja]; Array [j] = array [i]; Array [ii] = tmp; First of all, you should remove the code to generate a random number, which is Be distributed evenly between a 0 (inclusive) and n (exclusive) for a separate function. It's a good job of the job you need elsewhere. Second, I do not call the srand inside the shuffle function, depending on the random number generator the caller will start this way A deck can shuffle more than once in the bar. Third, you have to g...

iphone - ImageIO causes more memory to be allocated than the size of the images -

I have 5 UIimageViews that display .png files, each max 200kb, but ImageIO allocates about 1.3 MB for each and the average . 7.3 MB total to see when loaded. What is this happening? I have the same amount of images of the same class and it allocates only 2 MB maximum. As far as I understand the raw RGBA data (red, green, blue, alpha) I am loaded with loaded PNG / JPEG (both compressed formats) using iPhone 4 bytes per pixel so 100x100 image will be 40000 bytes. What are your images?

Phases skipped when using PrettyFaces (JSF) -

When using PrettyFaces to map a page containing forms, all steps are omitted after the restore view More feedback is presented. This form has not been submitted and the model has not been updated. It looks like something & lt; Sender & gt; Elements present in the configuration of the filter in web.xml

plsql - Oracle dual query -

I have a query: SELECT XY ('p1', 'p2 doubles From I know that's double but this part is XY ('p1', 'p2', 'p3', 'p3', 'p4', '100') ',' P4 ',' 100 ') Actually I'm surprised that X and Y are tables or what? OK, I can see three possibilities: X one There is a schema, and there is a function within the Y-X schema. X is a package, either with a public pattern or in the current schema, and Y is the function defined in that package. X is a type, either with a public pattern or currently schema, and Y is a function defined in a type. SQL * plus command DESCRIBE X or DESCRIBE XY What does the return?

html - Populate fields with default values using Jquery -

I would like to use jquery to populate fields with default values ​​For example, I have an email address Field and I want to add example@email.com to the gray italic text in the box and delete the user when the user clicks on the field. Is there any good way to do this with a plugin or something? If possible I would really like to toggle a fully deployed division. & lt; Input type = "text" id = "email" /> & Lt; Input type = "text" id = "name" /> Then, $ (function () {$ ('# email'). Focus (focus). Blur [0] Focus (Focus) Blur (Blur) [0] .defaultValue = "Type name here";}) Function Focus () {this.value = (This.value == this.defaultValue)? '': This.value; } Function Blur () {this.value = (this.value == '')? This.defaultValue: this.value; } $ (Function () {$ ('# email, # name') with AddClass ('default'). with styles Focus: Blur [0] .defaultValue = "example@ema...

actionscript 3 - how to resolve the UIComponent was not found in action script -

Creating an Action Script Category MyCircle UIComponent ..... Provides Some Code When I compile, I get an error: Error 28: Definition of the base class UIComponent was not found. class extends the MyCircle UIComponent What do I do? Add it to the beginning: import mx.core UIComponent;

tsql - What is the most optimal way of concatenating string values from column to single string? (T-SQL) -

मेरे पास एक टेबल है सदस्यमोट (सदस्यआईडी इंट, मोटो नवरचार (100)) मुझे एक ऐसी प्रक्रिया बनाने की आवश्यकता है जो प्रति उपयोगकर्ता मोटो मूल्यों की कोमा से जुड़ी सूची को वापस लौटा देगा। मैंने निम्नलिखित को बड़ी सफलता के साथ प्रयोग किया है, यह एक एकल उपयोगकर्ता की जानकारी प्राप्त करता है DECLARE @results VARCHAR (MAX) SELECT @Results = COALESCE (@ परिणाम + ',' + मोटो, मोटो) मेम्बंबरमोोटो से सदस्य सदस्य = 1 आर्डर द्वारा मोटो अब, यदि आप प्रति उपयोगकर्ता प्रति एक बार या उस प्रकृति के बारे में कॉल करना चाहते हैं, तो आप इसे फ़ंक्शन में एक्सट्रपोल कर सकते हैं ।

regex - Replacing with SED, trying to append content doesn't work -

I'm trying to use sed to fix a file, and I'm doing wrong. There is no indication that why the SED is not behaving as I hope it will be appreciated. My file contains a bunch of a line, each has a single value. The content of values ​​is irrelevant to the replacement, save it that they are always alpha-numeric and follow a pattern. P> sed 's /\(.*\)/ NULL; 0; 400; 6; 2010-07-27; Results in: 1 / 'selection.csv : NULL; 0; 400; 6; 2010-07-27; 1326 GP11 SHH Naul; 0; 400; 6; 2010-07-27; 2312bb30mm Attachments (unsuccessful) However, when joined, things get ugly: sed 's / \ (. * \) / \ 1; Null; Null; Results in 1 / 'selection.csv : ; NULL; NULL; 1 2312BB30DUM; NULL; NULL; 1 On the last line, except for everyone, is quite disappointing. It should be quite clear that I am doing wrong here, but I can not understand it. (Note: It is not sure whether it is SO or SU content ... feel free to move it to Superuser, if you can and can...

c# - Fixing gaps in streamed USB data -

We have a hardware system that has some FPGA and FTDI USB controller. The hardware streams data over USB bulk transfers on PCs around 5 MB / s and software is tasked to stay in sync, check CRC and write data to file. In the FTDI chip 'busy' PC during your waiting for the pc which gets high when completing your business. There is limited amount of buffering on FTIDI and elsewhere on the hardware. The busy line is too much compared to the buffer (50-100 ms) from the hardware, so we are losing data to help me fix this problem to prevent hardware from redesigning. Having said! I think my code is very fast because we run it up to 15 MB / s, so that if an IO leaves the obstacle, are we expecting a lot from PC / OS? Here my data is the entry point. I sometimes get a dropped bit or byte if the checksum is not calculated, then I change it until it does. Byte [] data is almost always 4K. zero ftdi_OnData (byte [] data) {list & lt; Byte & gt; Buffer = new list &...

hide jquery facebox modal manually -

I used my custom close button on my Facebox model to turn it off ... it's OK (ie) off Does, but it closes after I click the Close button to add to the bottom of the page ... & lt; One onclick = "$. Facebox.close ();" Href = "javascript: void (0);" Class = "pass" & gt; & Lt; Img alt = "close popup" src = "picture / close" title = "closed" square = "closed_size" /> & Lt; / A & gt; $ (document) .bind ('close.facebox', function) ($ {Document}. Unbind ('keydown.facebox') $ ('# aspnetForm'). Attachments ($ ('# facebox .content') .HTML ()) /// Additional line to make sure that the facebox There is no flashing effect on closing: The content is still there! $ ('#facebox content'). Children () .css ({'display': 'block'}); $ ('#foundboxes'). FeedThat (function () {$ ('#facebook content'). RemoveClass () AddClass (...

windows - C/C++: duplicate main() loop in many threads -

I have this "interesting" problem. I have this legacy code that looks Int main () {while (true) {doSomething (); }} I want to duplicate doSomething () in multiple threads, so that now looks like the main () int main () {RunManyThreads (threadEntry }} Zero thread entry () {while (true) {doSomething (); }} The problem is that doSomething () uses many global and stable variables, and I can not change its code. Is there any move to duplicate those static variables, so each thread has its own set? (Thread some kind of local storage, but without affecting doSomething ()) I use VisualC ++ To make a long story short, no, not least ( What i called) reasonably Do not want to change doSomething () , your best bet is probably to run multiple copies of the current process instead of trying to use multi-threading if Each thread is going to use a different copy of the global variable, and in this way, the difference between multithreading and multiple processes will ...

dynamic - Using jquery to hide dynamically added divs -

नीचे दिए गए jquery कोड divs को समाप्त होने के साथ- value-wrapper को छुपाएंगे, जब पृष्ठ लोड होता है। मेरी समस्या यह है, कि "अधिक मूल्य जोड़ें" बटन एक और पंक्ति जोड़ देगा (संख्या बढ़ी हुई है)। जब ऐसा होता है, तो सभी divs प्रकट होते हैं एचटीएमएल मार्कअप इस तरह दिखता है: & lt; div id = "" समूह-सूचना आइटम "& gt; & LT; fieldset & gt; & Lt; किंवदंती & gt; सदस्य सूचना & lt; / किंवदंती & gt; & Lt; लेबल & gt; फ़ॉर्म लेबल 1 & lt; / label & gt; & LT; तालिका & gt; & LT; टीआर & gt; & LT; टीडी & gt; & Lt; div वर्ग = "फॉर्म-रेडियो" & gt; & Lt; इनपुट प्रकार = "रेडियो" वर्ग = "फॉर्म-रेडियो" चेक = "चेक किया गया" मान = "0" नाम = "जीसीआई [0] [डीई] [मूल्य]" आईडी = "संपादित-जीसी-वैल्यू -1" & gt; ए एंड एलटी; इनपुट प्रकार = "रेडियो" वर्ग = "फॉर्म-रेडियो" मान = "1" नाम = "जीसीआई [0] [एफए]...

c# - Specifying the Tension in a Cubic Bezier Curve -

I am trying to create a PathGeometry which uses the cubic bezier cuvers using the orthogonal line segment In a WPF, I came across an MSDN which describes in the Cardinal Splinces GDI +, which almost expects to complete. I have been successful in the most part, but now I need to implement a property that controls the "smoothness" of the curve, as described in the above tension property. The article states that the value of 1.0 for the result of stress in "the path of at least the total turn". What does it mean for the control points of the cubic beijier curve? Note: Since the line segments are orthogonal, the angle between the two consecutive sections is always 90 degrees. I'm not sure that he does anything simple This is an image from the article for easy reference. The red squares indicate the last points and the numbers indicate stress, although I am most interested in the inclusive values ​​of 0.0 to 1.0. General Look at this context fo...

c# - Disable feature in Master Page from Content Page -

I have a master page for all my ASP.Net pages. It works fine for 95% of pages ... except that it contains unwanted features that are included in other 5% pages. What causes problems in this application? Is it possible for content pages to enable / disable the feature available in the master page in any way? One option I can think of is to consider the name of the page for the master page and then to decide what to do, but it has been running for a long time ... You can add a mastertime directive to your content page so that you can gain access to the master page class ... and from there you can master your master page. .. & lt;% @ MasterType virtualpath = "~ / MyMaster.master"% & gt; and you will have access to the master property as a class typed in your code ...

c# - Getting started with automated integration/unit testing in an existing code base -

Background: We have been assigned a very large codebase (1.4 million lines), which is primarily in C #. AP 2.0 2.0 ASMX web services are mainly included in access to data in the SQL Server 2008 database and also in various XML files. There are no existing automatic tests in place. We have an automatic night (CC .net). We want to present some level of automated testing, but it is not possible to restart the granular level unit tests for this amount of code. Our first idea is to find a way to prepare automated tests, which We have to provide some level of code coverage to call each web service with a set set of parameters. A quick way to get the highest amount coverage is with some automated tests. Is this called unit testing or will it be considered anything else? How do I go about separating the data store to get the results of the test continuously? Will any testing tool work better for this approach than others? XUnit? MS test? NUnit? Any suggestions for starting us in the righ...

List directories in a folder, ignore sub directories ANT -

असल में मेरे पास एक javadoc के लिए निम्नलिखित संरचना है: build + --- javadoc + ------- मॉड्यूल ए + ------- मॉड्यूल बी + --- सूचकांक html मॉड्यूल एक्स फ़ोल्डर्स हैं। मैं फ़ोल्डर्स की सूची में उप-फ़ोल्डरों की उपेक्षा की कोशिश कर रहा हूं, इसलिए मैं मुख्य सूचकांक बना सकता हूं। अब तक यह मेरे पास है: & lt; लक्ष्य नाम = "x" & gt; & Lt; dirset id = "dist.contents" dir = "build / javadoc" बहिष्करण = "बिल्ड / javadoc / * / **" / & gt; & Lt; प्रॉपर्टी नाम = "प्रोपेंट डिस्ट। कॉन्टेंट्स" रिफिड = "डिस्ट कंटेंट्स" / & gt; & LT; गूंज & gt; $ {prop.dist.contents} & lt; / गूंज & gt; & Lt; / लक्ष्य & gt; लेकिन यह मुझे मॉड्यूल के फ़ोल्डर और इसके सभी सबफोल्डर्स दोनों को देता है। मुझे पता है कि यह थोड़ा विस्तार होना चाहिए, लेकिन मैं इसे समझ नहीं सकता। उपयोग में बदलें को शामिल करने के बजाय को शामिल करता है, और वाइल्डकार्ड निर्दिष्ट करता है जो उप-निर्देशिकाओं में नहीं निकलता: ...

Vertical Bars in HTML/CSS -

How would I go about creating vertical bars, all near one another (touch) middle to left of the page (All sizes in width)? This is the trick for you: & lt; Div id = "wrapper" & gt; & Lt; Div class = "bar green" & gt; & Lt; / Div & gt; & Lt; Div class = "bar graner" & gt; & Lt; / Div & gt; & Lt; Div class = "bar greenist" & gt; & Lt; / Div & gt; & Lt; Div class = "bar generist" & gt; & Lt; / Div & gt; & Lt; / Div & gt; And to go with CSS: html, body, #wrapper, .bar {margin: 0; Padding: 0; Height: 100%; } #wapper {width: 50%; }. Bar {float: left; Width: 25%; / * Should never add more than 100% *.}. Green {background color: # a8ff00; } .grir {background-color: # 7ad800; } .greenest {background-color: # 3eb603; } .greenerest {background-color: # 2c7e03; } You can see it.

c# - Why Invalidate() should be called outside the control then it can work? -

I am using C # + winforms to develop software. I have a UserControl that has many DataGrid views in datagridview1.datasource = dc.doctor; I use linq to populate the datagrid view with Dataset, because I need to refresh the datasheet to update the records, so I create a new datacentext and data Allocate the source again. Select dc.doctor from datagridview1.datasource = p; The first time I found, although I reset the data source, the datagrid view can not be refreshed yet, someone tells me that I should call the invalid work on the Datagrid view, I tried to some extent, it works. But if I call invalidity within the class of the user control, then this will not work. If I'm creating a public function on the square of the user control, then it's user control. Call with Refresher (), then it works. Does anyone tell me what am I missing? When a call invalidates, when will it really work? Thanks in advance! Deactivating the work eliminates all other things lik...

c - strlen() Refuses to Read String from struct hostent * -

I am working through a small tutorial about creating a basic packet sniffer for Linux. I am getting everything, and now I want to add an IP-to-host mapping. Before I add this function: Zero IPtoHostname (char * ipaddress, char * hostname) {struct hostent * host; In_addr_t ip = inet_addr (ipaddress); If (hostname) {puts ("can not allocate memory ..."); Exit (-1); } Host = gethostbyaddr ((Four *) and IP, 32, AF_INET); Hostname = Stardup ​​(host-> H_NA); } It basically takes a string IP address ("192.168.28.18") ipaddress and the hostname of that IP ("who.cares.com" ) Fills in hostname . What happens strlen Refus to give me anything (I know that strdup works, and I have tested this myself) and segfaults. I have used GDB, and the string ends in an empty character and it is not a null. I have also used a raw string assignment with a string string: Zero IPtoHostname (char * ipaddress, char * hostname) {Static Stretch Hostent * Host...

numerical methods - How to compute exact complexity of an algorithm? -

Without the support of unimaginative signaling, is the only way to get the complexity of time of the algorithm is a tiring step? And without the code of each line, can we reach the big-o representation of any program? Description: To try to know the complexity of many numerical analysis algorithms that are most appropriate to solve a particular problem such as - between the Regula-Felsi or Newton-Raptson method for solution of EUN, The intention is to evaluate the exact complexity of each method and then decide ('N' or any argument in it) is less complicated. The only way -" easy " To know the exact complexity of a complex algorithm - - rather, in a difficult manner, rather than just the proper way - it is to create a profile. A modern implementation of an algorithm has a complex interaction with numerical libraries and CPU and its floating point unit. For example, cash memory access is much faster than the out-of-cache memory access, and there may be more ...

visual studio - XAP files for silverlight 4 -

Can you put the lightlight 4 XAP files in an ASPX page and then make them in 2008? If so, how do you do this? Sure, why not? Simply add XAP to your ASP.NET web project and add a tag to your ASPX. Here's the basic embed for a silverlight app: object data = "data: app / x-silverlight-2," type = "application / x-silverlight-2" width = "100 % "Height =" 100% "& gt; & Lt; Param name = "source" value = "ClientBin / MyApp.xap" /> & Lt; Param name = "onError" value = "onSilverlight error" /> & Lt; Param name = "background" value = "white" /> & Lt; Param name = "minRuntimeVersion" value = "4.0.50401.0" /> & Lt; Param name = "auto upgrade" value = "true" /> & Lt; A href = "http://go.microsoft.com/fwlink/?LinkID=149156&v=4.0.50401.0" style = "text-decoration: none" & gt; ...

function - Python variable assignment order of operations -

Is there a way to assign a variable inside a function call in Python? Some sort of curr = [] curr.append (num = num / 2) The nope assignment is one, it is not in the derivative languages.

html - Footer is sticking to bottom = good, but main content has scrolls as if footer is fixed = bad -

Check my link below if you have a large screen, but now if you are on a small screen, then my Patterns will stay in the bottom of the screen, there is a scroll bar that appears before the footer Why is it? Your problem lies in the fixed height and width values ​​of your DIV containers CSS: container at 1024px. You want to return it to 1000px because most browsers of 1024px will add a horizontal scrollbar to a very thin 1-2px window range. If your design does not allow for this, you can change overflow: auto to overflow: any . CSS: main is a constant height to disable the upper scrollbar if the content extends above this height then do the same thing as above.

swing - Scala - menu bar only appears when window contents revalidated -

आयात स्कला.swing._ import swing.event। {WindowClosing} import java.awt.Dimension ऑब्जेक्ट MenuBarTest { डेफ मुख्य (आर्ग्स: ऐरे [स्ट्रिंग]) {val फ्रेम = नया फ़्रेम () {दृश्य = वास्तविक सामग्री = नया पैनल () {पसंदीदासिज़न = नया आयाम (600,400)} शीर्षक = "टेस्ट" प्रतिक्रियाएं + = {केस विंडोक्लोटिंग (ई ) = & Gt; System.exit (0)} menuBar = new MenuBar {सामग्री + = नया मेनू ("एक मेनू") {सामग्री + = नया मेनूइटम ("एक आइटम") सामग्री + = नया मेनूइटम (क्रिया ("क्रिया वस्तु") {println (शीर्षक)}) सामग्री + = नए विभाजक सामग्री + = नए चेकमेन्यूइटम ("मुझे चेक करें")}}}}} तुरंत मैं विंडो का आकार बदलता हूं कोई भी विचार क्यों यह है और मैं इसे कैसे रोक सकता हूं? पोस्ट-पाठ "आइटमप्रॉप =" टेक्स्ट "> कथनों के क्रम को बदलने की कोशिश करें जैसे दृश्य = सच को फ्रेम परिभाषा के अंत में लाया जा रहा है। एक और चीज के बाद पैक विधि कॉल करना होगा फ्रेम बना रहा है।

javascript - Script in iPhone SDK -

Can anyone help me, how to write a script in the iPhone SDK without the HTML string? I'm trying this: [webView stringByEvaluatingJavaScriptFromString: @ "var script = document.createElement ('script');" "Script. Type = 'text / javascript';" "Script.text = alert ();" "Document.getElementsByTagName ('body'). Attachment (script);"]; But I can not see the warning on this. Can anyone help me in this? [webview stringvvvtv javascriptframestring: @ "var script = document. CreateElement ('script');" "Script. Type = 'text / javascript';" "Script.text = \" function myFunction () {"" warning (); ""} \ ";" "Document.getElementsByTagName ('body') appendChild (script);"]; [WebView stringbivyewelting JavaScript ScriptWriterString: @ "MyFunction ();"]; Try it out ....

Iteration in python dictionary -

I populate a dragon dictionary based on certain conditions. My question is: Can we retrieve the word in the same order because it's population? questions_dict = {} data = str (header_arr [opt]) + str (line) questions_dict.update ({data: Xl_data}) valid_xl_format = 7 if (type.lower () == "Ma" or type.lower () == "mc"): data = ARR (header_ar [opt]) + str (line) question_date. Update ({Data: xl_data}) valid_xl_format = 7 If I repeat, then it is not in order, in order for in the query: logging .debug ("% s:% s"% (k, questions_dict [K]) in order to keep track of a dictionary population , come A type of requirement is different from Paco dict. / Code> (commonly known as "ordered commands"), such as third-party modules, or, if you can upgrade to Python 2.7 , so.

.net - TypeInitializationException when running mstest from command line -

We have a subset of unit test that was always running through Visual Studio recently. I am now working on a continuous integration setup which will run the test. When all the tests pass through the visual studio, but when I try to run them from the command line using mstest they fail with "TypeInitializationException" which says that the dll file for this type is not Can get it. System Typing Initialization: foo.bar_Accessor 'for the startizer threw an exception --- & gt; System.IO.FileNotFoundException: The file or assembly could not load the file 'foo, version = 1.0.0.0, culture = neutral, public keypoint = null' or one of its dependencies could not specify the system file. Encashment Manager is loaded with: c: \ WINDOWS \ Microsoft.NET \ framework \ v2.0.50727 \ mscorwks.dll DLL is a project reference in question in the unit test project There is also a test reference which creates the foo.bar_Accesor version of the class. I have noticed that wh...

windows - What should I know to build a framework like WPF? -

I want to make it clear: I'm not really building WPF Scratch. But since I have seen the WPF, I wanted to be in the WPF team and wanted to create WPF. I know WPF quite well, but if you know WPF now, you can not make it. WPF is built on DirectX and uses User32. I think the first book I need to read is that. Can you recommend me a few more books or resources or practices? I'm a student (which gives me a lot of time to invest in learning) and I'm ready to do anything if he can help me in programming Windows and, finally, May be found on the board. Again, I do not want to create WPF. I just want to know what to know to be able to make it. I'm not sure it's a one-job ... you need a-team On a serious note, WPF is a big and latest step in the development of Windows XP. MS has learned WinForms for WPF from its MFC journey. It is a bit unrealistic to estimate that you can do it all in a reasonable time frame ... unless you're just not good enough. Upd...

multithreading - basic python server using spawn/threads -

There is a problem I am facing. And it should be very simple. I have an app that keeps the data in the "A" DIR will be a series of data files. I have to be a constantly running server, which has a constant look at the DIR, and when looking at a full file in DIR, the server creates a spawn / fork / thread (in the exact word / Python Not sure which one does some work Actually, I'm going to include / execfile ("foo") an external file in the thread, to work, in the file "A" Depending on the file. I want to be able to run multiple threads at the same time. That's why I am trying to run the whole process as soon as possible, and I must run multiple threads in parallel to implement the thread / spawn / thorny process. There is no communication between different process processes I have seen various examples using twisted, etc. But I think I am thinking .. Any simple / complete example I can play with is great !! (The specimen signals on th...

sql - using isDBNULL to store null back in the database -

I have a textbox in many asp.net that accepts the value from the user and sends it to SQL Server via SQL Server When the user does not enter the value in the text box, which means that I can allow the null to be filed in the table, but if its integer variable stores it 0, then because int HostelFees; HostelFees = Text box 1 text; // Forum is asked to put hostel fees in FIE (hostel fees); It stores 0 in the database, which I want, but it is not empty. I went through several documents and understood only a bit about ISDBNLL, but still how I insert the null: (And I'm not using any stored procedure. Just type in the function insertFee (hostelfixes) . I use it command. To do the sequence of non-sequential > Should you consider int? , which is one of the int . In that case, you can call HostelFees.HasValue You can use to see if a blank is stored, and HostelFees.Value to use the integer part. Please note that in your sample you can directly A string value is one I...

vsto - PowerPoint: How to get the current slide in multi-selected slides? -

I have selected multi-slides in the present presentation, but I want to get the slide that is in the current document view. I tried to use the following code to get the slide, global This addin.app.activ window.lookdown slide but this failed, I found the first slide in the selected slides. Any suggestions? create an event application. Selected slide selection + = Application_Slide selection selected; Private Zero application_SlideSelectionChanged (Slider SldRange) {Debug.WriteLine (SldRange [1] .SlideNumber); } Returns the current slide number in the document view

python - Getting started with Pylons and MVC - Need some guidance on design -

Any time frameworks / Design pattern / which was never using 'called', I really do not know how it has reached. What I have read in the Pilon's book, so far, it seems that I do the following: My routes ./config/routes.py Make it in This is where I map the URL for the controllers. Create the controller for the URL This is where the main part of the code is false, it does all this work and prepares it for viewing Create my template I create a template and assign data to its controller Model ... me Do not know for whom they are: / So my question is, can you recommend any reading material for someone who is not clearly know what they do Hey I really want to start using the pylons but I think in a few months I will come back to my code and think ... "What was F?" EDIT: In a better, in a nutshell, the question came to mind: Which code should be placed in the controller? What code should I put in the model? The view is just templ...

c# - what are the differences between OLEDB and ODBC? -

Currently, I can connect to local .mdb with Oleb connections. I can query, add, update and delete the database with the correct results. How to connect to the ODBC database in relation to the use of ODB database in C #? The probability of a connection will be different in the connection string (and possibly setting up an ODBC connection in the control panel ), But .NET classes for connections apply all IDBconnection / commands / transactions, so they are very similar. In C #, you have the Ondi connection and the ODBC connection, I believe - but again both the base interfaces are applicable. A brief overview can be found here: Most database vendors support ODBC because it is designed to be a kind of shared connection mechanism , But again most of the vendor likes the supply or any other (Oracle ADOnate provider, MySQL provider, etc.). Either normal, or if its only a small application, suitable for the target database is most appropriate.

Pattern for forcing adding to collection through method in C# -

I have a class with a collection member. I would like to prevent external code from modifying this collection directly, instead use methods (which can do proper verification etc.). I thought it was tough. Here's the solution I'm using Can you please tell me if it's the best way to do common practice? All this seems just a little ovenenariad. By using the system. Colllections.Generic; Using System.Collections.ObjectModel; Public Sector Fu {Private list & lt; Bars & gt; _bars = new list & lt; Bars & gt; (); Public readline calling & lt; Bars & gt; Bar ({return _bars.AsReadOnly ();}} Public Zero AdBar (repeatedly) // Black Sheep {// Insert Validation logic here _bar. (Bar);}} I think this is a good solution, this approach has been discussed here by Martin Fowler

xaml - WPF Style Triggers from another control -

I have an image that I want to make when the user rotates with it on the mouse, a And the image will be The code below does not work: & Lt; / Catalyst & gt; & Lt; /Style.Triggers> & Lt; / Style & gt; & Lt; /Image.Style> & Lt; / Image & gt; & Lt; Image source = "volumen_bar.png" name = "bar_wilm" visibility = "hidden" /> Any ideas how can I set up another Control Setter property with another control trigger? 10x How to: & lt; UserControl.Resources & gt; & Lt; Local: BoolToVisibilityConverter x: key = "BoolToVisibilityConverter" /> & Lt; /UserControl.Resources> & Lt; Image Name = "First Image" Source = "Volume Page" /> & lt; Image source = "volumen_bar.png" name = "bar_wowm" visibility = "{binding ismouthover, elementname = first image, mode = oneway, converter = {static resource bulletovisability convent...

security - Secure SQL Server accessed by fat client -

Is there a way to secure a SQL Server database that is accessed by the fat client? Meaning: This app communicates directly with the database because it keeps the SQL statements on its own. This means, the connection string should be somewhere on the client. Using this connection string (either with Vnath or SQL Server authentication) any user can use some management studio or command line from DB and DB can place different statements in comparison to GII. What to do about it? I can not place another layer between the client and the database because this architecture is okay. In all security models, including Windows and SQL authentication, the right to a right User (for an identity), and not for an application. Therefore, any access required by the app must be given to the user to run the application. When Windows authentication is used, it means that the same user can take advantage of all the privileges required by an application from an SSMS query. This is a basic rule th...

iphone - UITableViewCell. How do I programmatically align textLabel to top? -

By default, a UITableViewCell instance is located in the textLabel / detailTextLabel labeled pair in the center of its original view. I like the combination of a cell at the top of the cell. How can I do that program? Thanks, Doug Description of docs - [UIView layoutSubviews] "Layouts are overridden by subclasses in subviews when influencing is implemented. The default implementation of this method is nothing." This description is not elaborate, but correct in this situation, the behavior of the method is to layout your subviews, this device will ever apply to orientation changes. Whenever you call call-set NADE layout, it is also later set for the invitation. Because implementation of UIView does not do anything (and I guess it for UI control), you will have full creative freedom to prepare sub-views of your UVV sub-class Override - layout touch and to manipulate the position: The built-in text label and the --DoubleLabel view. Override -viewDidl...

django - Equivalent replacement for ListProperty(db.Key) in djangoappengine -

I'm trying to use more, but I am unsure how I can write models to include the standard I know that djangotoolbox provides this field type but I am unable to detect exact syntax. code> class profiles (db.model): data_list = db Listproperty (DBK) class data (db.model): name = db StringProperty () View: prof = profile () data = data. For all data (data): prof.data_list.append ( Data) /// Here data_list data unit Data.get (prof.Data_list) will be able to obtain all data entities whose keys are in the data_list attribute

c# - already an open DataReader associated with this Command - when I'm not using datareader? -

I am getting an error that an open dataarder is associated with this command when I am not using a datesterer (Though probably the executereader is the same thing) If I do not have a stockman, then how do I close it? Using (SqlConnection conn = new SqlConnection (ConnectionString)) {SqlCommand cmd = new SqlCommand ("spSelectAllTypes", Connecticut); Cmd.CommandType = CommandType.StoredProcedure; SqlCommand cmd1 = New SqlCommand ("spSelect AllTripA", conn); Cmd1.CommandType = CommandType.StoredProcedure; Conn.Open (); // checkbox list cbTransportType.DataSource = cmd.ExecuteReader (); CbTransportType.DataBind (); // dropdown list ddlTripTypeA.DataSource = cmd1.ExecuteReader (); DdlTripTypeA.DataTextField = "TripType"; DdlTripTypeA.DataValueField = "TripTypeID"; DdlTripTypeA.DataBind (); } I just want to be able to have a bunch of dropdown list in an open connection database. (Before each open and closed for each control) Execute Rea...

javafx - JFXtras and Netbeans compiler issue -

Would anyone be able to run the latest JFXTrust package in a project in Netbeans? I'm not sure what I'm doing wrong ... whether it's importing incorrectly, incorrectly executing it, or just downloading the wrong jar files I use JavaFX 1.3 and NetBeans 6.9 I am doing I have been able to identify components of the Library to Netbans (I type XCustomNode, and it prompts me to import from the organization. Jfxtras view.) On trying to create / run, However, I get the compiler error such as: Note: there is an internal error in the OpenJFX compiler. After checking the duplicate, please enter a bug on the OpenJfax-compiler home home (https://openjfx-compiler.dev.java.net/Issues). Include in your report: - The following diagnostics - File C: \ Documents and Settings \ me \ Local Settings \ Temp \ javafx_err_4220242024568343160.txt - and if possible, the source file that triggers this problem. Thank you. C: \ Documents and Settings \ My \ Documents \ NetBusiness Project \ src...

syntax - SQL efficiency - [=] vs [in] vs [like] vs [matches] -

Just out of curiosity, I was wondering if there was no speed in using [[code> = vs [[code> in ] versus [ as ] vs [ matches ] (for only 1 value) syntax for SQL Select the field from the table where the field = value; vs Select the field from the table where the value (value) in the field; versus Select the field from the table where the value-like fields; versus select the fields that match the fields field; A will also add to it and sub query. But this performance depends on the optimizer of the SQL Engine. In Oracle you have a lot of difference between IN and EXISTS, but it is not necessary in SQL Server. The second thing you have to think about is the selection of the column that you use. Some cases show that these are better. But you have to remember that IN is nonsargable (enable non-search logic) so that = = = and index support Best? You should spend some time testing it in your environment

How can I produce some simple json with this Ruby class? -

Here is a simple ActiveResource class, there are some examples variables and maybe even some methods, but it does not support any data . Ruby-1.8.7-p299 & gt; Class box & lt; ActiveResource :: Base; Attr_accessor: a ,: b ,: c ,: d; End = & gt; Zero populate it: Ruby-1.8.7- p299> Bx = box. new; Bx.a = 100; Bxb = 200; Bx.c = 300; Bxad = 400; Bx = & gt; # & Lt; Box: 0xb5841c54 @ attributes = {}, @ b = 200, @ a = 100, @ prefix_options = {}, @ c = 300, @ d = 400 & gt; So far, how good do we cherish those example variables for some of our Jason models? Say we do not pay attention to b and c , but a , d , or something else . Ruby-1.8.7- p299 & gt; Bx.to_json ({: only => gt; ['B', 'C']}) => "{}" This does not work, however, because we do not have any properties 'b' or 'c', only values ​​are. " "" Even better, can we obtain it without an inheritance from ActiveResource? ...

How can I run a ColdFusion scheduled task at an interval <60 seconds? -

I have a CFC method that I would like to run at 30 seconds intervals. However, the problem is that ColdFusion will not let me do the work that runs at intervals of 60 seconds or less. Does anyone have any idea about how I can accomplish this? To answer this question, "Have your script run for more than 30 seconds," or to answer any other question, all have already taken into consideration and this concern is not. I am running ColdFusion 8.0.1 (w / hotfix 4) on Windows Server 2003 (IIS6). As a side note, I am using Java 1.6u21 as my JVM for coldfusion. Thanks in advance. The only way to do this is with some manual edits of the file for your scheduled tasks. Such: Make a designated work with a 5 minute interval. Open the file named neo-cron.xml in your CF install lib directory. You may want to first back up . Search for the name of your assigned work This is a large part of XML, so you want to format it and find it in XML Editor. After the name of ...

Solve rack issue for Dreamhost and Rails 3 rc -

मेरे environment.rb में शामिल हैं: ENV ['GEM_PATH'] = फाइल। एक्सपेंड_पाथ ('~ / .gems') + ':: /usr/lib/ruby/gems/1.8' मेरे gemfile में शामिल हैं: स्रोत 'http : //rubygems.org 'स्रोत: Gemcutter मणि' रेल ',' 3.0.0.rc 'मणि' mysql 'मणि' haml 'मणि' RedCloth 'मणि "friendly_id" "~ & gt; 3.0" मणि' नास्तिक-will_paginate ',' ~ & Gt; 3.0.0 "# वेब सर्वर के रूप में गेंडा का प्रयोग करें # मणि 'इकसिंगा' # कैपिटलरानो #gem 'कैस्टिस्टैनो' के साथ तैनाती करें # डीबगर # मणि 'रूबी-डीबग' का उपयोग करने के लिए # अतिरिक्त रत्नों को बंडल करें # मणि 'बीजे' # मणि 'नोकोगीरी', '1.4.1' # मणि 'sqlite3-ruby',: need = & gt; 'Sqlite3' # मणि 'ए वीएस-एस 3',: आवश्यकता = & gt; 'एवेएस / एस 3' स्वप्नहस्त पर एक रेल 3 एप की तैनाती के बाद त्रुटि यह है: आपने पहले ही रैक 1.1.0 को सक्रिय कर लिया है, लेकिन आपके Gemf...

html - List Type Image Query -

I have a green triangular image that I would like to use for a particular list item but how to unsure. I have created a class called, and set a list-type-image in my green triangle image. Then and ul class = "bullet"> li & gt; Set a & lt Any ideas? Thanks Can you post your CSS? It should look like this: List-style-image: url (greentriangle.gif)

PHP operator confusion (a beginner's question) -

I am trying to remove someone else's code and I have come to this part of this code: $ html = '& lt; Div class = "event" & gt; . "\ N"; Get (('events_ees')) {$ html. '' & Lt; A href = "'. Get (' Event_Image ').' & Gt; '.' & Lt; img src = "'. Pt () '? Src = '. '(Event' image ').' & Amp; Amp; W = 100 "alt =" ' Get_the_title (). ' '/' Gt; '. '& Lt; / A & gt; & Lt; Br / & gt; . "\ N"; } $ Html = '& Lt; A href = "'get_permalink ($ eventId).' & Gt; // title = "permanent link". Get_the_title_attribute (). '' Get_the_title () '' & lt; / a & gt; "\ N"; if (('Event Mode Time')) {$ html. = Get ('Event_Time'). ' " ("Store_Location");} $ Html = ' & lt ;! - Event - & Gt; ' "$ \ E...

Downloads & Safari Extension -

I wrote an application that runs in the background and periodically scans my downloads folder and files their Depends on different types of folders. I want to re-write this application as a Safari extension, but I did not find any way to stop the download. All ExtensionsApi are all very limited and the small-eyed candy seems to focus a lot on the app. Is it possible to block and redirect downloads via the Exponent API? No you can not access the hard drive through the extension API.

Is there any way to use XNA 3.1 with Visual C# Express 2010? -

Is there a way to use XNA 3.1 with Visual C # Express 2010? No you can potentially refer to some assemblies and use, but full experience including content pipeline To get, you will need XNA Game Studio, the current release supports only Visual Studio 2008. However, you can use it with Visual C # 2010 Express. This is (as part of the Windows Phone Tools Set).

java - Importance of Shared Package in GWT -

I realize that the GWT client does not compile classes in the package. But what is the importance of the shared package? The sections which I have to put in this package. I Which classes do I want to put in this package? Any arguments or data types that are used by both the client and the server will save you from the duplicate code between the two sides and possibly the reasoning and the data types Compatible .

regex - Regular Expression matching floating point numbers not ending with -

I am trying to extract CSS status from the string - example: "top Right center on the left 0 0% 50% 100% 360 degree 15.5% -16.3% "The problem is that the string includes an angle" 360deg ". I do not want any number to be matched with regular expressions after "deg" Currently, I have: (- ([[0-9] *. [0-9] + | [0- 9] +)). (Center) | (Top) | (Left). (Below). (Right) It matches all the numbers (Inc. angle - which I do not want). I have tried to use a negative lookhead: (- [[0-9] *. [0-9] + | [0- 9] +)) ( ?! Degree) (center) | (Top) | (Below). (Below). (Right) but it only appears to remove the end zero from 360deg - that is 360deg => 36 Does anyone know that Negative attitudes to removing angles are not successful? Regular expression match because it did not get two digits after "deg": 36 followed by 0 and it is not "deg". [0-9] * is generally greedy but if this match fails, it will try to match the fewer digi...

google image search: search similar images -

I want to write a mobile app that takes a snap and searches Google pictures for similar pictures and then displays the results is. However, with Google Image Search, I can only search for text strings, and with search API it seems that there is no possibility to search similar pictures ; This feature is only available through the web interface. Any ideas how can I solve this problem? Thanks, Christoph is a way you can do right now , But it is not officially supported, and possibly there are some restrictions on the number of questions you make. Update {{URL your image}} and SA = X and AI = H6 RATT5 JCTEILLPCCQ and WED = 0 CDQ 9Q8 is a Google Image Search API, Which is officially being disliked, but it will work for now.

text parsing - Removing values from a list in python -

I have a large file of names and values ​​on a single line separated by space: Name 1 Name 2 Name 3. .... After a long list of names, there is a list of values ​​corresponding to names. Values ​​can be 0-4 or not, what I want to do is consolidate the data file and delete all names and values ​​when the value is na for example For, the last line of the name in this file is: NominateStolat NamesNenNetHelast 0N2 I I agree with Justin using a zip. It's a good idea to have problems with two different lists How to put the data here is a proposal that should work fine. reader = open ('input.txt') author = open ('output.txt', 'w') name, nums = [], [] line = reader.read () . Zip (line [, x], line [X:]) for segment ('') x = lane (line) / 2 (n, v) in [n, v] z in z, if we! = 'No']: names.append (a) nums.append (b) writer.write ('' .joye (name)) Author. Written ('') Writer. #. Writer (Written)) # Author. Wr...

iphone - Implementing CATiledLayer on a UIWebView for fast scrolling -

I have a large webview in my iPad app and scrolling performance is a big problem, especially when you are browsing for the first time Webview In Mobile Safari, scrolling is extremely smooth and the page only appears as a transparent checkerboard pattern and load because it comes in the scene. The way I have read, I am using CATiledLayer, but I do not know how to implement it, can anyone show me the right direction? Thanks! A UIWebView should already tile behind the scenes If you If you create a UIWebView which is just the size of the display, then there is only one reason that I have no way of manually backing a UIBlue with a CATiledLayer that I know, due to its complex rendering architecture. Compared to mobile safaris, there will be other overlay views on slower scrolling, which needs to be composite on the web view when scrolling.

vb.net - WPF MVVM: Notifying the View of a change to an element within an ObservableCollection? -

An observation for objective calling calling works only when certain changes occur in the properties of the archive, not in Add objects, remove, clear, etc.). Is there any way to inform this view that there has been a change in something in the collection? InputifyPropertyChanged must also be implemented in the objects present in it. In your setter, you trigger the event, and WPF will take it over and read it in the new value until you are using two-way binding or read-only bindings.

c - Problem with pointers in binary search tree deletion -

I am trying to implement the operation of binary search trees and stuck on deletion. The use of indoor traversal as a representation of the tree is initially 10 11 14. Removing node 10, the expected output is 11 14 but I'm getting 11 11 14. Removing node 14 is expected to produce 11, but I am getting 0 11 67837. Please tell why I am getting the wrong output I am not looking for any code :). typedef struct _node {int data; Struct _node * left; Struct _node * right; } Node; Node * bstree_search (node ​​* root, int key) {if (root == NULL} {return root; } // Depending on the binary search relationship, the key can be found either in the left, // right, or root. If (key> route-> data) back to bstree_search (root-> gt; right, key); Else if (key & lt; root- & gt; data) bstree_search (root-> left, key) returns; Return route; } Zero bstree_inert (node ​​** skillful, int value) {// address has passed since address (root is detected) if we can change root ...

mysql - Devel Show Queries -

I can not explain something here, but in the development module settings I have "query information gathered" and "query displayed Is logged in ", and where does this information show up? When I load the page, I do not see anything different. Is there a variable that I need to inject in my templates elsewhere, which I remember? I want to see which questions are running on each page and how long they are taking. This should show in your subject in $ closed , unless you have In the event that nothing is done as an install, it appears in the admin menu under the Devel section.

Using Python class as a data container -

Sometimes it connects the related data to the cluster. I do this with a word like self.group = dict (a = 1, b = 2, c = 3) self.group ['a'] One of my colleagues I like to create a class class group square (object): def __init __ (a, b, c): self. A = a self .b = b self.c = c self.group = groupClass (1, 2, 3) print self.group.a Note that we can not use any class methods Are not defined. I like to use a word because I like to reduce the number of lines of code. My colleague believes that if you use class, the code is more readable, and it is easier to add methods in classes in the future. Whom do you like and why? If you never really define methods of a class, then a motive or a More matters in the opinion. Simple + Biltin is good! However, for each self.

Iterating variables to change its features in Python -

I specified values ​​in a loop with the set () function: (30 ): Range (6) for J: Satetrer (self, "e" +++ str (i) + ar (j), entry (self tip)) , Then I want to apply .grid () func with a loop with all these variables For example, self.e00.grid (line = 0 , Column = 0) How can I do this Maybe instead of suits for your matrix Use list of keys: self.metrics = [[border (6)] for j [[entry (self top)] # in column # for i columns ( 30)] For the rows i, the line in enumerate (self.ematrix): For J, ALT these calculations (line): elt.grid (line = i, column = j)

c# - How to read local cookies -

I have an ASP.NET web application that stores an HTTP cookie when a certain action is taken (e.g. Had clicked a link for it) Now, I am creating a standalone C # app for which to view and identify the cookies folder, when the cookie entry is created through my web application and the content of the cookie can be read. Can someone guide me on how to do this or show the sample code in C #? I can not help thinking that there is a wrong way to do this ... and this protection Is rack not such a better way that you can do it? Maybe to host a page in a WebBrowser and to use an object (you prepare) so you can talk with Javascript from the C # app?

security - The best way to create log-in realm in PHP -

I can do the login area in PHP and the way I do it by setting a session variable and checking that Whether the session variable is set or not on each restricted page, I check whether a certain session variable is set (or equal to a certain value). If not, I will send the user back to the login page. What is the best way to do this? Is there a more secure way to do this? There are answers to people with more safety. Keep it low, you should think of SSL and other things like password hashing ... Hope it helps :)

php - Maximum SQL Queries per page -

There is no definitive answer to this question, so if it is considered subjective and assume that bad Please feel free to turn it off. Actually I'm developing a huge web application (PHP), and uses it. Right now it is under development and some things in the database are really complex, so there is a need to create many questions to display pages (about 7-25 questions). Since this is likely to happen on a large scale, I would like to know what max is, it is a type of point which indicates that "you might be doing something wrong And should be optimized ", the number of SQL queries that should be per page. I have a very simple caching system that just reduces the queries run by 5 of the 15 seconds for the same user. What are the 25 questions going on? Should I stop development for a short time (I have a lot of time) and stop the code refactor, remove SQL queries, which do not give time to improve performance on this part? It may seem a bit confusing, then i...

c# - Execute multiple aggregates at once (SQL, LINQ).. or with better performance? -

I have a table with the record that contains a datetime column "CreationDate". I need to get the following information for every for the last 90 days: How many records were in total existence How many records were added that day I can definitely do this through a loop of counting, but this database will be killed 90 times ... I am using C #, LINQ, SQL Server 2008. are you looking for something like this? As with CTE (SELECT COUNT (*) over) (), Total Cost, CAST (Convert DateTime as VARCHAR, CreationDate, 101) as DateValue, * MyTable to WHERE CreationDate & gt; = DATEADD (DD, -90, GETDATE ())) DateValue, TotalCount, Order by date, as the line count from the CTE group by TotalCount;

c# - How to end the user session and make sure that the user is logged out? -

I am new to .aspx and now it is a matter of fact that since I am projecting a web enabled This is the login user. I drag the login template down and then is used for the session ["Authentication"] = Username. Thasting (); The current log in information to store the user and so now I also used the hyperlink "logout" in the upper right corner and then moved it to the login page. (If this is the wrong way to move wrongly, then tell me, I am learning all over the internet). Now, if I run on the Web, I can easily enter, but when I will take the "hyper link" "logout" to me again on the login page, but if I re-press the back button of the browser then that data transfers control over the page and I can again perform the data operation. I used it on the page load of the login page session ["authenticated"] = zero so that only the login button Users can login again by clicking Session ["Authentication"] = Username...

xml - Append header and footer if they don't exist with XSLT -

How can I do XML XML input XML input inside a native node, if it does not already exist? For example, if I have an input: & lt; Project & gt; ... & lt; / Project & gt; I want to wrap it with a prefix and suffix: & lt ;? Xml version "1.0" encoding = "UTF-8" & gt; & Lt; Site & gt; & Lt; Project & gt; ... & lt; / Project & gt; & Lt; / Site & gt; However, & lt; Project & gt; The root node of the input is not, I want the input to be un-attached. Thank you in advance! This stylesheet: & lt; Xsl: stylesheet version = "1.0" xmlns: xsl = "http://www.w3.org/1999/ XSL / conversion" & gt; & Lt; Xsl: template match = "@ * | node ()" name = "detection" & gt; & Lt; XSL: Copy & gt; & Lt; Xsl: apply-select template = "@ * | node ()" /> & Lt; / XSL: Copy & gt; & Lt; / XSL: Templates & gt; & Lt;...

activerecord - How to insert records using select in codeigniter active record -

I want to implement an SQL query using the CodeIgniter Active Record class. The query looks like this .. INSERT California_Authurator (au_id, au_lname, au_fname) SELECT au_id, au_lname, au_fname Whereas the stat = 'ca' Is the codeIgniter possible without using the $$-> db-> query method? Solution : $ this-> DB- & gt; Select ('au_id, au_lname, au_fname'); $ This- & gt; Db- & gt; ('California_authors'); $ This- & gt; Db- & gt; Where ('state', 'ca'); $ Query = $ this- & gt; Db- & gt; get receive (); If ($ query-> num_rows ()) {$ new_author = $ query- & gt; Result_are (); Foreign ($ new_author $ $ = $ as author $ $) $ {$ this- & gt; Db- & gt; Enter ("writers", $ author); }} Regards I think that you SELECT ... INSERT query, there is no way to do this on the Active Record class, but there are two ways to do this 1) $ query = $ this- & gt; Db- & gt; Query ...

excel - Convert a 300 character string to a uniquely identifiable 8 character string in VBA -

I have designed a user interface for a device, where the user must enter a "name" which is a maximum of 300 characters Is long, and the tool generates a text file ("name" .txt) which is then uploaded to "server" (mainframe and unix). I want to shorten the 300 character string to a specific identifiable 8 character string (mainly in the mainframe), just like some small size using some sort of hashing algorithm. I got a SHA1 implementation but the resulting string is 40 characters long Can someone suggest VBA implementation for an algorithm? The resultant string requirement is 8 characters long; I guess it should be appropriate that we have a border on the size of the input string I think Jane's idea should work properly. If destroying SHA-1 hash is not your thing, then you can use CRC-32 (32bit ~ 8 ACI character 0 ... F). (You can try to use) As far as the CRC-32 conflict is concerned, it is not as safe, but it is at your end.

javascript - Dynamically adding two form elements with jQuery -

I am trying to create two form elements when the user clicks a button, which he can do 5 times I'm new, I'm running into problems in JQuery, Here's the code: $ (document) .ready (function () {$ ( '# BtnAdd') Length (var.) == ('.clonedInput') Length; var numTwo = $ ('.clonedInputTwo') Length; var newNum = New number (num + 1); var newElem = $ ( '# Etter (' id ',' input '+ new); var newElemTwo = $ (' # inputTwo '+ num2) .clone () .tr (' id ',' input '+ et (' id ',' name '+ New name) .attr ('name', 'name' + newNum); newElem.two.children ('first'). Attr ('id', 'name', + new name) .attr ('name', 'name $ ('#Enput' + num); $ ('#EntTwo' + num2) after $ ('newElem'); $ ('#BTNDL'); ('disabled', ' '); $ (' New Bundle ') $ (' # BtnAdd ') attr (' disabled ',' disabled ...

asp.net mvc - Nhibernate (and ORMs in General): work with Objects or ObjectIds? -

It's something that was pulling me for a while. On one side - OOP / Rich Domain model hand / Em> - I think I should pass (context) about the real things about which I am talking about. On the other side - DB / Web app hands - I think it's easier and more efficient to pass only the integer ID Instead of objects Consider an ecommerce list type application: User is logged in and navigate to a product page They post a comment With this comment continuing, the planned controller has 3 pieces of information in action: a) User ID (from athlete cookie or from anywhere) , B) Product ID (probably from QuickString), and C) Comment Text. Now, what is the best practice here? Does it really increase the user and product objects (for example, they are mixed with all the DB work), when we know that it will be used for everyone, the ORM can read their ID and be appropriate External DB in the table whose keys are stored in the table? What are people...

iphone - How to change the color of UIBarButtonItem? -

I have a UIToolbar, and then add two UIBarButtonItem to UIToolbar items. How do I change the color of UIBarButtomItem? I did not find the API in the document. UIBarButtomItem has a customization limit so that you can use UIButton instead of UIBarButtonItem Will give

Html5/Javascript frameworks/server side JS Framework vs Ruby on Rails? -

My question is whether a developer knows only the tracks on HTML5 / Javascript frameworks / server side JS Framework or Ruby Is that skill set allowed to develop the best web app on the web or to provide more creativity? Regards 1) You should know about HTML / 2) and a server-side technology (Ruby on Rail / PHP / Java / Parthon etc.) for the development of a basic web application. When it comes to decorating the application, you need 1) CSS 2) Javascript framework The first skill set requires you to fly into the world of the web More independent of Rata will provide.

debugging - Using windbg for the first time to debug a process which shuts down without warning -

I have a process, when I click on a button on my UI, another process launches this In the process it stops any clues without any warning or logs. How do I use the Windbug to understand this problem? Also, what do I do for the symbol file path? To download symbols from MS symbols, I am not sure that I have to set an NV variable too. Thanks How to get symbols here:. Generally, the easiest way to do this is to set an environment variable: _NT_SYMBOL_PATH = SRV * c: \ websymbols * Http: //msdl.microsoft .com / download / symbols Be sure that after you set environment variables, you start Windbg, and keep in mind that VS Recent versions of this will also use this environment variable, so they will be slow to start debugging. My first step will try to do two processes and will separate - can you start the one who fails, as if it fails? Quit Often one of these indicates: One stack overflow (infinite recursion) Exception in an exception handler (sometimes) Messi...

visual studio 2010 - How to get user Names of domain in Sharepoint web part? -

I want to get user names in Active Directory using SharePoint WebPart. Either way I can get the user name using ASP Net but I can convert that part to SharePoint Web Part .... Here is the code ......... System use; Using System.Collections.Generic; Using System.Linq; Using System.Web; Using System.Web.UI; Using System.Web.UI.WebControls; Using System.DirectoryServices; Using System.Data; String domain = "LDAP: // servername"; DirectoryEntry entry = new directoryInterity (domain); Directory Finder Explorers = New Directory Finder (Entry); Finder.filtor = "(and (object class = user))"; Search ResultCollection resultCol = searcher.FindAll (); // Link List for List of Store User Name & lt; String & gt; User_Names = New list & lt; String & gt; (); Int count = 0; Foreach (Results in search results result results) {User_Names.Add (Results Properties ["CN"] [0] .Ostring ()); Calculation = count + 1; } // All user names can be printed for u...