Posts

Showing posts from June, 2015

python - Django: construct form without validating fields? -

I have a form form MyForm which I update using AJAX because the user Fills. I have a visual method that updates the form by creating myForm from request.POST and feeds it back. def update_form (request)): if request.method == 'POST': dict = {} dict ['form'] = MyForm (request.POST) .as_p () return HttpResponse (Json.dumps (dict), mimetype = 'application / javascript') HttpResponseBadRequest () Return, however, this calls for cleaning / recognition routines, and I Do not want to show messages until they actually activate "submit". So the question is: How do I create a django.forms.form with existing data? Unless you call form.is_valid () Until then the verification does not start. But as I'm guessing, you want that the data in your form is filled with user type, as long as users do not submit clicks. def update_form (request): if request.me Thod == 'POST': If request is not done. POST.get ('submit'): dict...

reference - C++ object termination notification -

In the C ++ program, my two references are numbered objects: King and Heirs . The heir has to be blocked until the king is destroyed. The king is a reference item that will be destroyed when its reference number becomes zero. If the warrior is in the context of the king, then the king's reference number will never be at zero, how can he be the heir block until the king is destroyed? "post-text" itemprop = "text"> In the context of non-owners (or "weak"). To wait till the death of the king, you can use a mute x until the king dies and the heir block is waiting to leave the king. / P> If you have to wait for many succession and the heir has been given some order, you can get a "heir selector" object which keeps track of the heirs list and keeps track of his predecessor , And when the king releases Mutex, it will give ownership to the next heir in that list.

objective c - iPhone basic memory management -

Is it proper storage management? I am thinking that if alloc is in -viewDidLoad . should be released after, SomeViewController.h #import & lt; UIKit / UIKit.h & gt; @ Interface Some ViewController: UIViewController {UIButton * someButton; NSString * someString; } @ Property (Nonomatic, Replacement) IBOutlet UIButton * someButton; @property (nontomic, copy) NSString * someString; @end Some ViewController.m #import "SomeViewController.h" @implementation SomeViewController @ synthesis someButton, someString; - (zero) viewDidoadload [[Super Viewedload]; SomeButton = [[UIButton alloc] init]; SomeString = [[NSString alloc] init]; } - (zero) viewDiduude {self.someButton = zero; Self.someString = Zero; } - (Zero) DailyButton release, self.someButton = Zero; [SomeString release], self.someString = Zero; [Super DeLoc]; } @end Thanks Edit: One more thing if I put UIButton in IB, So do I still need alloc ? When you call init on an object, t...

scrum - Articles explaining anti-AGILE patterns -

The more clients I see, I see that even more bad implementation of the strange herd. Sometimes I just hope that I am misunderstood the basic principles of agile, but as much as I read clearly, I read as clearly what I am really developing, and how it is implemented. . I'm looking for comics / articles I personally like this white paper (pdf) And it is by far the most There are some links to the Scam Alliance below, which do not have an account here, they are cached links, edit / P> This is discussed before and after a lot of observation (articles about ScrumBut and many talks and articles. First by interest Ken Schwaber and Jeff Sutherland) There are two reasons for this principle, with each set of "smell": No cultural changes - banner Under the blanket, tight and lately, most of the earbers are still old orders and controls, as well as managers still using "point and tell" management techniques (talk to someone and tell them) What ...

jQuery live event on iPad...why doesn't it work? -

I am using jQuery to develop a webpage on the iPad and it seems that the live event of jQuery does not work ... this was the case when I was working with SDK iPad Emulator and now I have to work on the iPad, that's still (I hope this was an emulator mistake). Running the same code on Web Kit builds works fine. I'm just thinking that someone else is facing this problem? If there is a fix? Or if it's me? thanks :) This issue is for some reason Mobile Safari does not attach click events to some DOM elements, so you have to attach them manually. $ ('header') live (. 'Click', get_location_input); And when you add it later, it works on the ipad & lt; Div class = 'header' onclick = '' & gt; Station information & lt; / Div & gt; Here is the information where I got my information

python - Splitting a string separated by "\r\n" into a list of lines? -

I'm reading some data from the communication method of the subprocess module. I'm a big string divided by "\ r \ n" s Coming as I want to divide it into a list of lines, how is this done in dragon? Use splitline method on string. From the docs: str.splitlines ([keepends]) Return a list of rows in the string, break line breaks on line borders The result is not included in the list, unless the slope is given and is not correct. This will do the right thing, regardless of the end of the line "\ r \ n", "\ r" or "\ N" OS. The line ending the NB "\ n \ r" will also be divided, but you will get an empty string between each line, because it will consider "\ n" as a valid line ends And as the end of the next line of "\ r" E.g. & gt; & Gt; & Gt; "Foo \ n \ rbar" .splitlines () ['foo', '', 'bar']

mod rewrite - Regex match this OR that? -

इस के लिए regex क्या है? मैच स्ट्रिंग संपादित करें: मुझे नहीं चाहिए भाग क्योंकि अभिव्यक्ति का उपयोग अपाचे आधुनिक पुनर्लेखन पर किया जाता है, क्योंकि मैं नोड से बचने के लिए मॉड _rewrite के तर्क को बदल नहीं सकता। संपादित करें: मेरा प्रारंभिक प्रयास ([^ /] +) (.html) $ (^। Php) $ - जो मंथलीज़ गलत है अपाचे mod_rewrite mod_rewrite में, नहीं चरित्र ('!') संभव पैटर्न उपसर्ग के रूप में भी उपलब्ध है। यह आपको एक पैटर्न को अस्वीकार करने में सक्षम बनाता है; कहने के लिए, उदाहरण के लिए: `` यदि वर्तमान यूआरएल इस पैटर्न से मेल नहीं खाता ''। यह असाधारण मामलों के लिए उपयोग किया जा सकता है, जहां नकारात्मक पैटर्न से मेल खाते आसान है, या अंतिम डिफ़ॉल्ट नियम के रूप में। इसलिए आपको ऐसा कुछ करने में सक्षम होना चाहिए: ! ^ (। *? /.* |। *? \। (?: php | html) $) $ और इससे जो कुछ भी नहीं होना चाहिए इसमें / और .php या .html में समाप्त नहीं होता

intellij idea - Grails - IntelliJIdea9 Strange problem with packages -

