Posts

Showing posts from January, 2010

activerecord - rails accepts_nested_attributes_for :reject_if not working -

I turned on to try to override the auto save parameter because I do not think so Can be done I moved order to shipping address model has_shipping_address and now I have it: #model .. class orders & lt; ActiveRecord :: Base is_to: billing_address belongs_to: shipping_address ac_secures_nested_attributes_for: billing_ address acceptations_nested_attributes_for: shipping_address ,: reject_if = & gt; Proc {| Properties | | Features ["has_shipping_address"]! = '1'} DEF after_initialize self.build_billing_address until billing_address self.build_shipping_address shipping_address addresses end end class shipping & lt; Order eder attr_accessor: has_shipping_address end class order adapter & lt; ActiveRecord :: Base validates_presence_of: name # More assumptions here .. see end # & lt;% form_for @ order do | F | & Gt%; # ... for & lt;% f.fields_: shipping_address do | Addr_f | & Gt%; & Lt;% = addr_f.check_box: has_shipping_ad

Building a topic hierarchy for indexing content -

I am trying to create topic maps to classify the content. For example, the subjects are sub categories of 'art' 'art history', 'painting', 'sculpture', etc. I've crawled some of the online resources, but I have not seen any problem about how I want to use the hierarchy. I have got a lot of material that I want to index from the topic, to give the above example, if a user searches for 'art' then they only mention anything 'art' Not even mentioning 'painting', even if it does not mention 'art'. Fair enough. But if, in the second part of my inheritance, I have 'house maintenance', for example, there may still be a sub-topic of 'painting'. But if a user searches for 'art' then my engine says, 'Well, painting is a sub-category of' art ', so I think this piece of material that comes from your bathroom The best color to paint the walls ... Has anyone come before this problem?

javascript - Unable to validate user input - onkeyup event not firing -

I can not find any JavaScript errors, but the code does nothing ... < Code> function registerValidator (target, validator) {var element = document.getElementById (target); If (element) {var validationID = element.id + "_validationResult"; Var validation span = document. CreateElement ('span'); ValidationSpan.id = validationID; Element.parentNode.appendChild (validationSpan); Element.onkeyup = function () {var results = verifier (element); If (result.ok) {validationSpan.innerHTML = '& lt; Img src = "/ media / valid.gif" width = "12" />; '; } Else {validationSpan.innerHTML = '& lt; Img src = "/ media / invalid.gif" width = "12" />; '; If (result message) {Validation Spanner HTML + = '& lt; Br / & gt; + Result message; }}}; Warning (1); }} (Element.value.length & gt; = 4) {Results .ok = true;} and {result.ok = false; result. Message = "too small";} return result;})

How to clean HTML tags using C# -

उदाहरण के लिए: & lt; html xmlns = "http: //www.w3 .org / 1999 / एक्सएचटीएमएल "xml: lang =" en "lang =" en "& gt; & Lt; शीर्ष & gt; & Lt; title & gt; शीर्षक & lt; / title & gt; & Lt; / head & gt; & LT; बॉडी & gt; & Lt; a href = "aaa.asp? Id = 1" & gt; मैं यह टेक्स्ट प्राप्त करना चाहता हूं & lt; / a & gt; & Lt; div & gt; & Lt; h1 & gt; यह मेरी इच्छा है !! & lt; / h1 & gt; & Lt; b & gt; यह मेरी इच्छा है !!! & lt; / b & gt; & Lt; / div & gt; & Lt; / body & gt; & Lt; / html & gt; और इसका नतीजा यह है: मुझे यह टेक्स्ट प्राप्त करना है यह मेरी इच्छा है !! यह मेरी इच्छा है !!! : HtmlDocument डॉक = नया HTML दस्तावेज़ ( ); doc.LoadHtml (एचटीएमएल); स्ट्रिंग s = doc.DocumentNode.SelectSingleNode ("// body")। इनरटेक्स्ट;

ruby on rails - Is it meaningful to override the '==' method in ActiveRecord subclasses? -

रेल ' ActiveRecord :: Base वर्ग एक विधि परिभाषित करता है जो true यदि वस्तुओं समान हैं या उनके पास एक ही आईडी है। मैंने अपने रेल मॉडल के कुछ और मॉडलों में == ओवरराइड किया है ताकि अधिक सार्थक समानता स्थितियों की अनुमति मिल सके। जब मैं ऑब्जेक्ट की सीधे तुलना करता हूं (उदा।, स्क्रिप्ट / कंसोल के माध्यम से), लेकिन अगर मैं my_array_of_models.include जैसे कुछ करता हूं, तो ये काम करता है? अन्य_मॉडल , शामिल है? हमेशा झूठा देता है। भले ही सरणी में ऐसी कोई वस्तु होती है जो "बराबर" है (मेरी परिभाषा के अनुसार)। मैंने ऐसा करके तय किया है, उदा।, my_array_of_models.any? {| एल | El.attr == other_model.attr} (जो मुझे लगता है कि जिस तरह से आपको तुलना करने के लिए प्रोत्साहित किया जाता है वैसे भी), लेकिन मैं सोच रहा हूं: क्या == ActiveRecord मॉडल में, या ActiveRecord एक उच्च स्तर पर कुछ करता है जो ऐसे ओवरराइड पद्धति को बेकार (या इससे भी बदतर, खतरनाक) प्रदान करता है? स्रोत यहाँ मेरे लागूकरण हैं ओवरराइड तरीके दो वर्ग हैं, उपयोगकर्ता और संपर्क करें । उपयोगकर्ता

xslt - Show items by category xml -

मेरे पास इस तरह के एक XML आउटपुट है: & lt; डेटा & gt; & LT; मद-प्रकार & gt; & Lt; एंट्री आईडी = "1" आइटम = "5" & gt; & LT; श्रेणी & gt; जमे हुए & lt; / श्रेणी & gt; & Lt; / प्रविष्टि & gt; & Lt; एंट्री आईडी = "2" आइटम = "4" & gt; & LT; श्रेणी & gt; नाश्ता & lt; / श्रेणी & gt; & Lt; / प्रविष्टि & gt; & Lt; / मद-प्रकार & gt; & LT; आइटम & gt; & Lt; एंट्री आईडी = "28" & gt; & LT; आइटम नंबर & gt; 1115 & lt; / आइटम नंबर & gt; & Lt; नाम & gt; मैरियन बेरीज, IQF & lt; / name & gt; & LT; क्षेत्र & gt; & Lt; आइटम आईडी = "1" & gt; किराने का सामान - फ्रोजन & lt; / item & gt; & Lt; / क्षेत्र & gt; & Lt; / प्रविष्टि & gt; & Lt; एंट्री आईडी = "2 9" & gt; & LT; आइटम नंबर & gt; 1117 & lt; / आइटम नंबर & gt; & Lt; नाम & gt; प

Authentication programmable login c# -

I have a test for which I need to use authentication to see if a user Logged in before authenticating and authenticated. Is it possible to set up authentication from the unit test, so that you authorize / log authentication in the main application to authorize and log in? What I will do in this case is a method that takes an example of an IIdentity so you can be sure That "user" is logged in or not logged in. You can do public zero DoSomething (IIdentity Identity), you can use fake IIdentity to use any joke structure (like Rhino Mox). {If (identity.IsAuthenticated) ...} Then your unit test will look like this: [test] Public Zero Test () {Var Spider = New Mock Repository (); IIdentity identification = joke. Dynamicmock & lt; IIdentity & gt; (); // your test argument here}

php - How to let users add object tags in FCK editor? -

I am using the FCK editor, and I want to enter the object tag ... however, The only way is that the users are being asked to enter the tag in the source section ... most users are getting so hot as if on teck content ... < Div class = "post-text" itemprop = "text"> You are right: There is a recipe for troubles in tagging users. I recommend using specific plug-ins for content that you want to allow to add users. / P> I'm more familiar with TinyMCE, but for sure, I have a wide array of FCKEditor plugins for stuff like YouTube, for example.

Find where Java loads files from? -

I was just thinking that the Java program is searching for a file, there is a way to find out. I am trying to load a setting file with the FileInputStream fstream = new FileInputStream ("ldaplookup.ini"); But this is not a file found error Ini file is in the same folder as the square file, but I'm assuming that it is searching somewhere else. Thanks, -Pet File appears relative to the path of file inputstream execution is. If the resource file is in the same folder as the file class, then you can try it using: InputStream stream = this.getClass (). GetResourceAsStream ("ldaplookup.ini");

c# - Should I always call Page.IsValid? -

I know that never user input is trusted, because undesirable input can compromise the integrity of the application in some way It may be accidental or deliberate; However, there is also a case for calling on the page. IISValid Whenever there are no verification controls on the page (again, I know its wrong procedure to trust user input except for verification)? Does Page.Ivalid display any other type of validity? I looked at MSDN, and the docs indicate that the page ISIILID is only effective if the page has validation controls, or pages. Validity method has been called. A friend of mine suggested that I check the page every time I click the button handlers. Even if there is no validity control or a clear page. Validity call. I would be the first to tell you that" All input is bad until other input is proved. "However, in this case, I think your friend is wrong because in his argument we can possibly come up with one hundred other qualities which should be checked or

.net - Some kind of error, Possibly When Viewing a Windows Form in the Designer -

Although I have solved this problem, but it has returned: for the property Code generation 'selected people' failed. ECS, version = 1.0.0.0, culture = neutral, public keynote = null 'is not marked as serializable.' The asset error message on the property is a list (of the person) and for some reasons it triggers this error, everything I do, and is really unique. Here's a bit more information about answering the problem. Yes, this design takes place during the time, it is basically a disclosure that contains a user control in which there is a selected property, sometimes even when I do not have the focus either form, if I try to compile / run and just one OK, ECS in message message box. Come with Antiques. Countermand Professional should be just one LINQ in the SQL generated category, it should not make any difference to the problem, although I've added the feature before posting. The reason for this is that the designer tries to retain the property

iphone - Can I move a UIAlertView? -

I'm making a warning view slightly higher so I can also fit a keyboard on the screen. I'm just grabbing the warning frame and changing the Wii when I have already shown the warning so that the frame variable is valid. It works fine on the simulator, but when I do this on the hardware, the warning starts with the correct position, but then almost immediately its original vertical center jumps to the place. Is UIAlertView a definite thing that does not change in accordance with the applicable guidelines or am I doing something wrong? Thanks Why are you trying this against OS? I got this to work on both OS 3.0 simulator and OS 3.0 device: UIAlertView * alert = [[UIAlertView alloc] initWithTitle: @ "Warning" message: @ "alert" representative : Cancel itselfTenTital: @ "OK" other button titles: zero]; Alert.transform = CGAffineTransformTranslate (warning. Transform, 0.0, 100.0); [Alerts show]; CGAffineTransformTranslate takes three ar

Repeat Unix Command in Java -

Whether to run a Unix command ( ps in my case) from time to time in Java Is there a way? The loop I wrote to: while (this.check) {try {ProcessBuilder pb = new process builder ("ps"); Process process; System.out.println ("* * Running ps` * *"); Byte [] buffer; String input; Proc = pb.start (); BufferedInputStream osInput = New BufferedInputStream (proc.getInputStream ()); // each time it prints after System.out.println (osInput.available ()) for the first time; Buffer = new byte [osInput.available ()]; OsInput.read (buffer); Input = new string (buffer); (String line: for input.split ("\ n")) {if (line.equals ("")) is in progress; This.handlePS (line); } Proc.destroy (); Try {Thread.sleep (10000); } Grip (ie the affected exception) {ie.printStackTrace (); }} Hold (IOException ioe) {io.printStackTrace (); }}} does not work This runs for the first time perfectly, but after that there are 0 bytes available from the input stream. I'll t

jquery - How to stop the select box from being blocked as a pop-up bit Internet Explorer 8? -

I am working on a website where I click on a general selection box, which it is popup by IE8 Is blocked. what?! Am i doing something Is there a way around it? I am using some jQuery plugins, but nothing affecting those selected boxes What jQuery Form Plugin Can Do It? This is introduced by running some versions of a software that installs multiple versions of IE together Upgrade. Better yet, switch to using VM to test older versions of IE, this will give you a safe environment that reflects a better reality.

Unable to make a if-else loop for google-books in Bash -

मेरा वर्तमान कोड #! / Bin / bash # W = $ 2 # ई = $ 3 # आर = $ 4 # टी = $ 5 # ओ = $ 5 # प्रीपेड = "" एपेंड = "" $ 1 "में -एच) echo 'उपयोग: google [- {hxdw}] [& lt ; आरएजी & gt;] 'गूंज' -एच: मदद दिखाएं। ' 'गूंज' -x: "& lt; arg & gt; के लिए खोज" "गूंज" -d: "define: & lt; arg & gt;" 'echo' -w: '& lt; arg & gt; साइट: wikipedia.org 'बाहर निकलें ;; -x) प्रीपेड = "\" "ऐपेंड =" है \ "" बदलाव ;; -डी) = "\" परिभाषित करें: "एपेंड =" \ "" बदलाव ;; -वा) = "" एपेंड = "साइट:। Wikipedia.org" बदलाव ;; -wo) प्रीपेड = "" ऐपेंड = "साइट: .mathworld.wolfram.com /" shift ;; -तो) प्रीपेड = "" एपेंड = "साइट:। Stackoverflow.com /" shift ;; -बी) प्रीपेड = "" ऐपेंड = "" शिफ्ट ;; एएसएसीसी [[-ज़ "$ 1"]]; फिर # मैं इस रेखा के बारे में न

iphone - how to get around lack of 'add' button in ABPeoplePickerNavigationController? -

My Apps provide a custom class with the contact record in Address Book of the iPhone need to associate. If everything is fine and everything is good when I present ABPeoplePickerNavigationController and allow the user to select a current Contact. The problem is that the user is no clear way to easily allow you to add a contact record, if they're looking for before does not exist in their Address Book < p> ABPeoplePickerNavigationController getting ABNewPersonViewController in a way it's easy & amp that; Intuitive for the user? You can add UINavigationBar can create a UIBarButton and therefore like ABPeoplePickerNavigationController. peoplePicker.topViewController.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem: UIBarButtonSystemItemAdd goal: self action: @selector (addPerson :)]; - (IBAction) addPerson: (ID) this {ABNewPersonViewController * view = [[ABNewPersonViewController alloc] init]; View.newPersonV

flash - With a Flex ColumnChart, is there a way to center the datatip over the column -

I am using the Flex column chart with custom dataTipRenderer . I am able to apply a good skin with the datatip renderer, but I'm not sure how to centipulate datatip. Is there a way to keep data tips on the columns rather than the chart center, does the general top-right alignment chart? Instead of: | Tip text | +++++++++++++++++++++++++++++ I want to: | Tip text | ++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++ If you have datatip renderer, you can set property X in main component (canvas, hbox or vbox) : X = "this.x - (this.width * .5)"

cocoa - NSTableColumn bound to a BOOL value -

I have the NSTableView bound to an NSArrayController. In my model I have a BOOL field, I typed that value into columns I'm trying to It displays correctly (1 where the value is yes and 0 where there is no value), but it is only to read = (I can not store it when I am trying to edit a value - When I do not enter anything, the setter is never used, the column is editable. I can successfully tie it with IB - I like it all the way I bind to The program can not be metromic = ( similarly the column is created and added: NSTableColumn * column = [[[NSTableColumn alloc] initWithIdentifier: @ "OK "[Column header disabled]; [[column header area] Set string value: @" OK "]; [column bind: @" value "to object: capeth with RRC: @" order objects " Option: zero]; [table adapter column: column]; I have a problem with only the BOOL values, if I use the same column All other works are okay. It is readable = (. Trying to edit a value, I can n

indexing - Indexed ranged search algorithm for IP Addresses -

Looking at the ACL list with 10 billion IPv4 category in CIDR notation or between two IPs: What is an effective search / indexing algorithm for testing that a given IP address meets the criteria of one or more ACL categories? ? Suppose that most ACL class definitions have a large number of C blocks. The indexing point through the hash table is easy, but try to figure out which points I did not find in the proper way were covered by a large list of "lines". Significance like some signals about some characteristics - Pre-computing at the class C level which covered that point but the table is very large .. or some kind of KD tree is dynamically expanded Set as level. In addition to this, it was also thought that there might be conflict detection algorithms which can be at this address. Any sign or signal in the right direction? "post-text" itemprop = "text"> You can look for all the intervals that overlap with any interval or point. Fo

What's the best C# code highlighting plugin for wordpress? -

It would be best if it highlights the same way as it is in the visual studio. If you are using Visual Studio, you can try. will be a non-visual studio option (more info)

git releases management -

What is the "right" approach to managing relation using GIT, I say, Master, Reliance - 1, Reliance-2 and Release 3 branches. Release 1 has already been released and I only tagging the bug fixing and release version on it Release 2 is going to be released soon and I mostly develop on this branch while on 3 I develop things which Necessary in the future When I add some features when I release -2 and it should go to 3 but not 1, I want to: Merge to release Release-2 and release Release 3 related to the Cherry-pick feature? Cherry-pick is committed to master related to convenience and select -3 to release it in comparison to Cherry? sth else? When I have to change the STH in all the editions, then I should do it on master and cherry - should it be taken in all the branches? Should I still master the latest (release-3 branch) or the developer on release 3 or not and join the master before the release -4 branch needs me? When I fix the stability on Rel

html - PHP returning page error on simplexml print_r -

The problem is only with one file when I try to do a DocumentDOM / SimpleXML method, so it seems That problem does not have any clue with that file what can this be. If I do the following: $ file = "test1.html"; $ Dom = DOMDocument :: Load HTML file ($ file); $ Xml = simplexml_import_dom ($ dom); Print_r ($ xml); In Chrome, , I get a "Page Unavailable" error in Firefox, I do not get anything. If I do the same thing but for "test2.html", I get printed as expected. If I try the same thing but by doing so: $ file = "test1.html"; $ Data = file_get_contents ($ file) $ dom = DOMDocument :: loadHTML ($ data); $ Xml = simplexml_import_dom ($ dom); Print_r ($ xml); I get the same issue. If I comment on the print_r line, then Chrome goes to the blank space with "Page unavailable". I changed the permissions to 777, if it was a problem, there was no fix. I just tried to resonate the content of html, no problem. Any clue

c# - DataSet: Enumerator and FindById do not return equal DataRow -

The problem today in my code is weird, and I could not reproduce it yet. I am working with a typed dataset (made with designer) and I am looping all the rows in a datat. Occasionally (!), When the returned row while searching through the primary key is not the same, it is some code for the calculator that I have written to reproduce the issue : foreach (Dataset 1. Datatable 1st Draw DS Datalet 1) {if (ds.DataTable1.FindById (dr.Id)! = Dr) Console .Write (dr.Id) ; } No line will be written in the console, because FindById always returns the same line, which is really logical. In the code of my project, in a similar dataset with some string columns, approximately 3% of the lines (always the same lines!) Do not happen, and one of the string fields is simply empty: Ds.DataTable1.FindById (dr.Id)! = Dr // Returns incorrect, whatever reason the primary key is the only primary key field, and FindById for it is a generated method, whether someone knows a little signal or even

TFS Bug reassignment behaviour -

This is likely to design for large teams with proper QA departments, but we only have 3 devs and each round robin QAs do the job of others. The problem is that the person makes A a bug, and it is specified in person B, and the person fixes B, the bug gives the TFS creator the bug again. P> This is the easiest way to make changes in this way. In many other things, it will add "Process Editor" area within your Tool menu in VS. Use the "Open Writers from the Server" utility to download the action topic type that is bothering you, to change the changes you want (under the Workflow tab in your case), then upload it to the server " Import "run. The full XML specification is documented on MSDN for types of work, but as always it is quite dense. This is the one which walks you through the possibilities.

.net - Convert a custom object array to System.Array in C# -

I have an array of custom objects in MyCustomArr []. I want to convert it to System.Array so that I can pass it in a method that only accepts System.Array. The signature of the method is: public zero load (array 1, string paragraph 2) {} No conversion is required for me as far as I know it. You can just go ahead and pass your array in the method. The following code works well: MyClass [] myClassArray = new MyClass [2]; MyClassArray [0] = new MyClass (); MyClassArray [1] = New MyClass (); Weight (myClassArray, "some text");

web applications - BanBuilder Banned-Word List Generator - Would You Use It? -

From: Why BanBuilder? Designed for BanBuilder you allow to customize your restricted word list, and are constantly evolving as people get new ways around restricted words (for example letters Instead of using symbols), they add to the database and all its free! This idea sounds great, but some people have added a few words, which may not be banned, e.g. "Unmarried" is probably not a swear word, nor a price is banned. Certainly no DIY site is being helpful either by banning "screw". Is anything useful that can be useful, whose wide range is possible, who has done the people? I do not think it is very useful. Perhaps for Kidi site where people think it is extremely important. However, very aggressive things can be said without using the wrong language, which means that ultimately this is a practice in futility if you ask me. I like very much 2.0 Sites IE: "This duck" will probably be edited in approximately 20 seconds.

ruby - Hoptoad on rails test works but I don't get notified about exceptions -

I set the hopoutad on my prod server and ran the rap hot tread: test I get a notification in my hoptouch interface, so it works great. But then I forgot to migrate my database after being deployed to my last place so I found "ActionView :: TemplateError" in my production log. It happened because of a 500 that I think HopToad should have been informed about me Thank you! As a side note, is it a standard practice to automatically migrate your deployment process to your production database? You have the option. It is a standard practice to use Capistranos for the deployment of Rail App. You can deploy the Cop # to deploy App Cap Deployment with Capistrano: Transfer # to deploy App Cap: Migrate # Delegate and migrate at the same time To do You can decide whether to execute the command separately or not. I am sorry about HototAut, but I do not have a rail app with the attached attached to the test.

sql server - How do I generate random number for each row in a TSQL Select? -

I need a different random number for each line in my table. The apparent code that appears below uses a similar random value for each line. SELECT table_name, RAND () magic_number FROM info_schema.tables I like to take out an int or floyat. The rest of the story is going to use random numbers to create random date offsets from a known date, e.g. Offset offset 1-14 days from the initial date. This is for Microsoft SQL Server 2000. In short, the following code is a randomized number between 0 and 13 with a normalized distribution To change your category, change the number at the end of the expression: ABS (CHECKSUM (NewId ())% 14 Be extra careful if you need a category that contains both positive and negative numbers, if you do it wrong, it is possible to double count the number 0. A small warning for math nuts in the room: There is a slight bias in this code. CHECKSUM () The number of results that are normalized in the whole range of SQL int datatype, or at leas

linux - How to split flv file by size using FFmpeg or mencoder or smth else? -

I need to split a flv file into a known size block on the Linux server. For example, my original file 9 MB is and Chuck size is 4 MB. So I should get 3 parts - 4 MB, 4 MB and 1 MB. It seems that FFMPE can only divide by the time. The maincoder can start with time (-sing time) in size (-andSize SIZE MB). But if the first section starts at the second number then obviously 0, how can I start another for the next part? Do you have any suggestions? Thanks in advance. Calculate the time (seconds) of each block & amp; Use x-x X -t X + avg_block_time for split video

c# - Create a document library with external persistence -

I would like to create a custom document library, where I use the standard UI but implements a different persistence layer. Basically getting and displaying documents from a different source system. In this way I can use my existing object model, but I can take advantage of great office integration in SharePoint. I found a good article but they are cheating, they have coded an entirely new UI for external solidarity. I have seen the SPList and SPDocumentLibrary objects but I can not override the necessary methods. I have seen the structure of the incident and it is close but important events like 'GetFile It's not the one that you are trying to do right (or perhaps a "good") fit, but I mainly mention it for awareness and possibly giving you some additional thoughts (and warnings). The SharePoint's storage infrastructure takes advantage of two different back-end stores: one for metadata (always the SharePoint SQL Database), and one for blob storage

database - Run a query from two data sets programmatically -

I am trying to resolve the data from a website and a database programmatically Now my process is manual I download data from the website, download data from my database, and mail using an Excel vlookup . Within Excel, I am only matching 1 date for many items. I want to reconcile data with many dates and many items. The problem is that I have to manually download the data from the website. I've heard people say "external joins" and "get the table" but I do not know where it starts from, is there anything I can do with VBA or Do I code in Notepad? Normally I write it to put the website data in a staging table and then select selected statements to be included in it. For that data in my database in that table. To be able to match the record, you may need to clean it for the first time if they are stored separately

binaryfiles - Format/encoding of this binary data file -

I am trying to write a program that integrates with Adventure Axis, software for financial planners and so on. The site of the product is here: I need to write new entries in the price files, but most of them are binary. I looked around online and did not get much, and I emailed their support, But I suspect that this will help. I have a small dummy file and printout, which the program said to the file. I ran the file through a ruby ​​script that prints the character if it is a word or symbol and ASCIIL is not otherwise here is the Ruby script: pri = file.read '062109_dummy .pri 'pri.each_byte do | Char | Print char.chr = ~ / [\ w! @ # \ $% \ ^ & Amp; \\\\\\\\\\\\\\\\ /? Char.chr: '' + char.to_s + '' end and output: pri1.001 254 250 251 252 29 0 2 adusnok 0 0 0 0 0 0 0 0 0 33333s7 @ 1 254 250 251 252 29 0 2 2 csusxom 0 0 0 0 0 0 0 0 H225 Jade 20 174 GA @ 1 254 250 251 252 29 0 2 etusvv 0 0 0 0 0 0 0 0 0 0 246 (\ 143 194 213F @ 1 254 250 251 25

soap - SoapAction Issue under Java 1.3 -

This problem is bothering me for the day. Hopefully someone has come before this and has developed an alternate solution. So I have developed an intermediate Java app, which invites a SOAP action during its execution Now, the behavior of this bit of code under 1.6 bit JDK is working well: // Hold a try SOAPConnectionFactory soapConnectionFactory = SOAPConnectionFactory.newInstance () inside the block; Soap Connection Connection = Soap Connection Factor. Security connection (); MessageFactory Message Factory = MessageFactory.newInstance (); SOAPMessage soapMsg = messageFactory.createMessage (); String Soap Action = getHeaderUrl () + "/" + + "\ r \ n"; Mime Headers Header = Soap Message GateMeMeHDers (); Headers.addHeader ("SOAPAction", Soap Action); // Review SOAP Action Header header_count = soapMsg.getMimeHeaders (). GetHeader ("SOAPAction") Length; Outside ("Soap actions with soap headers:"); If (header_count == 0) is exclude

c# - Shredding files in .NET -

Is there an SDK, which can be used to secure the pieces safely in the managed code? EDIT: EDIT: Either SDK or some type of COM based component. A very good article was recently discussed about this: Leading forensic experts will be able to achieve a single bit original position after a rewrite with 56% success rate. Thinking that you have a 50% success rate with a pure random assessment, I do not think there is anything to be worried about you. The myth that is actually removal of data from your hard disk is the fact that even companies specializing in data recovery, sometimes using different methods overwritten for several decades. We accept, openly acknowledging that once the hard disk is overwritten with zero, all its data is irreversibly lost. Craig Wright, a forensic expert, claims to have this story finally rested, he and his colleagues started a scientific study, which looks closely at different compositions and hard disks of different ages. , Overwrite their

osx - Mac user needs some folder help with applescript. SFW -

I have a folder full of images and I need to create a text file of all image names with applescript. There are some ways to read the applications in all files, approximately 10k of them and then output it to a text file? Any help would be great! Thanks for reading. Why not just do it from the terminal. ls> Pix.txt

.net - Benchmarking small code samples in C#, can this implementation be improved? -

On the SO often I benchmark myself a small part of the code to see which duplication is the fastest Often I get comments that the benchmarking code does not take into consideration the jooting or garbage collector. I have the following simple benchmarking functions that I have gradually developed: Fixed zero profiles (string description, intertion, action fanc) {// warm Up fenc (); // clean gc Compile (); Var watch = new stopwatch (); Watch.Start (); For (int i = 0; i Usage: Profile ("A description", how_many_iterations_to_run, () = & gt; {// ... the code has been profiled }); Is there any flaw in this implementation? Is it great to show that Implementation X implementation is higher than Z graph more than Y? Can you think in any way that you will improve it? Edit It is very clear that time-based approach (in opposition to iterations), has been liked, does anyone have any implementation where impact on time checks? Do not you? There is a modif

c++ - How to use 16bit heightmaps with Ogre3d and PhysX -

I am using Augrey 3D and Physics. When I load an area from an 8bit height map, this view looks normal on the debugger. Look at the first image: But when I save the height map as a 16 bit image, I get what you see on the second image. > Here is the code, it works normally with 8bit PNG: mSceneMgr-> Setgreatmetry ("terrain.cfg"); MTSM = static_cast & lt; TerrainSceneManager * & gt; (SceneMgr); TerrainOptions mTerrainOptions = mTSM- & gt; GetOptions (); // Load heihgtmap image mimage; MImage.load ("isl_h_ph.png", Resource Group Manager: GetSellingington (.) GetWorldResourceGroupName ()); // Load image / image buffer type pOrigSrc const uchar * pOrigSrc = mImage.getData (); Const uchar * pSrc; // Image size mPageSize size_t mPageSize = mTerrainOptions.pageSize; NxActorDesc ActorDesc; // Set height height of field FieldDesc = New NxHeightFieldDesc; HeightFieldDesc-> NbColumns = mPageSize; HeightFieldDesc-> NbRows = mPageSize; HeightF

Create executable application in linux -

How do I create an executable application in Linux like .exe file in Windows? Most of you have used "Pidgin IM" in Linux / have seen that it will open the window where you can see your friends, and more like gnome-caculator, I have the same executable file for my application Want to make Thanks Edwards. The most common way to create an executable is to use a compiler (just like windows). The GNU Compiler Collection (GCC) can already be installed on your Linux system, see if you can find it by: $ gcc or $ gcc --help If not, you have to install it. In this man page ( man gcc ), info pages ( info gcc ) and one. Note GCC C command is automatically a compiler part, for other languages ​​ G ++ and for others (although you have command line There is considerable control over the options).

visual c++ - How to remotely degug msgina.dll? -

I have been fully customized in the msgina.dll module, do I need to debug it? I can get it Abdul Khaliq It has been for some time Has been dug in live development What did I do: A virtual machine was created with the version of windows for debugging (you will also need those symbols which I think) You can map The virtual PC's serial port and WinDbg (debug tool that came with Windows SDK) connect it. I was able to debug successfully and was able to receive messages from the beginning of windows. (And I have used Windows XP and Target OS for development, without any antenna) This technique also works without the beginnings of your live work, which is essential in this technique: A quick Google gave a detailed explanation to describe the detail which I explained: Using VMWARE:

php - Is it dangerous thing to view access log without sanitizing via web browser? -

Is it dangerous to view access logs without sensitization through a web browser? I am considering recording access logs, and I am considering watching it through VV browser, but if the attacker modifies his remote host or user agent or something, So can he attack me? Attack code is your remote host or user agent or act. So do I need to clean by htmlspecialchar before opening the access log file via web browser? I mean that the attacker will insert some attack code in your remote host or user agent, or seeing some things, I see the access lock via the web browser, then my PC will affect that code. You probably need some HTML formatting for output and so the log data must be sensitized / encrypted For logic: If you send output as text / plain, then the client should not parse any HTML / javascript. e.g. & lt ;? Output of Php header ('content-type: text / plain; charset = UTF-8'); & Lt; Script & gt; Alert (document.URL); & Lt; / Script & gt

Java to batch file -

प्रयास करें {स्ट्रिंग comd = "E: /ior1.txt"; रनटाइम आरटी = रनटाइम.गेटरीटाइम (); rt.exec ( "C: /tes1.bat" + comd + ""); System.out.println ("प्रक्रिया से बाहर निकलेंगुण:"); } पकड़ (अपवाद ई) {System.out.println ("अप्रत्याशित अपवाद कार्य निष्पादित करने की कोशिश कर रहा है:" + ई); } लेकिन जब मैं चलाता हूं मुझे इस तरह एक अपवाद मिलता है अप्रत्याशित अपवाद कार्य निष्पादित करने की कोशिश कर रहा है: java.io.IOException: CreateProcess: C: / Tes1.batE: /ior1.txt त्रुटि = 2 जारी रखने के लिए कोई भी कुंजी दबाएं। । । यह बैच फ़ाइल सामग्री है गूंज "परीक्षण" गूंज% 1 < Div class = "post-text" itemprop = "text"> .bat (rt.exec रेखा में) के बाद एक रिक्त गायब है संपादित करें: आप निष्पादित करने का भी प्रयास कर सकते हैं: rt.exec ("cmd /cc:/tes1.bat" + comd);

sql - How to import excel files into SqlDatabase .mdf file -

I have a long excel sheet with the details of the books of the library..I can import this data into an .mdf file I can do You will need SQL Server Management Studio, and use its import feature

c - Reading bytes from bmp file -

मैं सी का उपयोग कर एक बीएमपी फ़ाइल से बाइट कैसे पढ़ूं? यह सिर्फ एक बाइनरी फाइल लोड करने के लिए एक सामान्य प्रयोजन के कंकाल है, और पहले बाइट को एक सूचक वापस लौटाता है। यह फोल्ड (fopen ()) के साथ फोल्ड () के बाद फोिल () है, लेकिन यह एक ... थोड़ा और वर्बोस है कोई त्रुटि-हैंडलिंग नहीं है, हालांकि त्रुटियों के लिए जांच की जाती है और मुझे विश्वास है कि यह कोड सही होगा। यह कोड खाली फ़ाइलों को अस्वीकार कर देगा (जो, परिभाषा के द्वारा, फिर भी लोड करने के लिए कोई डेटा नहीं है)। #include & lt; stdio.h & gt; # शामिल करें & lt; stdlib.h & gt; स्थिर इंट फाइल_आइज़ (FILE * में, आकार_टी * आकार) {if (fseek (in, 0, SEEK_END) == 0) {long len = ftell (in); अगर (लेन & gt; 0) {यदि (एफईसीईएक्स (में, 0, SEEK_SET) == 0) {* size = (size_t) लेन; वापसी 1; }} 0 वापसी 0; } स्थिर शून्य * load_binary (const char * फाइलनाम, आकार_टी * आकार) {FILE * in; शून्य * डेटा = शून्य; Size_t लेन; अगर ((= (फ़ाइल में), = () में) (यदि = (फ़ाइल =) (=,)) = (= ()) (यदि ((डेटा = malloc (len)) = =) (अगर (fre

java me - left and right command menus in LWUIT form -

Using the LWUIT Framework to Develop a Mobile App LWUIT by default puts the first command in the left and later commands It will be placed in the right menu of the form which has already been left in the form. I need to add two menus to formatting. In the left menu, the typical application specific commands such as "Reduce", "Back" and "Exit" in the right menu include screen-specific commands like "Play Video" etc. ... left in the beginning of the form The text "option" in the soft button and the correct softbutton of the form contains the text "menu" when the user selects "Options", then a menu will be displayed with the following command: at least back when the sub The yogi selects the right soft button "menu", a menu will appear on the screen with specific commands: play audio play video etc. ... The order of the right menu varies from one form to the other, while the left menu The order remains the

c# - "InnerText" on XmlNode in LINQ query do not work -

When I call a property "intrite" on the XMLNode in the LINQ query, I get a strange error: "One object Key has already been added. " looks like the query: var partnersXml = in dataContext.SomeTableInDb the partnerTable where partnerTable.XmlType ==" partner " Select new {PARTNERID = XmlDocumentWrapper (partnerTable.XmlDocument). SelectionSingleNode ("// * [name () = 'partnerId']"). Entertext}; Explanation: partnerTable.XmlDocument string XML DB XmlDocumentWrapper method gives an XmlDocument for an XML string The query works perfectly without "intrtext" (then there is XmlNode in partnerId). Is there some kind of bug in LINQ or what? What is the solution to this problem? Stack trace: System.ArgumentException: An object with the same key has already been added. System.ThrowHelper.ThrowArgumentException on System.Data.Linq.Mapping.UnmappedType.GetDataMember (ExceptionResource Resources) System.Collections

c# - How do I open a file that is opened in another application -

I have a winforms application that is loaded in Excel files for analysis Currently, the file excel to open Excel file Should not be open in advance otherwise FileIOException is thrown when I try and load in the file. What do I want to do, read my application in the file, even if it is open in Excel rather than compelling the user to close the worksheet. Note that the application only needs to read the file in question, not writing it. Is this possible? You can try to run the fileshare. Redirection when opening a file: using (var stream = new filestream (@ "d: \ myfile.xls", Flamemade. Open, File Access. Read, FileShare. Read-White }) {}

java - How to Pass NULL Data Type? -

What is the datatype for NULL while passing that value to a database? There is a tap of the data type NULL means ABSENCE data when there is no data, how can it be sorted out?

iis 7 - What to know about IIS? -

I would like to know what types of things are really important for you on day-to-day basis in IIS? And what should I look for in the beginning? Any article / book / tutorials are welcome. Have you thought about joining some virtual labs, such as: < P> This link is also full of resources:

internet explorer - ExtJS and the infamous memory leak -

एक्स्टजएस का उपयोग करते समय कुख्यात IE परिपत्र संदर्भ मेमोरी रिसाव को रोकने के लिए मुझे क्या करना चाहिए, अगर कुछ भी हो? मैंने देखा है और, लेकिन मैं कुछ छोटी चीजों की सूची में / से बचने की उम्मीद कर रहा हूं। जो आपके लिए स्मृति रिसाव (परिपत्र संदर्भों को तोड़कर) को रोका जा सकेगा। YUI का उपयोग घटना उपयोगिता में होता है जो मूल रूप से एक ही बात करता है जब तक आप सभी श्रोताओं को addListener के माध्यम से संलग्न करते हैं और DOM से कुछ निकालने से पहले purgeElement खोलते हैं, तब तक आपको लीक से मुक्त होना चाहिए।

cp - Unable to copy all but ~ -files and .gitconfig to Git -repo -

I have Meri Dev files on ~ / bin /, while in my Jiaiti repo file ~ / github / myProject / I last to copy the files from the file following files have always triggers: #! / Bin / zsh # editors # {{cp / users / masi / .emacs / users / aunt / Github / MasiDvorak / CP / users / aunt / bin / editor / Emacs / * / users / aunt / Github / MasiDvorak / editor / Emacs / CP /Users/Masi/.vimrc / users / aunt / Github / MasiDvorak / cp / users / aunt / bin / editor / Vim / * / users / aunt / GitHub / MasiDvorak / editors / vim / #}}} # shells # {{{CP /Users/Masi/.bashrc / users / aunt / GitHub / MasiDvorak / CP /Users/Masi/.profile / users / aunt / GitHub / MasiDvorak / CP /Users/Masi/.zshrc / users / Male / GitHub / MasiDvorak / #}}} #P Rograming # {{{cp / user /Masi/.screenrc / users / aunt / GitHub / MasiDvorak / CP /Users/Masi/.Xmodmap / users / aunt / GitHub / MasiDvorak / CP /Users/Masi/.xmonad/xmonad. hs / users / aunt / GitHub / MasiDvorak / Kxmonad / CP /Users/Masi/.gdbinit / users

iphone - Get notification when NSOperationQueue finishes all tasks -

NSOperationQueue is wait other operators , but I do not want to wait Synchronous for this. I want to hide the progress indicator in UI when qi is over. What is the best way to accomplish this? I can not send notifications from my NSOperation , because I do not know who will be the last, and [queue operation] is not yet empty (Or worse - repipulated) when the notification is received. > Use KVO to inspect your queue property, then you can tell what your queue is [queue] collaboration count] == ​​0 Was completed by checking for. In the file you are doing KVO from anywhere, announce a reference for this type (): Fixed NSString * kQueueOperationsChanged = @ "kQueueOperationsChanged"; When you organize your queue, do this: [self.queue addObserver: Path to self: @ "Operation" option: 0 Reference: & amp; KQueueOperationsChanged]; Then enter your in ValleForKeyPath : - (zero) Inspection valueforcover: (NSString *) The keypad object:

Binding more than one <select> in ASP.NET MVC? -

I have a table of items, each of my own & lt; Select & gt; How do I bind them in the parameters of a controller method? Ideally, I have an array containing (for each row in the table) selected value code> options . How do I do this? My google-fu is weak today all your & lt; Select & gt; The same name should be plus [N] in S, where n is zero based. Try it out: & lt;% var i = 0; & Gt%; & Lt;% foreach (Miscellaneous Rows in Model. Rye) {%> & Lt; TR & gt; & Lt; TD & gt; & Lt;% = Html.DropDownList (string.format ("option [{0})", i ++), line.Ennormable in specified form & lt; SelectListItem>)% & gt; & Lt; / TD & gt; & Lt; / TR & gt; & Lt;%}% & gt; And your post action may look like this: public action your action (string [] option) {...}

c# - redirect using itemreceiver sharepoint -

When a list item is added to a sharepop list, I want to redirect to a thank you page. How can I do this in an item receiver? I think you can redirect to item editing event. But I would generally not recommend using the event receiver for something like this. Create your new item ASPX page, add list item program when the user clicks the OK button. When a list item is to be added, you redirect from your custom ASPX page to the Welcome Page.

python - subprocess module: using the call method with tempfile objects -

I have created temp designated files, the NamedTemporaryFile method with templatefile libraries I've written to them buffers fly, and I did not turn them off I'm trying to use the subprocess module to call some shell commands subprocess.call ('cat% s'% f.name) always says that the named temporary file does not exist. os.path.exists (f.name) always gives the right I can run the cat command directly from the file. Is there any reason that the subprocess module will not work with the temporary files? Can you do this work? Shell = Using the correct option for subprocesses?

java - Hibernate: Specifying columns in a one-to-many relationship -

I am trying to create a layer of hibernation for a database schema I do not necessarily have any control I have simplified, two tables. There are two important columns for the table original : parent_id integer primary key Autoincremented parent_code , string, unique key generated by any black box somewhere (assuming it is a UUID for discretion) Data columns The table contains two important columns of children : Child_parent_id , integer, primary key, autoincremented child_parent_code , foreign key pointing to the parent parent_code of the parent A group of columns of data plus I want to be able to call my father. Groups () and want to get a collection of hair objects. But in Hibernation, installation of mapping files seems impossible, searching the child table with the parent_id value ( instead of parent_code ). In Parent.hbm.xml & lt; Set name = "childs" inverse = "true" lazy = "true" table = "ch

c++ - VC++ doesn't detect newly created env variable using GetEnvironmentVariable -

I am using WinEngFrown GetEnvironmentVariable to get the value of a variable that I just created. I'm running Windows XP and VC ++ 2005. If I run the program from within Visual Studio, then this new variable can not be found. If I run it from the command prompt, then it does. I restarted VC ++, but the same result I have also restarted all the examples of Visual Studio, but still this is the problem. If I reboot the PC, but it can be solved, but I am curious why it is so. Here is the code I am using: #define BUFSIZE 4096 # defined VARNAME TEXT ("MY_ENV_NAME") int _tmain (int argc, _TCHAR * argv []) {TCHAR CNY NVU [BUFSIZE ]; DWORD dwEnv = :: GetEnvironmentVariable (VARNAME, chNewEnv, BUFSIZE); If (dwEnv == 0) {DWORD dwErr = GetLastError (); If (dwErr == ERROR_ENVVAR_NOT_FOUND) {printf ("Environment variable does not exist. \"); Return -1; }} And {printf (chNewEnv); } Return 0; } If I change MY_ENV_NAME with something such as TEMP, it works as expected,

.net - Obtain output files from a MSBuild project -

Is it possible to get a list of all output files from an MSBuild project? Simple project, I & lt; Include CreateItem = "$ (OutputDire) ** \ *" & gt; & Lt; Output ItemName = "AllOptups" WorkPameters = "Include" /> & Lt; / CreateItem & gt; But my projects are part of a larger construction, and all the outputs go to a normal location, I want to be able to exculde dlls and content that is not related. Any thoughts? After looking at my comment, I realized that I tell you the wrong thing really needs it There is an interesting problem on hands. If you do not mind editing the project file, you may be able to get pretty close for whatever you want. An item is flywears that keeps track of all files that were written during the build process. To start playing with this AfterBuild target & lt; Target name = "afterbild" & gt; & Lt; Message text = "file-source: @ (file-world)" value =

c# - Copy Folder/File wiithout modifying attributes? -

Is it possible to copy file or folder from one location to another without modifying its attribute data? For example, if I have a folder on a network drive and it was created on 2/3/2007 and I want to copy it to my c ... but leave the date / time stamp 2/3/2007 Give ... Is It Possible? I'm not sure that this is possible; Although you can use these methods to basically return methods and reset these attributes back. Specifically SetCreationTime and SetModificationTime methods will be of the highest value for you in this case.

lucene.net - How to: Increase Lucene .net Indexing Speed -

I'm trying to make a lucene of about 2 million records. Indexing time is around 9 hours. Can you please suggest how to increase performance? I wrote a horrible post about how a lucene index is parallel It's really written a lot, but you'll find it (there's some sample code that you want to see). Either way, the main idea is that you want to divide your data into pieces of big size, and then work on each piece on a different thread when each piece is made, Can merge into an index. With the above-mentioned approach, I am capable of indicating approximately 4 million records. 2 hours. Hope this gives you the idea of ​​going from here.

safari - stop background of iphone webapp from responding to swipes -

I am creating a mobile version of my website, and am trying to feel it as originally as possible on the iPhone . However, areas with any background on the page respond to swipe gestures, so that you can move the page away from the screen. Specifically, if the user touches and swipe to the left, for example, the content changes from the edge of the screen and a page can see the 'white background' behind the page. How can this be prevented? I want to 320x480 the page with scroll-swiping disabled (except list elements that I have selected). I've added the following meta tag at the top of the page: & Lt; Meta name = "apple-mobile-web-app-enabled" content = "yes" /> & Lt; Meta name = "apple-mobile-web-app-status-bar-style" content = "black" /> I have also made the following attempts as an event handler for touchtaste, touch-movement, and missing events of body elements: function Cancel TouchEvent (e) {If (! E)

Open Source Projects Engineered using TDD and C#? -

I'm looking at an example of an open-source project that was engineered using test driver development (TDD) at C # .NET Framework Do you know about any one? Check if you are interested in web development in ASP.NET MVC (C #) and