Posts

unit testing - Flex, Flexunit: How to test that an event is dispatched twice? -

I use FlexUnit's code to test for some events in the Flex app using the addAsync method. Testing that the incidents are transmitted so far, I can ensure that at least one incident has been removed. However, I want to be a bit more elaborate; I want to make sure that the set of incidents required by me is actually sent. Is there a useful test pattern (or even different test frameworks - I'm flexible!) To accomplish this? I tried this code, but it did not apply for a second time ResultPropertyChange Expected ResultPropertyChange (Events: Events, NumbersOfAvent: Int = 1): Zero {Trace ("Event" + Event + "" + Event + Target + "+" + + "Number OffIF Events "With" + "trail left ..."); AssertTrue (event.type == Response Chenzed Event.RESPONSE_CHANGED); if ( NumberOfAventis> 1) {event.target.addEventListener (Response Changed Event. REPNSE-Changed, Adesink (Expected Result Portrait Change, 1000, Number OFAVE-1))}} Public Fu...

oracleclient - Why do I get Oracle connection errors only in a VS 2008 web app/site project? -

Using Visual Studio 2008 on Vista 64bit, if I create a test web site or web application that looks like this Looks ... Public Partial Class _Default: System.Web.UI.Page {Secure Zero Page_load (Object Sender, EventArgs e) {OracleConnection Connection; Connection = New Oracle Connection ("User ID = User; Password = Usager; Data Source = Datasource;"); Connection.Open (); }} ... and to run it, I get the following error. ORA-12154: TNS: could not resolve the specified identifier identifier I am aware of this issue about parents ... Visual Studio 2008 is installed in program files (x86) but another god has only one setup and it works for him. The project itself is not in a directory with a name that has parents. I know that this is not my tnsnames.ora or my sqlnet.ora file. I am setting my machine in the same way that all the Gods who are working on this project. I also have 100% certain strings that I am using are correct. If I am creating a console applic...

c# - Object Syncronization Between Multiple Clients Algorithm -

Is not because to sort things as I sorted. To start I do not have to worry about the conflict because clients can only add to the object collection. But I am struggling to work in my head, how the clans interact, what things need to be transferred to each other. I think that has been done many times before, and should be of some type UPDATE: I think I'm asking if there is one way to sync the cycle through all the objects on each peer and check that they are present at the other end If you use INotifyPropertyChanged of serializable objects that implement ObservableCollection Objects can queue for objects because they change. If you have objects that require synchronization in a hashset , you can avoid double-entry in the queue at the expense of linear order. If you carefully override GetHashCode () , or gives a strong hash better way, you can filter the item that changes equally on both ends. Edit: Initial sync, create a packet that lists ...

Symbian Power Status Notification -

I have an application that uses a memory card and protects the power of the card reader / state operation The need to restore has been turned off and back again it usually happens after some time of activity and the phone goes into power save mode. In Windows Mobile, I solved the same problem by getting the power notification from the system and took the appropriate action. I would like to know whether this message is equivalent to Symbian? To clarify, I am not interested in the current status of the battery level, connected to the AB cable. I want to receive notifications before going to sleep mode and after waking up. Thanks There is a possibility of using the user's inactivity timer, which That's the incentive to go to power in the device - Save mode:

asp.net - Custom Validation -

I have two text boxes and submit buttons. I have applied custom verification to the first text box when I first I am losing my focus, validating custom legalization. But I have to click the verification button only. Validate the use of Javascript ... button Javascript click on the button, where you type the text box value And can see quick messages.

How to load another file's content to the current file in Vim? -

In the form of a title, in any convenient way? I want to load a template comment specifically for some CVS / GIT commit or sendmail. I think it is the Vi environment, not Vim. at the VIM command prompt: : read new_file Or for small: : new_file This will be the contents of the new_file For example, if it is the cursor, it is the contents of new_file : I do not like green eggs and I do not like the ham I am am I And this is what you are editing: I meant what I said and I said that I mean yes and your cursor is on the first line and you type: : read new_file Then your buffer will be: I meant what I said and I said that what I mean is that I do not like green eggs and ham. I do not like you. I am 100 percent faithful to the elephant. Pre>

linux - Running shell script in detached screen session. Must kill. How? -

I'm a Ubuntu Linux user I'm running away from jobs and starting a screen session. During this session I dug a file containing a long list of command line arguments to be executed. I was compelled to make connections and now the jobs are still on this screen and I am unable to kill them. Does anyone know how to execute all the ongoing execution of this script and how to kill future commands. Thank you in advance. Reach the screen screen - D-R Then you can resume your session.

iphone - Can you force a touch event to cancel after touchesBegan? -

Given a fixed position of one of my UIViews, I want to answer it and then touch any other touch I will cancel / end that is specially released by touching the competition. Actually I have a UIView subclass in comfort and if it is touched I want to take some other UIViews out of the way ... So the next time this response series is touched, touch normally You can respond to / expire ... Yes, I was seeing / running / ending this state touching but I am thinking that only the stage of that touch event There is a way to get rid of Fake touch: Set & lt; NSObject & gt; = [UITouch ()] event = UIEvent () self.touchesEnded (fake touch, event: event)

PHP - get image from byte array -

I am trying to create a back-end for my mobile application. I am sending the content of an image in the body of the HTTP request (output stream) as a byte array, I want to read this stream of bytes in PHP scripts and take back an image. Can anyone tell me how can I do this? Thank you. You can obtain the request body $ body = Reading from file_get_contents ('php: // input'); What you do with that data Depending on you, you can write the data in a file as you mentioned that this is image data, you can drop the data into the object can do. Another option is to use and load the image.

iphone - GPS coordinates in degrees to calculate distances -

On the iPhone, I get the position of the user in decimal degree, for example: latitude 39.470920 and longitude = -0.3731 9 2; This point A. I need to make a line with a GPS coordinate, even in decimal decimals, point B. Then, calculate the distance between the line (perpendicular) to A and B and the other point C. The problem I get confused with the values ​​in degree. I want to do the results in meters. Need conversion? How would the final formula calculate like this? - (CLLocationDistance) getDistanceFrom: (const CLLocation *) location FirstLogro = 30.0; First light = 30.0; Second Langatti = 40.0; Second latitude = 40.0; CLLocation * firstLoc = [[CLLocation alloc] initWithLatitude: first light latitude: first-time]; CLLocation * secondLoc = [[CLLocation alloc] initWithLatitude: Second latitude longitude: Second lengeness]; Double distance dimensions = [from first lock distance: sec lock];

How to find whether the .NET installed or not in the System by using c++? -

Is there an API available, to determine whether the .NET framework is installed in the system or not. Or atlest anybody how can i do this myself in c ++ and how does it even know where the .NET is installed if it is installed ?? How can I do this ... Anyone like this Help will be appreciated LoadLibrary () try mscoree.dll and then just pass GetProcAddress () to the coded loaded library) and GetCORSystemDirectory () and then try to get GetCorSystemDirectory () by the received pointer. Switch to. If all steps are successful, then .NET has been installed. Do not forget to deal with the error - every step can fail and you need to make sure that your program is ready for it.

ruby - How can I create a new Date with just a weekday number? -

I use the day of the day to date. I am using Wday, but then how can I create a new date with that number (without using Date.commercial)? I only need the next week's date. For example, if I have 2 (Tuesday) then the new date will be the next Tuesday date (2009-07-28). Thanks! You can convert a number of days (like 2 ) to one The name of the day is as follows: day_number = 2 date :: DAYNAMES [day_number] # = & gt; 'Tuesday' If you install gem, you can parsing the natural language of dates and times. For example: chronic Parse 'Next Tuesday' # It is currently Thursday, July 23rd, # = & gt; By adding them, you can require the 'old' class MyClass # next week gives a date for the ninth day of the week next_n_de (n) chronic. From ("next # {Date: DAYNAMES [n}} ") End End

python - Duplicate django query set? -

मेरे पास एक साधारण डीजेंगो क्वेरी सेट है: qs = AModel.objects.exclude (राज्य = "एफ")। Order_by ("order") मैं इसका उपयोग निम्नानुसार करना चाहूंगा: qs [0: 3 ] .अपडेट (राज्य = 'एफ') अपेक्षित = qs [3] # त्रुटि यहाँ फेंकता लेकिन अंतिम कथन फेंकता है: "एक टुकड़ा लिया गया है एक बार एक क्वेरी अपडेट नहीं किया जा सकता है।" मैं क्वेरी सेट को डुप्लिकेट कैसे कर सकता हूं? यह त्रुटि फेंकने वाली पहली पंक्ति है : आप qs नहीं कर सकते [0: 3] .update () क्यू [0: 3] एक टुकड़ा ले रहा है; अपडेट () क्वेरी अपडेट कर रहा है। अपडेट () बल्क अपडेट के लिए है, जिसके परिणामस्वरूप एसक्यूएल क्वेरीज़ जैसे UPDATE एप_मॉडेल SET state = 'F' WHERE state & lt ; & gt; 'एफ'; आप "आदेश" के अनुसार पहले तीन वस्तुओं को अपडेट करने की कोशिश कर रहे हैं, लेकिन यह इस प्रकार के अद्यतन के साथ नहीं किया जा सकता - आप किसी एसक्यूएल को ऑर्डर करने या सीमित नहीं कर सकते हैं अद्यतन। इसे अलग तरह से लिखे जाने की ज़रूरत है, उदा। UPDATE एप_मॉडल एसईट...

c# - Align TextBox and Label text -

I'm designing a UI, and I got my head scabbed: how do I get a text box text and a label text Which can be aligned. In design mode, it is easy, you take one with your mouse, a purple line appears and a wola! Alignment is good, but my code is generated, how can I align their contents? Thank you! Edit : Layout is something I can not use (I do not make rules, my boss does ..) I like the use of FlowLayoutPanel (instead of TableLayoutPanel ) for this purpose Because you do not have to be fiddle with the column. Remember , to control vertical centered both top and bottom anchors on each control, and Flow layout control. Set AutoSiss = True and Autozizamod = Grow and Shrink. Edit : "Layout is something I can not use" in relation to your restriction: so that you can access the purple text baseline snapline status program, respectively. Want instead? It is possible, but the layout is unlikely to happen faster because only designer knows for the control of whe...

Export Gridview to Excel / additional Content -

I have a grdiview and a button on my page that exports content to an Axle file, what companies I would like to add There is also logo, title, date and time of today. Is there any idea? Thanks in advance You can do this. You can probably find a sample in your ASP.NET samples that comes close to C # and what you want to do; VB - Perhaps one of the "Excel reporting" samples or one of the "DataGrid and Excel for Back" samples. Disclaimer: I'm near SpreadsheetsGuide LLC

.net 3.5 - Launch a WPF window -

I have one for 3.5. Increasing Net Project Windows.Forms.Application.Run (WinForm) in the current project "System"; "Creates the initial Windows form I am thinking that if in any way can tell me what is the equivalent of calling a WPF window. Any help or advice If you are using C #, then try: P> new app (.) Run (new window ());

sql - .NET/C# Drizzle database client -

I am planning to use it in my next C # app because no C # client is available for the bootel, So I thought that by my conversion I would have to write my own, and then have to work with it. After looking at the Java client, I know that this is a long-term job that I had guessed, and I have no time except the Java client yet not mature. Since there is an official Drial C client library (), so writing a C # wrapper can be the best solution. Is there any device available that can help in preparing code for it? You should take a look at the launchpad. Within that project, SWIG is used to make Ruby such as various languages ​​such as Ramras and Python. All SWIG related files are part of that project, so it can be worth keeping an eye on what you are trying to get very easy to make.

colors - Are there any good reasons for using hex over decimal for RGB colour values in CSS? -

RGB (255,255,255) notation is available after CSS1 but #ffffff seems extremely popular. Obviously this is a bit more compact. I know that hex is more closely related to the underlying bytes, and understand that arithmetic will be of those values, but this is not something you are going to do with CSS. Color values ​​are generated from designers (such as mine), who do not face hex marking anywhere, and are more familiar with decimal symbols, in which they can be used in the app The main way of specifying the color is - in fact I have met some people who do not know how the given hex value breaks into RGB components and it is assumed that it will color directly , Such as the Pantone color system reference (such as PMS432). So, there is no reason to use decimals? Hex value is easy to copy and paste from your favorites Image Editor. RGB value is easy to manipulate with Javascript. (My favorite hex color value is #EDEDED and a site that we had in the background of #F1...

database design - How to model optional one-to-many relationship in 1NF -

How can you first model a zero, one or several types without breaking the normal form? That is that no false value is stored. Different relation table? It is adding a "worth" table, or this is very common Here is an example that matches my real world case: We have some free There is a college, say curriculum and some free hostel rooms come with some courses and dormitory rooms a fee. And many more rooms of the course have the same fee (zodiac), although they will be different courses / rooms then we will. tblCourse serial name tblDormRoom id address tblFee id number to take this one to my model, to have optional one-to-many relationship The tables were used to connect. tblCourseToFee CourseId FeeId tblDormRoomToFee DormRoomId FeeId In this way I can avoid any zero value storage, and also to avoid duplicate storage Charges are shared between that dormroom and course. And the Quick N Dirtyire version is considered, which does not strictly adhere to 1 N...

c# - How to get Nhibernate to handle non existing database columns gracefully -

I am working on a project for which most databases are completely identical but some columns may be missing. For example, how do I handle NHibernate, for example, I have 4 columns, an index and 2 data columns which will always be available, but a song customer does not want a column in their database. As a legacy app is part of migration I do not have the luxury of directing the database format or even changing the database. Anyone have any idea about how to do this. I can not get NHibernate shards to work with it. KR Nikki I ignore columns I do not know how to mapped otherwise I will try to create several mapping files for different databases and then configure your SessionFactor by using the correct mapping files based on my environment. Will do This little work is setup in the beginning but it makes very clear that in the database X you have Columns ABC and in the Database Y, you have the column AB.