I have a problem with a project checked on the job. I have a class called GridBuilder , which is com.ent.proj.utils.grid The package is located in a package named com.ent.proj. Utils.grid import grails.orm.HibernateCriteriaBuilder Import org.hibernate.criterion.Criterion import org.hibernate.Criteria class GridBuilder {} In the package declaration the word grid red, and read The symbol grid can not be resolved This directory structure is: grailsapp-- utils --- com --- ent-- - progs --- utilities --- grid --- gridbinder Groovy I am using IntelliJ Idea 9 as an INE Any thoughts? Thanks in advance update I see this file in the project view, but not in Grails view. > Runs from the command line $ grails run-ap , and could the app start properly that its an IntelliJIdea issue? "post-text" itemprop = "text"> Did you declare Grails-app / utils as a source folder in 'Project Structure' module?

jQuery click on li with nested ul -

I have a list within the lists when a user searches for a list item ( / Code>), then I nested & lt; Ul & gt; Before adding to the nested lists I wanted to show that, when I click on a list item, there would be any function, now, clicking on any of the nested lists, that function also is run. That makes sense, because they are part of the list item. A around the first part of the list item and lt; Span & gt; Apart from wrapping it, the ceremony is going on, there is a selector who runs something on my parents & lt; Ul class => "bucket" & gt; & Lt; Li class = "bucket" & gt; & Lt; Img src = "arrow_group_collapsed_true.png" square = "arrow" & gt; & Lt; Img src = "blue_folder.png" category = "folder" & gt; See all & lt; / Li & gt; & Lt; Li class = "bucket" & gt; & Lt; Img src = "arrow_group_collapsed_false.png" square = ...

Perl idiom for getting a maximum number of elements in an array -

I wanted to close the first five elements of an array, so I stupid: @foo = @foo [0 .. 4]; And heartily admired my own cleverness but breaking it once @foo ended with only three elements, because then I finally gave it Instead of two element elements with two element elements, I changed it to: @foo = @foo & gt; 5? @fu [0 .. 4]: @fu; It works but is somewhat ugly "Do I give everything to the first five elements of the array?" There is a better phrase to say. You can set the last pointer of an array to reduce or extend it. Like your code, you will need to check to ensure that your non-element is not making the element. $ # foo = 4 if $ # foo> 4;

java - Red-black tree - How to find the node's parent? -

