Search Results

Search found 139 results on 6 pages for 'leon mcgregor'.

Page 4/6 | < Previous Page | 1 2 3 4 5 6  | Next Page >

  • Zooming to UIView and it's sub-views

    - by leon
    Hi, I have a UIView which I can zoom to (as it is set as a subview of UIScrollView). UIView has UILabel, UITextField, etc. If I just zoom to the UIView, then of course label and text field get fuzzy (the same effect if you are zooming to the image file without changing image resolution). To solve the problem I need to increase the font size and sizes of the UILable and UITextField in according to the scale used to zoom in (scale is passed as a param by the UIScrollView). This is where I am getting confused. Changing frame (by increasing it width and height by zooming scale) I get all my elements (sub-views) repositions (because changing frame effects center and bounds) Question: 1. What would I need to do to zoom in to the sub-views and just increase the sub-view sizes while keeping them in the exactly the same position? thanks

    Read the article

  • Can I dispose a DataTable and still use its data later?

    - by Eduardo León
    Noob ADO.NET question: Can I do the following? Retrieve a DataTable somehow. Dispose it. Still use its data. (But not send it back to the database, or request the database to update it.) I have the following function, which is indirectly called by every WebMethod in a Web Service of mine: public static DataTable GetDataTable(string cmdText, SqlParameter[] parameters) { // Read the connection string from the web.config file. Configuration configuration = WebConfigurationManager.OpenWebConfiguration("/WSProveedores"); ConnectionStringSettings connectionString = configuration.ConnectionStrings.ConnectionStrings["..."]; SqlConnection connection = null; SqlCommand command = null; SqlParameterCollection parameterCollection = null; SqlDataAdapter dataAdapter = null; DataTable dataTable = null; try { // Open a connection to the database. connection = new SqlConnection(connectionString.ConnectionString); connection.Open(); // Specify the stored procedure call and its parameters. command = new SqlCommand(cmdText, connection); command.CommandType = CommandType.StoredProcedure; parameterCollection = command.Parameters; foreach (SqlParameter parameter in parameters) parameterCollection.Add(parameter); // Execute the stored procedure and retrieve the results in a table. dataAdapter = new SqlDataAdapter(command); dataTable = new DataTable(); dataAdapter.Fill(dataTable); } finally { if (connection != null) { if (command != null) { if (dataAdapter != null) { // Here the DataTable gets disposed. if (dataTable != null) dataTable.Dispose(); dataAdapter.Dispose(); } parameterCollection.Clear(); command.Dispose(); } if (connection.State != ConnectionState.Closed) connection.Close(); connection.Dispose(); } } // However, I still return the DataTable // as if nothing had happened. return dataTable; }

    Read the article

  • Reading the Set-Cookie instructions in an HTTP Response header

    - by Eduardo León
    Is there any standard means in PHP to read the Set-Cookie instructions in an HTTP Response header, without manually parsing it? More specifically, I want to read the value of the ASP.NET_SessionId cookie returned by an ASP.NET Web Service I am consuming. EDIT: I am consuming the Web Service using PHP's native SoapClient class. I can use the __getLastResponseHeaders() method to retrieve the whole of the HTTP response header returned by the Web Service: HTTP/1.1 200 OK Cache-Control: private, max-age=0 Content-Type: text/xml; charset=utf-8 Server: Microsoft-IIS/7.5 Set-Cookie: ASP.NET_SessionId=ku501l55o300ik3sa2gu3vzj; path=/; HttpOnly X-AspNet-Version: 2.0.50727 X-Powered-By: ASP.NET Date: Tue, 11 Jan 2011 23:34:02 GMT Content-Length: 368 But I want to extract the value of the ASP.NET_SessionID cookie: ku501l55o300ik3sa2gu3vzj And, of course, I don't want to do it manually.

    Read the article

  • Java Synchronized function

    - by leon
    Hi I have a question. In the following code, if a thread were blocked at wait statement, and another thread attempts to execute foo(), would the hello wolrd message be printed? and Why? Many Thanks synchronized foo(){ system.out.println("hello world"); ..... wait(); ..... }

    Read the article

  • Programmatically filtering contacts in Outlook 2010 Add-In

    - by Leon Havin
    I am trying to programmatically filter Outlook contacts in the Contacts folder in Outlook 2010. I followed DASL filter rules, but it seems working for Find function and throws exception when I assign this filter to view.Filter = FilterString. Any ideas what I am doing wrong? The correct result would display filtered contacts in the existing contacts view. Outlook.Application myApp = ThisAddIn.myApp; Outlook.NameSpace myNamespace = ThisAddIn.nSpace; Outlook.MAPIFolder myContactsFolder = ThisAddIn.contactsFolder; if (myContactsFolder == null) { Log.Verbose("Contacts folder not found"); return null; } Outlook.Items contactItems = ThisAddIn.contactItems; //use filter to take only contact and not DistListItem Outlook.Items outlookContacts = contactItems.Restrict("[MessageClass] = 'IPM.Contact'"); Outlook.ContactItem contact = null; int iOutlookContacts = contactItems.Count; if (iOutlookContacts > 0) { string FilterString = "[FullName]='" + param + "'"; // Find works with this filter contact = (Outlook.ContactItem)outlookContacts.Find(FilterString); if (contact != null) { // need to display in contacts search window Outlook.View currentView = myApp.ActiveExplorer().CurrentView; currentView.Filter = FilterString; // cannot parse exception occurs here currentView.Save(); currentView.Apply(); } }

    Read the article

  • how to Calculate number of address bits needed for memory?

    - by leon
    Hi I am preparing my exam for computer system. I don't quite understand how to calculate the number of address bits needed for the memory. For example, Suppose that a 1G x 32-bit main memory is built using 256M x 4-bit RAM chips and this memory is word-addressable. What is the number of address bits needed for a memory module? What is the number of address bits needed for the full memory? And what about If the memory is byte addressable, what would be the solutions? Many thanks

    Read the article

  • Browser extensions to re-render the page using an updated version of my CSS file, without reloading the page itself

    - by Eduardo León
    I want to learn Web UI design. (I know, I know. Being a programmer puts me at a disadvantage. But I want to try anyway.) Thus, I would like to "debug" my CSS files. Once of the biggest annoyances I have found is that I cannot test a change in my CSS files without reloading the whole page. Sometimes, the page is too big. Sometimes, a lot of elements were brought to the page after lots of clicks, because my pages rely too heavily on AJAX. Sometimes, I just hate hitting Command+R all the time. Is there any extension for any of the major browsers (preferably Safari and/or Chrome) that re-renders the page using an updated version of the CSS file, without reloading the whole page itself?

    Read the article

  • Looping through array in PHP to post several multipart form-data

    - by Léon Pelletier
    I'm trying in an asp web application to code a function that would loop through a list of files in a multiple upload form and send them one by one. Is this something that can be done in ASP? Because I've read some posts about how to attach several files together, but saw nothing about looping through the files. I can easily imagine it in C# via HttpWebRequest or with socket, but in php, I guess there are already function designed to handle it? // This is false/pseudo-code :) for (int index = 0; index < number_of_files; index++) { postfile(file[index]); } And in each iteration, it should send a multipart form-data POST. postfile(TheFileInfos) should make a POST like it: POST /afs.aspx?fn=upload HTTP/1.1 [Header stuff] Content-Type: multipart/form-data; boundary=----------Ef1Ef1cH2Ij5GI3ae0gL6KM7GI3GI3 [Header stuff] ------------Ef1Ef1cH2Ij5GI3ae0gL6KM7GI3GI3 Content-Disposition: form-data; name="Filename" myimage1.png ------------Ef1Ef1cH2Ij5GI3ae0gL6KM7GI3GI3 Content-Disposition: form-data; name="fileid" 58e21ede4ead43a5201206101806420000007667212251 ------------Ef1Ef1cH2Ij5GI3ae0gL6KM7GI3GI3 Content-Disposition: form-data; name="Filedata"; filename="myimage1.png" Content-Type: application/octet-stream [Octet Stream] [Edit] I'll try it: <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <form name="form1" enctype="multipart/form-data" method="post" action="processFiles.php"> <p> <? // start of dynamic form $uploadNeed = $_POST['uploadNeed']; for($x=0;$x<$uploadNeed;$x++){ ?> <input name="uploadFile<? echo $x;?>" type="file" id="uploadFile<? echo $x;?>"> </p> <? // end of for loop } ?> <p><input name="uploadNeed" type="hidden" value="<? echo $uploadNeed;?>"> <input type="submit" name="Submit" value="Submit"> </p> </form> </body> </html>

    Read the article

  • Measuring how "heavily linked" a node is in a graph

    - by Eduardo León
    I have posted this question at MathOverflow.com as well. I am no mathematician and English is not my first language, so please excuse me if my question is too stupid, it is poorly phrased, or both. I am developing a program that creates timetables. My timetable-creating algorithm, besides creating the timetable, also creates a graph whose nodes represent each class I have already programmed, and whose arcs represent which pairs of classes should not be programmed at the same time, even if they have to be reprogrammed. The more "heavily linked" a node is, the more inflexible its associated class is with respect to being reprogrammed. Sometimes, in the middle of the process, there will be no option but to reprogram a class that has already been programmed. I want my program to be able to choose a class that, if reprogrammed, affects the least possible number of other already-programmed classes. That would mean choosing a node in the graph that is "not very heavily linked", subject to some constraints with respect to which nodes can be chosen. EDIT: The question was... Do you know any algorithm that measures how "heavily linked" a node is?

    Read the article

  • How to build a dynamic resize-able Flash player

    - by Leon
    Morning stackers! So my question today isn't dealing with any code, but how to go about this the correct way from the start. I have a video player built to a static size (max: 800x600) which I'll have to re-code every time I need it to be a different size. What I need it to do in the near future is dynamically resize itself and all the elements inside of it based on 1 width variable that it will received either from HTML or XML. Now to me there are 2 ways to go about this: Start with the smallest size possible and resize upwards, but I'm unsure of how the Flash movie will actually expand upwards as of right now. Or 2, start with the largest size possible (in this case 800x600) and size everything down. Step 1, I think seems to be the better way to go about this (ala YouTube style), but Step 2 also seems like it could be the easier way? A friend of mine mentioned that I should go with the larger size and have elements resize in each class, then fix to the upper left hand corner. However for the player to fit inside of certain div columns on sites, blogs whatever he said that there will have to be an HTML/CSS side of this... meaning that the div containing the resized flash player will have to cover up the areas of the Flash movie that are not to be shown? Is that possible to put a 800x600 flash movie into a div that smaller then 800 pixels wide? And cover it up with another div? Anyways, my mission is to be able to have a dynamically sized player like this: Thoughts? Recommendations? Best practices for this before I start?

    Read the article

  • Is it possible to configure Apache to host both an ASP.NET Web Service and a PHP Web site?

    - by Eduardo León
    Noob question (because I'm a noob when it comes to Web development). I'm not sure whether I should ask it here or at ServerFault. I am developing an ASP.NET Web Service and a PHP Web site consuming the Web Service. They are meant to be run on different machines. However, only for development purposes, I need to run both on my machine. I cannot use virtual machines. I would like to know if it is possible to configure IIS Apache to host both my Web Service and my Web site? Or, do I need to host the PHP site using Apache? I am using IIS 7.5 Apache HTTP Server 2.2 (NOTE: I have nothing against Apache. In fact, so far I like it more than IIS, however, I would rather not have two Web server applications installed in the same machine.) PHP 5.3.4 .NET Framework 2.0 3.0 or 3.5 (whichever comes with Visual Studio 2008) mod_aspdotnet for Apache 2.2

    Read the article

  • Replacing a C++ ActiveX component with a .NET implementation?

    - by Leon Breedt
    I have existing managed and unmanaged software using an ActiveX component supplied by a third party to perform some communications, but it is now required that this communication be routed through my application. Ideally I'd be able to install a .NET component which will expose exactly the same interface, and will be usable as a drop-in replacement. However, I am running into the limits of my understanding of COM, which admittedly is quite minimal. How best to ensure that my implementation of the interface is 100% binary compatible with the existing object? How do I ensure that applications use my implementation of the interface instead of the legacy implementation? Is it simply a matter of registering my implementation, and unregistering the legacy one? How do I ensure it's a "drop-in" replacement, and requires no changes to existing software? How do I ensure unmanaged code can use it without issue? Note: I am able to require that .NET 4.0 be used, if that will make things simpler.

    Read the article

  • How to read from multiple queues in real-world?

    - by Leon Cullens
    Here's a theoretical question: When I'm building an application using message queueing, I'm going to need multiple queues support different data types for different purposes. Let's assume I have 20 queues (e.g. one to create new users, one to process new orders, one to edit user settings, etc.). I'm going to deploy this to Windows Azure using the 'minimum' of 1 web role and 1 worker role. How does one read from all those 20 queues in a proper way? This is what I had in mind, but I have little or no real-world practical experience with this: Create a class that spawns 20 threads in the worker role 'main' class. Let each of these threads execute a method to poll a different queue, and let all those threads sleep between each poll (of course with a back-off mechanism that increases the sleep time). This leads to have 20 threads (or 21?), and 20 queues that are being actively polled, resulting in a lot of wasted messages (each time you poll an empty queue it's being billed as a message). How do you solve this problem?

    Read the article

  • What version of Visual Studio is this python compiled with?

    - by leon
    I am trying to find out the version of Visual Study that is used to compile the python on my computer It says Python 2.6.2 (r262:71605, Apr 14 2009, 22:40:02) [MSC v.1500 32 bit (Intel)] on win32 What I do not understand is that MSC V.1500. Does it mean it is compiled with 2005? I cannot find this information on `python.org' neither. Any help is appreciated!

    Read the article

  • Questions regarding Web Service development in C++

    - by Eduardo León
    The purpose of this question is to play a joke, but the question itself is serious. Inspired by DOS on Dope, I want to make my own framework for Web Service development based on MFC serialization. However, my only experience in Web Service development consists in having written a toy ASP.NET Web Service. All I had to do to expose a method was... [WebMethod] public ReturnType ExposedMethod(InputType1 param1, InputType2 param2) { //... } ... and ASP.NET took care of the rest for me. Obviously, I will have to do everything by hand in my own framework. Thus, I would like to delve a bit more into the little details of how ordinary SOAP Web Services work, in order to replicate them. So I have mainly two questions: Where can I find the details on how SOAP Web Services work, and what ASP.NET hides from me? What are the main challenges I am going to find in my completely lunatic project?

    Read the article

  • merging indexed array in Python

    - by leon
    Suppose that I have two numpy arrays of the form x = [[1,2] [2,4] [3,6] [4,NaN] [5,10]] y = [[0,-5] [1,0] [2,5] [5,20] [6,25]] is there an efficient way to merge them such that I have xmy = [[0, NaN, -5 ] [1, 2, 0 ] [2, 4, 5 ] [3, 6, NaN] [4, NaN, NaN] [5, 10, 20 ] [6, NaN, 25 ] I can implement a simple function using search to find the index but this is not elegant and potentially inefficient for a lot of arrays and large dimensions. Any pointer is appreciated.

    Read the article

  • UIView viewWithTag 0 problem

    - by leon
    Hi, On view in IB I have numerous items (including view itself). ONLY one item has tag 0, yet following line works for ANY UITextBox other then the one with tag 0. Note that only ONE UITextBox has tag 0, why: (UITextField *) [self.view viewWithTag:0]).text = @"foo"; Interesting that when triggered event received for the element with tag 0, I can get value of Tag 0 with no problem. Is there a limitation to look for tag 0 elements?

    Read the article

  • Modify an MP3 slightly to change the data appearence

    - by Léon Pelletier
    I'm thinking about encrypting MP3s in a database, so that when user is downloading them with his software desktop player, only the software can decrypt them. This part is not a problem. The problem is I don't want a user to upload an mp3 to the database, then check which changes have been made to the file so he can reverse-engineer the file or at least see which algorithm is used to encrypt the files. So, user uploads MP3-A, then it becomes MP3-B because it has been modified, and I encrypt it to MP3-C. And when decrypted, it sounds 99.99% like MP3-A. I know MP3 format is lossy, but I wonder if there's a way to convert audio with limited loss, or if I need to forget it right now.

    Read the article

< Previous Page | 1 2 3 4 5 6  | Next Page >