Search Results

Search found 2919 results on 117 pages for 'brian genisios house of bilz'.

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

  • A design for watching IPTV anywhere in the house?

    - by Carlos
    I'm currently getting TV and internet via IP to my house. The service comes into an ISP-supplied Router (ST585) which is in turn connected to an IPTV box. I need to replace the router, as it's port forwarding seems to be broken, so I was thinking of getting a box with an IGMP proxy. I once mistakenly got a non-IGMP box, with the result that the internet worked, but the IPTV didn't. The trouble is, I have no idea how to set up the IPTV part of the installation. I do have a copy of the ST585 configuration, but it doesn't look anything like the Cisco stuff that I learned about at CCNA. What are the steps necessary to reproduce the IGMP setup? I was thinking of WireSharking the communications on the network, but I suppose I'd need a hub for that? As a bonus, since the packets are coming in with the TV signal, is it possible to mess with the IGMP setup so I can watch TV anywhere in the house?

    Read the article

  • Is it possible to have a wireless in-house NAS with wireless data transfer rates of equivalent to SATA speeds?

    - by techaddict
    Basically I would like to know, if it is possible to set up an NAS in my house to be accessed wirelessly, that can reach equivalent real-life data transfer speeds to USB 3.0 or an internal SATA hard drive. I have been wanting to do this for some time ( a couple of years now). Basically, this is what I want to do: Plug in a number of hard drives in an array, somewhere in my house, to be left plugged in and never have to be monitored. Ideally several terabytes. Whenever I am home, to have my computer and laptop configured to automatically find the NAS, as easy as plugging in an external hard drive - except completely wirelessly. Data transfer needs to be as seamless and quick as having added another internal hard drive in my laptop. Moreover, data should be able to accessed without having to copy it over - I should be able to wirelessly access the NAS and browse files, and open files directly from the NAS. For example, say I wanted to open a video - I should be able to play the video that is located on the NAS, directly from the NAS, completely wirelessly. If I wanted to open a .pdf file, I should be able to open it and read it directly from the NAS, as if it were located on my physical internal hard drive. Cost is important as well. Please tell me what equipment I need for this to be possible. I know you geniuses out there who can tell me if this is possible.

    Read the article

  • FREE goodies if you are a UK based software house already live on the Windows Azure Platform

    - by Eric Nelson
    In the UK we have seen some fantastic take up around the Windows Azure Platform and we have lined up some great stuff in 2011 to help companies fully exploit the Cloud – but we need you to tell us what you are up to! Once you tell us about your plans around Windows Azure, you will get access to FREE benefits including email based developer support and free monthly allowance of Windows Azure, SQL Azure and AppFabric from Jan 2011 – and more! (This offer is referred to as Cloud Essentials and is explained here) And… we will be able to plan the right amount of activity to continue to help early adopters through 2011. Step 1: Sign up your company to Microsoft Platform Ready (you will need a windows live id to do this) Step 2: Add your applications For each application, state your intention around Windows Azure (and SQL etc if you so wish) Step 3: Verify your application works on the Windows Azure Platform Step 4 (Optional): Test your application works on the Windows Azure Platform Download the FREE test tool. Test your application with it and upload the successful results. Step 5: Revisit the MPR site in early January to get details of Cloud Essentials and other benefits P.S. You might want some background on the “fantastic take up” bit: We helped over 3000 UK companies deploy test applications during the beta phase of Windows Azure We directly trained over 1000 UK developers during 2010 We already have over 100 UK applications profiled on the Microsoft Platform Ready site And in a recent survey of UK ISVs you all look pretty excited around Cloud – 42% already offer their solution on the Cloud or plan to.

    Read the article

  • On my Mac, under the 'Shared' folder it shows another computer in my house, am I hacked?

    - by user27449
    I didnt' setup any connection to another computer in my house (its a PC), and I just noticed under my 'Shared' folder in the file explorer on my Mac laptop I see the name of the PC. How could this have shown up when I didn't even try to connect to it before? Could I possibly be hacked or is this normal it just scanned our internal wireless network? I havent' setup any kind of network really, just have a wireless modem that other computers share.

    Read the article

  • Using selection sort in java to sort floats

    - by user334046
    Hey, I need to sort an array list of class house by a float field in a certain range. This is my code for the selection sort: public ArrayList<House> sortPrice(ArrayList<House> x,float y, float z){ ArrayList<House> xcopy = new ArrayList<House>(); for(int i = 0; i<x.size(); i++){ if(x.get(i).myPriceIsLessThanOrEqualTo(z) && x.get(i).myPriceIsGreaterThanOrEqualTo(y)){ xcopy.add(x.get(i)); } } ArrayList<House> price= new ArrayList<House>(); while(xcopy.size()>0){ House min = xcopy.get(0); for(int i = 1; i < xcopy.size();i++){ House current = xcopy.get(i); if (current.myPriceIsGreaterThanOrEqualTo(min.getPrice())){ min = current; } } price.add(min); xcopy.remove(min); } return price; } Here is what the house class looks like: public class House { private int numBedRs; private int sqft; private float numBathRs; private float price; private static int idNumOfMostRecentHouse = 0; private int id; public House(int bed,int ft, float bath, float price){ sqft = ft; numBathRs = bath; numBedRs = bed; this.price = price; idNumOfMostRecentHouse++; id = idNumOfMostRecentHouse; } public boolean myPriceIsLessThanOrEqualTo(float y){ if(Math.abs(price - y)<0.000001){ return true; } return false; } public boolean myPriceIsGreaterThanOrEqualTo(float b){ if(Math.abs(b-price)>0.0000001){ return true; } return false; } When i call looking for houses in range 260000.50 to 300000 I only get houses that are at the top of the range even though I have a lower value at 270000. Can someone help?

    Read the article

  • How to optimise MySQL query containing a subquery?

    - by aidan
    I have two tables, House and Person. For any row in House, there can be 0, 1 or many corresponding rows in Person. But, of those people, a maximum of one will have a status of "ACTIVE", the others will all have a status of "CANCELLED". e.g. SELECT * FROM House LEFT JOIN Person ON House.ID = Person.HouseID House.ID | Person.ID | Person.Status 1 | 1 | CANCELLED 1 | 2 | CANCELLED 1 | 3 | ACTIVE 2 | 1 | ACTIVE 3 | NULL | NULL 4 | 4 | CANCELLED I want to filter out the cancelled rows, and get something like this: House.ID | Person.ID | Person.Status 1 | 3 | ACTIVE 2 | 1 | ACTIVE 3 | NULL | NULL 4 | NULL | NULL I've achieved this with the following sub select: SELECT * FROM House LEFT JOIN ( SELECT * FROM Person WHERE Person.Status != "CANCELLED" ) Person ON House.ID = Person.HouseID ...which works, but breaks all the indexes. Is there a better solution that doesn't? I'm using MySQL and all relevant columns are indexed. EXPLAIN lists nothing in possible_keys. Thanks.

    Read the article

  • Use HTTP PUT to create new cache (ehCache) running on the same Tomcat?

    - by socal_javaguy
    I am trying to send a HTTP PUT (in order to create a new cache and populate it with my generated JSON) to ehCache using my webservice which is on the same local tomcat instance. Am new to RESTful Web Services and am using JDK 1.6, Tomcat 7, ehCache, and JSON. I have my POJOs defined like this: Person POJO: import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement public class Person { private String firstName; private String lastName; private List<House> houses; // Getters & Setters } House POJO: import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement public class House { private String address; private String city; private String state; // Getters & Setters } Using a PersonUtil class, I hardcoded the POJOs as follows: public class PersonUtil { public static Person getPerson() { Person person = new Person(); person.setFirstName("John"); person.setLastName("Doe"); List<House> houses = new ArrayList<House>(); House house = new House(); house.setAddress("1234 Elm Street"); house.setCity("Anytown"); house.setState("Maine"); houses.add(house); person.setHouses(houses); return person; } } Am able to create a JSON response per a GET request: @Path("") public class MyWebService{ @GET @Produces(MediaType.APPLICATION_JSON) public Person getPerson() { return PersonUtil.getPerson(); } } When deploying the war to tomcat and pointing the browser to http://localhost:8080/personservice/ Generated JSON: { "firstName" : "John", "lastName" : "Doe", "houses": [ { "address" : "1234 Elmstreet", "city" : "Anytown", "state" : "Maine" } ] } So far, so good, however, I have a different app which is running on the same tomcat instance (and has support for REST): http://localhost:8080/ehcache/rest/ While tomcat is running, I can issue a PUT like this: echo "Hello World" | curl -S -T - http://localhost:8080/ehcache/rest/hello/1 When I "GET" it like this: curl http://localhost:8080/ehcache/rest/hello/1 Will yield: Hello World What I need to do is create a POST which will put my entire Person generated JSON and create a new cache: http://localhost:8080/ehcache/rest/person And when I do a "GET" on this previous URL, it should look like this: { "firstName" : "John", "lastName" : "Doe", "houses": [ { "address" : "1234 Elmstreet", "city" : "Anytown", "state" : "Maine" } ] } So, far, this is what my PUT looks like: @PUT @Path("/ehcache/rest/person") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) public Response createCache() { ResponseBuilder response = Response.ok(PersonUtil.getPerson(), MediaType.APPLICATION_JSON); return response.build(); } Question(s): (1) Is this the correct way to write the PUT? (2) What should I write inside the createCache() method to have it PUT my generated JSON into: http://localhost:8080/ehcache/rest/person (3) What would the command line CURL comment look like to use the PUT? Thanks for taking the time to read this...

    Read the article

  • LEFT OUTER JOIN SUM doubles problem

    - by Michael
    Hi I've got two tables: Table: Shopping shop_id shop_name shop_time 1 Brian 40 2 Brian 31 3 Tom 20 4 Brian 30 Table:bananas banana_id banana_amount banana_person 1 1 Brian 2 1 Brian I now want it to print: Name: Tom | Time: 20 | Bananas: 0 Name: Brian | Time: 101 | Bananas: 2 I used this code: $result = dbquery("SELECT tz.*, tt.*, SUM(shop_time) as shoptime, count(banana_amount) as bananas FROM shopping tt LEFT OUTER JOIN bananas tz ON tt.shop_name=tz.banana_person GROUP by banana_person LIMIT 40 "); while ($data5 = dbarray($result)) { echo 'Name: '.$data5["shop_name"].' | Time: '.$data5["shoptime"].' | Bananas: '.$data5["bananas"].'<br>'; } The problem is that I get this instead: Name: Tom | Time: 20 | Bananas: 0 Name: Brian | Time: 202 | Bananas: 6 I just don't know how to get around this.

    Read the article

  • In Java Concurrency In Practice by Brian Goetz, why is the Memoizer class not annotated with @ThreadSafe?

    - by dig_dug
    Java Concurrency In Practice by Brian Goetz provides an example of a efficient scalable cache for concurrent use. The final version of the example showing the implementation for class Memoizer (pg 108) shows such a cache. I am wondering why the class is not annotated with @ThreadSafe? The client, class Factorizer, of the cache is properly annotated with @ThreadSafe. The appendix states that if a class is not annotated with either @ThreadSafe or @Immutable that it should be assumed that it isn't thread safe. Memoizer seems thread-safe though. Here is the code for Memoizer: public class Memoizer<A, V> implements Computable<A, V> { private final ConcurrentMap<A, Future<V>> cache = new ConcurrentHashMap<A, Future<V>>(); private final Computable<A, V> c; public Memoizer(Computable<A, V> c) { this.c = c; } public V compute(final A arg) throws InterruptedException { while (true) { Future<V> f = cache.get(arg); if (f == null) { Callable<V> eval = new Callable<V>() { public V call() throws InterruptedException { return c.compute(arg); } }; FutureTask<V> ft = new FutureTask<V>(eval); f = cache.putIfAbsent(arg, ft); if (f == null) { f = ft; ft.run(); } } try { return f.get(); } catch (CancellationException e) { cache.remove(arg, f); } catch (ExecutionException e) { throw launderThrowable(e.getCause()); } } } }

    Read the article

  • Windows won't boot after moving house. How do I solve this?

    - by James
    Ive just moved house and tried to set up my desktop after packing it away and now when I power it on, the BIOS boots up and no errors are found but when my computer tires to boot into Windows 7 a continuous fast beeping sound is made and a black screen is displayed. What I've done so far: Reset to UEFI defauts Played about with RAM, I had 4*4 GB sticks, I took all of them out to test for a mobo error which I have and now im only using 1 stick of 4 GB. Changed my GPU, I tok my gtx580 out and now im using the onboard Intel 3000 graphics driver, the BIOS and uefi are correctly displaying so I no longer think its a GPU based error. Ive check all of the connections and nothing seems to be loose. My HDD setup is: 2 128 GB SSD's in Raid 0 as my main C drive (possibly cause of error?) 1 1 TB Games drive 1 2 TB Data Drive Ive also got a blueray drive connected. After searching the internet im pretty much out of suggestions but im currently downloading a live CD to see if it will boot and if I can access some files on my HDD.

    Read the article

  • Which free RDBMS is best for small in-house development?

    - by Nic Waller
    I am the sole sysadmin for a small firm of about 50 people, and I have been asked to develop an in-house application for tracking job completion and providing reports based on that data. I'm planning on building it as a web application. I have roughly equal experience developing for MySQL, PostgreSQL, and MSSQL. We are primarily a Windows-based shop, but I'm fairly comfortable with both Windows and Linux system administration. These are my two biggest concerns: Ease of managability. I don't expect to be maintaining this database forever. For the sake of the person that eventually has to take over for me, which database has the lowest barrier to entry? Data integrity. This means transaction-safe, robust storage, and easy backup/recovery. Even better if the database can be easily replicated. There is not a lot of budget for this project, so I am restricted to working with one of the free database systems mentioned above. What would you choose?

    Read the article

  • Cannot log in with created user in mysql

    - by Brian G
    Using this command GRANT ALL PRIVILEGES ON *.* to brian@'%' identified by 'password'; I try to login with: mysql -u brian -ppassword The error is: ERROR 1045 (28000): Access denied for user 'brian'@'localhost' (using password: YES) I am doing this as root and I did try to flush privileges. I tried this with countless users but it does not seem to work. I can create a user with no password and login works. Command line and from phpmyadmin

    Read the article

  • SQL..Sum two rows

    - by Cha
    Sample data: LOCATION NAME LABEL1 LABEL2 SERVICE TIME NY Andrew A B HOUSE 2555 NY Andrew A B CAR 35 NJ Copley C A HOUSE 1025 NY Copley A B HOUSE 650 VA Dalton D C PET 25 What I want to do ias add another column where in it shows sum(Time) of rows with same data except for the Service.Also, the services that I need are only the sum of car and house.Is this possible? If not can you help me with the right query Sample output I need: LOCATION NAME LABEL1 LABEL2 SERVICE TIME SUM NY Andrew A B HOUSE 2555 **2590** NY Andrew A B CAR 35 NJ Copley C A HOUSE 1025 1025 NY Copley A B HOUSE 650 650

    Read the article

  • Removing entity bug

    - by Greg
    hello, I am trying out the ria services and I am experiencing this problem that seems very strange to me. I am creating a new entity of type "House" and add it to context without saving the context so the id of the new entity is 0, after i remove this entity and add another new entity of type "House" again and again without saving the context, here comes the weird part, now I have an entity of type "City" which holds entityset of all "Houses" in that city, so to put the newly created entity "House" into the city i do something like this - house.City = city, where house is type "House" and city is type "City", afte this step a check the context and suddenly there are 2 entities of type "House" with id 0, one of them is the one I have deleted at the beginning. Any idea what is causing this and how to fix it?? thank you Greg

    Read the article

  • ria entity remove bug

    - by Greg
    hello, I am trying out the ria services and I am experiencing this problem that seems very strange to me. I am creating a new entity of type "House" and add it to context without saving the context so the id of the new entity is 0, after i remove this entity and add another new entity of type "House" again and again without saving the context, here comes the weird part, now I have an entity of type "City" which holds entityset of all "Houses" in that city, so to put the newly created entity "House" into the city i do something like this - house.City = city, where house is type "House" and city is type "City", afte this step a check the context and suddenly there are 2 entities of type "House" with id 0, one of them is the one I have deleted at the beginning. Any idea what is causing this and how to fix it?? thank you Greg

    Read the article

  • NoSQL: How to retrieve a 'house' based on lat & long?

    - by Tedk
    I have a NoSQL system for storing real estate houses. One piece of information I have in my key-value store for each house is the longitude and latitude. If I wanted to retrieve all houses within a geo-lat/long box, like the SQL below: SELECT * from houses WHERE latitude IS BETWEEN xxx AND yyy AND longitude IS BETWEEN www AND zzz Question: How would I do this type of retrival with NoSQL ... using just a key-value store system? Even if I could do this with NoSQL, would it even be efficient or would simply going back to using a tradition database retrieve this type of information faster?

    Read the article

  • The perverse hangman problem

    - by Shalmanese
    Perverse Hangman is a game played much like regular Hangman with one important difference: The winning word is determined dynamically by the house depending on what letters have been guessed. For example, say you have the board _ A I L and 12 remaining guesses. Because there are 13 different words ending in AIL (bail, fail, hail, jail, kail, mail, nail, pail, rail, sail, tail, vail, wail) the house is guaranteed to win because no matter what 12 letters you guess, the house will claim the chosen word was the one you didn't guess. However, if the board was _ I L M, you have cornered the house as FILM is the only word that ends in ILM. The challenge is: Given a dictionary, a word length & the number of allowed guesses, come up with an algorithm that either: a) proves that the player always wins by outputting a decision tree for the player that corners the house no matter what b) proves the house always wins by outputting a decision tree for the house that allows the house to escape no matter what. As a toy example, consider the dictionary: bat bar car If you are allowed 3 wrong guesses, the player wins with the following tree: Guess B NO -> Guess C, Guess A, Guess R, WIN YES-> Guess T NO -> Guess A, Guess R, WIN YES-> Guess A, WIN

    Read the article

  • Top 31 Favorite Features in Windows Server 2012

    - by KeithMayer
    Over the past month, my fellow IT Pro Technical Evangelists and I have authored a series of articles about our Top 31 Favorite Features in Windows Server 2012.  Now that our series is complete, I’m providing a clickable index below of all of the articles in the series for your convenience, just in case you perhaps missed any of them when they were first released.  Hope you enjoy our Favorite Features in Windows Server 2012! Top 31 Favorite Features in Windows Server 2012 The Cloud OS Platform by Kevin Remde Server Manager in Windows Server 2012 by Brian Lewis Feel the Power of PowerShell 3.0 by Matt Hester Live Migrate Your VMS in One Line of PowerShell by Keith Mayer Windows Server 2012 and Hyper-V Replica by Kevin Remde Right-size IT Budgets with “Storage Spaces” by Keith Mayer Yes, there is an “I” in Team – the NIC Team! by Kevin Remde Hyper-V Network Virtualization by Keith Mayer Get Happy over the FREE Hyper-V Server 2012 by Matt Hester Simplified BranchCache in Windows Server 2012 by Brian Lewis Getting Snippy with PowerShell 3.0 by Matt Hester How to Get Unbelievable Data Deduplication Results by Chris Henley of Veeam Simplified VDI Configuration and Management by Brian Lewis Taming the New Task Manager by Keith Mayer Improve File Server Resiliency with ReFS by Keith Mayer Simplified DirectAccess by Sumeeth Evans SMB 3.0 – The Glue in Windows Server 2012 by Matt Hester Continuously Available File Shares by Steven Murawski of Edgenet Server Core - Improved Taste, Less Filling, More Uptime by Keith Mayer Extend Your Hyper-V Virtual Switch by Kevin Remde To NIC or to Not NIC Hardware Requirements by Brian Lewis Simplified Licensing and Server Versions by Kevin Remde I Think, Therefore IPAM! by Kevin Remde Windows Server 2012 and the RSATs by Kevin Remde Top 3 New Tricks in the Active Directory Admin Center by Keith Mayer Dynamic Access Control by Brian Lewis Get the Gremlin out of Your Active Directory Virtualized Infrastructure by Matt Hester Scoping out the New DHCP Failover by Keith Mayer Gone in 8 Seconds – The New CHKDSK by Matt Hester New Remote Desktop Services (RDS) by Brian Lewis No Better Time Than Now to Choose Hyper-V by Matt Hester What’s Next? Keep Learning! Want to learn more about Windows Server 2012 and Hyper-V Server 2012?  Want to prepare for certification on Windows Server 2012? Do It: Join our Windows Server 2012 “Early Experts” Challenge online peer study group for FREE at http://earlyexperts.net. You’ll get FREE access to video-based lectures, structured study materials and hands-on lab activities to help you study and prepare!  Along the way, you’ll be part of an IT Pro community of over 1,000+ IT Pros that are all helping each other learn Windows Server 2012! What are Your Favorite Features? Do you have a Favorite Feature in Windows Server 2012 that we missed in our list above?  Feel free to share your favorites in the comments below! Keith Build Your Lab! Download Windows Server 2012 Don’t Have a Lab? Build Your Lab in the Cloud with Windows Azure Virtual Machines Want to Get Certified? Join our Windows Server 2012 "Early Experts" Study Group

    Read the article

  • One National Team One Event &ndash; SharePoint Saturday Kansas City

    - by MOSSLover
    I wasn’t expect to run an event from 1,000 miles away, but some stuff happened you know like it does and I opted in.  It was really weird, because people asked why are you living in NJ and running Kansas City?  I did move, but it was like my baby and Karthik didn’t have the ability to do it this year.  I found it really challenging, because I could not physically be in Kansas City.  At first I was freaking out and Lee Brandt, Brian Laird, and Chris Geier offered to help.  Somehow I couldn’t come the day of the event.  Time-wise it just didn’t work out.  I could do all the leg work prior to the event, but weekends just were not good.  I was going to be in DC until March or April on the weekdays, so leaving that weekend was too tough.  As it worked out Lee was my eyes and ears for the venue.  Brian was the sponsor and prize box coordinator if anyone needed to send items.  Lee also helped Brian the day of the event move all the boxes.  I did everything we could do electronically, such as get the sponsors coordinate with Michael Lotter on invoicing and getting the speakers, posting the submissions, budgeting the money, setting up a speaker dinner by phone, plus all that other stuff you do behind the scenes.  Chris was there to help Lee and Brian the day of the event and help us out with the speaker dinner.  Karthik finally got back from India and he was there the night before getting the folders together and the signs and stuffing it all.  Jason Gallicchio also helped me out (my cohort for SPS NYC) as he did the schedule and helped with posting the speakers abstracts and so did Chris Geier by posting the bios.  The lot of them enlisted a few other monkeys to help out.  It was the weirdest thing I’ve ever seen, but it worked.  Around 100+ attendees ended up showing and I hear it was  a great event.  Jason, Michael, Chris, Karthik, Brian, and Lee are not all from the same area, but they helped me out in bringing this event together.  It was a national SharePoint Saturday team that brought together a specific local event for Kansas City.  It’s like a metaphor for the entire SharePoint Community.  We help our own kind out we don’t let me fail.  I know Lee and Brian aren’t technically SharePoint People they are honorary SharePoint Community Members.  Thanks everyone for the support and help in bringing this event together.  Technorati Tags: SharePoint Saturday,SPS KC,SharePoint,SharePoint Saturday Kanas City,Kansas City

    Read the article

  • CakePHP: How do I order results based on a 2-level deep association model?

    - by KcYxA
    I'm hoping I won't need to resort to custom queries. A related question would be: how do I retrieve data so that if an associated model is empty, no record is retrieved at all, as opposed to an empty array for an associated model? As an oversimplified example, say I have the following models: City -- Street -- House How do I sort City results by House numbers? How do I retrieve City restuls that have at least one House in it? I don't want a record with a city name and details and an empty House array as it messes up pagination results. CakePHP retrieves House records belonging to the Street in a separate query, so putting somthing like 'House.number DESC' into the 'order' field of the search query returns a 'field does not exist' error. Any ideas?

    Read the article

  • Getting null value after adding objects to customClass

    - by Brian Stacks
    Ok here's my code first viewController.h @interface ViewController : UIViewController<UICollectionViewDataSource,UICollectionViewDelegate> { NSMutableArray *twitterObjects; } @property (strong, nonatomic) IBOutlet UICollectionView *myCollectionView; Here is my viewController.m // // ViewController.m // MDF2p2 // // Created by Brian Stacks on 6/5/14. // Copyright (c) 2014 Brian Stacks. All rights reserved. // #import "ViewController.h" // add accounts framework to code #import <Accounts/Accounts.h> // add social frameworks #import <Social/Social.h> #import "TwitterCustomObject.h" #import "CustomCell.h" #import "DetailViewController.h" @interface ViewController () @end @implementation ViewController -(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { //CustomCell * cell = (CustomCell*)sender; //NSIndexPath *indexPath = [_myCollectionView indexPathForCell:cell]; // setting an id for view controller DetailViewController *detailViewcontroller = segue.destinationViewController; //TwitterCustomObject *newCustomClass = [twitterObjects objectAtIndex:indexPath.row]; if (detailViewcontroller != nil) { // setting the custom customClass object //detailViewcontroller.myNewCurrentClass = newCustomClass; } } - (void)viewDidLoad { twitterObjects = [[NSMutableArray alloc]init]; [super viewDidLoad]; [self twitterAPIcall]; // Do any additional setup after loading the view, typically from a nib. } - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { return 100; } - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { //UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"myCell" forIndexPath:indexPath]; // initiate celli CustomCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"myCell" forIndexPath:indexPath]; // add objects to cell if (cell != nil) { //TwitterCustomObject *newCustomClass = [twitterObjects objectAtIndex:indexPath.row]; //[cell refreshCell:newCustomClass.userName userImage:newCustomClass.userImage]; [cell refreshCell:@"Brian" userImage:[UIImage imageNamed:@"love.jpg"]]; } return cell; } -(void)twitterAPIcall { //create an instance of the account store from account frameworks ACAccountStore *accountStore = [[ACAccountStore alloc]init]; // make sure we have a valid object if (accountStore != nil) { // get the account type ex: Twitter, FAcebook info ACAccountType *accountType = [accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierTwitter]; // make sure we have a valid object if (accountType != nil) { // give access to the account iformation [accountStore requestAccessToAccountsWithType:accountType options:nil completion:^(BOOL granted, NSError *error) { if (granted) { //^^^success user gave access to account information // get the info of accounts NSArray *twitterAccounts = [accountStore accountsWithAccountType:accountType]; // make sure we have a valid object if (twitterAccounts != nil) { //NSLog(@"Accounts: %@",twitterAccounts); // get the current account information ACAccount *currentAccount = [twitterAccounts objectAtIndex:0]; // make sure we have a valid object if (currentAccount != nil) { //string from twitter api NSString *requestString = @"https://api.twitter.com/1.1/friends/list.json"; // request the data from the request screen call SLRequest *myRequest = [SLRequest requestForServiceType:SLServiceTypeTwitter requestMethod:SLRequestMethodGET URL:[NSURL URLWithString:requestString] parameters:nil]; // must authenticate request [myRequest setAccount:currentAccount]; // perform the request named myRequest [myRequest performRequestWithHandler:^(NSData *responseData, NSHTTPURLResponse *urlResponse, NSError *error) { // check to make sure there are no errors and we have a good http:request of 200 if ((error == nil) && ([urlResponse statusCode] == 200)) { // make array of dictionaries from the twitter api data using NSJSONSerialization NSArray *twitterFeed = [NSJSONSerialization JSONObjectWithData:responseData options:0 error:nil]; NSMutableArray *nameArray = [twitterFeed valueForKeyPath:@"users"]; // for loop that loops through all the post for (NSInteger i =0; i<[twitterFeed count]; i++) { NSString *nameString = [nameArray valueForKeyPath:@"name"]; NSString *imageString = [nameArray valueForKeyPath:@"profile_image_url"]; NSLog(@"Name feed: %@",nameString); NSLog(@"Image feed: %@",imageString); // get data into my mutable array TwitterCustomObject *twitterInfo = [self createPostFromArray:[nameArray objectAtIndex:i]]; //NSLog(@"Image feed: %@",twitterInfo); if (twitterInfo != nil) { [twitterObjects addObject:twitterInfo]; } } } }]; } } } else { // the user didn't give access UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Warning" message:@"This app will only work with twitter accounts being allowed!." delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil]; [alert performSelectorOnMainThread:@selector(show) withObject:nil waitUntilDone:FALSE]; } }]; } } } -(TwitterCustomObject*)createPostFromArray:(NSArray*)postArray { // create strings to catch the data in NSArray *userArray = [postArray valueForKeyPath:@"users"]; NSString *myUserName = [userArray valueForKeyPath:@"name"]; NSString *twitImageURL = [userArray valueForKeyPath:@"profile_image_url"]; UIImage *image = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:twitImageURL]]]; // initiate object to put the data in TwitterCustomObject *twitterData = [[TwitterCustomObject alloc]initWithPostInfo:myUserName myImage:image]; NSLog(@"Name: %@",myUserName); return twitterData; } -(IBAction)done:(UIStoryboardSegue*)segue { } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } @end Here is my customObject class TwitterCustomClass.h // // TwitterCustomObject.h // MDF2p2 // // Created by Brian Stacks on 6/5/14. // Copyright (c) 2014 Brian Stacks. All rights reserved. // #import <Foundation/Foundation.h> @interface TwitterCustomObject : NSObject { } @property (nonatomic, readonly) NSString *userName; @property (nonatomic, readonly) UIImage *userImage; -(id)initWithPostInfo:(NSString*)screenName myImage:(UIImage*)myImage; @end TwitterCustomClass.m // // TwitterCustomObject.m // MDF2p2 // // Created by Brian Stacks on 6/5/14. // Copyright (c) 2014 Brian Stacks. All rights reserved. // #import "TwitterCustomObject.h" @implementation TwitterCustomObject -(id)initWithPostInfo:(NSString*)screenName myImage:(UIImage*)myImage { // initialize as object if (self = [super init]) { // use the data to be passed back and forth to the tableview _userName = [screenName copy]; _userImage = [myImage copy]; } return self; } @end The problem is I get the values in the method twitterAPIcall, I can get the names and image values or strings from the values. But in the (TwitterCustomObject*)createPostFromArray:(NSArray*)postArray method all values are coming up as null.I thought it got added with this line of code in the twitterAPIcall method [twitterObjects addObject:twitterInfo];?

    Read the article

  • Goodbye XML&hellip; Hello YAML (part 2)

    - by Brian Genisio's House Of Bilz
    Part 1 After I explained my motivation for using YAML instead of XML for my data, I got a lot of people asking me what type of tooling is available in the .Net space for consuming YAML.  In this post, I will discuss a nice tooling option as well as describe some small modifications to leverage the extremely powerful dynamic capabilities of C# 4.0.  I will be referring to the following YAML file throughout this post Recipe: Title: Macaroni and Cheese Description: My favorite comfort food. Author: Brian Genisio TimeToPrepare: 30 Minutes Ingredients: - Name: Cheese Quantity: 3 Units: cups - Name: Macaroni Quantity: 16 Units: oz Steps: - Number: 1 Description: Cook the macaroni - Number: 2 Description: Melt the cheese - Number: 3 Description: Mix the cooked macaroni with the melted cheese Tooling It turns out that there are several implementations of YAML tools out there.  The neatest one, in my opinion, is YAML for .NET, Visual Studio and Powershell.  It includes a great editor plug-in for Visual Studio as well as YamlCore, which is a parsing engine for .Net.  It is in active development still, but it is certainly enough to get you going with YAML in .Net.  Start by referenceing YamlCore.dll, load your document, and you are on your way.  Here is an example of using the parser to get the title of the Recipe: var yaml = YamlLanguage.FileTo("Data.yaml") as Hashtable; var recipe = yaml["Recipe"] as Hashtable; var title = recipe["Title"] as string; In a similar way, you can access data in the Ingredients set: var yaml = YamlLanguage.FileTo("Data.yaml") as Hashtable; var recipe = yaml["Recipe"] as Hashtable; var ingredients = recipe["Ingredients"] as ArrayList; foreach (Hashtable ingredient in ingredients) { var name = ingredient["Name"] as string; } You may have noticed that YamlCore uses non-generic Hashtables and ArrayLists.  This is because YamlCore was designed to work in all .Net versions, including 1.0.  Everything in the parsed tree is one of two things: Hashtable, ArrayList or Value type (usually String).  This translates well to the YAML structure where everything is either a Map, a Set or a Value.  Taking it further Personally, I really dislike writing code like this.  Years ago, I promised myself to never write the words Hashtable or ArrayList in my .Net code again.  They are ugly, mostly depreciated collections that existed before we got generics in C# 2.0.  Now, especially that we have dynamic capabilities in C# 4.0, we can do a lot better than this.  With a relatively small amount of code, you can wrap the Hashtables and Array lists with a dynamic wrapper (wrapper code at the bottom of this post).  The same code can be re-written to look like this: dynamic doc = YamlDoc.Load("Data.yaml"); var title = doc.Recipe.Title; And dynamic doc = YamlDoc.Load("Data.yaml"); foreach (dynamic ingredient in doc.Recipe.Ingredients) { var name = ingredient.Name; } I significantly prefer this code over the previous.  That’s not all… the magic really happens when we take this concept into WPF.  With a single line of code, you can bind to the data dynamically in the view: DataContext = YamlDoc.Load("Data.yaml"); Then, your XAML is extremely straight-forward (Nothing else.  No static types, no adapter code.  Nothing): <StackPanel> <TextBlock Text="{Binding Recipe.Title}" /> <TextBlock Text="{Binding Recipe.Description}" /> <TextBlock Text="{Binding Recipe.Author}" /> <TextBlock Text="{Binding Recipe.TimeToPrepare}" /> <TextBlock Text="Ingredients:" FontWeight="Bold" /> <ItemsControl ItemsSource="{Binding Recipe.Ingredients}" Margin="10,0,0,0"> <ItemsControl.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> <TextBlock Text="{Binding Quantity}" /> <TextBlock Text=" " /> <TextBlock Text="{Binding Units}" /> <TextBlock Text=" of " /> <TextBlock Text="{Binding Name}" /> </StackPanel> </DataTemplate> </ItemsControl.ItemTemplate> </ItemsControl> <TextBlock Text="Steps:" FontWeight="Bold" /> <ItemsControl ItemsSource="{Binding Recipe.Steps}" Margin="10,0,0,0"> <ItemsControl.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> <TextBlock Text="{Binding Number}" /> <TextBlock Text=": " /> <TextBlock Text="{Binding Description}" /> </StackPanel> </DataTemplate> </ItemsControl.ItemTemplate> </ItemsControl> </StackPanel> This nifty XAML binding trick only works in WPF, unfortunately.  Silverlight handles binding differently, so they don’t support binding to dynamic objects as of late (March 2010).  This, in my opinion, is a major lacking feature in Silverlight and I really hope we will see this feature available to us in Silverlight 4 Release.  (I am not very optimistic for Silverlight 4, but I can hope for the feature in Silverlight 5, can’t I?) Conclusion I still have a few things I want to say about using YAML in the .Net space including de-serialization and using IronRuby for your YAML parser, but this post is hopefully enough to see how easy it is to incorporate YAML documents in your code. Codeplex Site for YAML tools Dynamic wrapper for YamlCore

    Read the article

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