Search Results

Search found 1786 results on 72 pages for 'jack brown'.

Page 11/72 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • iPhone: Creating a hierarchy-based table navigation.

    - by Jack Griffiths
    Hi there, I've tried to ask this before, but nothing got answered. Basically, I would like someone to explain to me how to create a table, which when a cell is tapped, pushes the user to the next view for that cell. I have this so far: Click here to view what I have. I would further like to, say when CSS is tapped, it goes to a new view which has another table in it. This table would then take the user to a detail view, which is scrollable and you can switch pages through it. I would appreciate longer, more structured tutorials on how to do each and every bit to get it to work. Here's my array in my implementation file: - (void)viewDidLoad { arryClientSide = [[NSArray alloc] initWithObjects:@"CSS", @"HTML", @"JavaScript", @"XML", nil]; arryServerSide = [[NSArray alloc] initWithObjects:@"Apache", @"PHP", @"SQL", nil]; self.title = @"Select a Language"; [super viewDidLoad]; } and my .h: @interface RootViewController : UITableViewController <UITableViewDelegate, UITableViewDataSource> { IBOutlet UITableView *tblSimpleTable; NSArray *arryClientSide; NSArray *arryServerSide; } My current code crashes the script, and this error is returned in the console: Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UITableViewController loadView] loaded the "NextView" nib but didn't get a UITableView.' If that error is the source of why it's not pushing, then an explanation of how to remedy that would also be appreciated Many thanks, Jack

    Read the article

  • Getting input and output from a jar file run from java class?

    - by Jack L.
    Hi, I have a jar file that runs this code: public class InputOutput { /** * @param args * @throws IOException */ public static void main(String[] args) throws IOException { boolean cont = true; BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); while (cont) { System.out.print("Input something: "); String temp = in.readLine(); if (temp.equals("end")) { cont = false; System.out.println("Terminated."); } else System.out.println(temp); } } } I want to program another java class that executes this jar file and can get the input and send output to it. Is it possible? The current code I have is this but it is not working: public class JarTest { /** * Test input and output of jar files * @author Jack */ public static void main(String[] args) { try { Process io = Runtime.getRuntime().exec("java -jar InputOutput.jar"); BufferedReader in = new BufferedReader(new InputStreamReader(io.getInputStream())); OutputStreamWriter out = new OutputStreamWriter(io.getOutputStream()); boolean cont = true; BufferedReader consolein = new BufferedReader(new InputStreamReader(System.in)); while (cont) { String temp = consolein.readLine(); out.write(temp); System.out.println(in.readLine()); } } catch (IOException e) { e.printStackTrace(); } } } Thanks for your help

    Read the article

  • Should I use two queries, or is there a way to JOIN this in MySQL/PHP?

    - by Jack W-H
    Morning y'all! Basically, I'm using a table to store my main data - called 'Code' - a table called 'Tags' to store the tags for each code entry, and a table called 'code_tags' to intersect it. There's also a table called 'users' which stores information about the users who submitted each bit of code. On my homepage, I want 5 results returned from the database. Each returned result needs to list the code's title, summary, and then fetch the author's firstname based on the ID of the person who submitted it. I've managed to achieve this much so far (woot!). My problem lies when I try to collect all the tags as well. At the moment this is a pretty big query and it's scaring me a little. Here's my problematic query: SELECT code.*, code_tags.*, tags.*, users.firstname AS authorname, users.id AS authorid FROM code, code_tags, tags, users WHERE users.id = code.author AND code_tags.code_id = code.id AND tags.id = code_tags.tag_id ORDER BY date DESC LIMIT 0, 5 What it returns is correct looking data, but several repeated rows for each tag. So for example if a Code entry has 3 tags, it will return an identical row 3 times - except in each of the three returned rows, the tag changes. Does that make sense? How would I go about changing this? Thanks! Jack

    Read the article

  • Combinationally unique MySQL tables

    - by Jack Webb-Heller
    So, here's the problem (it's probably an easy one :P) This is my table structure: CREATE TABLE `users_awards` ( `user_id` int(11) NOT NULL, `award_id` int(11) NOT NULL, `duplicate` int(11) NOT NULL DEFAULT '0', UNIQUE KEY `award_id` (`award_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 So it's for a user awards system. I don't want my users to be granted the same award multiple times, which is why I have a 'duplicate' field. The query I'm trying is this (with sample data of 3 and 2) : INSERT INTO users_awards (user_id, award_id) VALUES ('3','2') ON DUPLICATE KEY UPDATE duplicate=duplicate+1 So my MySQL is a little rusty, but I set user_id to be a primary key, and award_id to be a UNIQUE key. This (kind of) created the desired effect. When user 1 was given award 2, it entered. If he/she got this twice, only one row would be in the table, and duplicate would be set to 1. And again, 2, etc. When user 2 was given award 1, it entered. If he/she got this twice, duplicate updated, etc. etc. But when user 1 is given award 1 (after user 2 has already been awarded it), user 2 (with award 1)'s duplicate field increases and nothing is added to user 1. Sorry if that's a little n00bish. Really appreciate the help! Jack

    Read the article

  • UITableView cell appearance update not working - iPhone

    - by Jack Nutkins
    I have this piece of code which I'm using to set the alpha and accessibility of one of my tables cells dependent on a value stored in user defaults: - (void) viewDidAppear:(BOOL)animated{ [self reloadTableData]; } - (void) reloadTableData { if ([[userDefaults objectForKey:@"canDeleteReceipts"] isEqualToString:@"0"]) { NSIndexPath *path = [NSIndexPath indexPathForRow:0 inSection:8]; UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:path]; cell.contentView.alpha = 0.2; cell.userInteractionEnabled = NO; } else { NSIndexPath *path = [NSIndexPath indexPathForRow:0 inSection:8]; UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:path]; cell.contentView.alpha = 1; cell.userInteractionEnabled = YES; } if ([[userDefaults objectForKey:@"canDeleteMileages"] isEqualToString:@"0"]) { NSIndexPath *path = [NSIndexPath indexPathForRow:1 inSection:8]; UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:path]; cell.contentView.alpha = 0.2; cell.userInteractionEnabled = NO; } else { NSIndexPath *path = [NSIndexPath indexPathForRow:1 inSection:8]; UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:path]; cell.contentView.alpha = 1; cell.userInteractionEnabled = YES; } if ([[userDefaults objectForKey:@"canDeleteAll"] isEqualToString:@"0"]) { NSIndexPath *path = [NSIndexPath indexPathForRow:2 inSection:8]; UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:path]; cell.contentView.alpha = 0.2; cell.userInteractionEnabled = NO; NSLog(@"In Here"); } else { NSIndexPath *path = [NSIndexPath indexPathForRow:2 inSection:8]; UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:path]; cell.contentView.alpha = 1; cell.userInteractionEnabled = YES; } } The value stored in userDefaults is '0' so the cell in section 8 row 2 should be greyed out and disabled, however this doesn't happen and the cell is still selectable with an alpha of 1... The log statement 'In Here' is called so it seems to be executing the right code, but that code doesn't seem to be doing anything. Can anyone explain what I've done wrong? Thanks, Jack

    Read the article

  • SQL SERVER – Shrinking Database is Bad – Increases Fragmentation – Reduces Performance

    - by pinaldave
    Earlier, I had written two articles related to Shrinking Database. I wrote about why Shrinking Database is not good. SQL SERVER – SHRINKDATABASE For Every Database in the SQL Server SQL SERVER – What the Business Says Is Not What the Business Wants I received many comments on Why Database Shrinking is bad. Today we will go over a very interesting example that I have created for the same. Here are the quick steps of the example. Create a test database Create two tables and populate with data Check the size of both the tables Size of database is very low Check the Fragmentation of one table Fragmentation will be very low Truncate another table Check the size of the table Check the fragmentation of the one table Fragmentation will be very low SHRINK Database Check the size of the table Check the fragmentation of the one table Fragmentation will be very HIGH REBUILD index on one table Check the size of the table Size of database is very HIGH Check the fragmentation of the one table Fragmentation will be very low Here is the script for the same. USE MASTER GO CREATE DATABASE ShrinkIsBed GO USE ShrinkIsBed GO -- Name of the Database and Size SELECT name, (size*8) Size_KB FROM sys.database_files GO -- Create FirstTable CREATE TABLE FirstTable (ID INT, FirstName VARCHAR(100), LastName VARCHAR(100), City VARCHAR(100)) GO -- Create Clustered Index on ID CREATE CLUSTERED INDEX [IX_FirstTable_ID] ON FirstTable ( [ID] ASC ) ON [PRIMARY] GO -- Create SecondTable CREATE TABLE SecondTable (ID INT, FirstName VARCHAR(100), LastName VARCHAR(100), City VARCHAR(100)) GO -- Create Clustered Index on ID CREATE CLUSTERED INDEX [IX_SecondTable_ID] ON SecondTable ( [ID] ASC ) ON [PRIMARY] GO -- Insert One Hundred Thousand Records INSERT INTO FirstTable (ID,FirstName,LastName,City) SELECT TOP 100000 ROW_NUMBER() OVER (ORDER BY a.name) RowID, 'Bob', CASE WHEN ROW_NUMBER() OVER (ORDER BY a.name)%2 = 1 THEN 'Smith' ELSE 'Brown' END, CASE WHEN ROW_NUMBER() OVER (ORDER BY a.name)%10 = 1 THEN 'New York' WHEN ROW_NUMBER() OVER (ORDER BY a.name)%10 = 5 THEN 'San Marino' WHEN ROW_NUMBER() OVER (ORDER BY a.name)%10 = 3 THEN 'Los Angeles' ELSE 'Houston' END FROM sys.all_objects a CROSS JOIN sys.all_objects b GO -- Name of the Database and Size SELECT name, (size*8) Size_KB FROM sys.database_files GO -- Insert One Hundred Thousand Records INSERT INTO SecondTable (ID,FirstName,LastName,City) SELECT TOP 100000 ROW_NUMBER() OVER (ORDER BY a.name) RowID, 'Bob', CASE WHEN ROW_NUMBER() OVER (ORDER BY a.name)%2 = 1 THEN 'Smith' ELSE 'Brown' END, CASE WHEN ROW_NUMBER() OVER (ORDER BY a.name)%10 = 1 THEN 'New York' WHEN ROW_NUMBER() OVER (ORDER BY a.name)%10 = 5 THEN 'San Marino' WHEN ROW_NUMBER() OVER (ORDER BY a.name)%10 = 3 THEN 'Los Angeles' ELSE 'Houston' END FROM sys.all_objects a CROSS JOIN sys.all_objects b GO -- Name of the Database and Size SELECT name, (size*8) Size_KB FROM sys.database_files GO -- Check Fragmentations in the database SELECT avg_fragmentation_in_percent, fragment_count FROM sys.dm_db_index_physical_stats (DB_ID(), OBJECT_ID('SecondTable'), NULL, NULL, 'LIMITED') GO Let us check the table size and fragmentation. Now let us TRUNCATE the table and check the size and Fragmentation. USE MASTER GO CREATE DATABASE ShrinkIsBed GO USE ShrinkIsBed GO -- Name of the Database and Size SELECT name, (size*8) Size_KB FROM sys.database_files GO -- Create FirstTable CREATE TABLE FirstTable (ID INT, FirstName VARCHAR(100), LastName VARCHAR(100), City VARCHAR(100)) GO -- Create Clustered Index on ID CREATE CLUSTERED INDEX [IX_FirstTable_ID] ON FirstTable ( [ID] ASC ) ON [PRIMARY] GO -- Create SecondTable CREATE TABLE SecondTable (ID INT, FirstName VARCHAR(100), LastName VARCHAR(100), City VARCHAR(100)) GO -- Create Clustered Index on ID CREATE CLUSTERED INDEX [IX_SecondTable_ID] ON SecondTable ( [ID] ASC ) ON [PRIMARY] GO -- Insert One Hundred Thousand Records INSERT INTO FirstTable (ID,FirstName,LastName,City) SELECT TOP 100000 ROW_NUMBER() OVER (ORDER BY a.name) RowID, 'Bob', CASE WHEN ROW_NUMBER() OVER (ORDER BY a.name)%2 = 1 THEN 'Smith' ELSE 'Brown' END, CASE WHEN ROW_NUMBER() OVER (ORDER BY a.name)%10 = 1 THEN 'New York' WHEN ROW_NUMBER() OVER (ORDER BY a.name)%10 = 5 THEN 'San Marino' WHEN ROW_NUMBER() OVER (ORDER BY a.name)%10 = 3 THEN 'Los Angeles' ELSE 'Houston' END FROM sys.all_objects a CROSS JOIN sys.all_objects b GO -- Name of the Database and Size SELECT name, (size*8) Size_KB FROM sys.database_files GO -- Insert One Hundred Thousand Records INSERT INTO SecondTable (ID,FirstName,LastName,City) SELECT TOP 100000 ROW_NUMBER() OVER (ORDER BY a.name) RowID, 'Bob', CASE WHEN ROW_NUMBER() OVER (ORDER BY a.name)%2 = 1 THEN 'Smith' ELSE 'Brown' END, CASE WHEN ROW_NUMBER() OVER (ORDER BY a.name)%10 = 1 THEN 'New York' WHEN ROW_NUMBER() OVER (ORDER BY a.name)%10 = 5 THEN 'San Marino' WHEN ROW_NUMBER() OVER (ORDER BY a.name)%10 = 3 THEN 'Los Angeles' ELSE 'Houston' END FROM sys.all_objects a CROSS JOIN sys.all_objects b GO -- Name of the Database and Size SELECT name, (size*8) Size_KB FROM sys.database_files GO -- Check Fragmentations in the database SELECT avg_fragmentation_in_percent, fragment_count FROM sys.dm_db_index_physical_stats (DB_ID(), OBJECT_ID('SecondTable'), NULL, NULL, 'LIMITED') GO You can clearly see that after TRUNCATE, the size of the database is not reduced and it is still the same as before TRUNCATE operation. After the Shrinking database operation, we were able to reduce the size of the database. If you notice the fragmentation, it is considerably high. The major problem with the Shrink operation is that it increases fragmentation of the database to very high value. Higher fragmentation reduces the performance of the database as reading from that particular table becomes very expensive. One of the ways to reduce the fragmentation is to rebuild index on the database. Let us rebuild the index and observe fragmentation and database size. -- Rebuild Index on FirstTable ALTER INDEX IX_SecondTable_ID ON SecondTable REBUILD GO -- Name of the Database and Size SELECT name, (size*8) Size_KB FROM sys.database_files GO -- Check Fragmentations in the database SELECT avg_fragmentation_in_percent, fragment_count FROM sys.dm_db_index_physical_stats (DB_ID(), OBJECT_ID('SecondTable'), NULL, NULL, 'LIMITED') GO You can notice that after rebuilding, Fragmentation reduces to a very low value (almost same to original value); however the database size increases way higher than the original. Before rebuilding, the size of the database was 5 MB, and after rebuilding, it is around 20 MB. Regular rebuilding the index is rebuild in the same user database where the index is placed. This usually increases the size of the database. Look at irony of the Shrinking database. One person shrinks the database to gain space (thinking it will help performance), which leads to increase in fragmentation (reducing performance). To reduce the fragmentation, one rebuilds index, which leads to size of the database to increase way more than the original size of the database (before shrinking). Well, by Shrinking, one did not gain what he was looking for usually. Rebuild indexing is not the best suggestion as that will create database grow again. I have always remembered the excellent post from Paul Randal regarding Shrinking the database is bad. I suggest every one to read that for accuracy and interesting conversation. Let us run following script where we Shrink the database and REORGANIZE. -- Name of the Database and Size SELECT name, (size*8) Size_KB FROM sys.database_files GO -- Check Fragmentations in the database SELECT avg_fragmentation_in_percent, fragment_count FROM sys.dm_db_index_physical_stats (DB_ID(), OBJECT_ID('SecondTable'), NULL, NULL, 'LIMITED') GO -- Shrink the Database DBCC SHRINKDATABASE (ShrinkIsBed); GO -- Name of the Database and Size SELECT name, (size*8) Size_KB FROM sys.database_files GO -- Check Fragmentations in the database SELECT avg_fragmentation_in_percent, fragment_count FROM sys.dm_db_index_physical_stats (DB_ID(), OBJECT_ID('SecondTable'), NULL, NULL, 'LIMITED') GO -- Rebuild Index on FirstTable ALTER INDEX IX_SecondTable_ID ON SecondTable REORGANIZE GO -- Name of the Database and Size SELECT name, (size*8) Size_KB FROM sys.database_files GO -- Check Fragmentations in the database SELECT avg_fragmentation_in_percent, fragment_count FROM sys.dm_db_index_physical_stats (DB_ID(), OBJECT_ID('SecondTable'), NULL, NULL, 'LIMITED') GO You can see that REORGANIZE does not increase the size of the database or remove the fragmentation. Again, I no way suggest that REORGANIZE is the solution over here. This is purely observation using demo. Read the blog post of Paul Randal. Following script will clean up the database -- Clean up USE MASTER GO ALTER DATABASE ShrinkIsBed SET SINGLE_USER WITH ROLLBACK IMMEDIATE GO DROP DATABASE ShrinkIsBed GO There are few valid cases of the Shrinking database as well, but that is not covered in this blog post. We will cover that area some other time in future. Additionally, one can rebuild index in the tempdb as well, and we will also talk about the same in future. Brent has written a good summary blog post as well. Are you Shrinking your database? Well, when are you going to stop Shrinking it? Reference: Pinal Dave (http://blog.SQLAuthority.com) Filed under: Pinal Dave, PostADay, SQL, SQL Authority, SQL Index, SQL Performance, SQL Query, SQL Scripts, SQL Server, SQL Tips and Tricks, SQLServer, T SQL, Technology

    Read the article

  • laptop motherboard "shorts" when connected to adapter

    - by Bash
    Disclaimer: I'm sort of a noob, and this is a long post. Thank you all in advance! summary: completely dead laptop with no signs of life whatsoever (suddenly, for no apparent reason) Here's the deal: Lenovo Y470 (only a few months old with no water or shock damage). It stopped working suddenly (no lights, no sound, even when connecting adapter with or without battery). I tried a different adapter (same electrical rating), but no luck. I disassembled the thing completely, and tried plugging in the adapter and looking for signs of life with all different combinations of components installed (tried all combinations of RAM, CPU, USB power cords, screen, etc plugged in). no luck. Then, I noticed (as I was plugging in the adapter to try for the millionth time) that there was a "spark" for an instant when I first connect the adapter to the power jack. The adapter's LED would then flash (indicating it isn't working or charging). So, I thought the power jack has a short of some sort (due to bad soldering or something). Scanned virtually every single component on the motherboard, and tested the power jack connections with a multimeter. No shorts or damage to anything on the entire motherboard. Now I'm thinking I need to replace the motherboard. But, my actual question: What does this "shorting" when connecting the adapter signify? (btw, the voltage across the power connections and current through it drop to virtually zero when the adapter is connected and "sparks", and they stay that way). The bewildering thing is that there are no damaged components, and the voltage across adapter terminals returns to normal after I disconnect it (so it's not damaged). Please take a look at the pictures (of the motherboard's power connection and nearby components) and see if I'm missing something completely obvious... Links to pictures and laptop and motherboard model: pictures on DropBox Motherboard model: LA-6881P Laptop model: Lenovo IdeaPad Y470

    Read the article

  • Windows XP can use a wired network port, but MacBook (OS X) fails on the same port

    - by Dean Hill
    I wired the Cat5 in my house seven years ago. The wired ports have worked fine with both my Windows XP laptop and MacBook. My wireless network also works fine, but I like to use wired occasionally. One of the Cat5 runs wasn't terminated with a jack, so I recently terminated this wire with a port/jack on the wall end and a standard Cat5 plug on the end that plugs into my router. This is the same setup as my other runs. Unfortunately, the MacBook isn't working well with the new wired port. The OS X Network System Preferences show the IP, Subnet, Router, etc., and everything looks fine. A "netstat -ibd" shows no errors or dropped packets. However, when I open a page in Safari, the status says "Contacting 'www.google.com'" and appears to hang. If I wait for a couple minutes, part of the Google page starts to display, but it is still not the full page load. When I use a Windows XP laptop on the same wired port, everything works fine. An internet speed test shows good results and all web pages load fine. A "netstat -e" under Windows shows no errors. I've used a Cat5 tester, and the cable tests fine (wires 1-8 light up in sequence). I've replaced both the port/jack and the connector twice to make sure I wired things correctly. I'd really like this Cat5 to work with the MacBook (and I'm trying to avoid running a new length of cable). Any ideas what the problem could be?

    Read the article

  • Convert a cassette tape recording to digital format

    - by Electric Automation
    Has anyone been successful with transferring audio cassette tape recordings to a digital format? I would like to preserve old cassette tape recordings of my grandparents to some digital format: MP3, WAV, etc... The quality of the tapes are mediocre. I think I can handle the quality restoration but getting the audio from tape to digital is my question. Below is a list of the hardware that I can work with: Cassette Deck: I have a Technics stereo cassette deck model RS-B12. It has separate left and right IN and OUT RCA type jacks on the back. In the front it has a headphone phono jack, plus left and right mic input phono jacks. On the computer side: -I have a Windows Vista PC with no additional software other than what came with the machine from Costco. No sound editing software that I can see. There is no sound card on the PC. On the front panel there is a mini-phono mic input jack and there are several different types of in/out mini-phono jacks on the back. In addition, USB and Firewire. I also have access to a new (2009) iMac with a mini-phono input jack for a powered mic or other audio source and GarageBand that has come with the computer. In addition, USB and Firewire. What are my options for getting these cassette recordings into a digital format? Whats the best format? What sort of wires would I need and will I want to utilize the USB or Firewire or can I simply use the audio inputs on the PC (or Mac) to receive the audio stream?

    Read the article

  • Convert a cassette tape recording to digital format

    - by Optimal Solutions
    Has anyone been successful with transferring audio cassette tape recordings to a digital format? I would like to preserve old cassette tape recordings of my grandparents to some digital format: MP3, WAV, etc... The quality of the tapes are mediocre. I think I can handle the quality restoration but getting the audio from tape to digital is my question. Below is a list of the hardware that I can work with: Cassette Deck: I have a Technics stereo cassette deck model RS-B12. It has separate left and right IN and OUT RCA type jacks on the back. In the front it has a headphone phono jack, plus left and right mic input phono jacks. On the computer side: -I have a Windows Vista PC with no additional software other than what came with the machine from Costco. No sound editing software that I can see. There is no sound card on the PC. On the front panel there is a mini-phono mic input jack and there are several different types of in/out mini-phono jacks on the back. In addition, USB and Firewire. I also have access to a new (2009) iMac with a mini-phono input jack for a powered mic or other audio source and GarageBand that has come with the computer. In addition, USB and Firewire. What are my options for getting these cassette recordings into a digital format? Whats the best format? What sort of wires would I need and will I want to utilize the USB or Firewire or can I simply use the audio inputs on the PC (or Mac) to receive the audio stream?

    Read the article

  • My home router randomly disconnects me and I'm unable to reconnect to it

    - by Roy Tang
    It's happened a few times, I'm not sure how to diagnose/debug, so any advise would be appreciated. Symptons: sometimes the router will randomly disconnect; the connection icon on my desktop (wired to the router) gets that yellow "!" symbol that tells me my connection just went down. At this point I'm unable to ping the router. afterwards I try to reset the router by removing then reconnecting the power jack on the router side (this is the fastest way as I can't reset the power strip it's connected to without rebooting my desktop. the router has a reset thingy, but it's one of those things where i have to find a pin to stick into the hole, and when I get disconnected I usually need to get reconnected immediately so I just pull and put back the power jack), but even after that the connection has the same state. after the router reboots, if I try to connect to it using a wifi device like my ipad, the ipad prompts me for the wifi password even though it had already "remembered" all the settings for this router forever after i finally decide to reboot the power strip, and my desktop and the router boot up again, the connection returns to its normal state somewhat and i'm able to connect to it as normal using the desktop and wifi devices. What do I need to check the next time this happens so I can figure out the problem? Is it possibly because we've been using the power jack on the router as an easier way to reboot it? Should I be shopping around for a new router? If it helps, the router is a DLink DIR-300

    Read the article

  • Silverlight Cream for May 15, 2010 -- #862

    - by Dave Campbell
    In this Issue: Victor Gaudioso, Antoni Dol(-2-), Brian Genisio, Shawn Wildermuth, Mike Snow, Phil Middlemiss, Pete Brown, Kirupa, Dan Wahlin, Glenn Block, Jeff Prosise, Anoop Madhusudanan, and Adam Kinney. Shoutouts: Victor Gaudioso would like you to Checkout my Interview with Microsoft’s Murray Gordon at MIX 10 Pete Brown announced: Connected Show Podcast #29 With … Me! From SilverlightCream.com: New Silverlight Video Tutorial: How to Create Fast Forward for the MediaElement Victor Gaudioso's latest video tutorial is on creating the ability to fast-forward a MediaElement... check it out in the tutorial player itself! Overlapping TabItems with the Silverlight Toolkit TabControl Antoni Dol has a very cool tutorial up on the Toolkit TabItems control... not only is he overlapping them quite nicely but this is a very cool tutorial... QuoteFloat: Animating TextBlock PlaneProjections for a spiraling effect in Silverlight Antoni Dol also has a Blend tutorial up on animating TextBlock items... run the demo and you'll want to read the rest :) Adventures in MVVM – My ViewModel Base – Silverlight Support! Brian Genisio continues his MVVM tutorials with this update on his ViewModel base using some new C# 4.0 features, and fully supports Silverlight and WPF My Thoughts on the Windows Phone 7 Shawn Wildermuth gives his take on WP7. He included a port of his XBoxGames app to WP7 ... thanks Shawn! Silverlight Tip of the Day #20 – Using Tooltips in Silverlight I figured Mike Snow was going to overrun me with tips since I have missed a couple days, but there's only one! ... and it's on Tooltips. Animating the Silverlight opacity mask Phil Middlemiss has an article at SilverZine describing a Behavior he wrote (and is sharing) that turns a FrameworkElement into an opacity mask for it's parent container... cool demo on the page too. Breaking Apart the Margin Property in Xaml for better Binding Pete Brown dug in on a Twitter message and put some thoughts down about breaking a Margin apart to see about binding to the individual elements. Building a Simple Windows Phone App Kirupa has a 6-part tutorial up on building not-your-typical first WP7 application... all good stuff! Integrating HTML into Silverlight Applications Dan Wahlin has a post up discussing three ways to display HTML inside a Silverlight app. Hello MEF in Silverlight 4 and VB! (with an MVVM Light cameo) Glenn Block has a post up discussing MEF, MVVM, and it's in VB this time... and it's actually a great tutorial top to bottom... all source included of course :) Understanding Input Scope in Silverlight for Windows Phone Jeff Prosise has a good post up on the WP7 SIP and how to set the proper InputScope to get the SIP you want. Thinking about Silverlight ‘desktop’ apps – Creating a Standalone Installer for offline installation (no browser) Anoop Madhusudanan is discussing something that's been floating around for a while... installing Silverlight from, say, a CD or DVD when someone installs your app. He's got some good code, but be sure to read Tim Heuer and Scott Guthrie's comments, and consider digging deeper into that part. Using FluidMoveBehavior to animate grid coordinates in Silverlight Adam Kinney has a cool post up on animating an object using the FluidMotionBehavior of Blend 4... looks great moving across a checkerboard... check out the demo, then grab the code. 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

  • Having problem with C++ file handling

    - by caramel1991
    Our lecturer has given us a task,I've attempted it and try every single effort I can,but I still struggle with one of the problem in it,here goes the question: The company you work at receives a monthly report in a text format. The report contains the following information. • Department Name • Head of Department Name • Month • Minimum spending of the month • Maximum spending of the month Your program is to obtain the name of the input file from the user. Implement a structure to represent the data: Once the file has been read into your program, print out the following statistics for the user: • List which department has the minimum spending per month by month • List which department has the minimum spending by month by month Write the information into a file called “MaxMin.txt” Then do a processing so that the Department Name, Head of Department Name, Minimum spending and Maximum spending are written to separate files based on the month, eg Jan, Feb, March and so on. and of course our lecturer does send us a text file with the content: Engineering Bill Jan 2000 15000 IT Jack Jan 300 20000 HR Jill Jan 1500 10000 Engineering Bill Feb 5000 45000 IT Jack Feb 4500 7000 HR Jill Feb 5600 60000 Engineering Bill Mar 5000 45000 IT Jack Mar 4500 7000 HR Jill Mar 5600 60000 Engineering Bill Apr 5000 45000 IT Jack Apr 4500 7000 HR Jill Apr 5600 60000 Engineering Bill May 2000 15000 IT Jack May 300 20000 HR Jill May 1500 10000 Engineering Bill Jun 2000 15000 IT Jack Jun 300 20000 HR Jill Jun 1500 10000 and here's the c++ code I've written ue#include include include using namespace std; struct Record { string depName; string head; string month; float max; float min; string name; }myRecord[19]; int main () { string line; ofstream minmax,jan,feb,mar,apr,may,jun; char a[50]; char b[50]; int i = 0,j,k; float temp; //float maxjan=myRecord[0].max,maxfeb=myRecord[0].max,maxmar=myRecord[0].max,maxapr=myRecord[0].max,maxmay=myRecord[0].max,maxjune=myRecord[0].max; float minjan=myRecord[1].min,minfeb=myRecord[1].min,minmar=myRecord[1].min,minapr=myRecord[1].min,minmay=myRecord[1].min,minjune=myRecord[1].min; float maxjan=0,maxfeb=0,maxmar=0,maxapr=0,maxmay=0,maxjune=0; //float minjan=0,minfeb=0,minmar=0,minapr=0,minmay=0,minjune=0; string maxjanDep,maxfebDep,maxmarDep,maxaprDep,maxmayDep,maxjunDep; string minjanDep,minfebDep,minmarDep,minaprDep,minmayDep,minjunDep; cout<<"Enter file name: "; cina; ifstream myfile (a); //minmax.open ("MaxMin.txt"); if (myfile.is_open()){ while (! myfile.eof()){ myfilemyRecord[i].depNamemyRecord[i].headmyRecord[i].monthmyRecord[i].minmyRecord[i].max; cout << myRecord[i].depName<<"\t"< cout<<"Enter file name: "; cinb; ifstream myfile1 (b); minmax.open ("MaxMin.txt"); jan.open ("Jan.txt"); feb.open ("Feb.txt"); mar.open ("March.txt"); apr.open ("April.txt"); may.open ("May.txt"); jun.open ("Jun.txt"); if (myfile1.is_open()){ while (! myfile1.eof()){ myfile1myRecord[i].depNamemyRecord[i].headmyRecord[i].monthmyRecord[i].minmyRecord[i].max; if (myRecord[i].month == "Jan"){ jan<< myRecord[i].depName<<"\t"< if (maxjan< myRecord[i].max){ maxjan=myRecord[i].max; maxjanDep=myRecord[i].depName;} //if (minjan myRecord[i].min){ // minjan=myRecord[i].min; //minjanDep=myRecord[i].depName; //} for (k=1;k<=3;k++){ for (j=0;j<2;j++){ if (myRecord[j].minmyRecord[j+1].min){ temp=myRecord[j].min; myRecord[j].min=myRecord[j+1].min; myRecord[j+1].min=temp; minjanDep=myRecord[j].depName; }}} } if (myRecord[i].month == "Feb"){ feb<< myRecord[i].depName<<"\t"< //if (minfebmyRecord[i].min){ //minfeb=myRecord[i].min; //minfebDep=myRecord[i].depName; //} for (k=1;k<=3;k++){ for (j=0;j<2;j++){ if (myRecord[j].minmyRecord[j+1].min){ temp=myRecord[j].min; myRecord[j].min=myRecord[j+1].min; myRecord[j+1].min=temp; minfebDep=myRecord[j+1].depName; }}} } if (myRecord[i].month == "Mar"){ mar<< myRecord[i].depName<<"\t"< if (myRecord[i].month == "Apr"){ apr<< myRecord[i].depName<<"\t"< if (minaprmyRecord[i].min){ minapr=myRecord[i].min; minaprDep=myRecord[i].min;} } if (myRecord[i].month == "May"){ may< if (minmaymyRecord[i].min){ minmay=myRecord[i].min; minmayDep=myRecord[i].depName;} } if (myRecord[i].month == "Jun"){ jun<< myRecord[i].depName<<"\t"< if (minjunemyRecord[i].min){ minjune=myRecord[i].min; minjunDep=myRecord[i].depName;} } i++; myfile.close(); } minmax<<"department that has maximum spending at jan "< else{ cout << "Unable to open file"< } sorry inside that code ue#include should has iostream along with another two #include fstream and string,but at here it was treated as html tag,so i can't type it. my problem here is,I can't seems to get the minimum spending,I've try all I can but I'm still lingering on it,any idea??THANK YOU!

    Read the article

  • Help with jQuery Traversal

    - by Jack Webb-Heller
    Hi guys, I'm struggling a bit with traversing in jQuery. Here's the relevant markup: <ul id="sortable" class="ui-sortable"> <li> <img src="http://ecx.images-amazon.com/images/I/51Vza76tCxL._SL160_.jpg"> <div class="controls"> <span class="move">?</span> <span class="delete">?</span> </div> <div class="data"> <h1>War and Peace (Oxford World's Classics)</h1> <textarea>Published to coincide with the centenary of Tolstoy's death, here is an exciting new edition of one of the great literary works of world literature.</textarea> </div> </li> <li> <img src="http://ecx.images-amazon.com/images/I/51boZxm2seL._SL160_.jpg"> <div class="controls"> <span class="move">?</span> <span class="delete">?</span> </div> <div class="data"> <h1>A Christmas Carol and Other Christmas Writings (Penguin Classics)</h1> <span>Optionally, write your own description in the box below.</span> <textarea>Dicken's Christmas writings-in a new, sumptuous, and delightful clothbound edition.</textarea> </div> </li> </ul> This is code for a jQuery UI 'Sortable' element. Here's what I want to happen. When the Delete thing is clicked ($('.delete')), I want the <li> item it's contained within to be removed. I've tried using $('.delete').parent().parent().remove(); but in the case of having two items, that seems to delete both of them. I'm a bit confused by this. I also tried using closest() to find the closest li, but that didn't seem to work either. How should I best traverse the DOM in this case? Thanks! Jack

    Read the article

  • jQuery jScrollPane - it simply won't work! :'(

    - by Jack Webb-Heller
    Hey folks, OK - I'll admit, I'm quite a beginner in this jQuery-department. I've probably made some amateur mistake, but hey, you gotta learn somewhere! :) So I'm using jScrollPane: http://www.kelvinluck.com/assets/jquery/jScrollPane/jScrollPane.html I want to use it style the scrollable area in my second column. Specifically, I would like to apply and format the scrollbars on the div #ajaxresults My page is... rather jQuery heavy. I don't know if any variables are conflicting or something... in fact I really have no idea at all why this isn't working. Take a look at my problematic page: http://furnace.howcode.com In the header, I've set this to go: <!-- Includes for jScrollPane --> <script type="text/javascript" src="http://localhost:8888/js/jquery.mousewheel.min.js"></script> <script type="text/javascript" src="http://localhost:8888/js/jScrollPane.js"></script> <link rel="stylesheet" type="text/css" media="all" href="http://localhost:8888/stylesheets/jScrollPane.css" /> <script type="text/javascript"> $(function() { $('#ajaxresults').jScrollPane(); }); </script> (I've changed localhost on the server copy though) Nothing ever seems to work with the #ajaxresults div. I've set, as the jScrollPane docs say, overflow:auto on it but still no luck. I find that when jScrollPane DOES seem to 'run' it just moves the div down about 100 pixels. Try it for yourself. Perhaps someone could help? There's quite a few jQuery plugins there so I don't know if something's colliding/crashing etc... Please note the site is still in development between myself and a friend, which explains the personal messages we submit to each other ('Hi Donnie!' etc. :D ). Also, when you view the page nothing may appear in the second column for a few seconds - it's just fetching the data via Ajax. So give it a little time. Thanks very much! Jack

    Read the article

  • Java delimiter reader

    - by newbieprogrammer
    I have a colon-delimited text file containing grouped, related data. The People group contains people's names followed by their ages, separated by colons. How can I parse the text and group people according to their ages? The structure is as follows: Group.txt Age:10:20:30:40: Group:G1:10:G2:30:G3:20:G4:40: People:Jack:10:Tom:30:Dick:20:Harry:10:Paul:10:Peter:20: People:Mary:20:Lance:10: And I want to display something like this: G1 Jack Harry Paul Lance G2 Dick Peter Marry G3 Tom G4

    Read the article

  • What's the best way to return stuff from a PHP function, and simultaneously trigger a jQuery action?

    - by Jack Webb-Heller
    So the title is a tad ambiguous, but I'll try and give an example. Basically, I have an 'awards' system (similar to that of StackOverflow's badges) in my PHP/CodeIgniter site, and I want, as soon as an award is earned, a notification to appear to the user. Now I'm happy to have this appear on the next page load, but, ideally I'd like it to appear as soon as the award is transactioned since my site is mostly Ajax-powered and there may not be page reloads very often. The way the system works currently, is: 1) If the user does something to trigger the earning of an award, CodeIgniter does this: $params['user_id'] = $this->tank_auth->get_user_id(); $params['award_id'] = 1; // (I have a database table with different awards in) $this->awards->award($params); 2) My custom library, $this->awards, runs the award function: function award($params) { $sql = $this->ci->db->query("INSERT INTO users_awards (user_id, award_id) VALUES ('".$params['user_id']."','".$params['award_id']."') ON DUPLICATE KEY UPDATE duplicate=duplicate+1"); $awardinfo = $this->ci->db->query("SELECT * FROM awards WHERE id = ".$params['award_id']); // If it's the 'first time' the user has gotten the award (e.g. they've earnt it) if ($awardinfo->row('duplicate') == 0) { $params['title'] = $awardinfo->row('title'); $params['description'] = $awardinfo->row('description'); $params['iconpath'] = $awardinfo->row('iconpath'); $params['percentage'] = $awardinfo->row('percentage'); return $params; } } So, it awards the user (and if they've earnt it twice, updates a useless duplicate field by one), then checks if it's the first time they've earnt it (so it can alert them of the award). If so, it gets the variables (title of the award, the award description, the path to an icon to display for the award, and finally the percentage of users who have also got this award) and returns them as an array. So... that's that. Now I'd like to know, what's the best way to do this? Currently my Award-giving bit is called from a controller, but I guess if I want this to trigger via Ajax, then the code should be placed in a View file...? To sum it up: I need the returned award data to appear without a page refresh. What's the best way of doing this? (I'm already using jQuery on my page). Thanks very much everybody! Jack

    Read the article

  • How to Lookup For something main VBA

    - by gorPweN
    Hi, I wanna know how to Lookup For many number in a column A corresponding to a name in Column B By coding in VBA..And Write it in column C??? Thanks in advance..Im new in this... Exemple A B C 200-333 Jack 200-345 Lea 200-346 Fresh 200-347 Tide Jack 200-323 Tide Lea Fresh 200-344 Tide

    Read the article

  • what's the right way to bind sqldatasource to asp:label in asp.net 4.0?

    - by cskilbeck
    Is it possible using Eval? If so, can someone post a short fragment to illustrate? My SqlDataSource returns 1 record with 3 fields, I'd like to Format these into a string. eg: Record Field 'Name' = 'Jack' Field 'Amount' = 100 Field 'Date' = 12.02.2010 asp:Label text should end up being: Welcome Jack, last payment was 100 on 12.02.2010 if another control than asp:Label is appropriate, that would be good to know also.

    Read the article

  • iPhone: Grouped tables and navigation controller issues

    - by Jack Griffiths
    Hi there, I've set up a grouped table on my app, and pushing to new views works fine. Except for one thing. The titles and stack layout are all weird. Here's the breakdown: I have two sections in my table. When I tap on the first row in the first section, it takes me to the correct view, but the title of the new view is the name of the first row in the second section of the table. In turn, the second row in the first section's title is the second row in the second section's title. If I tap on the second row in the second section of the root view table, the navigation button goes to the second row in the first section of the table. So here's a diagram of my table: Table Section 1 Row 1 Row 2 Row 3 Table Section 2 Row A Row B Row C So if I tap on row 3, the title of the pushed view is Row C. The navigation button tells me to go back to Row 3, then eventually ending up at the root view. Here's my implementation file pushing the views: - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { //CSS if ([[arryClientSide objectAtIndex:indexPath.row] isEqual:@"CSS"]) { CSSViewController *css = [[CSSViewController alloc] initWithNibName:@"CSSViewController" bundle:nil]; [css setTitle:@"CSS"]; [self.navigationController pushViewController:css animated:YES]; } //HTML if ([[arryClientSide objectAtIndex:indexPath.row] isEqual:@"HTML"]) { HTMLViewController *html = [[HTMLViewController alloc] initWithNibName:@"HTMLViewController" bundle:nil]; [html setTitle:@"HTML"]; [self.navigationController pushViewController:html animated:YES]; } //JS if ([[arryClientSide objectAtIndex:indexPath.row] isEqual:@"JavaScript"]) { JSViewController *js = [[JSViewController alloc] initWithNibName:@"JSViewController" bundle:nil]; [js setTitle:@"JavaScript"]; [self.navigationController pushViewController:js animated:YES]; } //PHP if ([[arryServerSide objectAtIndex:indexPath.row] isEqual:@"PHP"]) { PHPViewController *php = [[PHPViewController alloc] initWithNibName:@"PHPViewController" bundle:nil]; [php setTitle:@"PHP"]; [self.navigationController pushViewController:php animated:YES]; } //SQL if ([[arryServerSide objectAtIndex:indexPath.row] isEqual:@"SQL"]) { SQLViewController *sql = [[SQLViewController alloc] initWithNibName:@"SQLViewController" bundle:nil]; [sql setTitle:@"SQL"]; [self.navigationController pushViewController:sql animated:YES]; } & the array feeding the table's data: - (void)viewDidLoad { [super viewDidLoad]; arryClientSide = [[NSArray alloc] initWithObjects:@"CSS",@"HTML",@"JavaScript",nil]; arryServerSide = [[NSArray alloc] initWithObjects:@"Objective-C", @"PHP",@"SQL",nil]; // arryResources = [[NSArray alloc] initWithObjects:@"HTML Colour Codes", @"Useful Resources", @"About",nil]; self.title = @"Select a Language"; [super viewDidLoad]; // Uncomment the following line to display an Edit button in the navigation bar for this view controller. // self.navigationItem.rightBarButtonItem = self.editButtonItem; } Any help would be greatly appreciated. Jack

    Read the article

  • Sqlite Database LEAK FOUND exception in android?

    - by androidbase
    hi all, i am getting this exception in database Leak Found my LOGCAT Shows this: 02-17 17:20:37.857: INFO/ActivityManager(58): Starting activity: Intent { cmp=com.example.brown/.Bru_Bears_Womens_View (has extras) } 02-17 17:20:38.477: DEBUG/dalvikvm(434): GC freed 1086 objects / 63888 bytes in 119ms 02-17 17:20:38.556: ERROR/Database(434): Leak found 02-17 17:20:38.556: ERROR/Database(434): java.lang.IllegalStateException: /data/data/com.example.brown/databases/BRUNEWS_DB_01.db SQLiteDatabase created and never closed 02-17 17:20:38.556: ERROR/Database(434): at android.database.sqlite.SQLiteDatabase.<init>(SQLiteDatabase.java:1694) 02-17 17:20:38.556: ERROR/Database(434): at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:738) 02-17 17:20:38.556: ERROR/Database(434): at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:760) 02-17 17:20:38.556: ERROR/Database(434): at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:753) 02-17 17:20:38.556: ERROR/Database(434): at android.app.ApplicationContext.openOrCreateDatabase(ApplicationContext.java:473) 02-17 17:20:38.556: ERROR/Database(434): at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:193) 02-17 17:20:38.556: ERROR/Database(434): at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:98) 02-17 17:20:38.556: ERROR/Database(434): at com.example.brown.Brown_Splash.onCreate(Brown_Splash.java:52) 02-17 17:20:38.556: ERROR/Database(434): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 02-17 17:20:38.556: ERROR/Database(434): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459) 02-17 17:20:38.556: ERROR/Database(434): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512) 02-17 17:20:38.556: ERROR/Database(434): at android.app.ActivityThread.access$2200(ActivityThread.java:119) 02-17 17:20:38.556: ERROR/Database(434): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863) 02-17 17:20:38.556: ERROR/Database(434): at android.os.Handler.dispatchMessage(Handler.java:99) 02-17 17:20:38.556: ERROR/Database(434): at android.os.Looper.loop(Looper.java:123) 02-17 17:20:38.556: ERROR/Database(434): at android.app.ActivityThread.main(ActivityThread.java:4363) 02-17 17:20:38.556: ERROR/Database(434): at java.lang.reflect.Method.invokeNative(Native Method) 02-17 17:20:38.556: ERROR/Database(434): at java.lang.reflect.Method.invoke(Method.java:521) 02-17 17:20:38.556: ERROR/Database(434): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860) 02-17 17:20:38.556: ERROR/Database(434): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) 02-17 17:20:38.556: ERROR/Database(434): at dalvik.system.NativeStart.main(Native Method) how can i solve it??? thanks in advance...

    Read the article

  • Invoking brill tagger through C#

    - by Toshal Mokadam
    We want to use brill tagger such that on a button click, it will tag the Input.txt into output.txt. So we have created a new visual studio project and put a button. On button click event we wrote the following code. There are no errors and we can see the command prompt getting invoked. But the output file is not getting created. The code is as follows. could you pls guide us?? private void button1_Click(object sender, EventArgs e) { ProcessStartInfo brillStartInfo = new ProcessStartInfo(@"C:\Users\toshal\Documents\Visual Studio 2008\Projects\brill tagger\bin\brill.exe"); brillStartInfo.Arguments = "/C brill.exe LEXICON.BROWN Input.txt BIGRAMS LEXICALRULEFILE.BROWN CONTEXTUALRULEFILE.BROWN > output.txt"; brillStartInfo.UseShellExecute = false; brillStartInfo.RedirectStandardOutput = true; brillStartInfo.RedirectStandardError = true; brillStartInfo.CreateNoWindow = false; Process brill = new Process(); brill.StartInfo = brillStartInfo; brill.Start(); string output = brill.StandardOutput.ReadToEnd(); brill.WaitForExit(); }

    Read the article

  • jQuery does not return a JSON object to Firebug when JSON is generated by PHP

    - by Keyslinger
    The contents of test.json are: {"foo": "The quick brown fox jumps over the lazy dog.","bar": "ABCDEFG","baz": [52, 97]} When I use the following jQuery.ajax() call to process the static JSON inside test.json, $.ajax({ url: 'test.json', dataType: 'json', data: '', success: function(data) { $('.result').html('<p>' + data.foo + '</p>' + '<p>' + data.baz[1] + '</p>'); } }); I get a JSON object that I can browse in Firebug. However, when using the same ajax call with the URL pointing instead to this php script: <?php $arrCoords = array('foo'=>'The quick brown fox jumps over the lazy dog.','bar'=>'ABCDEFG','baz'=>array(52,97)); echo json_encode($arrCoords); ?> which prints this identical JSON object: {"foo":"The quick brown fox jumps over the lazy dog.","bar":"ABCDEFG","baz":[52,97]} I get the proper output in the browser but Firebug only reveals only HTML. There is no JSON tab present when I expand GET request in Firebug.

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >