Daily Archives

Articles indexed Sunday January 2 2011

Page 6/27 | < Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >

  • handling NSStream events when using EASession in MonoTouch

    - by scotru
    Does anyone have an example of how to handle read and write NSStream events in Monotouch when working with accessories via EASession? It looks like there isn't a strongly typed delegate for this and I'm having trouble figuring out what selectors I need to handle on the delegates of my InputStream and OutputStream and what I actually need to do with each selector in order to properly fill and empty the buffers belonging to the EASession object. Basically, I'm trying to port Apple's EADemo app to Monotouch right now. Here's the Objective-C source that I think is relevant to this problem: / / asynchronous NSStream handleEvent method - (void)stream:(NSStream *)aStream handleEvent:(NSStreamEvent)eventCode { switch (eventCode) { case NSStreamEventNone: break; case NSStreamEventOpenCompleted: break; case NSStreamEventHasBytesAvailable: [self _readData]; break; case NSStreamEventHasSpaceAvailable: [self _writeData]; break; case NSStreamEventErrorOccurred: break; case NSStreamEventEndEncountered: break; default: break; } } / low level write method - write data to the accessory while there is space available and data to write - (void)_writeData { while (([[_session outputStream] hasSpaceAvailable]) && ([_writeData length] > 0)) { NSInteger bytesWritten = [[_session outputStream] write:[_writeData bytes] maxLength:[_writeData length]]; if (bytesWritten == -1) { NSLog(@"write error"); break; } else if (bytesWritten > 0) { [_writeData replaceBytesInRange:NSMakeRange(0, bytesWritten) withBytes:NULL length:0]; } } } // low level read method - read data while there is data and space available in the input buffer - (void)_readData { #define EAD_INPUT_BUFFER_SIZE 128 uint8_t buf[EAD_INPUT_BUFFER_SIZE]; while ([[_session inputStream] hasBytesAvailable]) { NSInteger bytesRead = [[_session inputStream] read:buf maxLength:EAD_INPUT_BUFFER_SIZE]; if (_readData == nil) { _readData = [[NSMutableData alloc] init]; } [_readData appendBytes:(void *)buf length:bytesRead]; //NSLog(@"read %d bytes from input stream", bytesRead); } [[NSNotificationCenter defaultCenter] postNotificationName:EADSessionDataReceivedNotification object:self userInfo:nil]; } I'd also appreciate any architectural recommendations on how to best implement this in monotouch. For example, in the Objective C implementation these functions are not contained in any class--but in Monotouch would it make sense to make them members of my

    Read the article

  • InnoDB or MyISAM - Why not both?

    - by Skoder
    Hey. I'm new to databases, and I've read various threads about which is better between InnoDB and MyISAM. It seems that the debates are to use or the other. Is it not possible to use both, depending on the table? What would be the disadvantages in doing this? As far as I can tell, the engine can be set during the CREATE TABLE command. Therefore, certain tables which are often read can be set to MyISAM, but tables that need transaction support can use InnoDB. I'm sure there must be a problem, otherwise this would be the ultimate answer :).

    Read the article

  • Microsoft MVP for the year 2011

    - by vik20000in
    It’s been three year in a row now. I am MVP for the year 2011 also. It feels so great to get the news that I have been MVP again. Very big thanks to the MVP Team, My MVP Lead and Microsoft for giving the MVP award to me for 3 year in a row. Also a great thanks to all the friends, Family, developers, community members that have worked with me. Without your support this would not have been possible. I will try and continue the work in 2011 alsoVikram

    Read the article

  • Silverlight Cream for January 01, 2011 -- #1020

    - by Dave Campbell
    In this short New Year's Day 2011 Issue, 3 Mikes: Mike Taulty, Mike Snow, and Mike Ormond. Above the Fold: Silverlight: "Native Extensions for Silverlight (NESL)?" Mike Taulty WP7: "Monitoring Memory Usage on Windows Phone 7" Mike Ormond From SilverlightCream.com: Native Extensions for Silverlight (NESL)? Mike Taulty has a really good write-up on Native Extensions for Silverlight... he describes what that project is about and gives guidance on best practices. Win7 Mobile: Uniquely Identifying a Device or User Mike Snow has a post up describing how to uniquely identify the phone or device your app is running on using the Microsoft.Phone.Info.DeviceExtendedProperties namespace Monitoring Memory Usage on Windows Phone 7 Mike Ormond has a post up showing how to turn on and make use of the framerate counters in WP7 Stay in the 'Light! Twitter SilverlightNews | Twitter WynApse | WynApse.com | Tagged Posts | SilverlightCream Join me @ SilverlightCream | Phoenix Silverlight User Group Technorati Tags: Silverlight    Silverlight 3    Silverlight 4    Windows Phone MIX10

    Read the article

  • Happy New Year!! Microsoft MVP Award

    - by T
    I received this letter  from Microsoft this morning   Dear Teresa Burger, Congratulations! We are pleased to present you with the 2011 Microsoft® MVP Award! This award is given to exceptional technical community leaders who actively share their high quality, real world expertise with others. We appreciate your outstanding contributions in Expression Blend technical communities during the past year. There has been some work involved but over all, 2010 has been a blast!!  I am very honored to have received this award and look forward to a lot more community involvement, learning, exploring and sharing in the years to come.  You all rock!! Thank you!!!  http://mvp.support.microsoft.com/ http://www.microsoft.com/expression/products/Blend_Overview.aspx

    Read the article

  • Set up Glassfish connection pool to talk to a database on a Ubuntu VPS

    - by Harry Pham
    On my Ubuntu VPS, i have a mysql server running and a Glassfish 3.0.1 Application Server running. And I am having a hard to have my GF successfully ping the database. Here is my GF set up Assume: x.y.z.t is the ip of my VPS Resource Type: javax.sql.ConnectionPoolDataSource User: root DatabaseName: scholar Url: jdbc:mysql://x.y.z.t:3306/scholar URL: jdbc:mysql://x.y.z.t:3306/scholar Password: xxxx PortNumber: 3306 ServerName: x.y.z.t Inside my glassfish3/glassfish/lib, I have my mysql-connector-java-5.1.13-bin.jar Inside the database, table mysql here is the result of the query select User, Host from user; +------------------+-----------+ | User | Host | +------------------+-----------+ | root | 127.0.0.1 | | debian-sys-maint | localhost | | root | localhost | | root | yunaeyes | +------------------+-----------+ Now from my machine, if I try to connect to this db via mysql browser (mysql client software), well I cant. Well from the table above, seem like it only allow localhost to connect to this db. Keep in mind that both my db and my GF are on the same VPS. Please help

    Read the article

  • How to send emails without getting into Spam Act trouble?

    - by Jason
    Lets say I have a database of 60,000 emails. I would like to send them an email notifying them of a new related service (similar to what they've signed up) which adds value to what they already signed up to. I know most of them would welcome it but they did not opt-in for this new related service. I don't want to send out the email invite only to find out I got into some Spam Act trouble. What is a friendly way to reach these targetted audience?

    Read the article

  • Gnome+NX clipboard behavior; auto-copy on select?

    - by threecheeseopera
    I am having issues with the Gnome(/Linux/Debian+Ubuntu) clipboard when connected remotely; it's default behavior appears to be to automatically add text to a clipboard buffer when that text is selected. This is not usually a problem, until I need to log into one of these systems remotely (w/ GUI), and attempt to use a shared clipboard. If I 'copy' text on the local machine (destined to replace some text on the remote machine), that copy buffer is overwritten as soon as I select the text on the remote machine to be replaced. Is there some way around this? It sort of drives me nuts. Thanks! UPDATE: This is really an NX server issue; X11 supports multiple clipboards ("selections": clipboard, primary. secondary; see this excellent article) that behave differently, and it appears that my problem is related to how NX server translates this over to the host machine.

    Read the article

  • The Year 2010, The Year of Change

    As I look back on the year of 2010, I could have never predicted the wonderful changes that have occurred for my wife and me. The beginning of this year started out as the 9th year that we lived in South Florida, and my fourth year working for DentalPlans.com as a software engineer/network admin. About 3 months in to the year I was given an excellent opportunity to work for MovieTickets.com in the software engineering department. This opportunity allowed me to gain experience with jQuery due to one of my projects was to reengineering MovieTickets.com existing Marketing Panel System. About 3 months after working at MovieTickets.com, my wife and I were offered an opportunity of a life time. I was offered a Job in a large background\information security company located in Nashville, TN as software engineer II.  I must note that after living in South Florida for 9 years, my wife and I really had a strong distaste for the South Florida life style and the general attitude/culture of the area. Even though we shared a strong dislike for the area in which we lived I must admit that it was a tough decision to leave MovieTickets.com because I was really doing well and I made some great new friends like Chris Catto, and Tyson Nero.  In fact, they introduced me to Local Microsoft User Groups, and software development podcast like DotNetRocks.com and Hanselminutes.com.  In addition, we also went to my first Microsoft launch down in Miami for Visual Studios 2010. I must admit it was a cool experience.  I truly hope to keep in touch with them to see how their careers grow, and I know they will. I must admit I was nervous and excited to start the next chapter in our live as I started up the 26 foot U-Haul truck and got on the road for Nashville from Boca Raton. I knew that the change was going to lead to new adventures and new opportunities that I could never imagine.  As we pulled in to the long driveway of our rental house, we knew that this was the right place for my wife and I. Natalie, my wife had actually come up to Nashville and within one week of my job offer had set up a nice rental home for us to restart our lives in TN.  I must admit that the wonderful southern hospitality took a bit to get use to due to the type of people we were used to dealing with on a regular basis. Our first 2 months seemed like we were living a dream because of our new area and the wonderful people we live around. So far my new job is going really well and I really like the people on my team and department. In fact after 6 months I am now in charge of all application builds for our new deployment process. I am also leading up a push for setting up of continuous integration within our new build process.  In addition to starting my new job, I was also offered a position as an adjust instructor at ITT Tech teaching course like VB.net, Java Script, Ajax, and database development. So far I have really like teaching at the college level.  Information technology has really been great for my life so I am really glad to be able to give back. That is actually why I started DotNetBlocks. This site allows me to document things I have learned as I work with technology, and allows others to borrow from my experiences.  I hope that this site can help others as others have helped me get where I am. Finally, I am glade to report that I only have 4 classes left for my master’s degree at Capella University. I am proud to announce that I am still on track to graduate with 3.91 GPA.  This last class was really a test because I had a crazy idea that I could work full time as a software engineer, teach two college courses as a first time teacher and also take an advanced masters class in application architecture. I have no idea how I actually survived, but I am really surprised how well I actually did. I was invited back to reach again at ITT Tech, and I passed my masters class with an “A”.  I have decided to take this next term off from my master’s program so that I do not get burned out.  Also, so that my new current employer will pay for more of my education, tuition reimbursement is an awesome benefit. This was my year 2010, how was yours?

    Read the article

  • Right click doesn't work on HP mini 210 touchpad

    - by user4041
    Need help in getting the right mouse click to work on a HP mini 210-1015TU when using the touchpad. If I plug in a USB mouse, both left click and right click function as normal. Using the touchpad however I can only get the left click to work. Attempting to right click gives the result expected from a left click. As per some comments on a forum I added a file 11-touchpad.conf to /usr/share/X11/xorg.conf.d. I can provide further details if required. This made touchpad operation noticeably smoother but the problem with the right mouse click remains. Not a hardware problem as right clicked worked with 10.04 and still works with Windows 7 starter. 10.10 installed using wubi.

    Read the article

  • Extremely slow upload speeds in nautilus with FTP

    - by Oscar Godson
    I was at home uploading a WP site and it's maxing at 4.2kb. I did a speed test and im getting ~1MB upload (my home ISP caps it out at that). I uploaded a 5MB file via Chrome, to test, and it uploaded within 2 mins. The file uploaded was a wordpress.xml file through the uploader. Same file in nautilus is taking forever. To upload this WP site and all the plugins took 1 hour. Any ideas of why or how? P.S. I've been using my hosting company also for years and they've never had any speed issues uploading.

    Read the article

  • Live CD installer gets stuck with a grayed out forward button.

    - by TRiG
    I have a CD with Ubuntu 10.10 and a laptop with Ubuntu 8.10. The laptop had all sorts of crud on it, and anything I wanted to keep was backed up on an external drive, so I was happy to do a wipe and reinstall instead of an update. So after a bit of faffing about trying to work out how to get the thing to boot from the CD drive, I did that. So the screen comes up with the choice: the options are Try Ubuntu and Install Ubuntu. I choose to install and to overwrite my current installation. So far so good. I then get a progress bar labelled something like copying files (I forget the exact wording) and further options to fill in for my location, keyboard locale, username and password. On each of these screens there are forward and back buttons. On the last screen (password), the forward button is greyed out. Well, I think to myself, no doubt it will become active when that copying files progress bar completes. The progress bar never completes. It hangs. And the label changes from copying files to the chirpy ready when you are. The forward button remains greyed out. The back button is as unhelpful as you'd expect it to be. And there's nothing else to click. We have reached an impasse. I tried restarting the laptop, to test whether it actually was properly installed. It wasn't. I tried to run Ubuntu live from the CD, to test whether the disk was damaged. That wouldn't work either, but I suspect it's just because the laptop is old and has a slow disk drive. I'm typing this question on another computer using the Ubuntu live CD and it's working fine. So there's nothing wrong with the CD.

    Read the article

  • Command line option to check which filesystem I am using?

    - by j-g-faustus
    Is there a command that will show which file system (ext3, ext4, FAT32, ...) the various partitions and disks are using? Similar to how sudo fdisk -l lists information about disks and partitions? Update Accepted the "mount" answer as mount works without specifying filesystem type (commenting out the relevant entries in fstab, if any): $ sudo mount /dev/sdf1 /mnt/tmp $ mount | grep /mnt/tmp /dev/sdf1 on /mnt/tmp type ext3 (rw) Found another option in ubuntuforums - blkid: # system disk $ sudo blkid /dev/sda1 /dev/sda1: UUID="...." TYPE="ext4" # USB disk: $ sudo blkid /dev/sdf1 /dev/sdf1: LABEL="backup" UUID="..." TYPE="ext3" # mdadm RAID: $ sudo blkid /dev/md0 /dev/md0: LABEL="raid" UUID="..." TYPE="ext4" Thanks for your help!

    Read the article

  • Examples of good Javascript/HTML5 based games

    - by Zuch
    Now that Flash is largely being replaced with HTML5 elements (video, audio, canvas, etc.) are there any good examples of web-based games built on completely open standards (meaning Javascript, HTML and CSS)? I see a lot of examples of pure HTML5 implementations of what was once only in Flash (like stuff here: http://www.html5rocks.com/) but not many games, a domain which still seem dominated by Flash. I'm curious what's possible and what the limitations are.

    Read the article

  • how to get post content with groovy listening on a port?

    - by Amir Raminfar
    I wrote the following simple groovy code that handles a request. if (init) data = "" if (line.size() > 0) { data += "--> " + line + "\n" } else { println "HTTP/1.1 200 OK\n" println data println "----\n" return "success" } I then run it by doing groovy -l 8888 ServerTest.groovy However, it doesn't seem to print any POST data. I am testing it by doing curl -d "d=test" http://localhost:8888/ Does anybody know how to get that data in groovy?

    Read the article

  • How to make schema and code dynamic?

    - by Jonarch
    I want to make my database schema and application code as dynamic as possible to handle "unknown" use cases and changes. Developing in PHP and MySQL. Twice now I have had to change my entire schema including table and column names and this means the developers have to go back to the application code and modify all the SQL queries and table/columns names. So to prevent this I want to if just like we do on pages where we have page content, title bar etc dynamic like a %variable%, can we do it for the schema and maybe even for the php code functions and classes somehow? It takes weeks to re-do all changes like this vs if it is dynamic it can be done in under a day.

    Read the article

  • web development using google sites

    - by CHID
    Hi, I have hosted a website. But now my client asks to change it to http://sites.google.com. They hav registered their domain in google. I logged in the site and saw the procedures to create a website from scratch. But is there any way to directly replace the site into google sites. Like, in my site i hav included css files in a folder called stylesheets/css and access it through the link tag. And there are several folders lik that, viz images, scripts etc. 1.Now if i have to transfer it to google sites, where do i create the folders and stuff. I have the priviliges to login to the admin part of the site. 2.And also is there anyway to create database and access it in google sites? 3.Also i see that only html pages can be created. Is there a way to add php pages or other scripting languages? 4.Going forward will google sites be usefull for professional web designing. pls give ideas on whether or not google sites is a good idea to go with

    Read the article

  • C# : Regular Expression

    - by Pramodh
    I'm having a set of row data as follows List<String> l_lstRowData = new List<string> { "Data 1 32:01805043*0FFFFFFF", "Data 3, 20.0e-3", "Data 2, 1.0e-3 172:?:CRC" , "Data 6" }; and two List namely "KeyList" and "ValueList" like List<string> KeyList = new List<string>(); List<string> ValueList = new List<string>(); I need to fill the two List<String> from the data from l_lstRowData using Pattern Matching And here is my Pattern for this String l_strPattern = @"(?<KEY>(Data|data|DATA)\s[0-9]*[,]?[ ][0-9e.-]*)[ \t\r\n]*(?<Value>[0-9A-Za-z:?*!. \t\r\n\-]*)"; Regex CompiledPattern=new Regex(l_strPattern,RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace); So finally the two Lists will contain KeyList { "Data 1" } { "Data 3, 20.0e-3" } { "Data 2, 1.0e-3" } { "Data 6" } ValueList { "32:01805043*0FFFFFFF" } { "" } { "172:?:CRC" } { "" } Scenerio: The Group KEY in the Pattern Should match "The data followed by an integer value , and the if there exist a comma(,) then the next string i.e a double value The Group Value in the Pattern should match string after the whitespace.In the first string it should match 32:01805043*0FFFFFFF but in the 3rd 172:?:CRC. Here is my sample code for (int i = 0; i < l_lstRowData.Count; i++) { MatchCollection M = CompiledPattern.Matches(l_lstRowData[i], 0); KeyList.Add(M[0].Groups["KEY"].Value); ValueList.Add(M[0].Groups["Value"].Value); } But my Pattern is not working in this situation. Please help me to rewrite my Pattern.

    Read the article

  • How can I improve this SQL to avoid several problems with its results?

    - by Josh Curren
    I am having some problems with trying to search. Currently this will only return results that have at least 1 row in the maintenance_parts table. I would like it to return results even if there are 0 parts rows. My second problem is that when you search for a vehicle and it should return multiple results (multiple maintenance rows) it will only return 1 result for that vehicle. Some Background Info: The user has 2 fields to fill out. The fields are vehicle and keywords. The vehicle field is meant to allow searching based on the make, model, VIN, truck number (often is 2 - 3 digits or a letter prefix followed by 2 digits), and a few other fields that belong to the truck table. The keywords are meant to search most fields in the maintenance and maintenance_parts tables (things like the description of the work, parts name, parts number). The maintenance_parts table can contain 0, 1, or more rows for each maintenance row. The truck table contains exactly 1 row for every maintenance row. A truck can have multiple maintenance records. "SELECT M.maintenance_id, M.some_id, M.type_code, M.service_date, M.mileage, M.mg_id, M.mg_type, M.comments, M.work_done, MATCH( M.comments, M.work_done) AGAINST( '$keywords' ) + MATCH( P.part_num, P.part_desc, P.part_ref) AGAINST( '$keywords' ) + MATCH( T.truck_number, T.make, T.model, T.engine, T.vin_number, T.transmission_number, T.comments) AGAINST( '$vehicle' ) AS score FROM maintenance M, maintenance_parts P, truck T WHERE M.maintenance_id = P.maintenance_id AND M.some_id = T.truck_id AND M.type_code = 'truck' AND ( (MATCH( T.truck_number, T.make, T.model, T.engine, T.vin_number, T.transmission_number, T.comments) AGAINST( '$vehicle' ) OR T.truck_number LIKE '%$vehicle%') OR MATCH( P.part_num, P.part_desc, P.part_ref) AGAINST( '$keywords' ) OR MATCH( M.comments, M.work_done) AGAINST( '$keywords' ) ) AND M.status = 'A' GROUP BY maintenance_id ORDER BY score DESC, maintenance_id DESC LIMIT 0, $limit"

    Read the article

  • Require User to be Logged in to Download ZIP Files

    - by Jonathan Wood
    Is it possible to require the user be authenticated (logged in) when downloading ZIP files from my site? Note that I don't have direct control of IIS7. (I'm on a shared hosting account.) I can't simply alter the access for a particular directory because many directories are involved and most contain other files that can be accessed freely. I've Googled this a bit and found similar questions. But I've been unable to find this exact question.

    Read the article

  • Fullscreen HTML Element using window.innerHeight/Width different with DOCTYPE

    - by CryptoQuick
    I'm trying to make an HTML5 canvas element fullscreen with the window.innerHeight and innerWidth properties. Unfortunately, on Chrome 10, when I set use the following doctype: <!DOCTYPE HTML> ...there is some extra scrolling space indicated by scroll bars which shouldn't appear. Without a doctype, everything is fine. The element is an HTML5 canvas, so styling with 100% will only stretch the content. Is it worth using a doctype which breaks my functionality (without which might be bad?), or should I subtract, say, 15px from the values in order to keep scroll bars from appearing? (which is kludgy)

    Read the article

  • Only add if not already in place

    - by Woppie
    Here's my data structure: var data = [ { id: '1924', info: 'boo' }, { id: '1967', info: 'foo' } ]; The id value should be unique, but the info may not be unique. How would I add new data into the data hash only if the id of the new data is unique? Is the only way to iterate over the whole hash and see if there is such an id already in place? data.push({ id: '1967', info: 'goo-goo' }); //should not be added data.push({ id: '1963', info: 'goo-goo' }); //should be added

    Read the article

  • How does one gets started with Winforms style applications on Win32?

    - by Billy ONeal
    EDIT: I'm extremely tired and frustrated at the moment -- please ignore that bit in this question -- I'll edit it in the morning to be better. Okay -- a bit of background: I'm a C++ programmer mostly, but the only GUI stuff I've ever done was on top of .NET's WinForms platform. I'm completely new to Windows GUI programming, and despite Petzold's excellent book, I'm extremely confused. Namely, it seems that most every reference on getting started with Win32 is all about drawing lines and curves and things -- a topic about which (at least at present time) I couldn't care less. I need a checked list box, a splitter, and a textbox -- something that would take less than 10 minutes to do in Winforms land. It has been recommended to me to use the WTL library, which provides an implementation of all three of these controls -- but I keep getting hung up on simple things, such as getting the damn controls to use the right font, and getting High DPI working correctly. I've spent two freaking days on this, and I can't help but think there has to be a better reference for these kinds of things than I've been able to find. Petzold's book is good, but it hasn't been updated since Windows 95 days, and there's been a LOT changed w.r.t. how applications should be correctly developed since it was published. I guess what I'm looking for is a modern Petzold book. Where can I find such a resource, if any?

    Read the article

  • DIV Overlaying DIV, links in backmost DIV non-accessible

    - by Shawn
    I have a photoshop image that is 500x600 that I am using as a background image for the first div. The second div sits over top of the first div and is populated with images. The z-index of the first div is set to 100. The effect is the photoshop image sits over top of all of the smaller images. The photoshop image is a letter with the inner-content of it set to be transparent and the small images create the filling. Each of the small images however is a link, but none of the links are accessible. How can I remedy that? I would post the code here, but I have absolutely no clue how to format it. I quite simply do not understand typing a backtick followed by the tab key and then a dollar sign. All that ends up is I type a backtick here followed by a dollar sign in the Tags section below.

    Read the article

  • PHP manipulating multidimensional array values

    - by Joker
    I have a result set as an array from a database that looks like: array ( 0 => array ( "a" => "something" "b" => "something" "c" => "something" ) 1 => array ( "a" => "something" "b" => "something" "c" => "something" ) 2 => array ( "a" => "something" "b" => "something" "c" => "something" ) ) How would I apply a function to replace the values of an array only on the array key with b? Normally I would just rebuild a new array with a foreach loop and apply the function if the array key is b, but I'm not sure if it's the best way. I've tried taking a look at many array functions and it seemed like array_walk_recursive is something I might use, but I didn't have luck in getting it to do what I want. If I'm not describing it well enough, basically I want to be able to do as the code below does: $arr = array(); foreach ($result as $key => $value) { foreach ($value as $key2 => $value2) { $arr[$key][$key2] = ($key2 == 'b' ? $this->_my_method($value2) : $value2); } } Should I stick with that, or is there a better way?

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >