Posts

Showing posts from May, 2013

How can I make a "browse for file.." button in VB.net? -

I am trying to create a simple FTP uploader how can I create it so that users choose a file to upload Could? Look, what I want is a button (which I do) that a user can click, and it shows the OpenFileDialog (which I have), but then when they choose a file, I want to That his path should be shown in the text box. How can I do this? Try the following code New OpenFileDialog as a slow dialogue ) If DialogResult.OK = dialog.ShowDialog then TextBox1.Text = dialog.FileName end if

How do Reddit and similar sites keep users from voting on links and comments more than once? -

I was curious and downloaded the code but I think I can not find what I'm looking for. I thought I could get a database table with the mapped user id to link the user ID. But I can not find anything like that. This ticket indicates some code:

ruby on rails - bizarre Facebook connect with authlogic problem -

I set up a Facebook connection for my application after the following. But there is a strange problem with Facebook Connect on my Firefox and Google Chrome browser, it will not just allow me to authenticate. But it works perfectly on Safari Is your development platform accessible to Facebook? In my experience, Chrome and Firefox did not work behind the router on my local machine with that example, but Safari (like your experience) did. However all this worked when the setup was on an internet-accessible box.

parsing - How can I execute an ANTLR parser action for each item in a rule that can match more than one item? -

I am trying to write an ANLR parser rule that matches a list of things, and I write parser action > This is the result of an evaluator in which three MyIdentEvaluator objects - A1, A2 , And a list for each of the A3's. Here's a snippet of my grammar: returns my_list [IEvaluator e]: {$ e = New MyListEvaluator (); } '$' From LPAREN = my_ident + {/ * wants to do something here for each 'my_ident' * / / * The following sees only 'A3' my_ident * / $ e.Add ($ op.e); } RPAREN; My_ident [IEvaluator E] Returns: IDent {$ e = New Menteent Evil ($ IDENT.text); }; I think that my_ident is correctly defined, because I have given these three MyIdentEvaluators to my input string Expected to be prepared, but only after my_ident is added to the list (A3 in my example input). How can I treat each of these elements independently, either by changing the grammar or by changing the action through the parser? It also happened to me that my termi...

php/regex: separate feed data -

& lt; विवरण & gt; & amp; lt; img src = 'http: //example.com/Pic_018_70x70.gif '& Amp; gt; और & lt; / img & amp; gt; & amp; lt; br / & amp; gt; यह विवरण की सामग्री है। & Lt; / description & gt; अगर मेरे पास फीड्स के विवरण क्षेत्र में छवियां आ रही हैं, तो मैं छवि को एक वैरिएबल में कैसे अलग कर सकता हूं और शोर को पट्टी कर सकता हूं और उसका विवरण भी छोड़ दिया है? यह आपको अपने प्रश्न में स्ट्रिंग से आईएमजीआरटीआर विशेषता का महत्व देगा, और आपको पाठ देगा: $ sxml = नया SimpleXMlelement (html_entity_decode ($ str)); $ Images = $ sxml- & gt; xpath ('// @ src'); $ टेक्स्ट = $ sxml- & gt; xpath ('// description'); छवियों को प्रतिध्वनित करें [0]; // http://example.com/Pic_018_70x70.gif प्रतिध्वनि करें $ टेक्स्ट [0]; // यह विवरण की सामग्री है

php - Problem in array search -

I am trying to find values ​​within an array. This array always starts at 0. Unfortunately the array_search array starts searching from element 1. Then the first element is always overlooked. How do I start this array from 1, or array-search? Start with 0? The array comes out of an XML web service, so I can not modify the results to the rally. See manual, it can help you: If you do If you are trying to increase the key by one, you can do this: my_array_search ($ needle, $ hansstack, $ string = false) {$ key = array_search ($ needle, $ Hunsack, $ strict); If (is_integer ($ key)) $ key ++; Key to return; } My_array_search ($ xml_service_array);

web services - Webservice security - What is the best option? -

I would like to protect our webserives though I'm not completely sure how this is done. There is no need to say that I am very new to this. What I would like to do here is that I would like to authenticate the user that if the user has authenticated the database / ActiveDirectory or third party authentication, then I would like to use a token or principal (machine specific) and send it to the webservice Is this possible? If yes, then what principle will be sent in clear text? In fact, I'm asking for guidance on how to implement security in webservices If you want WCF , Using the default wsHttpBinding , which uses WS-Security, then you can choose how to authenticate users. I believe the default will be Windows authentication.

iphone - Checking singleton property with nil value causes error -

When I check a single property which is not zero, then it hits my app but when I do a class Examples look for zero on the property, everything works fine This works fine:. self.MyProperty == zero but the application will end with "EXC_BAD_ACCESS" [MySingleton SharedManager] .SomeProperty! = Void What is the difference between? Singleton that I can not check for zero Here is the singleton implementation: File h: @interface MySingleton: NSObject {NSString * SomeProperty; } @protecti (nontomic, copy) nssting * some pratiti; + (Massiglittan *) shared manager; @end .m file: #import "MySitington" Fixed MySettington * SharedMenger = Zero; @Milangington @ Sintex Some Properties; - (zero) Delok [[Some Proprietary Dellok]; [Super DeLoc]; } + (Messiglton *) shared manager {if (! Shared manager) {sharedManager = [[missing alloc] init]; } Return Share Manager; } This is what I think in the console when trying to assign something to SomeProperty:...

php - Zend Studio: How do you add a new action to an existing controller via the IDE? -

If you add a bus code, it does not auto-activate the action in the .zfproject.xml file. Adding the following information: I was, that IDE is an existing controller to manually add additional actions manually without the command line tool Uses a way to add to the usage? In fact zfproject.xml is designed to update without using the zf tool feature. However, I'm running into errors using ZF tool. Project 2 Project 3 When I create a project Trying to run the zf tool against "Project 2" for this, it comes back with an error because it is trying to run the zf tool against "workbench root instead of 2" root I have not found a solution to this problem - so I still can not use Zend studio to make actions I am using Windows 7 Porschell and running the zf command line interface to create actions for time. "post-text" itemprop = "text"> If you do this from the studio, the project file will not be updated for the current versi...

c# - Navigating to a specific fragment in a flow document from code behind -

I have a WPF page that has been used as an input form with multiple controls on one side, and one Flow document reader other I want to set the contents of this document reader as a specific part of a flow document which loads on form load (through loaded events). I have an article that shows how to do this, use pieces, but the examples shown are only expressed in XAMML. In my case, I need to update the document property of the flow document reader when a user focuses a control (I have already wired the events), so let me do this in code rather than XML is required. I have tried to set the property of the document: document # control where the document is in the form of the XAML flow document Is the name and Control_Sport is the name of the piece that I need to navigate. Although it gives an error, this hash is not being signed. I tried to see MSDN, but its XML only Felix, Link to MSDN article: Any help would be appreciated. / Div> You can call any bl...

ASP.NET - Log User Session Start/End Times for Audit Trail - Global.ASAX? -

P> 1) Windows ID - 2) session Start time - 3) session closing time - 4) being browsed URL (optional) at the time of introducing some basic sessions have (See below) to log the code. Set the code in the global "session_start" method of ASACX, but it's still up to date. I am feeling that this is an ancient approach and there are "better" ways of doing this so I actually have two questions: 1) Is this the right way to go about doing this? If not, what are some other options? 2) If this is the right way, do I need to leave some code in the "session_and" method, when they record while exiting, and get a complete solution? Is this method always called when they close the browser tab on which to open the site, or close the whole browser (I do not have logout functionality)? Can anybody leave users on the end method of this session (or start up for that matter)? as dim connsql new System.Data.SqlClient.SqlConnection (ConfigurationManager.Conn...

python - Sorting and grouping objects by Date with the Django ORM -

I have a paragraph model in which there is a date field, I want to ask questions against all paragraph objects, and for each specific year Along with a datatype, and then each separate month. For example Archives = {2009: {12, [,, ...], 11: [...]}, 2008: {12, [...], 11: [...]},} Is it possible? This type of question takes a long time, the simplest solution is through the data and group of year and month You can see it in your hand or use it in your template. It really depends on what you want to do with the data. If you have a year and month grouping archives to apply, it is a very common thing, you may want to consider creating a one year and month field, which you populate when saved. . This may be something by hand: arch = {} for archiving. Objects.all (): year = arch.get (a.pub_date.year, {}) months = year.get (a.pub_date.month, []) month .append (a) year [a.pub_date.month] = Arch of Arc [a.pub_date.year] = year or grouped logic (without trial) using the ...

ruby on rails - RadRails is very slow on Windows 7 -

I am trying to use radarres on Windows and it works relatively smoothly. But, when I hit F5 in my browser I have to wait ~ 15 seconds to refresh the page. This is upset because the CPU usage is about 5% and it seems that the radarles are not doing anything during the 15 seconds, there is no debugger activity, there is no SQL connection, and no server requests. Does anyone have to configure this IDE? Thank you PS: I'm editing on Ruby 1.8: In the first place I thought the web server was also. But it displays the debug: "Full in 13ms (see: 11, db: 2) | 200 OK [... ... it does not look guilty! So, between this time where is my request, I hit F5 and the moment receives the web server and executes it? Thanks again. OK I have definitely found my problem ... I Using remote databases and reverse DNS was active in server my_sql. The connection with this option takes approximately 5 seconds if the hostname can not be resolved. I have disabled this reverse DNS, th...

Include (../x.php) doesn't work on my Linux server why? -

In my XMP I can: need_once ('../ myFile Php '); And it works. When I want to upload a file, it does not work. There is an error on the server: WARNING: need_once (.. / myFile.php) [function.require-once]: failed to open the stream: / home / Xxx / public_html / Yyyy / testinclude.php Fatal error on line 11: require_once () [function.require]: Required to open '../myfile.php' (include_path = '.: / Usr / lib / php: / / 11 / Any thoughts on /home/xxx/public_html/yyyy/testinclude.php line 11 in usr / local / lib / php ')? One possible reason for this is that your file-wrapper is not exactly the same. In UNIX, file paths are case-sensitive. This is not the case in win, therefore, if you are including ../ myFile.php , then your file should be named myFile.php , not Myfile.php . In addition, included always contains files according to the current path . Consider these two files. /home/xxx/public_html/first.php & lt ?? Includes p...

qt - is there a performance difference between QList<QList<int> >myList; and int ** myList;? -

I would like to know whether it is more efficient to use ** one int ** from QList or if they are too much There are more equals I have to do a lot of calculations so that I would like to get it faster. If I have QList documentation: Internally, QList is shown as an array of pointers for T type items Ref: So, it looks very equivalent if you want to make sure, you can see or write source code.

python - Using the Image.point() method in PIL to manipulate pixel data -

Image
I am using a lookup table to colorize a black and white image that defines color relationships is. The lookup table is a 256-element list of RGB Tuvles: & gt; & Gt; & Gt; Lane (color) 256 & gt; & Gt; & Gt; Color [0] (255, 237, 237) & gt; & Gt; & Gt; Color [127] (50, 196, 33) & gt; & Gt; & Gt; My first version is used for getpixel () and putpixel () methods: For Range (Y) in Y: Range (Y) for Y: Pixel = IMGGet pixel ((x, y)) IMG.put pixel ((x, y), color [pix [0]]) This was a slow slower, a profile report, indicating the putpixel and getpixel methods as offenders Is a small investigation (i.e., read the document) and me " Note that this method is relatively slow. " re: putpixel ( real runtime : 53s in putpixel 1024x1024 image for 50s getpixel ) Based on the suggestion in the docs, I use im.load () and instead use direct pixel Done: for pixels = img.load () in range (w): for range y (h): pixel...

javascript - Finding the position of current td cell when click on -

The user is trying to find the existing cell that is clicking. For example if the user first clicked on the cell I have to return 1. If they click on the tenth cell then I want to come back. The table has 16 total rooms. & lt; Html & gt; & Lt; Top & gt; & Lt; Title & gt; Lite out! & Lt; / Title & gt; & Lt; Script type = "text / javascript" src = "jquery-1.4.js" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" & gt; // var / i } Function getTdCount () {return $ ("TD") Length; } $ (Document) .ready (function () {$ ("#btr tr td"). Hover (function () {$ (this) .Css ('border-color', '00FF33');}, function) $ $ (This). CSS ('border color', 'black')}) $ offProtoType = $ ('# offprototype') CSS ('display', 'block'). RemoveAttr ('id') $ ('TD'). App ($ Offproto Type) $ ("#btr tr td") Clic...

php - How does one script call another? -

Suppose you have access to a script that will print or resize an id string, whose name will be string, that is, something like this: output an id string. I want to create a script which will allow me to get iyadstring, provided i already have a variable holding an nmstring, i.e., like this pseudagon: $ name = " Homer Simpson"; $ Id = 'www.example.com / script.php? Name = $ name '; Can you help me understand how I should do this? ... thanks, as always! If you are writing code on the same domain, then for security reasons, instead of You can consider the requirement () or of the functions () , and what you need to do as a function in php, in this way, your server needs to pay garbage data and your application There is no risk to crash. If you need to draw data from another script then do so with caution, especially the server which is not reliable, said, you can either do it with either: or, later Looks easy.

Internet Explorer P3P Issues! Help! -

I'm getting privacy icon to go to IE 7I IE8 and spend 10+ hours trying out different things And nothing is working, whatever I try, it takes the same result. I have created a P3P document from the IBM tool and it has fully validated it. Can you think of any reason that the privacy icon will also be displayed when I have passed the verifier? Any help really is appreciated! I do not see your website "7" safety mode and any privacy icon on IE8 When I go to the privacy report in the browser for your website, it correctly shows a summary of both the privacy statement (basic information and cookies). As far as I can tell, your P3P document is configured and serving properly. Have you tried to clear your browser cache, if it is loading old P3P documents?

java - NetBeans form designer: Change layout after call to initComponents -

I have a class that spreads javax.swing.JPanel , it has a pocket button I have created a class in Netbeans Designer , like I have a initComponents () function called a Class Constructor. What do I have to do when / when a function is called, then I change the layout of the second button, and the two buttons. Just do it: add public zero seconds () {javax.swing.JButton secondButton = new javax.swing.JButton (); Add (Second Button, Java.A.T.BirdLyut.Setter); } does not work, the new button is not visible I tried calling to invalid () , but no luck How can I re-evaluate the layout? If it is said that the function is called more than once, then which part of the layout / button is required to call the settlement ()? If I can not use NetBean Designer, will it be easy to handle? before adding the button to you BorderLayout.CENTER You have to set the panel layout. In addition, you must first add and add the button again and apply the modified () method to the ...

grails - LDAP-authentication and local roles don't work -

Authentication by LDAP works like a charm, however, when I play a user role and secure a page in the requestmap; / books / show / ** and ROLE_USER ) This works only for local-only users, not authenticated by LDAP for users. ( IS_AUTHTHICATED_FULLY works, though) How can I fix this?

linux - Writing a file quite quick, overwriting the file take much longer -

I have some functionality problems with PHP scripts on the Linux box, so I was going to see some commands One thing I noticed was that writing a file is very fast: [root @ localhost ~] # dd if = / dev / zero of = / root / myGfile bs = 1024K count = 1000 1000 1000 + 0 records record 1048576000 bytes (1.0 GB), 1.0817s, 969 MB / s but overwriting takes a lot of time; [root @ localhost ~] # dd if = / dev / zero of = / root / myGfile bs = 1024K count = 1000 1000+ records in 1000+ records, 1048576000 bytes (1.0 GB) Copy, 23.0658 s, 45.5 MB / s Why is it so? (I can repeat those results.) The first time you write a file, this system There is a buffer in the memory. The second time when you write a file, the file is truncated, which is the reason for all the dirty pages to be written on the disk for some reason. Yes, it seems stupid: why write the file's data when the file is scaled down in zero? You can display it by creating another dd , just write, say, 4k figur...

create regex for several matches -

I will test the date string to see if it is one of three: dd-mm-yyyy OR yyyy Or dd-mm-yyyy / dd-mm-yyyy I have combined these three, but the last one causes problems because I just \ "\" / \ \ \ / \ / \ \ Previous> [0- 9] {2} - [0- 9] {2} - [0- 9] {4} - & gt; Dd-mm-yyyy [0- 9] {4} - & gt; Yyyy [0- 9] {2} - [0- 9] {2} - [0- 9] {4} \ Q / \ E [0- 9] {2} - [0- 9] {2} - [0- 9] {4} - & gt; Combined expression: ([0- 9] {2} - [dd-mm-yyyy / dd-mm-yyyy 0-9] {2} - [0-9] {4} | [0-9] {4} | [0-9] {2} - [0-9] {2} - [0-9] {4} \ Q / \ E [0-9] {2} - [0- 9] {2} - [0- 9] {4}) Question 1: How to make a single " / "Is allowed between dates? Question 2: Finally what does a regex and $ mean at the beginning? And I should have it in me Br Anders UPDATE: (based on replies and comments) Thanks! Two correct answers I marked the last one because there was a very easy way of writing that I tried to do. The language is probably XSLT or C #. It is in CMS Umbr...

c# - How to modify an invocation parameter of a mocked method with Moq? -

Is it possible to modify an implantation parameter of a simulated method? Specifically I want to convert buffer to the prefixed byte array in the following example. Example: int MockedClass.Read (byte [] buffer, int offset, int count) explanation: calling Read load count bytes off by buffer in the byte array supplied. Now I should have a buffer to call after calling read has been done in my application code, is this possible? If so, how do I make frequent calls to read ? Edit: By using the setup command like this: MockedClass.Setup (x = & gt; x.Read (this.This is another lieutenant; byte []> gt; (), this. Any of these & lt; int & gt; (), this. Lt; int & gt; ()). (Byte [] buffer, int offset, int calculation) => Buffer [0] = 0xAA); When giving the unit test, I give a strange problem: Code> Read is created and the representative code ( buffer [0] = 0xAA ) The debugger shows that the buffer actually null and the unit...

c - Default flags for gcc compiler in Eclipse -

I want to compile all of my programs with the option -wall-punctual-centric Defaults. Is Eclipse a way to add these flags to the compiler command by default for all the projects? To include those values, CFLGS, and Eclipse run a tool that runs that environment variable Used by default when compiling (such as creating). Eclipse may need to specify the environmental variable before running (and then inherited when the eclipse runs), but there may be a way to specify the default environment in the Eclipse. (I do not use Eclipse, so I have to see this about setting up and testing; Or maybe this answer can jog anybody's memory, if so, hesitate to edit Do not.) On the one hand, you want -std = c99 instead of -ansi -sync option - std = c89 or -std = c ++ 98, depending on it That's you're compiling C or C ++, and both of those standards are showing their age. I have assumed this test to be installed inside a VM running Windows, and, however, CFLAG is in the en...

formatting - Java Date issues -

I have a problem with the date of Java, when I pass in a Bile method before 1949. The date I have given back is for example 2049, I know that there is something to do with the date format and would be thought of using yyyy instead of RRRR. But I can not understand how and how to bring it. Any help will be more apreciated public static java.sql.Date parseDate (string date) throws ParseException {if (date! = Null) {SimpleDateFormat dateFormat = New SimpleDateFormat ("dd-MMM- Yyyy "); New java.sql.Date Return (dateFormat.parse (date) .gettime ()); } Return tap; } Thanks John Let me give that format to you . . Public static java.sql.Date parseDate (string date) throws ParseException {if (date! = Null) {SimpleDateFormat dateFormat = New SimpleDateFormat ("dd-MMM-yyyy"); New java.sql.Date Return (dateFormat.parse (date) .gettime ()); } Return tap; } I suspect what you want ... private date converts () throws up ParseException {String dateStr = ...

EventHandler, event, delegate based programming in Python any example would appreciate? -

Actually I'm a C # developer, I know the method of C #, event in fact, representative, representative, even .. But what is the best way to apply it to Python? I think you should be able to use the function: def do_work_and_notify (on_done): // do work on_done () def send_email_on_completion (): email_send ('joe@example.com', 'you are') do_work_and_notify >

windows mobile - Is there a tool to open a text-file directly from a remote (WM) device? -

I have also asked this question, but have not yet received a satisfactory answer. Since I think this question (Windows Mobile) is relevant to developers, I have decided to ask it here as well. If you believe this is inappropriate, please do not hesitate to close or remove this question. When I browse files on a remote Windows Mobile device using ActiveSync, then I want to regularly write the contents of the Txt files (application log files, etc.) Windows XP is not able to open these files directly from the device, so I have to copy them to my local disk before opening them. Is there a tool for WinXP that allows me to open files in one click, but rather copy them first? I'm specifically looking for a desktop-based tool, not a device running on a device. The reason for this is that I often reset the device reset and every time I do this I do not have to re-install the device. The short article is "no" and the reason for this is not clear, when you do not unders...

data binding - ASP.NET ListView with identical markup in EditItemTemplate and InsertItemTemplate -

I have a ListView that includes an EditItemTemplate and an InsertItemTemplate. Two forms share almost all of their markup, for example: & lt; Asp: listview runat = "server" ... & gt; & Lt; Layouttemplate & gt; ... & lt; / Layouttemplate & gt; & Lt; ItemTemplate & gt; & Lt; P & gt; & Lt;% # Eval ("name")%> & Lt; / P & gt; & Lt; P & gt; & Lt;% # Eval ("title")%> & Lt; / P & gt; ... & lt; / Itemtemplate & gt; & Lt; Insertitemtemplate & gt; & Lt; P & gt; Name: & lt; Asp: textbox runat = server text = '& lt;% # bind ("name")%> / & Gt; & Lt; / P & gt; & Lt; P & gt; Title: & lt; Asp: textbox runat = server text = '& lt;% # bind ("title")% & gt; / & Gt; & Lt; / P & gt; ... & lt; Asp: button runat = server commandname = "insert" text = "save" /> ...

firefox - Saving the manipulated DOM/HTML after editing it with Firebug -

Assume that I have removed Firefox with a firebug on a random site (say slashdot.org). After loading the site, I will see the firebug & gt; The HTML panel is so good now: My changes in Firefox are showing up immediately. My question: How do I save the edited tom tree (shown as HTML)? How can I load a previously tamable DOM Tree / HTML file in the "Basic Reference" of the page (example slashdot.org)? I want original reference so that all reference organizations (CSS, images, etc.) load properly. How can I save the edited tom tree (as HTML is shown)? Firebug does not include any method that can be used to save the current DOM file. However, you can save the firebug to save the DOM in the file for combining with web developer extensions. (Shown as HTML). After you manipulate the DOM in the firebug, the toolbar at the web developer top) & gt; View Source & gt; Created source & gt; View Archive & gt; Save Page as ... . How do I firs...

c++ - Run bash with redefined PS1 env variable -

I have written the CPP application, named MyShell, which takes the form of a parameter, some actual shell names (usually Bash) and its parameters. MyShell works as a cover for it. I need to open the internal shell, especially for PS1 environment variables. I know how to use it in a command line way PS1 env var: $ PS1 = "[myshell]" $ PS1 [myshell] $ but it is not so easy from CPP: string npeps 1 = "[meshled]" + string (getenv ("PS1")); Setenby ("PS1", NPS 1Cestrate ()); If (execvp (shell, argv) afaik, when bash is applied, it executes commands from /etc/.bashrc or / etc / profile (depending on the options of users). If I redefined the PS1 var then my Settainment ("PS1", newPS1.c_str ()); > If you just want to change the signal from the default settings, then you export PS1 = "[myshell] "$ PS1 to ~ / .bashrc or edit if you change the original If you do not want to, press it before launching ...

Sort by order of values in a select statement "in" clause in mysql -

I am selecting a group of account records from a large table (millions of rows) with integer ID values. In the original form of a question, as in one form, what I am doing to create a separate list from a big comma and I am passing in the query as the "in" section. The result is completely anonymous. What I want to do, results back in the order of values ​​in the "back" section. I think instead I would have to create a temporary table and include one instead, which I would like to save but can not be able to. Thoughts? The question size has been captured at just about 60 kilograms, because we are trying to limit the output size, but it can be arbitrarily larger, which can cancel the "in" question from any practical perspective. If not, thank you in advance. In fact, this is better: / P> SELECT * your_ table WHERE id (5, 6, 8, 12, 1); Reason for FIELD documentation:

sql - Quickly add a copy of a column to a MySQL table -

Let me quickly duplicate a DATETIME column in a table and give it a new name My columns In my table named My Dates myResults, I need a query to create a new column in the table called NewDate, which has the exact data as myDate column. Is it a faster way to do this than to approach a clear two-step approach to creating a new column, and then copying all the data (this is a large table and I have the fastest approach Looking for)? The obvious solution: Add an optional table 'myResults' to 'newdate' DATETIME; Set up `MyResults`` new date '=` myDate`; The obvious solution is the only solution, unfortunately. However, note that normally you should not copy a column to a relational database.

How to validate a SAML signature value -

I have a client who is sending the security key to the encryption they are using Triple DES. Each target sent by them has a signature value which must be valid to give them the necessary privileges. Can you give me a sample code which does this? Encryption and sign are two different animals Triple DES is a symmetric key method (encryption and decryption The same key used for). On the other hand, digital signatures use asymmetric keys (private / public key pair), where signatures are calculated using the private key, and can be validated using the public key. So if your client wants you to include signatures in XML, then you have to provide them with a public key. For encryption, which is specific to SML, is to use XMLEncryption, which defines the XML format to include encryption key information and encrypted data in your SAM messages, since a static symmetric The key exchanges are problematic - if it is stopped, the interceptor can encrypt and decrypt any message - instead o...

python - Expanding elements in a list -

I'm looking for a "good" way to process a list where some elements need to be expanded in more elements (Only once, no detail on the results) The standard way to do it is: i = 0 while i nl = [] at x in l: if needed _exending (x): Nl + = expand (x) else: nl.append (x) But they both look too long or I can just pass 2 and later level the list I: level (expand (x) if necessary x for xx xx A.) # or Diif try_expanding (x) .. But it does not "feel right" either. Is there any other obvious way to do this? If you do not need random access to the list that you are creating, then you can also write. A generator. def iter_new_list (old_list): for x in old_list: if need_expanding (x): for extension y for (x): yield y and: produce x new_list = list (iter_new_list ( Old_list)) This is functionally equivalent to your second example, but it can be more readable in your real-world situation. In addition, Python coding standards should use lowercase...

Active JQuery resource/directory with RSS news feed -

I want to update with the latest release of the latest JQuery news and plugins every day. Any active JQuery Web resources with RSS feeds that I can subscribe to? on iTunes of Carl Stein

multithreading - How can I SIMPLY perform two tasks at once in my iPhone app? (threading?) -

status: Now in my app I start downloading data from my server Give it Before the download starts, I want to update UILabel to say "now downloading" ... Problem: It seems The download takes care of all the computers, and the UILBL is never updated until the very end (the download has already ended) and then empty (or, in real time, ever Is not even visible) is set back. Question: How to tell your UILB to "download now" before I download Can I update? label.text = @ "download"; NSOperationQueue * operationQueue = [[NSOperationQueue] alloc] init]; NSINOption Operation * Operation = [[NSINOnocation Operation Alok] Initvith Target: Self Selector: @Selector (Download) Object: @ "http://www.google.com"]; [OperationQuality: Operation]; [Operation Release]; - (Zero) Download: Download (NSString *) url [Self Performance ChoicesManetred: @Selector (The Finger Download) Object: Waiting Without Waiting: No]; } - (zero) did FinishDownlo...

javascript - wrap long text in a div -

I ask for text from a db. If the text is too long, then I want to be able to write 400 characters after the text and at the end I want to display "...". How can this be done? I recommend that you do not do this in your query. You are probably propagating in a proportionate font, which means that the 400 characters are not the same size. "..." behind it is a little strange with many white spaces. You can ask the whole field and cut it using CSS (with limited browser support): overflow: hidden; Text-overflow: oval;

asp.net - how to encrypt folder in c#? -

A file contains files that are exposed by .xml files, .txt files, and third-party tools in a folder. Using C # (in VS 2008), I want to encrypt it completely in a folder before transferring it via FTP. Help is appreciated. You believe that file relies on both sides of the transfer, you can transfer to SCP (file transfer on SSH) or You can use FSTP, so all communications will be encrypted. If you do not want to or not, then you can encrypt files, good on how to encrypt / decrypt files.

Any tutorial to understand Streams, Buffers and their usage in Java? -

I'm coding Java for a while, but I have to admit that I can not find streams, buffers, etc. . 100% I have tried to find a good tutorial on the subject that argues for the reason behind them and their use, but I could not find any. Only small, separate snippets that do not help. Is there something there? It covers and goes into some detail.

Actionscript 3, read file text at compile time? -

Flash by inserting the contents of a text file into a string, or at least it .swf, then download it to the user do not require? solution: [embed (source = "ExampleText.txt ", MimeType =" app / octet-stream ")) protected var pscene: class; Var tmp: bitere = new pscene (); Results = tmp.readMultiByte (tmp.bytes available, tmp.endian); I was briefly able to understand how to read data from a byte array.

asp.net - How can I forward a url to the appropriate page? -

How can I forward a URL like: Useful Page: Is there any way to do this? I am using a DNN CMS but if you are unfamiliar with DNN and still the solution for redirection which will be helpful. Thank you, Matt You can find "friendly URL" within DN Rules ". In the Host Settings page, open the Friendly URL section under the Advanced Settings section. From there you can add a new rule, which is . * / Join / Default.aspx and replaces it with ~ / JoinOptions / MemberRegistration.aspx (I'm pretty sure that the use of that style of URL works , But I can replace the address with a URL to ~ / Default.aspx? Tabid = 423 ). By using this plan, you need to ensure that IIS requests the ASP.NET process. The easiest way to do this is to add the "Join" folder to "File" with a file called default as .px.

XCode - iPhone SDK Zombies -

Is the debugging application NSGobb enabled with the goal of ISDK 3.x? In addition to this if it is supported, can I get a list of possible levels anywhere? Yes, this is supported for both device and simulator. Although it is "NSZombieEnabled" (though not corpse). You set it by right-clicking on it executable and by selecting the environment then General - Set the value for "yes" if you want to disable it (and you do it for any production build) Uncheck the variable Please.

Using a grails/groovy class by reference -

I am trying to make my CRDoDr Controller so that Garras can not be made for goods. Instead of maintaining the code for the controller for each domain, I want to have a controller who can take care of any domain for the normal CRUD call. Because the difference is only the domain class name is. Domain Class Job & Examples; Note Job.get (id) Job.list () def Example = New Job (Parameters) Note. Gate (ID) Note. Def frequency = new job (parameter) I was thinking def someHandler = Job // some handlers. () DEP frequency = new handler (parameter) The first two static methods work fine (get, list) but not to create a new instance Call by default. def example = someHandler.newInstance () Creator for parameters using def example = SomeHandler.newInstance (parameter)

sql server 2005 - What is a dynamic SQL query, and when would I want to use one? -

What is a dynamic SQL query, and when do I want to use one? I'm using SQL Server 2005. Here are some articles: Introduction to dynamic SQL : dynamic SQL is a word used by SQL Code is generated which is programatically (part or completely) generated before your program is executed. As a result it is a very flexible and powerful tool. You can use dynamic SQL to complete tasks, such as which fields are filled on a form or add searches based on the tables being created with different names.

java - Deriving function name -

I want to accept the name of acceptable function as acceptsearchmatch method. For the former to say that the match is fun (Fu), how can I retreive just by foil the item? Help Thanks If I see, you can do something to do, check it out Is it a Maithili, and, if it is, then what is its name? If (accepted! = Null) {fCollectedMatches.add (accept); Last IRSource Resource = Approved.GetRSource (); If (! Resources (fLastResource) {if (fBinary) {Final IJavaElement element = JavaCore.create (resource); For one, you can check that this is a IMethod , which should give you access to its name. The public string getElementName () gives the simple name of this method, for the manufacturer, gives the simple name of the type of declaration. .

c# - Guessing Game and Number Comparison -

I do not understand how to compare numbers in a file with the number given in the function. This is my code: using the system; Using System.Collections.Generic; Using System.Linq; Using System.Text; Using System.IO; Namespace Guess_Game {class program {static zero main (string [] args) {int volume; Int Min, Max; Console.light line ("Enter number of numbers:"); Volume = int.Parse (Console.ReadLine ()); Console.light line ("Enter the maximum and minimum number you want to be in your file: \ n"); Console.light line ("MIN:"); Min = int.Parse (Console.ReadLine ()); Console.light line ("max:"); Max = int.Parse (console .readline ()); Console.light line ("now, approximate number:"); Int number = int.Parse (Console.ReadLine ()); Console WrightLine ("Now a number seems to already contain a file:"); Number = int.Parse (Console.ReadLine ()); GuessGame (minimum, maximum, volume, number); // if (number! = // the number is not equa...

api - PayPal MassPay and AddressVerify: Which SDK do I use? -

I am getting some conflicting information from PayPal. Today I have spent 2 hours on the phone, and posted my questions on my forum, and I have not got the same solution. That's why I am changing this because people actually know what they are doing. I am trying to add AddressVerify and MassPay API to my website. We are currently using Payflow Pro (Direct Payment, etc.), with no problem, our PayPal Manager uses Seller credentials for authentication through login, password and HTTPS interface. All this has been written in PHP using NPP. However, when I try to add an addressworthy and / or mesepay API using the HTTPS interface, all I get is a PNREF and an error, "Invalid Tender." On the forum, I see everyone as a login address in the form of an email address, and a certificate key of some sort. I told PayPal today how to get that information, and the developer said that I do not use login with key and I am using the wrong SDK. They told me where God guide should b...

python - Differentiate gtk.Entry icons -

I am adding two icons to gtk.Entry in PGT. def Entry_icon_events (self, widget, status, event) I'm trying to differentiate between them: & gt; Animate GTK_ENTRY_ICON_PRIMARY type GtkEntryIconPosition & gt; & Lt; Enum GTK_ENTRY_ICON_SECONDARY type GtkEntryIconPosition & gt; How can I do this? I'm digging through the documentation of PyGTK, but there is no GtkEntryIconPosition for any object nor has there any definition for this enums. Thanks A better way to do this is: def entry_icon_events (auto, widget, icon, event): if icon == gtk.ENTRY_ICON_PRIMARY: ... alif icon == gtk.ENTRY_ICON_SECONDARY: ...

deployment - How to start and stop a JBoss server from Maven, bound to a different address than localhost? -

I am working on a legacy Java Enterprise Server project, and currently I try to install night build I am here. We are using Maven 2, Jabos 4.2 and bamboo. The idea is that one of our dev servers is a bamboo agent, and Mewen build has been configured to strictly result in .ear file, then restart the server (we can not use soft deployment because our legacy app Uses a library which causes an exception during adoption ... we will be able to get rid of that canal library at some point, but not yet.) Works fine when I run Maven on my own machine: The server has been shut down and has been restarted with the latest build. However, on dev server we have many jobs server examples, which are tied for different IP addresses. And the meowen jeboss plugin used by me can interrupt and lock a server with a local host (default) and I have downloaded the source code for it and it just executes the run and shutdown script in the jabos bin directory. , Such as: Launch ("Run", "-C...

c# - Releasing temporary COM objects -

COM ऑब्जेक्ट का उपयोग कर निम्न C # कोड पर विचार करें। MyComObject ओ = नया MyComObject; कोशिश {var baz = o.Foo.Bar.Baz; कोशिश {/ baz} के साथ कुछ करो} अंत में {मार्शल। रीलीज कॉम ऑब्जेक्ट (बाज़); }} अंत में {Marshal.ReleaseComObject (o); } यह COM ऑब्जेक्ट्स ओ और baz जारी करेगा, लेकिन o.Foo और o.Foo.Bar । इससे समस्याएं हो सकती हैं, जब उन वस्तुओं में बड़ी संख्या में अप्रबंधित स्मृति या अन्य संसाधन हैं। एक स्पष्ट लेकिन बदसूरत समाधान, कोड को और भी अधिक try-end और मार्शल। रीलीज कॉम ऑब्जेक्ट । एक वैकल्पिक हल के रूप में, मैंने एक सहायक वर्ग बनाया है वर्ग अस्थायी कॉम-ऑब्जेक्ट्स: IDisposable {सार्वजनिक सी टी & lt; C & gt; (सी कॉम ऑब्जेक्ट) {m_objects.Add (comObject); वापसी comObject; } सार्वजनिक शून्य निकालना () {foreach (ऑब्जेक्ट ओ में m_objects) मार्शल। रीलीज कॉम ऑब्जेक्ट (ओ); }} उपयोग: का उपयोग कर (अस्थायी कॉम ऑब्जेक्ट्स टी = नया अस्थाई कॉम ऑब्जेक्ट ()) {MyComObject ओ = टी। टी। (नया MyComObject); Var बज़ = टी.टी. (टी.टी. (टी.टी. (ओ.एफू)। बार्स)। बज़); //...

regex - Verify if provided string corresponds to pattern on python -

Would you please advise how to confirm in the python if the provided string returns the returned patterns and returns Corresponds to For example, the following are the patterns given: & lt; [Prefix] - [ID]> 'separated by', '> | & Lt; Log> " Where the prefix is ​​any number of characters, the id is only numbers but not more than 5 digits, any number of logs is any letter Example: proj-123 | log message prog-2334, prose-345 | log message I think the easiest way is to implement regexp that I did not use on the python. Thanks. (?: [Az] + - \ d {1,5}) (?: [Az] + - \ d { 1,5}) * \. *. * It is not clear what you want to capture, so I use non-capturing groups. If you only need boolean: & gt; & gt; & Gt; Regex = '[az] + - \ d {1,5} (?:, [Az] + - \ d {1,5}) *. *' * 'Gt; & gt; regex , 'PROJE 234, PROJE-45 | LOG message') is not true Of course, the same results can be obtained from the ord...

java - How to iterate a table in JSP using Struts tags? -

& lt; सारणी सीमा = "0" सेल्सपेसिंग = "1" सेलपैडिंग = "0" चौड़ाई = "100% "वर्ग =" बोक्स्टब्लड "& gt; & Lt; th rowspan = "2" वर्ग = "fntnrml" colspan = "5" & gt; ट्रिप आईडी & lt; / th & gt; & Lt; बीन: लिखें नाम = "ऋण" गुण = "tripID1" / & gt; & Lt; td & gt; & lt; html: चेकबॉक्स प्रॉपर्टी = "ZAXY" /> gt; & lt; / td & gt; & Lt; td & gt; बीन: लिखें नाम = "ऋण" संपत्ति = "प्रोफ़ाइल 11" /> gt; & lt; / td & gt; & Lt; td & gt; बीन: लिखने का नाम = "ऋण" गुण = "StartDt11" / & gt; & lt; / td & gt; & Lt; / तालिका & gt; उपरोक्त तालिका को कैसे पुनरावृत्त करें? मैंने पढ़ा है कि केवल संग्रह ही बार-बार किया जा सकता है लेकिन मैं & lt; td & gt; के अंदर "चेकबॉक्स" का भी उपयोग कर रहा हूं I यदि आप सिंगल टेबल प्रदर्शित करना चाहते ह...

c++ - Thread Building Block versus MPI, which one fits mt need better? -

Now I have a serial solver in C ++ to solve optimization problems and let me have my solver different parameters To make parallel with this can help to improve the performance of the solver. Now I am not sure I should use TBB or MPI. I read from a TBB book, I think TBB is more suitable for looping or punished code. Since I do not have much experience with TBB, I think it is difficult to split my code into smaller parts to realize parallelization. Apart from this, I think that many writers used MPI in parallel to many solars and supported it. I think the MPI fits my need more since I do not have much information on TBB or MPI. Can someone tell me if my feelings are correct? What MPI would be better? If so, what content is good for learning MPI start up, I have no experience with the MPI and I use Windows System and C ++ thanks a lot. The basic thing you should keep in mind, shared memory and distributed memory. Share-memory occurs when you have more than one process (usually mo...

associations - Model a person-to-person relationship in Ruby-on-Rails using has_many :through -

I would like to model the relation of a person with another person, where the relationship is not hierarchical (i.e. friends and colleagues , Instead of parents and children) and I am interested in getting more details about each relationship (for example, the type of relationship, date of establishment). Finally, I want to use the act_as_tree connection to be able to navigate these relationships / diagrams. Migration: Class CreateProfiles & lt; ActiveRecord :: Migration DF self.up create_table: profiling | Table | Table.column: First Name ,: String Table: Last Name ,: String Table. Column: Telephone ,: String Table. Column: Email Address, String Table. Column: Location, String Table. Tamstamp End & Def self.down Drop_table: profile end and class relationships & lt; ActiveRecord :: Migration DF self.up create_table: relationships ,: id = & gt; Make false Table | Table.column my_id: integer table. Column your_id: integer table. column Relationship type: string t...

user controls - ASP.Net Themes, UserControls and CSS -

I am creating a web application with 30 pages, 12 user controls and 3 masterpages. I have centralized all CSS in a theme called default application will expand in the near future. What is the best practice to isolate CSS files? I want: A - Put everything B - separate each UserControl styles in a new CSS file (all in each page Styles) C - Similar to B, but user control css files not stored in theme (manual css loading in CSC). D - .......? I recommend separating my style into different types of elements. One style sheet for fonts is another for the more complex diva behavior for presentation / layout, after which there are individual style sheets for expansion cases. Then you can create a global style sheet that imports the default All controls, and the master page can set special cases beyond that, although I do not advise to be separated by UserControl. Now you have a very limited set. I run a site with about 200 user controls and 200 style sheets runs the b...

windows xp - Random COMException on Web App "The handle is invalid" -

Suddenly, when I'm trying a web app with IIS, then suddenly I am getting a strange fluctuation on this machine Stack trace: [COMException (0x80070006): Handle is invalid I (0x80070006 (E_HANDLE))] [FileLoadException] System.ServiceModel.Activation.HttpModule. ProcessRequest (Object Sender, EventArgs E) +0 System. Web. .HttpApplication.ExecuteStep (IExecutionStep step, Boolean & completed synchronously) +75 How can I fix this? Stop / start in IIS aspnet_regiis -i I need this server to work for a demo later today. Reboot Does not have a COM error, it is a Windows error, wrapped in a COM error code. This is a very low-level error, error code or stack trace can be very less distilled. There are lots of hits when you like Google Message, it's good if you do not have a good match then be sure to find yourself more.

How to find the list item currently under the mouse pointer in Flex? -

I have some inventory and tile list control how can I get a reference to the item list which is currently under the mouse pointer is? Add an event listener to each item in your list for mouseover, then add this event to your event .currentTarget

NHibernate property access strategy, How to set it up so that field.camelcase-underscore is preferred but autoproperty is fall back -

I want to set up an access strategy so that one area camelcase-underscore property backing is present, use it and others Use Automatic Property Is this the default behavior (since auto props are basically backed up fields)? Or how to apply it? By default the property is used to setter, so you need if you have backing field , Then specify access as camelcase underscore field (or whatever naming convention you use). This may be an easy way to get it, but you can use Fluent NHibernate's conventions to apply this behavior if using the backing fields and otherwise when the providers If the conference is implemented, then you can reflect the type of unit to check whether there is a similar camera campaign underscore field or not. If a backing field is found, then you modify the mapping to use the camelcase underscore as access. Here is an example using IPropertyConvention. (You may also want to do a similar investigation in one-to-many conferences): Public class Proper...

c# - Best method to creating re-usable sections in asp.net-mvc -

I have a form that I want in different parts of my website. Users enter their address, and submit the form that saves the address. I want to wrap it up, so in some places I can use it again after the same functionality is required. I am thinking of doing this: Make a partial view with the form, but the Action Location URL has been passed as a parameter . Create a separate class / method that will handle server-side verification ( saving / editing is already controlled in the DB layer Is there a better way to do this? Text "> ASP.NET uses the communication on the MVC configuration so that you can use it to send your address to different tasks, where it was requested that it was requested since . If you keep things in heaven: public action Foo () {return view ();} [AcceptVerbs (HttpVerbs.Post)] Public Zero Foo (string address) {// Code to update address} Your address will be partial in your Foo.aspx view, using helpful methods to create your own form...

geometry - How to check if a point (int - Coordinates) is within the hypotenuse of a triangle -

Image
I have found a right triangle and I want to see that if any point is on Hypotenuse of that triangle, all point plain integers Are not floating-point variables Edit: All green squares should be on the hypotenuse, not white squares. I know I want to test x, y, coordinates of the corners and coordinate of the point. All coordinates are full numbers (Y is slightly off in drawing, sorry). This job: If you know the triangle, then just for the hypothenuse function Create, in your example, it will be y = 5x / 12 . If you now find a point, then say x = 6, y = 3 , you can use these variables to see that it turns out right: 3 = roundup (5 * 6/12) . If this happens, the point is on the triangle, if not - then no.

string - In python, how do I exclude files from a loop if they begin with a specific set of letters? -

I am writing a Python script that goes through a directory and collects some files, but I want to I have many files that are named in the file Example code: Name: if name! = "Doc1.html" and name! = "Doc2.html" and name! = "Doc3.html": print name Assume that the directory contains 100 hundred HTML files, all of which are from the beginning 'doc' . What would be the easiest way to get them out? Sorry, I'm new to Python, I know that this is probably the basics. Thanks in advance. If the name is not there. Startswith ('doc'): Print name If you have more prefixes to print the name, you can also do this: if not name Startsless ('prefix', 'other', 'so far')): Print name / Pre> can accept a tuple of prefixes.

javascript - inline image captions plugin? -

What is an inline image caption plugin for jquery? Then a user can choose a single point on an image, and then insert a text caption. Whenever a person enters the image, the caption is displayed. This type of functionality is in Flickr. The keywords you are searching for are jquery photo tagging It looks informative:

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

I am using my first project LINQ (in mvc), so maybe there's something very simple that I remember. However, a day of searching and experimenting does not work, so it works. I am trying to write a LINQ query (Linux to SQL) in which in many cases where the statement is different from an OR or an AND. We do not know how many conditions are going in the query till runtime. This search is for filter control, where the user can choose multiple criteria for filtering. Select from table where table.col = 1 or table.col = 2 or table.col = 7 .... 'Other number of conditions Before I just create the SQL query as a string, while looping over all the situations. However, it seems that there should be a good way to do this in LINQ. I tried to use Expression trees, but they had a second thought for this moment on my head, where the lambda function was to be executed inside the statement such as: values ​​for matchingRows = matchingRows for each value Where (function (row) row.c...

sql - effect of number of projections on query performance -

I am looking to improve the performance of a query that chooses multiple columns from one table. Thinking that limiting the number of columns would affect the execution of the query. Maybe there is a misunderstanding of the question, but here goes anyway: The absolute number does not make a big difference in the column you select. However, which can make significant differences based on the index of the selected column table. If you are only selecting columns that are included in the index, then DB engines can use index only without bringing data to the table. If you do not use any single column which is not covered, however, it needs to bring the whole line (key lookup) and this will greatly reduce the performance. Occasionally this performance kills so much that the DB engine takes the option of full scan instead of bothering with the index; It depends on the number of rows to be selected. So, if you can remove the columns and convert it to a cover query, yes, it c...