Posts

Showing posts from February, 2010

signing - How to sign data properly in Ruby (HMAC?) -

I have a server (ROR app) sending information to the customer (Ruby Sinatra App) and I have a The way should the client come to ensure that the data comes from my server instead of a bad third party. The customer must log in to the server before anything else will be sent back in other ways so that the server can reply with a shared key which used to sign all further responses But then the third party can get that reaction and it can be bad. Let me sign the server response in Ruby, platform applicability), so that verification of fraud can be done without inspection of the customer's code. Any ideas? UPDATE : See if I can tell it better! (I've added the code to the Gitub as I have written this question, so you can do it (if you want!) Is a poke around :) The process is : Blogs that use a bookmarklet on their mobile device. This site submits the currently visited URL to .heroku.com. When siteender.heroku.com receives that request, its DB checks to see if anyone ha

ledit - Is there an enhanced interpreter toploop for OCaml? -

Python. Is anything similar to the Okamel? I should command a lot of history, though it would be good in other features too. I have read that I can get it command history by running it in Emac, but I do not use Amax .. / Div> gives you readline features (history, editing commands, etc.). In addition, adds some functionality, for example see.

asp.net - Remove RequiredFieldValidation from GridView Row -

I have a gridview like Excel sheet, I use it to update and insert new records. The last line is used for entry and can be empty. When the rows are updated or inserted, I need to add RequiredFieldValidation required for this, but I want to empty it completely. How it can be implemented. Thank you for your suggestions :) line 1 [withvalidation] row n [no validation when empty] Post-text "itemprop =" text "> If assumptions have been added to the ID, then you can refer to those IDs with code and programmatically stop the assumptions.

java - JTree data from database -

I am working on this example I want to optimize it in a way such as data public person getGenealogyGraph () throws SQLException pulled from a table with {connection (folder_id, folder_name, parent_id [foreign keys to determine the parents]. string = "jdbc: mysql: // localhost: 3306 / "; string db =" java "; con = Drayvrmanejrktakshn (URL + dB," root "," "); Arerest list = new Arreist () trying; A. {String sql = "SELECT * from folder"; st = con.createStatement (); rs = st.executeQuery (SQL); list.add ( "current folders"), while (rsnext ()) {string folder name = rs.getString ( "folder_name"); list.add (folderName); // system.out.println (folder name); // person a1 = new person (folder name);}} catch (exception e) { System.out.println (e);} Rs.close (); st.close (); con.close (); object hierarchy [] = list.toArray (); for (Int i = 1; i & lt ; Hierarchy Long; I ++) {person A + i = new person (hierarchy [i]);

c# - Get number of character selected in a multiline textbox in asp.net -

People, I have a multilingual text box and I have MaxLength = "160" , I also have a label indicating the number of remaining characters .... Now I want to get the number of characters selected by the user, he can remove it and I can calculate that calculation The total number of characters left in the label that represents which I have to add ..... I want to type it in the text box. This client-side is using Javascript For this, there is a solution for this. To do this in server side event handlers, get the length of the string, as long as your page is posted back to the server, the highlight has been removed.

sql - SQLPlus - Count function across several tables -

I am trying to calculate the number of riders in my data. And I'm having trouble finding this. The sample of my output is noted below, the data comes from many different tables and I had to join those tables which I do not have a problem. I'm trying to get the calculation count by DESCRIPTION by EVENT. And then display the columns below SQL & gt; Select EVENTNAME, description, RIDR2 from ERP_IR; EVENTNAME description RIDERS ------------------------------ ----------------- ------------- Ace Rental Car - Race on the fair Aron Adams of fair hill investment de 1 fair hill. Logical Level Course Ace Rental Car - Fair Arena Day Day 1 Fair Hill's Easy Aron Adams Early Level Race Course Ace Rental Car - Fair Hill Inc Day 2 on the interiors of Fair Hill race at Adroon Mountain View Weekend 1 at the basic level Race 1 Huffy Moon Sam Adams Tan Easy Level Course Valley Spring Water Mountain B3 Day Race on Hula Hut Kanth 'J.Gillgan IX Extravings Intermediate Layer Course

Is there an easy way to determine what a file is by its extension in C#? -

Is there an easy way to determine what files are in detail in C #? For example, if I pass the ".txt" file extension then it will return "text document" or if I pass it ".pdf" then it will return "Adobe Acrobat Reader". I see this behavior created in Windows Explorer under the "Type" column. Is there any way to copy it in C #? If you really want to get an explorer and you are ready to use Com Interop , You can use the shell. To get the application class with the minimum amount of code. If you go to add a reference, then browse to X: \ windows \ system32 \ shell32.dll which will import Shell 32 type library. Then just use the code: string GetFileType (string path) {Shell32.ShellClass shell = new Shell32.SheClCl (); Shell32.Folder folder = shellNameSpace (path.getDirectoryName (path)); Shell32.FolderItem item = folder. Purpose (path. GetFileName (path)); Return folder. GetDetailsOf (item, 2); }

jde - Trouble installing jdee in Carbon Emacs in Snow Leopard -

I recently decided to try emacs for Java development, so this is the first time I used emacs I have not found any errors at emacs startup, but I do not think jde is installed correctly because I do not see "jde" menu item when viewing the java file. I have the following DIR structure in the CD , JDE, and Elib have downloaded and removed: < Code> ~ / .emacs.d / site / cedet / latest ~ / .emacs.d / site / jde / latest ~ / .emacs.d / stie / elib / latest each In case the 'latest' is a symlink version, for example: cd ~ / .emacs.d / site / cedet ls -al drwxr-xr-x 17 dparoulek employee 578 December 4 12:17 cedet-1.0pre6 lrwxr -xr-x 1 dparoulek Staff 14 Dec 4 21:41 Latest - & gt; Cedet-1.0pre6 / Here is my .emacs file: ; JDE - Java development environment ;; Set debug option to enable a backtrace when no ;; The problem occurs (set debug-on-error t) ;; Updates to Emacs Load Path to Include Paths; JDE and its package require this code;; That you h

SQLite ADO .NET: how to specify a default value for GUID? -

As I searched earlier, the SQLieParameter (parametrized query) should not be used for "create tables" Could. I need to create a table with the GUID field and I should have a default value of all zeros. But the following questions: prepare a table test (the name text defaults to 'no name', id good default 0) creates a table In which adding items and reading it does not read a GUID again (SQLiteDataReader.GetGuid () raises exceptions). Perhaps nobody knows how to properly define a default GUID value for "Create a table" in SQLite ADO .NET? One of these things can work: Text default 'no name', id Good default ('00000000-0000-0000-0000-000000000000')) Create a table test (name text defaults' no name ', id guid default (' { 00000000-0000-0000-0000-000000000000} '))

php - How to determine UTC offset from server timezone? -

I have found a lot of examples of UTC tables and PHP methods, to change it, but I just get it After going to remember an easy way to change the server date, a user on my web page in the timezone selection. On this page I have found a clear guide to understand the boundary, but I do not know how to join the example "Europe / Rome" on the table, if there is more about it is clear? I know the time zone of my server (America / Chicago) but I still do not know one way to change it from the UTC method, that the user is different time zone (eg I tried something, but I am missing something, and I do not know what it is: & Lt ;? Php $ timezone = date ("e"); $ Date = date ('Y-M-DH: I: S'); Print $ date "- This is my server's date, and its timezone is - $ timezone There is no way to convert UTC timezone to Europe / Rome from -13? In all cases, like Europe / Rome is -13 or only because my server is US / UTC can be used to generate the dat

How many Pseudo-classes are there in CSS? -

सीएसएस में कितने छद्म वर्ग हैं? वे क्या हैं? एस मैं ज्यादातर का उपयोग करते हैं:: मंडराना: सक्रिय लेकिन: इससे पहले: बाद और: पहला बच्चा भी उपयोगी होता है।

Best practices when generating XML web services data for PHP -

I am currently using Fusioncharts in my project, for which XML should be in a specific format, data display I have a PHP file named webservice.php that has many similar iterations below: $ address = $ _SERVER [ 'PHP_SELF']; ... if ($ address == 'webService.php / fcf / last5pricechanges /') // // To query the MySQL db and export string in the browser to output the output variable to at least every line of XML Line output by line} Outputed XML can look like this: & Lt; Set name = "abc.com" value = "5" /> & Lt; / Graph & gt; This is a maintenance nightmare to update this code, however afaik is that it will not be possible to transfer data using standard format - as in the rest of the form, Fusionerts require specific XML properties. Are there better ways to handle the above? Can I easily improve the humility and maintenance of my code? I have some ideas that you can think of. # 1 Using a template engine, like

dynamic language runtime - IronPython compile-time checks against CLR libraries? -

I know that IronPython is a dynamically typed language, so I'm asking that it sounds too stupid Is it possible to have an IronPython script to ensure that this change in the context of CLR libraries will not result in runtime errors when the script is executed? The reason I ask is that I have written a library referenced by IronPathon scripts, and I want to know if I broke the interface used by IronPhon scripts while changing the C # library. Have given. While compiling code and compiling errors, it is easy to do it with other C # projects, but when IronPython compiles the script it does not seem to work. Any thoughts? No, your IronPathon code has not been broken in exchange for the interface; There is no way to verify from This is the nature of dynamic languages, such errors are presented on respectively

documentation - What are effective strategies for documenting a large legacy .Net platform as the main developer just quit? -

There is a limited understanding available in the remaining limited junior developers. Please share your strategies. 1) If you still have access to a senior developer, then ask him a document that is available for the system. Provides a high level map, so that you can know which classes work with which class, and which parts of the app are responsible for the functionality in the system. This will give you time to understand how the whole thing should work together. 2) I have heard some time ago that a person's comment is only valid "do not change it" in that sense, ask the senior god in the list of all "sensitive" pieces of the system, and tell why they are sensitive Are / pay attention to You want to know what you can change without worrying, and which places are my area. 3) On system unit testing, if this unit has not been tested yet, a great way to make documentation and understand how things actually work.

language agnostic - How to find the mathematical function defining a bezier curve -

I'm trying to implement a bezier curve and line segment transfer test. The closest thing in my search is to carry the mathematical function curve and keep it on the origin to carry the Bezier curve (to limit three control points for simplicity). Then, use the line segment's function as another function and give them equilibrium values ​​and solve the equation. The solution above from many sources (unless they misunderstood), my problem is that I can find a way Oh, and please indicate that if I intersect I am completely away from the track to find the point (signs). A beijier curve is a parametric function. Can be expressed as a quadratic beijier curve (i.e. three control points): f (t) = a (1 - t) ^ 2 + 2b (1 - t) t + whistle ^ 2 where a , b and c are digits and t goes from zero to one. This will give you two equations: x = a (1 - t) ^ 2 + 2b (1 - t) t + whistle ^ 2 y = kx + x = y = d (1 - t) ^ 2 + 2e (1 - t) t + Ft ^ 2 M ), you have three equ

Linq to Sql case insensitive equality -

I'm reading contradictory explanations from Linq on Sql string comparisons. When I do the following: / P> from d in p People where p.UserName = Select username P user name = "Johan" I'm right, the case is insensitive, whether Linq is doing it by default or Is this happening in the SQL database? I think you get conflicting results, indicates your db variable points and Where the comparison is actually executed. If it can, linq will generate the query and send it to the SQL Server. It seems that you can make the case insensitive by calling where p.UserName.ToLower () = username ToLower ()

objective c - Is there a delegate method that gets called when the user pressed "Retake" on the iPhone? -

I have a UIImagePickerController subclass, and I want to know that the user will press the "re" button. Is it possible ... What is the representative method called? I looked at the docs but I could not find anything: Edit: I accept the answer, though it needs to be built in OS 3.1 < / Div> You can delete default control with it: picker.showsCameraControls = NO; And implement a camera overlay with your own retry button, which again calls the Picture function to take over the UIImagePickerController.

Are there any lightweight ASP.NET MVC-based frameworks supporting OpenID? -

I am looking for a lightweight framework that will allow me to exclude an MVC CRRoad website very quickly, and I need it to support OpenID. Is there anything like this? According to this link DotNetOpenAuth which I will give first. Any good idea is that you can start a new web site that accepts OpenID and InfoCard immediately. Welcome ... Update: This template seems to be for webform only ...: (

c# - Combine native DLL and assembly into a single DLL -

I am currently programming in C ++ and C #. Using the original C ++ for the numerical computing part. Originally, I wanted to use C ++ / CLI to create a cover in basic C ++ classes, but I think it would be the result of a 2 to 4 times downturn. So I decided to compile my original C + + in DLL and called by .NET / C #. I will crunch the data in C # and preprocessing the number in the native DLL. The problem is that when I distribute others to use my work, then I should have a single DLL. Is this possible? BTW, I have all the source code for the original C ++. You can mix languages ​​in the same assembly .NET but not naturally << p> I keep the assemblies different from different languages.

How to determine if a PHP file is loaded via cron/command line -

I need to determine whether the code is being loaded into the code via the cron or command line or No. How can I do this? If you have control over the cron or command, the command line argument, and it $ _ SERVER ['argv'] [0] ? Reading script with * * * * * / usr / bin / php / path: & lt ;? Php if (- ($ _ SERVER ['argv'] [0] / / / script - cron ) and $ _SERVER ['argv'] [0] == ' -Cron ') $ I_AM_CRON = True; And $ I_AM_CRON = false;

Recommendation for C++ wrapper for cross platform in-process dynamic library bindings (i.e. a lightweight, high performance COM or CORBA) -

We are developing an application that will have a plug-in "architecture" Ownership algorithm (We will basically take a set of parsers and allow third parties to provide them with themselves) Domain space requires a lot of performance, so out-of-process Binding is not going to work and we 'force That leave heavy things such as Corba and COM. In fact, we are searching for a simple cross-platform cover: Load Library with a relative path some configuration / name < Provide mapping of special DLL Make some initializations and check the library to make sure it provides the necessary functionality I think that this is actually just a loading wraplibrary () and method call export. We can write it ourselves, but we want to use the existing code because there is enough in our plate. Again, throughput and performance are very important There are similar questions: - It is very close, but we only want in-process There is no need to be out of the process and

php - Why Aren't the _construct() Methods on EAV Resources and Collections Declared as Abstract Methods? -

I'm poking around the intestines of the Magento system code. For "regular" model resources, Magento's _construct initialization conference has been declared an intangible file: grain / core / model / resource / abstract.fof abstract Protected function _ composition (); This makes sense, because it compels developers to create their own model resources, which is necessary to call the composition, which makes the necessary initialization. However, the same conference / requirement exists for EAV model resources and their collections, but the _construct method not in those hierarchies is any Do you know the logic behind this? In such cases, do you need the _construct method on these models? Or is it a historical backward compatibility thing? It has been left for backward compatibility issues;) < / Html>

batch echo pipe symbol causing unexpected behaviour -

I have a variable in my batch file and there is a pipe symbol in it (this one: |) so when I variable my an unknown Receives an error about the internal / external command. I want a way to fix it properly or properly and symbols besides any additional spaces. There are many special characters, which should usually be saved in Windows batch files, here is a partial list Is: & lt; & Gt; & Amp; | ^% Escape character is ^ . So a literal | To get , you should do this: echo ^ | When special characters are in a variable, it becomes a little harder. But if you use special syntax, then you can replace the characters in a variable like this: set x = a ^ | B Reem to replace pipe character with underscore set Y =% X: | = _% Counter% Y% REM print "A_B"

How to determine next tabstop in VBA UserForm? -

I have a YouTube form in which there are some text box entry fields which are enabled / disabled by a checkbox I when a checkbox Is clicked to check, I want to move the focus to the now-enabled text box. The tab box tab option has the next control after the checkbox, so it seems that tab order will be a good idea to find the appropriate text box. But ... how can I get more control in the tab order after given control? Is there a way to do this, or do I have to calculate the all controls and figure out for yourself? I appreciate that it comes under the title of "telling all the controls", but it Very simple and I attach the code for perfection: Private sub-checkbox 1_kick () DM CTL as the control for each CTL I.Controls as if ctl.TabIndex = Me.ActiveControl.TabIndex + 1 then exit for ctl.SetFocus end if the next ending sub

css - Inserting wider banner than div -

Our designer has created a new banner for a site that is (deliberately) more comprehensive than the previous one, what some CSS magic Does it allow me to put new ones on both sides without planting and making it without putting it in place of the old (concentrated)? Thanks Use negative margins: .wide-banner {margin-left: -50px; } You may also need to use negative right margins based on other content of your page.

iphone - FBDialog cancel button callback -

When a user hits the cancel button in FBStreamDialog, which comes out of FBDialog, then I have trouble paying attention to that When the user clicks the Publish button, it seems that the callback FBDialog is dismissed; the little thing is always passed with the situation: whatever the button is clicked, what am I doing wrong? Thanks! Here is a class that handles all the FBCNact in my app: @interface socialmediaviewcanner: UIViewController & lt; FBSessionDelegate, FBRexestDelegate, FBDialogDelegate & gt; {... In this way I am logging in. FBLoginDialog * dialog = [[[FBLoginDialog alloc] initWithSession: self.fbSession] autorelease]; Dialog.delegate = self; [Dialog show]; Here I have instituted the FBstream Dialogue. FBStreamDialog * dialog = [[[FBstream dialog] alloc] init]; Dialog.delegate = self; Dialog.userMessagePrompt = @ "Enter additional comment:"; Dialog.attachment = [NSString stringWithFormat: @ "{\" name \ ": \" My name

c++ - Sharing object by reference or pointer -

Say I have a type of A that contains the initialize () method. The method receives object B, which is kept as an object data member. The B object is shared between many objects, thus A must have the originally received B object and not its copy. class A {public: bool initialize (b? B); Private: B ?? M_B; } object B should be present. Thus, I feel that in order to pass it by reference, instead of going through the indicator, and in the case of failure initially, B is in the tap. The only type of orderer for the MB is the type of B (it can not be referenced to B because the intializating of B is not done in AC-torb). Here's how to get started: bool A :: start (B & B) {m_B = & amp; Amp; B; ....} Is this aproach okay? UPD: The code is not new and I'm just trying to "fix" some problems. Indeed, I am not talking about some concrete A and B classes, rather than solving the problem in my code base, the code extends widely to B at the pointers

Classic ASP: How to write unicode string data in classic ASP? -

How can I show a nostalgic column that stores unicode data in a classic ASP web page (with zawgyi1 font Has been recorded)? When I get the value on the page and write it, then this "???" Shows I set the contents of the UTF-8 content of my ASP page with the following meta tags: & lt; Meta http-equiv = "content-type" content = "text / html; charset = UTF-8" & gt; Unfortunately, the text still "?????" Has been provided as. Any suggestions or ideas on how to display unicode values ​​in the classic ASP page? What about your codepage definition at the top of your page? & lt;% @ LANGUAGE = "VBSCRIPT" code = "65001"%>

api - Facebook Connect - Authentication and Security -

I would like to develop an external website using Facebook Connect instead of one's own login and registration process. First: Please do not respond to "View Document on Facebook Documentation". I have read all the pages, I think that many times. But I could not find any answer. I use this code for my login button: & lt; Fb: login-button v = "2" size = "large" autologoutlink = "false" onlogin = "window.location = '/ index.php'" & gt; Connect with Facebook & lt; / Fb: login-button & gt; I use to show the name of the current user: & lt; Fb: name uid = "loggedinuser" link = "true" firstnameonly = "false" rights = "wrong" useyou = "false" ifcantsee = "facebook-user" & gt; & Lt; / Fb: name & gt; And in the end, for logout, I use the following link: & lt; A href = "#" onclick = "javascript: fb.conne

java - Cannot set mnemonic in JLabel with HTML text -

The following associates set a JLabel and a memorable one with JTextArea, which punishes the label by pressing Alt-X on Windows Takes focus to JTextArea. JTextArea textArea = new JTextArea (10, 20); Jlab label = new jlabel ("text"); Label.setLabelFor (text field); Label.setDisplayedMnemonic (KeyEvent.VK_X); However, if the label uses HTML, the label is displayed as expected, but it is not decorated with memnic. JTextArea textArea = new JTextArea (); Jlab label label = new jlabel (" text "); // !!! No decoration label. Catalabelför (Textaria); Label.setDisplayedMnemonic (KeyEvent.VK_X); Is this expected behavior? Edit 1 : Modifies the example to use inhuman, which is not part of the HTML tag based on Aziz's answer. Edit 2 : Further experiments indicate that since the use of this look and fail, the key is not working. Basic labelUII takes different colors on the label, depending on whether it gets HTML or not. If not, Basic LabellUI h

haskell - How Functional language are different from the language implementation point of view -

There is a whole new paradigm of "functional programming", which requires a total change of thought patterns compared to procedural programming. It uses high order function, purity, monad, etc., which generally do not see compulsory and object-oriented languages. My question is that for these languages, implementation , for example, internal management such as memory management or pointers etc. Functional languages ​​that run on the top of the JVM does it mean that these languages ​​internally work on JVM as other languages? Implementation of functional programming languages ​​are using a wide range of implementation techniques in implementing a scheme Excellent introduction (a Lisp bid) gives this book: By Christian Quinneck.

compiler construction - Can gcc on Ubuntu on a 64-bit machine generate an executable where long is 32-bits? -

In other words, is this data-model LLP64 possible in this environment? Please note that my pointers should be 64-bit. It seems that this is possible (at least for AMD) -m32 -m64 Generate code for a 32-bit or 64-bit environment 32-bit environment sets int, lengthy and pointer to 32 bits and creates code Runs on i386 system. The 64-bit environment sets 32 beats and longer and pointers to 64 bits and generates code for AMD's x86-64 architecture.

Can I rollback Dynamic SQL in SQL Server / TSQL -

Can I run a dynamic SQL in the transaction and roll back using EXEC: exec (select 'from the table; select from * to tablebie;'); Place this in a transaction and use the @@ error after the Adam statement to rollback. For example. Code BEGIN transfer execution (select 'from * to table; select * to tableb';); IF @@ ERROR! = 0 ROLAB Returning Returns and ELSC Commit Transaction If there is a dynamic SQL statement and there is an error in N / 2 then the first 1 ((n / 2) - 1) statement roll back Questions about the first answer @@ will not take the error error most likely, which means that it can not be possible error, which means Can there be any transaction? TRY / CATCH in SQL Server 2005+ Yes I am using SQL Server 2005 but have not tried to catch before using BEGIN Start the transcription (select from 'exec; from the table; select;' tableb; ';); Command Transfer End Catch Rollback Transaction End Cache Or I should look at some other i

asp.net - User Control ViewState/State Help needed -

I need help with this code to work better, at present, what happens when it reloads I am opening the third value which is the calculation value. I want to reload my values ​​without losing the value of each property and reloading each instance of user control on the page. Thanks in advance Personal _Length double = 0.0 Public property length (double) then get it (Me.ViewState ("calcLength") isnot nothing) In the form of the return CTYPE ("CalcLength") = View TateLength.Text = value.ToString () _Length = value Double Double as Private _Width = 0.0 Public Property Width () as End End End Property ( Me.ViewState ("calcwidth") isnot is nothing) Then return CTYPE (Me.ViewState ("calcwidth"), double) Finish return _Width End Set (ByVal get double as Me.ViewState (" Calcwidth ") = m Ly Me.txtwidth.Text = value.ToString () _Width = Value End Set End Property Private _calculatedboardfeet double = 0.0 Public Property CalculateBoardFeet (

ruby - sudo rake with parameters -

है: sudo rake install - --with-mysql-dir = / Usr / local / mysql / एक वैध टर्मिनल कमांड है? मैं इसे चलाने की कोशिश करता हूं लेकिन इसे सही ढंग से चर में नहीं दिखता .. हालांकि ऐसा कुछ ठीक काम करता है: sudo gem install do_mysql - - -वि-मायसाइक्ल-डीआईआर = / यूएसआर / लोकल / माइस्किल / आप क्या हैं उस राक स्थापित आदेश के साथ पूरा करने की कोशिश कर रहा है? रेक एक स्क्रिप्टिंग उपयोगिता है, जो इसे अगले उपलब्ध "रैकेफाइल" से कार्य खींचती है, जिसे वर्तमान और सभी पूर्ववर्ती निर्देशिकाओं में देखा जा रहा है। यदि आप इसे काम करना चाहते हैं तो आपको "इंस्टॉल" कार्य की आवश्यकता होती है जो तर्क (ARGV- सरणी में रूबी में संग्रहीत) संसाधित होती है

Simple C# "new" question - syntax related -

I'm just curious how to create a new object in the command (to save space and to learn it at all) To combine commands together and on the additional line, the picture box is not ABC = new image box, like this: this.Form.Controls.Add (new Picturebox ABC) // something like that? Thanks for the help You have to instantize the object and Another object that must pass in form For example, you will write it in the code of 2 lines Picturebox.TEST myPictureBox = new Picturebox.TEST (); Form.Controls.Add (myPictureBox); You are simply passing the object in the form of the form. Control. Add. So to do this in line 1 ... Form.Controls.Add (New Picturebox.TEST ()); The first example is more readable and also gives you permission to use the myPictureBox instance in that method block.

actionscript 3 - From Rectangle into trapezoid -

How do I change reptangle in trichozoide with action script 3? My Trapezoid 3D Rooms Has a floor, and I want to texturize it (bitmap tile). _____________ | | | | | | _____ | | | / \ | | / Tripage \ | | / __________ \ | It depends on how you represent "rectangle" in your program goes. Some options: If your rectangle is vector, and you have access to anchor point: ---> O ------ o & lt; --- | | | | O ------ o becomes: o - o / o / o ------ o Simply translate the two top points and summarize them for each other. If that 'rectangle' is actually a DisplayObject , you will need to 'stitch' the same DisplayObject to create a new display. Examples of what you want with code. Another option is to use - which is using the above rendering method as the base. It is a bit difficult, but this is an option. You can use the displacement map as described. The code is AS2, but it should be quite simple for "port".

java - database connectivity? -

How to install SQL 2005 database connectivity with Java application I do not really know how to set the path for JDBC . Any help would be great. Download jdbc driver from You can either download Windows or Unix versions, it's not really what you use. If you select the Windows version, run the downloaded exe file; This will create a directory called Microsoft SQL Server 2005 JDBC Driver in that directory that you downloaded the file. Add the file Microsoft SQL Server 2005 JDBC driver \ sqljdbc_1.2 \ enu \ sqljdbc.jar to your classpath (either -cp option Java or, if you are using an application server by putting it in an appropriate server). Setting Your Connection In fact, the required information is as follows: Driver class name: com.microsoft.sqlserver.jdbc.SQLServerDriver < / Li> Connection URL: Jdbc: sqlserver: // [serverName [\ instanceName] [: portNumber]] [; Property = value [; Property = value]] More information and / or help direct

unit testing - Why do my Perl module tests fail when I run them with Test::Harness::runtests? -

I have a test script for a module when test scripts themselves run, it works as expected We need to run several tests, so I have created a file that runs all the scripts. However, the script returns when executing with runtests . During debugging, I tried to run the script using Baitics and it worked because the Runtest command caused the errors The code of exploitation is very straightforward: (pearl) -w be tough; Use warnings; Test :: Use Use; My @Tests = ('test1.pl', 'test2.pl', 'test3.pl'); Runtests (@tests); Errors arising from a cpan module we use, The solution I am hoping for is a way to run without errors Output from the test: Test 1 .......... false [] in the range "\ w-" regex; Marked by row 20. Use the unrecognized value on string in /app/perl/lib/Pod/HtmlEasy/Parser.pm line 422, line 20. string in ne / app / perl / lib / pod / HtmlEasy / Parser.pm line 363, line 22. False [] range "\ w-" in regex; Marked by li

.net - Is Environment.TickCount affected by system time adjustments? -

how i nit bcl property environment Curious as tick is applied. Especially I would like it now if it is affected. My first estimate was how the property was implemented, it was just a managed cover all around. However, documents of the method indicate that this is affected by the adjustments made by the GetSystemTimeAdjustment function , but there is nothing mentioned about time adjustment in the documentation. I'm trying to find out what the environment is. Tick ​​can be used while increasing the value of time (though less accurate). "post-text" itemprop = "text"> No, system time adjustment is not affected by this was my interpretation of this documentation, but my curiosity demanded hard work, so I had the following code run by adjusting the system: while (true) {Console.WriteLine (Environment.TickCount); Thread.Sleep (1000); } ... and output showed a complete sequence which was not affected by time adjustment. Updates I did a few more

.net - C++/CLI performance gain -

I started with Plain C long ago, then moved to C ++ and now let me use C ++ / CLI As a waste of performance, I am always trying to squeeze the last drop of the code into every line of code. I am currently in a project that can be done mostly in VB.Net (simplicity, resource availability, etc.), but there are some points which are very sensitive and I want to make those parts in C ++ / CLI Was planning. However, only a small part of it can be taken from the managed code, while the rest should be managed. The question is whether there is a performance advantage to be expected by writing C ++ / CLI managed functions compared to C + or VB.Net? What can I understand from the document I was reading, the only advantage is that managed / unmanaged thumbing is light, is this a case? Because I can not seem to be able to store handles in unmanaged arrays or structures (which I can manipulate fast) such as: string ^ mystr = "Oh, my!"; Object ^ Mary [10]; Mirera [0] = Maestrate; //

caching - What proportion of users have the flex framework cached? -

We have a Flex application that currently does not use Flex Framework as an RSL, but we consider switching But we are not sure that the ratio of users will already be cached to the framework. There is an additional complexity in that we are also using data visualization components, and we may have a choice of the framework we use, any information is greatly appreciated. - I tried searching, no use Adobe does not have any number published on it. Sorry. But I firmly recommend using Framework and Data Visualization RSL. Version 3.3 will be a good option. :)

html - How to resize the font inaccordance with the div size....? -

If the name is like "David" then it comes within the allocated space .... but if its name is "John Pal Abham D'Souza "Allocated space automatically increases .. So I need to name the space allocated by the resizing of the font. Give me a solution. You can use jQuery to check the length of the string and the appropriate fone Can estimate in t-size, examine the rendered width and then adjust it again if necessary. As stated above, Kieran, this will not be a stupid proof - if a name is too long then the font size will actually be smaller. Also, if there is no space in the long run, then read the text Although it will not wrap lines, it is a case of edge.

iphone - setPropertiesToFetch doesn't seem to have any effect -

I am trying to use setPropertiesToFetch in my Fitch request to limit data received from my store, but It seems that there is no effect when I use it and display the returned item in the console, then I can see that all my properties are displayed in the same data whether I set the property or not In the form of relationship defects , But there is data for all the features. NSFetchRequest * fetchRequest = [[NSFetchRequest alloc] init]; NSEntityDescription * entity = [NSEntityDescription EntityForName: @ Managed object contexts in "Entity": context]; NSDictionary * entityProperties = [by unit properties]; [FetchRequest Set Entity: Entity]; [FetchRequest set FetchBatchSize: 20]; [FetchRequest set is included in the display: no]; [FetchRequestSetNone ObjectsAstust: No]; [FetchRequest setPropertiesToFetch: [NSArray arrayWithObjects: [Entityproperties ObjectForky: @ "MyAttrib"], Zero]]; Fetch withdraws the same data with every object or without the last line. an

.net - C# Resized images have black borders -

Image
I have problems with image scaling in .NET. I use the standard graphics type to resize images like this example: Public static image scale (Image source image, int specific, int die heath) {bitmap tueran = new Bitmap (source image, destvuth, dead high); ToReturn.SetResolution (Source Image. HorizontalResolution, Source Image. Vertical Ringtones); (Graphics Graphics = Graphics Frameworks (ToReturn)) (Graphics CompositingQuality = System Drawings Drawing 2D Compositing Properties High Quality Graphics ShoeingMode System Drawing Drawing 2D Softking Mode High Quality ; Graphics Interpolation mode = Interpolation mode.Hyquive bibbic; Graphics Draw image (Source image, 0, 0, Distribute, Dest Hei );} Return to return;} But I have a big problem with the pictures resized: They have brown and black borders and without them the images are extremely It is necessary. Why do they appear and what can I do to make them disappear? Sample output: Try: graphic.CompositingMode =

Recommended Multithreading books in .Net / C#? -

Is there any book written for a book that works with multitudinous? I have seen the books of Joe Duffy and Joseph Albahari, and they are good. I was hoping that there is anything that touches on Pelicius and TPL, which certainly does Duffy's book, but many examples and snippets of it In C ++ I was ideally looking for some more C # oriented things. Thank you for your suggestions. has not been released yet, but you can use the online manuscript for PLINQ / TPL Includes libraries.

c# - How can I populate data from an Excel worksheet to grid? -

I am working on an application where I want to get an email ID from Excel sheet and send an email to each ID . I have tried to display an email ID in a grid as a test. My application is not throwing any errors, but it is not implementing it in the required way. Does anyone help to understand why this is happening? Take a look at this code, which adds Excel to a gridview: This can provide you with a neutral test with a tapping. Without your code and spreadsheets it is difficult to say what is the problem.

c - Mac application hangs on ReadPipe from USB device -

I took the / developer / example / IOKit / usb / USBSimple example and modified it so that it In fact, the device transfers some data (and hopefully soon). Here is my transfer data function (commented): zero transfer data (IOUSBInterfaceInterface245 ** intf, UInt8 inPipeRef, UInt8 pipe out) {Ioreturn error; CFRunLoopSourceRef cfSource; Err = (* intf) - & gt; CreateInterfaceAsyncEventSource (intf, and cfSource); If (error) {printf ("Transfer data: unable to create event source, err =% 08x \ n", mistake); Return; } // I need to send the tool out to Buf [0] = 0; Output [1] = 0; Output [2] = 0x18; [... kikot ...] // works the following, although I have no confirmation that the data actually comes to the device but after error 0 is err = (* intf) -> gt; ; Rickshaw pipes (intf, outPipeRef, outbuff, 64); If (mistake) {printf ("Transfer Data: TypePipFell, Error =% 08x \ n", mistake); Return; } UInt32 numBytesRead; NumBytesRead = Size (inBuf); // Until I ha

file io - Python IO Gurus: what are the differences between these two methods? -

I have two ways to write binary files: First work with the data received by the server corresponding to the file upload (i.e., a form whose enctype = "multipurpose / form-data"), and as an email attachment Dealt with the other data that is sent (ie, file data received by using the get_payload) parsing the main part of an email message message. The strange thing is, they are not interchangeable: if I use the first one to save data parsed from email attachment, then it fails; Similarly, the second function fails to handle uploaded file data. What are the important differences? This is the first method: def write_binary_file (folder, file name, f, chunk_size = 4096): "" "" result = false if confirm_folder (folder) " Write f file data for folder and file name combination: Try: file_obj = open (os.path.join (folder, file_base_name (name of file)), 'west bengal', chunk_size) read_buffer file_chunk (ch, chunk_size ): File_obj.write (file_ch

javascript - eclipse E4\eclipse 3.6 debuging java script with rhino -

I'm interested in this forum or provide some platforms thinks something that I really find interesting, like Gano Debug Javascript with Unfortunately (but hopefully) I can not find any content about this forum (if I'm successful, I would love to share knowledge) Thanks A web forum, which is actually the only newsgroup (news : //news.eclipse.org/eclipse.e4) is a front end. There is also one here.

php multi-dimensional array remove duplicate -

Ensure that there is a duplicate in the need to delete this question, but I can not find the answer elsewhere so I I have a 2D array that looks as follows: Array ([0] => Array ([0] => Dave [1] = & Jones [2] => c @ bc) [1] => Hey ([0] => John [1] => Jones [2] => A @ BC) [2] = & gt; Array ([0] => Bruce [1] = & gt; Finkle [2] => c @ bc)) I want Remove people with duplicate emails, therefore sub In Okt example I will take just [] [0] or [] [2]. I do not have to worry about checking names or something like that, I just need a DPD depip based on the same value. At the moment I have something like this if (is_array ($ array) & count ($ array)> 0) {foreach ($ subarray $ Array as] {$ duplicate email [$ subarray [2]] = isset ($ duplicate email [$ subarray [2]]); Not set ($ duplicateEmail [$ subarray [2]]); }} But this is not correct. Any help appreciated. A quick solution that uses the specification of the array index: <

perl - Moose ArrayRef attribute returned as an Array -

I have a feature that is an array (for read only) and internally manipulates objects. But when an accelerator calls the method, I want it to not return an array (or list). It will not only deduct the amount of the difference that the user of the class has to do, but this would mean that they can not mistakenly tamper with the same referee who is using my object. So what is the best way to do this? For some kind of extortion? Usage and delegation, such as handles => {My_array = & gt; 'Elements'} (via doy on #moose) A code in auto_deref is an undesirable behavior if you Caller scalar reference in the accelerator.

jQuery set value only if empty -

I am using a model to set a default value for a series of text box fields. However, I only want to set the field in the default value if a value does not already exist. Is there a way to do this with a jQuery selector? Current Code var fooVal = $ ('# cboxLoadedContent'). ('#SetFoo') Val () .; Var barVal = $ ('# cboxLoadedContent'). ('# Setbar'). Val (); $ ('.foo') val (fooVal) $ ('Bar') bar (BarVal). $ (".foo [value = '']"). Valve (fooVal); Edit: As Jonathan is described by you if you are using more than text input for this, then you need to be a bit more advanced ... especially the selection tag , But also checkboxes, radios and taxresus

javascript - Get the response headers with prototype.js -

Ajax.Request का उपयोग किए बिना प्रोटोटाइपज के साथ पृष्ठ के प्रतिक्रिया शीर्षकों को निकालने का एक आसान तरीका है < कोड>? आप वर्तमान दस्तावेज के लिए नहीं कर सकते हैं (अर्थात, जिसमें एक क्रियान्वयन जावास्क्रिप्ट कोड संदर्भित किया गया था)। देख । इसके लिए आपका क्या उपयोग है? हो सकता है कि पूरा करने के लिए आपको क्या करने की ज़रूरत है।

Regenerate a git repository -

Is there an order that automatically reboots a GIT repository? and update the files that are manually created or updated in my file system (such as adding git.), But also that I manually deleted from the repository from the app in my file system Automatically delete files (such as git add_or_delete.) I am taking a test to try a new GIT init, but I have not noticed this yet, if this is an unexpected side effect. For troubleshooting purposes, I need not only to command my file system to scan, but to actually make the repository again from the version of the app in my file system. Order for If I distinguish your question correctly: git commit -a Only all will replace the changed and deleted files, you will have to specify git add for new files. Like this: git add git commit -m "new structure" -a moves.

How do you make maps in Flash CS4 and then use them in iPhone games? -

I was watching a video showing a NGM Rolando 2 level designer. He used Flash CS4 to create the map. Would anyone know how would I go about doing this? Just you should know, I am an intermediate programmer, I know Java and Objective-C both very well. I do not know what I am saying is true or not, but hopefully my input will be useful: It can only be that The level used in Rolando is only vector graphic images and designers which you have seen in the video. Like Flash CS4 as Sector Editor? Then, I can be wrong here. It is also possible that the game has some code that decodes flash files in some way usable levels - assuming that Apple has their "no interpreter" rules. My final thought, which will be the least likely in my opinion, is that the game can be a flash game compiled to run on the iPhone using Adobe's Beta Flash-Iphone SDK is. I say this would be the least possible because I believe NGMOO has not used this method in their previous game and I do n

sorting - JQuery Help Needed for ID order given N Rows -

I am trying to add a function when a user clicks on "remove", < Update Update the optional color scheme I need help with it: I am able to update the number line but it is currently up to date for all the rows, even if there is nothing. Can anyone show me how to do this for the populated rows only? For example, when there is no data in the given row, stop it Some arguments for updating all the IDs for any row in my argument is wrong I'm trying to change the number at the end of the ID name (for example, "numRow11", with the same line number) $ ('# files_list tr'). Each (function (index) {// update number order $ (this) .find ("td: first"). Text (index + 1tr ('id', $ (this) .attr ('id') Replace ($ (This) .attr ('id') match (/ [(index% 2 == 0) $ (this) .removeClass (). AddClass ('even'); and $ (this) .removeClass () AddClass ('weird');}); Pause when a line doesn 'is the da

Cross platform c++ with libcurl -

I am a Pearl developer who never went to things in client-side programming I would like to think that I I'm a very good developer, except I know that the way I have a serious lack of knowledge about desktop programming, it really gets away from my reliability. He said, I really want to work in some desktop applications. I want to try to develop a simple application that will connect to my server and catch the RSS feed, then display it in the console. My plan of attack is to use libcurl (and curl) to capture the feed (I would like to have more curl content in the future) but I want to be able to run this small program on Linux, Window and Mac because I cross I want to understand the development of the platform. So here's the question (and I know it's very noobish): How do I write C ++ code which will use libcurl and curl, and will work on 3 key OS? The main thing is not to understand that I have to compile libcurl and curl, so how does it take it to other platfor

asp.net - Time Stamp in DBML is solving concurrency issues...why? -

We use LINQ our ASP to run the database. Questions and commands We have been having unified problems on the updates of tables in which we update the value of a date area, especially if two users click on a button at the exact same time and If the code tries to update a date field in the database, then the underlying optimistic concurrency fails to do its job and throws users an A Dispute If we go to dbml and set the field's time stamp to the right property and run the unit tests then this is a strange part. Just works fine ... no clear locks are needed We would like to understand it a bit more before implementing it in the whole system. Does anybody understand why it works? Without knowing the details of my system, I suppose that because the SQL Server DATETIME resolution 3 is the most Good MS, giving a high likelihood of conflict. TIMESTAMP is a counter in desquise and can not fight.

iphone - How to detect & avoid the use of private APIs in third party libraries -

Now when Apple is running a steady analysis of some kind of automatic analysis of the private API usage, many people are caught Because I use the other third-party libraries (which I compile myself from the code) of the three libraries and before I submit it to Apple to automatically audit it for automatic API usage, so I want to remove those parts Obtain / write again I can /. If I run nm on my application executable, I get a list of symbols, and I see the symbols in there which I do not use. For example, I am looking at _AudioServicesPlaySystemSound, and if I search for "AudioServicesPlaySystemSound" in XCode, I do not get any results. For example, I have a notice that Apple has a habit of giving names with initial underscores. Although However, if I deliberately add a private API to the call, I do not see it in the output of nm , but if I have strings on the binary < Based on this code, I have an idea that all the private API calls were to be compiled in a h

c# - How is the DataGridViewCell.FormattedValue updated? -

I have control which is expanded by DataGridView control I override the ProcessDialyKey event and throwing it and organizing my own I am able to respond to the Container form cell as a user type. The problem I am aware of is that when I am editing the "CellEditCision" from within the ProcessDialogKey method of DataGridView, the value of the cell I have been edited has not been updated yet. So, as the user type 'A', my CellEditKeyPress event starts to fire, but when I get the value cell, that value is still an empty string. The user can then type 'B', I can get the value 'A', and similarly. My event is always behind a keyboard effectively. For example, this is some code: Public class MyDataGridView: DataGridView {Public Representative Zero CellEditKeyPressHandler (Key Data, DataGridViewCell currentCell); Public Event CellEditKeyPressHandler CellEditKeyPress; Protected Override Bull Process System (Keyage Data) {If (CellEditCision! = Faucet)

Part II: How to make Ruby AES-256-CBC and PHP MCRYPT_RIJNDAEL_128 play well together -

This question is the continuation of my previous one, in this regard I have to work now, but I still go to the other direction I'm struggling for. PHP Generate cryptograph contains all the information that was provided, but I could get the ruby ​​code decrypt without any errors. Here's the PHP code I'm using to generate cryptogs: $ cleartext = "Who's a smart boy?"; $ Key = base64_decode ("6sEwMG / aKdBk5Fa2rR6vVw == \ n"); $ Iv = base64_decode ("vCkaypm5tPmtP3TF7aWrug =="); $ Cryptogram = encrypt_encript (MCRYPT_RIJNDAEL_128, $ key, $ clarext, acrypttmddcc, $ iv); $ Result = base64_encode ($ cryptogram); Print "\ n '$ Result' \ n"; RESULT 'JM0OxMINPTnF1vwXdI3XdKI0KlVx210CvpJllFja + GM =' Then there is an attempt to decrypt the Ruby: & gt; & Gt; Cipher = openSSL :: cipher :: cipher Enve ('AES-128-CBC') & gt; & Gt; Cipher.key = base 64decode 64 ("6sEwMG / aKdBk5Fa2rR6vVw ==

html - How to resolve 500 Internal Server Error? -

I am receiving a "500 internal server error" when I used to call AJAX calls What is the reason for this problem? How to solve it? Fixing server error with debugging, fixing, and an Ajax call absolutely < / Li> Introduce Debug Also It can be useful around the serverside code statement, where the error (and add a little bit of your AJAX request to dump all the responses in plain text) Firebug for Firefox also shares the AJAX call Being sent as There is a useful diagnostic tool for testing, which is to copy the URLs and quickstars used in Ajax calls and paste them into your browser. And what is being sent back as feedback.

c# - Preventing color bleeding with StateImageList on TreeView -

Image
Is there any color bleeding while using State ImageList with a Windows Farm Tree Weave? Using the same image list assigned to TreeView's ImageList property, the correct rendering can be seen by the following image. leaving state images Given that normal images are correct, all images are obtained from the same imagelist example. Update: I converted the images into 16 color indexed palettes. It does not seem that it is either slightly better, but still not acceptable. The document at .cd.php .stateImageList states: .NET Framework version 1.1 or later, the default depth 8 Bit is It seems that this 'default' change is not allowed. Okay, you can change this, but it does not do any good work. Considering the code in the reflector, when the state imagery property of TreeView is set, a new image list is created internally, this image list uses the default value for color depth and Since you can not change the color depth after making the imaginativ

I installed Eclipse IMP, eclipse ide can't open -

I have installed the project on eclipse, when I restart the eclipse, ops ..... # # SIGSEGV (0xb), PID = 13303, TID = +302090560 # # JRE version:> # # A critical error has been detected by the Java Runtime Environment 6.0_16- B01 # Java VM: Java Hotspot (TM) client VM (14.2-B01 mixed mode, sharing Linux x86) # Problematic frame: # /opt/DEVELOPMENT/eclipse-galileo-SR1/hs_err_pid13303.log: #c0000000000 #If you want to submit a bug report, please see: # http://java.sun.com/webapps/bugreport/crash.jsp # # # # # # # # # # # # # # # Report the bug to report bugs. # Revoke --------------- System Details --------------- < P> IDE: 5.0 uname :: Linux 2.6.28-17-Generic # 58 Ubuntu SMP Tuesday December 1 18:57:07 UTC 2009 i686 libc Ganymede OS Eclipse: Glibc 2.9 NPTL 2.9 rlimit: Stack 8192k, core 0 thousand, NPROC infinity, NOFILE 1024, as infinite load average: 1.28 1.18 1.14 CPU: Total 2 (2 cores per CPU, 1 thread per core ) Family 6 models 23 step 10, cmov, cx8, fxsr, MMX

multithreading - Is there a better way to block a C# timer when interacting with the user? -

I am using the System.Windows.Forms.Timer component on the main form of an application Everybody checks for updates on the database, however, there are several possible interactions with the user, such as the modal dialog is being thrown for some tasks. In general, I do not want this timer if the user is "busy" or other database operation is active. My current approach clearly shows the bracket "sensitive" checkDatabaseTimer.Stop () / start () pair (always try / end start ) Is used to ensure). But it seems to me a nervousness: If any future code changes the code of this form, then it should be remembered to apply this stop / start bracket around any code, for example For this, the user is prompted for an input, so it seems easy to forget to do so. Is there a better way to deal with this? Or is it just something we should be aware of because multithreading is like running with a scissor, is not one of those things that you can just argue is easy and sa

database - Wrong Result after Refresh pressed on DbNavigator Delphi -

I have encountered a very strange situation here. I'm reaching the database through JAT (MDB) I use the user to access DBGrid and DBNewigator to access it. Dataset is created using the TADOQuery component, with the following query: SELECT *, (Date '', [Date of birth], now ())) [Age] This works fine but whenever I press the refresh button on DBNewigator, the results of this calculated field are incorrect. For example, if I have been shown 7 on the age column in general, then after refreshing I have 40149, 40149 in 701, 6 changes 40150, 0 to 40156 etc. To see the correct results, I have to open the query again. / P> Can anyone help you? Try the following, which will return the age of the day. Use for age in the year: SELECT *, CINT (now () - [Date of birth]) / P> SELECT *, INT ([now () - [Date of birth]) / 365.242199) As the name of the table (Note, CITT round , Not INT) The reason for this is that ACCESS stores its date / time in the same m