In the red-black tree, when rotated, you will need to know who is the root of the specific node, however, only in the node The reference to the right or left child is I was thinking of giving a node frequency variable "parents", but for this reason I do not think that it is justified to do this and it is the root cause for rotation The context will be very complex to change. Public square node {Private left; Personal rights; Private IRD; Private parents; // I do not think that's a good idea) So, searching for my solution to apologize is to find the parent () method to use. I'm wondering what is the other way to find the node's parents? My solution: Sample tree: 50/25 75 If you have node 25 If you want to find the parents of, you pass something like this: node guardian = finder (Node25.value); And this node returns 550. Find the protected node parent (int val) {if (root == null) {return null; } Node current = root; Node original = cur...

caching - Cache expensive operations in R -

A very simple question: I used to write and write a text editor using my Running R script is reproducible, as suggested by many members. This approach is working very well for me, but I sometimes have to do expensive operations (like read.csv or Reshape ) that I better cache in the R environment, whenever I run the script (which usually happens several times as I progress and test new lines code). Is there a way to cache a script at a particular point, so every time I am just moving the incremental lines of code (as I am computing R)? Thank you. ## Load files only from disk if ## already in a variable If you have not been read (! (Present ("mytable")) {mytable = read.csv (...)} Edit: Fix Ypo - Thanks Dirk.

c# - Linq to SQL: Why "This SqlTransaction has completed; it is no longer usable." -

I have three tables related to each other, they represent a hierarchical object. A_Table-> B_Table - & gt; C_Table I have given my error below to set the primary key values ​​to the same values ​​as before. When I submit the check (), it fails with an error after 30 seconds: "This SqlTransaction has been completed, it is no longer useful." I know that the primary key values ​​are the same as before and after. I am under the assumption that Linq to SQL only modifies field values ​​if they are not equal to existing field values. DataContext.log and SQL update statements are not included in this code during this code. Why would this fail? Is it really trying to do some sort of comprehensive update to all Linq in Sql-RAM? Text after "div class =" itemprop = "text"> Applying the items generated by default INotifyPropertyChanging for DBContext conversion tracking And in that case it would not have detected a similar value set. ...

sql server - Format Table Variable Output with FOR XML AUTO -

Using SQL Server 2008. I have a table variable with one column and one row. If I do this: Announce the test breaks by inserting Test Testers in tables (testsId BigInt) @testsToRun where testId = 10 is selected I get the XML that looks like this: AutoType, type, root ('test message') from Top 1 * @tests to ToToRun XML, Code> & lt; Testmessage & gt; & Lt; _x0040_testsToRun testsId = "10" /> & Lt; / TestMessage & gt; When I really want to: & lt; Testmessage & gt; & Lt; TestsToRun testID = "10" /> & Lt; / TestMessage & gt; If the row is the source table, then it seems to work fine. When this is a table variable, then I do not want any child element label that I do not want, I do not want testsToRun and _x0040_testsToRun How do I work for my XML statement / clause to give me the proper output? Thank you. Try instead - use for XML path and you Define your output structure with...

Getting current time of a different timezone using C++ -

I am a different time zone How do I get the current time? For example, I need to know the current time in Singapore where my system is set at the time PT. An implementation UTC current time to get Time to use and then in your destination time zone to be TZ environment variable to be manipulated. Then convert the zone to the local time for localtime_r to use.

Help with XML Structure -

I am creating a report viewer. The viewer will have a tree control that displays all possible reports to choose the user. I am using a tree control because the report can be deeply dense in many levels, the tree can be like this: - North America + northern region + south region + west area - Build units - Units Ship + Eastern Area + South America At the lowest level of each group (for example, 'building units' and 'North America, for the west region' Haj '), I want to store information about the report that will be used to submit the report (for example, the information required to display the North American, West Territory, created reports of units). For example, I would like to include the name of the report (string), connection information (string) and available site (single string). What would be the best way to represent this in XML? I am not particularly fluent in XML, so I can use some help. Another requirement is that there really is no limit to ...

css - Aligning 3 social icons spaced out equally over a background image all wrapped in a div -

I have a container div tag that wraps an image called "tray" which provides a background to 3 social networking icons That is equally similar with the tray. I think it would be nice to rule the mouse even when I rollover them, but I am having some problems in any other situation in my own devices. I just want to combine it on the left side, all this, and nothing works! I'm sorry, but when I include the dialog box of this question, it does not work, so you can see the code here: I have to work on rollover effect, not just alignment with my second page, as you can see when you see my site, it's like a mess! So what are you doing is that when you want the situation then trying to use the situation Position status is relative. Remove the position and other positioning from your inserted divi and make it equal to the margin like your pop up distance. This will give you space for the popup action. After that, follow your "image status" and ma...

.net 3.5 - Overriding mouse over behaviour in WPF combo box -

After rotating a mouse over an item in the drop-down list, the item gets highlighted but shown in the text box The selected values ​​do not change until the item is clicked. I'm looking for a way to modify the mouse to change behavior in the control that comes with a combo box. I received the OnMouseEnter & amp; Tried to override like; OnMouseMove etc. You can do it by overriding the oorreading. The property of MouseEventArgs will give you the element under the mouse directly. You can use ComboBoxItem to obtain that element and then to select the item: Secure Override Zero OnMouseMove (MouseEventArgs e) {base.OnMouseMove (e) ; Var container = containerframe element ((dependent object) e.OriginalSource); If (container! = Null) {Selected Event = Item Container Generator Container to container (container); }}

android - Why are my notifications sometimes silent with ringtone from SD card? -

I am using information in my simple timer app (initial testing phase), and found that maybe 5% to 20 The time when I removed a notification, the sound did not come. Notification was shown correctly in all other cases, including LED flash, but was silent. I have confirmed with the temporary additional log lines that the sound URI I am using is sensible, and in reality there are similarities in the cases that do not work and which do not matter, I will briefly summarize the code of establishment notification , If I'm stupid somewhat monologically: // at the place where the receiver () calls from ... notification manager notifications ... ...; Notification n = new notification (Arrayable.con, text, next millisecence); N.setLatestEventInfo (...); N.flags = Notice. FLAG_NO_CLEAR | FLAG_SHOW_LIGHTS; N.OldOnMS = 250; N.ledOffMS = 1250; N.ledARGB = 0xff2222ff; N.audioStreamType = Audio Manager. STREAM_ALARM; N.sound = myUri; Notifications Information (int id, n); Here is the only co...

html - IE7 Hack for float/block bug -

I'm having trouble working with this layout in IE7: & lt; Span class = "box" & gt; Headline & lt; A href = "more" & gt; More ... & lt; / A & gt; & Lt; / Span & gt; .box {display: block; }. Box A {display: inline; float right; } All browsers display it correctly; title and more ... but IE7 makes it: title and more ... Any ideas on deciding this? I did not try to block, inline blocks, anything to work with some frequently used fixes like box-models etc. & lt; .box gt; & Lt; A href = "more" & gt; At the beginning of an & gt; tag; More ... & lt; / A & gt; Title & lt; / Span & gt;

How to drop clustered property but retain primary key in a table. SQL Server 2005 -

मेरे पास निम्न कुंजी है: ALTER TABLE dbo.Table जोड़ें सम्मिलित करें PK_ID प्राथमिक कुंजी CLUSTERED (आईडी एएससी) इसलिए मैंने आईडी कॉलम पर अनुक्रमणिका और प्राथमिक कुंजी को क्लस्टर किया है। अब मुझे क्लस्टर इंडेक्स को छोड़ना होगा (मैं दूसरे कॉलम पर नया क्लस्टर इंडेक्स बनाना चाहता हूं), लेकिन प्राथमिक कुंजी को बनाए रखने के लिए क्या यह संभव है? यह एक बयान में संभव नहीं है, लेकिन क्योंकि डीडीएल एमएसएसक्यूएल में लेनदेन है, आप कर सकते हैं तालिका में अन्य सत्रों को रोकने के लिए लेन-देन के अंदर बस कुछ भी करें, जबकि इसमें कोई प्राथमिक कुंजी नहीं है: आरंभ करें tran alter table dbo। [तालिका] ड्रॉप बाधा pk_id तालिका dbo alter। [तालिका] जोड़ें बाधा pk_id प्राथमिक कुंजी nonclustered (आईडी) कमांड ट्रॅन

wpfdatagrid - Unable to perform Up-down operation when wpf datagrid is sorted -

Hi, I have a Datgrid (WPF Toolkit) that is tied in an observation archive. Two buttons are "up" and "down", which move the selected row accordingly. For example: If the datagrid has 10 items and if I select the fourth object and press the "up" arrow then the 4th item will be taken to the third item and the last third item will be the 4th object. Ie swapping with the previous item similarly "down" arrows in another way. Private Zero BtnUpArrowClick (Object Sender, RoutedEventArgs E) { try {btnDownArrow.IsEnabled = true; CurrentRow = grdSeqData.SelectedIndex; If (currentRow == 0) {btnUpArrow.IsEnabled = false; } (CurrentRow = upRow;} and {btnUpArrow.IsEnabled = false;}}} Hold (Exception preceded) and (upRow = currentRow - 1; if (upRow> = 0) {sequence datatyst. {CatchExeption (LanguageHandler.GetCurrentCultureText ("EventUpArrow_Exception"), former);}} The above code is fine when the datagrid is not sorted, when I sort the ...

one to one - has one relationships and deletion in grails -

मैं grails में एक हैन संबंध में बाल ऑब्जेक्ट कैसे हटाऊँगा जैसे: मैं दो तरीकों से बाल ऑब्जेक्ट को हटाने की कोशिश की कोड> 1। Face.nose.delete () 2. नाक .delete () मुझे हमेशा एक ही अपवाद मिलता है दोनों तरीकों से झरना द्वारा सहेजा गया ऑब्जेक्ट हटाया गया है और एक और है मेरे पास कोई भी गतिशील तरीके हैं (जैसे addTo और removeFrom hasMany के लिए है) hasOne? कोई मदद? आप कोशिश कर सकते हैं face.nose = null Face.save () nose.delete () यदि आप केवल नाक हटाते हैं तो संपत्ति का चेहरा। अभी भी सेट है। बाद में कॉल की फेस एसवेई () नाक रुकती है। यदि आप केवल फेस सेट करते हैं। Nose = null (बिना बचत) तो परिवर्तन डेटाबेस को सहेजा नहीं है एक फेस पाने के लिए डेटाबेस के लिए एक बाद की क्वेरी आपको नाक सेट के साथ एक फेस देगी और एक सहेजना होगा ()।

sql server - Count using like in SQL - how to? -

मुझे एक दो टेबल मिली tblgamesals -name-url -siteID tblUrlCollection -url - साइट आईडी मैं कैसे गिनता हूं कि "यूआरएल" और "साइटआईडी" का इस्तेमाल करते हुए टीएलएलयूआरएल कलेक्शन में से प्रत्येक "यूआरएल" कितनी बार है? उपयोग करना चाहते हैं जैसे या कुछ ऐसा है कि मैं "url" इनपुट पैरामीटर के अंत में वाइल्डकार्ड जोड़ सकता हूं। कृपया मेरी मदद करें - बहुत बहुत धन्यवाद। प्रदर्शन यहाँ एक बड़ा मुद्दा नहीं है - बैकएंड सामान। प्रविष्टि @ साइटमैट इंक DECLARE @URL varchar (100) SET @url = 'Http: //stackoverflow.com%' SET @SiteId = 10 SELECT g.url, COUNT (u.url) के रूप में सी से TblGoals छ LEFT OUTER जुड़ें tblUrlCollection यू पर g.siteID = u.siteID और g.url = यू .url WHERE g.url जैसे @url और g.Site=@SiteId ग्रुप द्वारा जी.उर्ल

javascript - Graph Goat Teleportation Data with Google Vis. API via Chrome Extension -

Image
I just checked my Chromium Task Manager and found that my got teleported count unusual I thought it could be a good idea to create a browser extension that runs goat teleportation data through Browser Visualization API and produces some good reports so that I can easily track it and make sure I can not say that it does not get out of hand Is using Chrome extension to do the programming in Goet Teleported Is it possible to do? How do you feel that I should format the report? I was probably thinking a pie chart? There is one where to highlight such important information but sorry, Goats Teleported is not yet available through that API. Connection made a big hole in the system and urge you that to 1 goats.

sql - Is it faster to check if length = 0 than to compare it to an empty string? -

I have heard that in some programming languages ​​it checks whether the length of the string is 0 , To see if the content is " ? Select from users user_id Where LEN (USER_EMAIL) = 0 : Also T-SQL is true for sample Versus user select user_email = '' Edit You have updated your question because I saw it before. In that example, I would say that you should always use the user_id select where user_email = '' no Select user_id from users where lEN (user_email) = 0 will be allowed to use an index before one As the performance optimization, it will be a little bit subtle customization of the string! From [Guru] choose to see this in #temp . [Dbo]. [Spt_values] Create the cluster index ix ([name], [number]) at #temp [number]] Select [number] #temp Where [name] = '' [number] #temp from ou LEN ([name]) Original Answer Execution Plans In (SQL Server 2008 - I "borrow" the structure of time) I found a slight ...

c# - .Net Remoting not working in Windows 7 -

We have a server application (which has been developed using .Net 1.1, C #) which is port 8086 and Before listening to the client application, using the remoting will need to shake hands with this server. This application is working fine in almost all environments - Windows 2000/2003/2008 / XP / Vista We are now experiencing a problem with Windows 7. When we are stalking the server, it is opening the port and the client will be listening, but when trying to send the request, a customer who is running in other OS, gives a message That server is not running. We disabled the proxy, gave the exception to the proxy, but all became useless. On further analysis we found that there are many connectivity (LAN, Bluetooth and WiFi) in the system When we checked the TCP port, NetSat-A showed it local address 0.0.0.0:8086. That's why we disabled / removed Bluetooth; Wifi option and then tried Netstat also showing local eder 0.0.0.0:8086. How to move forward in this situation? ...

java - How does the scrolling on "Google Maps for Mobile" work? -

Go with a mobile device - Scrolling is super smooth with floating toolbars How are they accomplishing this with GWT? Update I mean the site viewed by a mobile browser, not the original app. And I always assumed that any Google web app was GWT - I think I have mistaken it. I do not see anything that indicates that they are using GWT at the bottom of the site Based on the link to, they are either telling people using the original Google Maps app (iPhone) installed or referring to those sites which are a local map for any mobile platform. Using the app will download I have some Google Maps app , Which is using the plain JavaScript version of Maps APIs3, and another is using GWT. Even using V3 API, there is a very simple map, which is optimized for mobile devices, I do not have any scrolling anywhere on the platform as a basic Google Maps app.

Silverlight custom control ToolTip not showing up each time -

In Silverlight application, I have a custom control with many custom properties to define your properties as dependency properties In the category of custom control announcement, I am showing tooltips: public override zero OnApplyTemplate () {base.OnApplyTemplate (); Border bordercntr = base.GetTemplateChild ("PART_SBorder") as the boundary; Bordercntr.MouseEnter + = New MouseEventHandler (bordercntr_MouseEnter); Bordercntr.MouseLeave + = New MouseEventHandler (bordercntr_MouseLeave); } Private Zero limitcntr_MouseEnter (Object Sender, MouseEventArgs e) {string _sno = this.SomeProperty.ToString (); ToolTipService.SetToolTip (this, "some text" + _sno); Visualstatizer Gostostat (This, "hovers", false); } The problem is that tooltip does not pop up mouse poinces for a custom control for the first time, but after reloading the page only after the second time, Happens: For the first time when I hover over any control, nothing is visible and the second...

XMLHttprequest post method in rails -

How to send files through xmlhttprequest.send (file) in Rail, the related method (method) in the post method controller Calling Any ideas? Method in the method specified in the method and get the request (body) content in the controller to get the same action calling method? Class = "post-text" itemprop = "text"> You should be able to get it from your request object. There may be something like this: path = "public" / file.open (path, "wb") {| F | F.write (request.body.read)}

c# - WPF: Is there a possibility to "route" ordinary mouse events to touch events in Windows 7 -

I am currently developing a touch screen application using WPF for C # (.NET 4.0) and Windows 7 I am My problem is that the currently available touch screen driver has generated only mouse events. (The manufacturer unfortunately does not provide a real Windows 7 driver) Therefore, I am currently not able to test properly. Is there a general way to tell Windows 7 that a device must be a touch device (although it can provide only - one touch event)? Check this out. . There is a mouse touchdivision CS file that looks like this. It converts events into manipulation of normal mouse events. /// & lt; Summary & gt; /// is used to translate mouse events in touch events, to enable an integrated /// input processing pipeline. /// & lt; / Summary & gt; /// & lt; Comment & gt; This class originally comes from Blake. UI - http: //blakenui.codeplex.com< / Comments & gt; Public Class Mouth Touch Device: TouchDevice, ITeDevice {#region Class Member Private ...

Renaming a Word document and saving its filename with its first 10 letters -

I have recovered using software called Fotorik from corrupted hard drive can write documents. The problem is that names of documents can not be recovered; All of them have been named according to serial numbers. There are more than 2000 documents to sort through and I was wondering if I can rename them using some automated process. Is there a script that I can use to search the first 10 characters in the document and change its name with it? It will be able to cope with many documents similar to the earlier documents and therefore should not write the documents with the same name. In addition, it is to avoid changing the name of the document with invalid characters (like '?', '*', '/', Etc.) I have only a little bit of Python, C Experience, and even less in Linux with Bash programming, bear with me if I do not know what I'm doing if I have to write a new script. How about VBSPT? Here is a brief description: FolderName = "C: \ Documents \...

python - In Jinja2 whats the easiest way to set all the keys to be the values of a dictionary? -

I have a dashboard that gives the name space to the context of each dashboard item There is a quick way I have a key in a template Can you set all values ​​of a dictionary? I want to reuse templates and not always specify the name of my variable. My references can be simplified to look at: {"": "business": [], "new promotion": [] }, "Message": {"one_to_one": [], "announcements": []} With a statement, I set up to include all business items locally Want to Currently I have to set each variable individually: {% to%} {% set businesses = business ["business"]%} {set new_promotions = business [" New_promotions "]%} {%" businesses.html "%} {% endwith%} I tried: {% of With%} {%} key, my_dict%} {% set key = value%} {% endfor%} {% include "businesses.html"%} {% endwith%} But they are only scope for the for loop, not including ... Short story short: you are voluntary ...

database - Storage of Static data within android app -

I am currently developing a simple information application on various university campuses. I want the app to operate primarily in an offline state, so I want to store all my information locally. The data within the app will not be subject to any type of change, so I was wondering how to make such data the best (practice)? Basically what should I store information in SQLite DB, Java file or XML? The answer depends on your needs, but due to the underlying integration with SQLite, the easiest is probably just You will have to use SQLite, plus you get the benefit of a relational database. You can reference for a start.

events - Java Swing properties (addPropertyChangeListener) -

Is there a published list of asset names for swing components? By looking at the source code, Javax.swing.table.TableColumn, I can call for fire replace strings with properties such as "Model Index", "Identifier", "Headerville" etc. Not in the form of string constants As far as I can tell, this class is the only way to know the properties of "properties" to see the source code. If there is no published list, then what is a better way of getting property names? Thank you. The only way to find out for sure is on the respective class isBound is the method. The code should be quite trivial using this code. This code may exclude all bound properties for a class

visual studio - Unit testing a Data Access Layer -

I am reading on a Project Data Access Layer Check Unit. Boil down for most options: Use a dedicated test database, but cleaning (or manually doing) in the final form of all unit tests Duplicate the database We used rollback in a previous project but I should know more about other options and how These are the best performers if you have sampling / articles / video ... so please share them. You can test type unit testing and integration testing with 2 projects. Unit test data tests one aspect of your project without access to data and the presentation. For unit tests you can use your database and user dependency injection so that your code can be unwanted from the data provider. It leads to a better architecture and can be plugged into a different data provider if you wish. Like going from an AdiNet to Anihiberate There are integration tests where you test your entire system and make sure that your code gets the correct data from the database. There should be a co...

zend framework - How is ACL implemented -

I am using Zend_Acl , PHP and am wondering how to implement the shadow ACL Go. All pages have become a resource and I ask always ALL that the user is authorized or not? I think I should use it if I want to use a controller plugin (can be setup to run on every request) to check that the user has permission or not? Or do I just put the query code where I need it? like. Should I ask ACL at the top of the pages? Then in publicly available pages, I leave it? If the app gets bigger then can you have trouble? Okay, if I just answer this question then let me close it What I did now was a controller plugin that sets its resource based on the privilege based on the controller name and action name, then under that development inquire ACL on that basis but whatever I have currently seen

c++ - Boost serialization fails in release mode while working in debug -

I am using promotional serialization with xml files with the c ++ program. When I check my program in debug mode, it's working fine. Then I try with the same file in release mode, but my program fails while loading the file. I tried to create XML files in release mode with my program, loaded them back, and also crashed down. The call stack indicates: packs_ui_main Exe! Boost :: archive :: basic_xml_grammar & lt; Char & gt; :: parse_start_tag (std :: basic_istream & lt; char, std :: char_traits & lt; char & gt; and amp; is = {...}) line 21 9C ++ The actual bug is ahead, but I do not have any debug info deep in the call stack. I do not know what type of settings can be different between release and debug, can explain this accident edit 1 I have a prebaseor I use the definitions in debug: WIN32; _CONSOLE; _DEBUG; __WXMSW__; __WXDEBUG __; _Windows; NOPCH; _USE_32BIT_TIME_T; I am using preprocessor definitions to release: WIN32; NDEBUG; _WINDO...

javascript - problem with setInterval(); and clearInterval -

I have a problem with the Setinterval, it's probably best to show an example, here's a link: Actually, I'm having trouble doing this work as if I need it when the page loads, the content rotates every three seconds and the buttons on the right also do this. When you click on a button the buttons increase and the animation stops - all the good. Then when you click the small closed button under the button that starts the animation - all good .... But then when you click the number button, the animation continues again. Why? There are so many codes, but there are set intervals and clear intervals: Line 69: On the document. Already the animation starts off - a global variable line 87: the user clicks the numbered button in that animation on an empty time line 102: when the user clicks on the closure button So the animation starts again That's it ... I do not get why he does not stop the animation a second time ... Why can anyone see? Any thoughts...

c# - PInvoke a function from a DLL compiled in C -

मेरे पास निम्न C फ़ंक्शन है typedef struct ekeycore_ctx_ ekeycore_ctx; Typedef संरचना ekeycore_enum_ ekeycore_enum; Typedef struct ekeycore_device_ {char * सीरियल; Char * portname; चार * नोड; बुल उपस्थित; BOOL का इस्तेमाल किया; } Ekeycore_device; Typedef संरचना ekeycore_simple_ ekeycore_simple; टाइपिंगफेम एन्यूम (EKEYCORE_OK = 0, / * सबकुछ ठीक था * / EKEYCORE_NOMEM = 1, / * स्मृति से बाहर * / EKEYCORE_NODEVICE = 2, / * कोई भी डिवाइस उपलब्ध नहीं हैं * / EKEYCORE_TIMEOUT = 3, / * कुंजी ने अनुरोध का जवाब नहीं दिया * / EKEYCORE_FAULTY = 4, / * डिवाइस में दोषपूर्ण / आक्रमण किया गया है * / EKEYCORE_UNKNOWN = 5 / * अज्ञात त्रुटि * /} ekeycore_result; EKEYCORE_API ekeycore_result ekeycore_simple_get (ekeycore_simple * ctx, intigned char * buff, size_t buffz) मुझे सी # से इस फ़ंक्शन (ekeycore_simple_get) को कॉल करने की आवश्यकता है, मैं इसके बारे में कैसे जाना होगा? वेरिएबल प्रकार कन्वर्ट कैसे करेंगे? आप शायद किसी के लिए थोड़ा अधिक स्टैक ओव्हरफ्लो पूछ रहे हैं इन स्थानों पर मैं प...

Facebook Posting API Question -

Right now I'm trying to post a media file in a media file on my site. I was working on the old API earlier, but now I am trying to work on it and I have a problem. I'm driving this $ facebook-> API_client- & gt; Stream_light ($ message, $ attachment, $ action_link); Is this an old API or new one? Because I'm getting this error A member function in stream_publish () on a non-object call I was reading a tutorial and he said API ('/ m / feed', 'post', array ('message' => gt; 'message', 'cb' = ';' ')); But how can I post an attachment / action link using that? Thank you! First of all, do not confuse the API with SDK. The latest PSP SDK's new graph API and old restore. The API is capable of communicating with both. and are using the new SDK, because Facebook :: $ Api_client is not present in the new SDK . Secondly, as is common with most tutorials, they only show you a snapshot of t...

Difference between string and text in rails? -

I am creating a new web app using Rail, and wondering, string and text and when should each be used? The difference depends on how the symbol is converted into related column type in the query language. With MySQL: string is mapped to VARCHAR (255) - : string | VARCHAR | : Border = & gt; 1 to 255 (default = 255): text | TINYTEXT, TEXT, MEDIUMTEXT, or LONGTEXT2. : Border = & gt; 1 to 4294967296 (default = 65536) Reference: Use each When should it be done? As a general rule of thumb, use : string for short text input (username, email, password, title, etc.) and : Text, for more expected input such as details, comment content, etc.

syntax - C type casts and addition precedence -

Image
अगली अभिव्यक्ति में प्राथमिकता क्या है? आइटम = (चार *) ढेर + ऑफसेट; क्या यह (char *) (heap + offset) या ((चार *) ढेर) + ऑफसेट ? पूर्वनिष्ठता तालिका के अनुसार द्विआधारी अतिरिक्त को कास्ट करें

textarea and javascript -

I am trying to set text while loading a php file ... I am doing something like this var a = document.getElementsByName ('Inquiry'); a.value = 'Pedingo de Information Day Preso, Relative Ao Products: http://www.musicland.pt/musicstore/product_info .php? Products_id = 2581 '; & lt; / scripts & gt; "; ? & Gt; Now I know that it is silly but this is just a lesson I want to make an evaluation first and if there is an ID then fill in the text field Generated source has corrected it and does not contain JavaScript errors, but textera is empty. I can not understand !! Can someone help me getElementsByTagName Gives a live node list. If your element has an ID, then use getElementById if you want it to be done on many elements in the node list, then use to loop . var a = document.getElementById ('Inquiry');

c# - ASP.Net How to update a updatePanel in main page from popup? -

Helping Somme, thanks in advance, I have two page ASPX, the first main page is an update pinl in which I have a second page. Calling as popup. Thank you for the valuable help. Call popup as I follow in javascript like this: this.showUrl = function (url) {if (! This.div) {this.create ( ); } Else {this.div.style.display = ''; This.hideDiv.style.display = ''; } DayPolt 2. Radically stable = this; This.iframe.src = url; }; Pass the Update Client ID of UpdatePanel for the popup. Then update with your codebehind or javascript.

c# - Programmatically To check dll exists in Gac or not.If so display it in grid -

I have a list of DLLs in a folder, whether I want to check a DLL for an application. If so, then I want to add that app's name to the grid. Anyone can tell how to program it in advance thanks Do an assembly. Load and check GlobalAssemblyCache TestAssembly = assembly. Loadfrum (dllname); If (! TestAssembly.GlobalAssemblyCache) is not in {// gac}

php - Running symfony unit test returns "There is no open connection" -

During the unit test run the Symphony may have a problem opening the database connection I have specified in my test env config / Databases.yml: All: Principle: Category: sfDoctrineDatabase Ultimate: DSN: 'mysql: Host = Local Host; Dbname = ms 'Username: MS Password: xxx test: Principle: Category: sfDoctrineDatabase param: dsn:' mysql: host = localhost; dbname = ms' Username: MS Password: xxx ... test file (test / unit / Mstiiti.afpi) looks like the following: require_once dirname (__ file __ ). '/ .. / bootstrap / unit.php'; $ A = new paragraph (); $ A-> setHeadline ("Article Title"); $ A-> save (); When I try to run a test using "Symphony Test: Unit MS" then it is only "no open connection" and it exits. Running trial alone (php test / unit / MSTest.php) returns full stack trace: C: \ phpworkspace \ MS> php test / unit / MSTest.php serious error: Do not come with the exception of 'Doctrine_Connection_Exce...

applet - call c++ exe from java -

I'm trying to call java applet to c ++ exe. For this purpose, I am using ProcessorBiller. My code is as follows ProcessorBB = new process builder (s); Process process = pb.start (); Final InputStream = process.getInputStream (); OutputStream Out = process.getOutputStream (); Print Vector PW = new printritter (new buffer ventricle (new output stream water (out)); Pw.println (1); Pw.println (1 + "" +2); New thread (new runnable) {public zero run} {try {BufferedReader br = new BufferedReader (new InputStreamReader) string line; while ((line = br.readline ()) = null {Out.println (line) ;}} Hold (java.io.IOException e) {}}}. Start (); pw.close (); C ++ looks like this when XE starts Find a short path to S. Find the associated path from the lowest distance of S. (1 + beta) to S. Find the path associated with the S within. Please input Input Command (1-4): Once U input command, for example 1 we get Please separate the input and T, by space: Then you ent...

proxy classes - After calling NHibernate.Initialize(proxyObject) I'm getting wrong objectType -

I have an object hierarchy> Parents> Children (lazy loading is set to true by default) Now I have all the parent objects The loading data will be the type of childproof in all the child's object from the database. Then I IList & lt; Parent & gt; Parents = NHibernateHelper.List & lt; Guardian & gt; (); Foreign currency (parent parent's parent) {if (NHibernateUtil.IsInitialized (parent.Child)) {NHibernateUtil.Initialize (parent.Child); If (parents- child.gettype ()! = Typed (hair)) // parent.Child.GetType () Please type proxy back to me new logic concept ("wrong type"); }} How can I change my parents? Due to checking the child's actual type "hair" system, I need real type (hair). This example is simple in real life. I have very complex mapping and relationship. Any thoughts? Try with: var realObject = session. GetSessionImplementation () PreistenceContext.Unproxy (parent.Child) However, it is a bad idea to tru...

php - Using JQgrid and sortableRows. Update table row order -

Experiment: I am able to call a warning after modifying my line order. How do I send / edit this data to PHP / the editingurl passes through this data, such as when attaching or editing, editurl gets $ _POST ['oper'] variable? Currently: jQuery ("# ​​images_list"). JqGrid ('sortableRows', option = {update: function (e, ui) {warning ("hi");}}); The first update event should be like the following: JqGrid ('SortableRows', {update: function (e, ui) {warning ("id =" + ui.item [0] .id + "left item with");}}); If you need other line data, you can get the code using the line id and get the getRowData method. How to post the results for the server You should decide yourself You can use the directly $ .jax function I think the order of the rows can change the rows Should not be interpreted to add, delete, or edit

android - Display view defined inside activity -

I have an activity 'A' which is called main activity until the timer runs out. A is said to attract pulses until the timer is over public class A extended activity {* some code * public class NestedView expands {public View {canvas canvas} on the zero {* Drag the pulses}}} I want to display the "pulse view" in the main "XML", which already has some buttons and scrollers, text boxes and so on. How can I reserve a part of the screen to display the pulses? I can not recreate the XML file because the above pulses are dynamic and in the image there is a red line entering the X axis for the user defined time. You can not have "A" activity and main activity at the same time. Instead, create a new view and add it to the layout in main.xml. See the documentation for an example It seems that section titled shape diagram can meet your needs. Edit: You can view the view from within your activity by calling (MyView) findViewById (R.id.my_view...

c# - Memory Efficient Recursion -

I wrote an application in C # that generates all the words that are in combination with letters, numbers and some special The characters can be The problem is that this storage is not efficient because it matches like recursive and some collections. Is there any way I can limit the memory environment? Change it to any one

iphone - Trouble decoding with NSKeyedUnarchiver -

I am writing an app targeted at iOS 4.0 on XCode 3.2.3, where AP closes when the NCCDER protocol. Saving seems to work fine, retrieving data from saved files. My save method looks like this: - NSArray * path = NSSearchPathForDirectoriesInDomains (NSDocumentDirectory, NSUserDomainMask, YES) to save path to create saveMusicalWorksToMemory {//}; NSString * document directory = [path item overindexx: 0]; NSString * mwPath = [document directory stringbapping textCompany: kMusicalWorksLocalFileSuffix]; NSString * fwPath = [document directory stringbappingpath company: kFeaturedWorksLocalFileSuffix]; NSMutableData * Music Warsawata; NSMutableData * featuredWorksData; NSKeyedArchiver * mwEncoder; NSKeyedArchiver * fwEncoder; Music warsdata = [nsmutable data data]; FeaturedWorksData = [NSMutableData data]; MwEncoder = [[NSKeyedArchiver alloc] initForWritingWithMutableData: Music Warsawata]; FwEncoder = [[NSKeyedArchiver alloc] initForWritingWithMutableData: featuredWorksData]; // encode ...

javascript - setInterval / clearInterval Issue inside it's scope -

I have the following code, and it works fine until I suppress the #play button I assume it Because the var intID is set to another location and it is not in the same scope when i window.clearInterval () it ... how do i fix it? BTW, this is Google Maps API version 3 function intervalstriggers () {return window.Sisthir (function () {placement ++; if (placements> gt; = markers. Lamps) {placement = 0;} Google.maps.event.trigger (Marker [placement], "click");}, 5000); }; Var intID = intervalTrigger (); Click on $ ('# Map_canvas') (function () {window.clearInterval (intID);}). $ ('A [href = # next marker]'). Live ('click', function () {placement ++; if (placements> gt; marker.lambi) {placement = 0}; google.maps.event.trigger (marker [place], "click"); Replacewith ('& lt; a href = "# play" & gt; play & lt; / a & gt;); Details are false. is; }); $ ('A [href = # prevmarker]'). Live ('click...

Calling a PHP function defined in another namespace without the prefix -

जब आप एक नेमस्पेस में फ़ंक्शन परिभाषित करते हैं, नामस्थान foo {function bar () {Echo "foo! \ N"; } क्लास MyClass {}} आपको इसे अन्य (या वैश्विक) नाम स्थान से कॉल करते समय नाम स्थान निर्दिष्ट करना होगा: बार (); // अपरिभाषित फ़ंक्शन \ bar को कॉल करें () foo \ bar (); // ठीक वर्गों के साथ आप "उपयोग" कथन को प्रभावी ढंग से वर्तमान नाम स्थान में एक वर्ग को आयात करने के लिए उपयोग कर सकते हैं [संपादित करें: मैंने सोचा था कि कक्षाएं प्राप्त करने के लिए आप "फू" का इस्तेमाल कर सकते हैं, लेकिन जाहिरा तौर पर नहीं।] उपयोग foo \ MyClass MyClass के रूप में; नया MyClass (); // ठीक है, foo \ MyClass का तत्काल लेकिन यह फ़ंक्शंस के साथ काम नहीं करता [और यह कितना है कि वह कितने हैं]: उपयोग करें बार के रूप में foo \ bar; बार (); // कॉल अपरिर्धारित फ़ंक्शन \ bar () आप टाइप करने के लिए उपसर्ग को कम करने के लिए नामस्थान उपनाम कर सकते हैं, एफ के रूप में उपयोग करें f; // अधिक उपयोगी यदि "foo" बहुत लंबा या नेस्टेड f \ bar () था; // ok लेकिन ...

Best way to keep changes in django-admin for future releases? -

I was wondering what is the best way to modify django-admin? Is this the best way to modify and compatibility to future releases? Especially I'm thinking again on search_fields, where Field__ Xact is required (= field) gets converted to field__iexact in the construction area of ​​the query? I just want to make amendments in a way that they are applicable in future releases. Thanks, Angel It is not possible to change default search , The place where __Exact Lookup is actually built in the main part of the admin system. So it can not be solved by applying its own administrator or meta derivatives. You can try your own search form, but for that you will need a lot of rewriting because you will need to hack in some javascript list display, with the list queries Bella will need to find a way. However it is likely to be supported in the entire 1.x release. Although you want to support the new admin features for future releases, you may need to customize your template a l...

ruby - Is there an elegant way to exclude the first value of a range? -

मान लें कि मेरे पास 0 से 10 की सीमा है: range = 0 .. .10 तीन बिंदुओं का मतलब है, कि अंतिम मान (10) को बाहर रखा गया है: range.include? 10 = & gt; गलत अब, क्या पहले मूल्य को बाहर करने का एक समान और सुरुचिपूर्ण तरीका है? उपर्युक्त उदाहरण के लिए, इसका अर्थ सभी मूल्यों को शामिल करना है 0 से अधिक बड़ा ( & gt; , नहीं & gt; = ) और छोटा 10 से। नहीं। ((0 + 1) ..10)

python - Doing an XSL transform of a branch of a Docbook element tree -

I want to use the DocBook XSL stylesheet so that different parts of a document can be rendered without completely changing . The complexity is that in some of these parts, and lieutenant; FootnoteF> gtc: Elements whose links are not within the same segment In other words, I want to process a branch of a tree containing & lt; Footnoteref & gt; s but & lt; Footnote & gt; Elements not reference. / & lt; Ipython console & gt; In & lt; Module & gt; () / Var / www / mpd / & lt; Ipython console & gt; In & lt; Genexpr & gt; ((Elt,)) /usr/lib/python2.6/dist-packages/lxml/etree.so lxml.etree.XSLT.__ call__ (src / lxml / lxml.etree.c: 109204) () XSLTApplyError: Internal error in xsltKeyFunction (): Could not get document information of a reference document. This happens in response to, e.g. etree.XSLT (etree.parse ('docbook.xsl')) (some_ediment) . I am using the normal xhtml stylesheet. I will not expe...

xcode - Is it possible to easily debug an iPhone serial-port app? -

Now I connect my iPod Touch (IOS 4 jailbroken) with eComote (a small embedded system) via serial port I am trying to I just follow this instruction: All things are well running, apart from this, I need to move my application / application / mapp.ap and send it to 777. However, it is difficult to debug because I do not use Xcode to run the app directly, is it possible to debug it with Xcode? Or how can I link to an additional console to show NSLog / printf messages? You enable syslog package syslog in Syslog, then tail -f / var Use / log / syslog to capture NSLog / printf from the SSH shell to capture the statement.

c++ - Get integer date representation (epoc time or jan1st 0001 base) from string ( Fri 4/2/2004 9:55:54 AM --------> <long representation>) -

I have the date in the string in the following format. Venus 4/2/2004 9:55: 54 AM I have to do a generic time utility in C ++, which parse it and give me long / intra-representation Which is either Apoc time base or 1 January 0001 time base. In addition, it would be good if usage is quite normal, in the sense that, even if the string has a slightly different format, it should work. Actually use should represent integer multiple string format. I want it in C ++ on Unix (Ubuntu). Someone can help. Rgds, AJ You can try

What is best way to salt password? -

Can you please tell me what is the best method of salt password, which method is best? Thank you. It does not really matter if you do it. This is a way to get different hashes for the same password. If you think that you need 256 hashes for each password, use a byte of salt. If you want to have 4 BNH for each password, then use 4 bites of salt. These types of trade-offs require more information about the domains that you provide. Say salt is visible in the public, so you do not have to worry about fancy unknown techniques to predict - any old can do PRNG.

mysql - String search in mysqltable using python -

I want to search mailings strings from a mysql table. The search string is not the correct sentence, it is only part of its punishment. Can anyone help me? Thank you in advance ... Nimmy What is such a thing? from the table where the string '% substring%'

php - how to show alert "data already exists" -

I think this is my first project newbie, I do not know how to solve any problem about duplication of data Pass input is page Serial, and one combobox: 1 Line. I think the input is twice, I mean there is a double input data here, the warning will be "data already exists" $ ("#input"). Click on (function () {if ($ ("$") Valid ()) {var params = $ ("# submit"). Serialize (); $ .ajax ({type: "post", url: " Process1.php ", data: parameter change (function () {var $ current = $ (this); $ ('input [' input 'name ^ =" text "]'). Each (function () {if ($ (This) .val () == $ current.val () and amp; $ (this) .attr ('id')! = $ Current.attr ('id')) {Warning ('data already $ ("# ShowModel") Val ($ ("#model") Val ().). $ ("# Showline") Val ($ ("# line" ) .Val ().). View this answer: