Arrays, Linked Lists and Performance

8 Aug

Map using reduce on List vs Map using for loop on array !

Airspeed Velocity

Patient: Doctor doctor, it hurts when I do this.
Doctor: Well, don’t do that.

On twitter, I wrote:

Your reminder that building arrays with reduce, while fun, is accidentally quadratic.

I was surprised at how surprising some found this. Quite a few people suggested the reduce version could be changed to not do the array copy (I don’t think it can). Some suggested maybe + could be optimized so it doesn’t perform a copy (I don’t think that it could easily, as we’ll see shortly).1

In other feedback, a few commented on the previous post about linked lists. Why implement an outdated data structure? What’s the point when we have arrays?

So, you know how sometimes I mention this isn’t a blog about Mac and iOS programming? It’s not a blog about Mac and iOS programming! Don’t put a enum-based linked list into your app just because I…

View original post 1,761 more words

Advertisements

Load Nib file into StoryBoard in Real Time/ Live Rendering (Objective – C)

2 Jun

Using XIB file as SubView in StoryBoard with Realtime preview using IB_Designables and IBInspectables Objective-C Code Sample.

Loading up the Nib file into the StoryBoard in the real time is only available after Xcode 6. This can be achieved using IB_Designables and IBInspectables. So what are IB_Designables and IBInspectables then?

So the thing is, we add IB_Designable before our class definition and prepend IBInspectable to the public properties that we are going to change in Real Time.. The IBInspectables provides a new feature to give access to add the user-defined run-time attributes. They provide a powerful mechanism for configuring any key-value coded property of an instance in a NIB or storyboard.

For Example:

@property (strong, nonatomic) UIView *customView;

@property (strong, nonatomic) IBInspectable UIColor *bgColor;

And IB_Designable provides a way to embed nib file to storyboard. When applied to a UIView or NSView subclass, the IB_Designable lets IB(Interface Builder) know that it should render the view directly in the canvas. This allows seeing how your custom views will appear without building and running your app after each change

For Example:

View original post 51 more words

Customizing appearance of UISegmentedControl

28 Sep

Chegg Engineering

My name is Simon and I’m part of the Chegg Mobile Team. I wanted to take this opportunity to share some ideas about customizing the appearance of the UISegmentedControl. You are probably familiar with the UISegmentedControl and its default look which is found in many native iOS apps:

generic-segmented-control

This UI control can be created using the UISegmentedControl Class which is available in the UIKit framework. The appearance of this control can be easily customized yet doing so is not always obvious to new iOS developers. I was recently asked to create a row of separate buttons that would behave in a similar manner to UISegmentedControl where only one segment could be selected at any given time. The design looked something like this (specifically this one I took from dribbble):

custom-segmented-control

View original post 463 more words

Facebook app for iOS7 without left side menu

17 Jun

If you have used or seen the new iOS 7, then there is one risky think apple has added to the OS. That is system wide swipe gesture ie swipe left to go back ! Why is it so risky ? It is because when we left swipe most of the app will open the side menu ! The example is facebook !!!

Now lets look at the new Facebook app for ios 7 which easily solves the slide side view menu problem, and goes native to iOS with tab bar controllers !

But this is only a test UI not a final ImageImageImageImageImageUI hence it looks like a quick and dirty fix rather then a final flat iOS7 style design. Lets say its a functional design rather then graphical one.

 

Source

Avoid 7 mistakes while developing Windows Phone 7 apps

7 Feb

I was reading a very good article recently about Windows Phone “15 Designing Windows Phone Icons” and decided to write this article.

Just last month i went to MIC (Microsoft Innovation Center Nepal ) in Phone Apps Development Factory. Maybe it was too much to ask for students in a very short period just 5 days to make an app. Some of them had very good idea like Fake SMS, but i knew he could never deliver such a complicated app in such a short time. Even if he could make it, due to Windows Market place policy it might not have been certified. To be frank for the students giving such idea was more than exciting, some of the apps ideas were simply superb, and some were super natural where as some was pure stupid!

AnZOO was really good idea, if it was more simple i know it will be perfect app for an age group of 1 to 3years. She just needed to remove the crazy idea of password and rather than typing animals some drag and drop of animal images would have made it a perfect game. For last 3 weeks I’m with Niece and she is 2 years old. My next app will be for herJ. Because she can easily play with her mum’s iPhone, play some games; load YouTube songs… believe it or not!!!

Medical apps idea was a good one but did it make it to the market place? Then there was a musical app, drum or something like that. One app I must mention was Fake GPS! It liked it too much. For me if the idea was original it was the best idea for the app. Even thought it was 1 time use app it was really funny: D. Terabytes to mega bite conversion are very simple apps logically but good one for first try rather than not making any app at all. I guess only one of those who were the part of the factor didn’t make app at all. Nepal Sambat Calendar has very good UI, and only app with real functionality. Best app for sure. There is a money manager but again there are already more advanced same type of app in market place, but sure some updates and it will be a good app.

Many of them made a collage app! Maybe some collage app is better than other but I feel like making a collage app is only for those who have no idea then that! Opps im sorry i know if you are one of those who have made collage app you must be really angry with me! But my whole point of writing this article is NOT to critise you guys. I know some of the collage apps have used mobile technology to grate extent, be it camera or bing maps etc. Just a thought something else other than collage app!

I don’t have problem with any of collage apps as much as i have with poor UI. For me beauty of Windows Phone is in its METRO UI. I’m sorry to say friends but most of apps (almost all the apps) I have seen that has been to Windows Phone 7 Marketplace from Nepal has very poor UI :(. No one really followed Metro UI principle, I know it’s difficult to understand and implement Metro-UI within 5days; all we want was to develop an app. But it’s NOT an Android App nor is it an iOS App, each of those has a different UI principle, it is really hard to get out of old ‘Button’ style when it’s been around for like decades!!!

We all are programmers in normal apps all we do is code, but if we move to be a web developer then only we see some real life of UI importance, even then there are separate web designer so when it comes to Mobile Apps we have a POOR really POOR app UI !

Let me make it loud and clear: I am NOT trying to criticise my friends i made at MIC, I just want my friends to make there next app better then what they have made now. I just want my Nepali friends to raise their bar. For me Windows Phone App factory was an easy path. I have been working as ASP.net for years now. I have even worked in Windows Mobile Classic 6.5 app for French car company Peugeot for its showroom in Netherland. I have a very good idea about HTML/CSS and VB.net, but i’m NOT a computer engineer. I did my engineering in Civil. All my programming knowledge is self-learned I don’t have any certificate or formal training of any kind!

But Windows Mobile Classic 6.5 has not even a single aspect common to Windows Phone 7. When it comes to UI, they are miles apart. It’s like comparing to command prompt to early days windows. The UI has nothing in common. But i want all my friends to follow some of the following point which i have learned in last few months at MIC so that they can make a better app!

There are 100’s of things we need to learn before we make a grate app like learning Images-Cultural-Aspects-and-Visual-Metaphors may need years to master. But I have pointed out some very basic mistake my friends and even I did while learning to make Windows Phone 7 app. SO I hope it will guide my friends to make better apps in future!

1. Never make ICONs for you app – I have seen some if my friends making icon for app. You can make your apps logo but not icons for it!  STOP! Don’t waste your time making Icons. No matter even if you are a very good designer you can’t make MetroUI icon as well as app in 5days can you? I don’t me you can never make icons yourself but in 5 days try to use free icon given by Microsoft in your apps. Don’t waste your time in icons. Even worst you will make the icon that does not follow Metro UI principle. Using Metro UI style Icons will make your apps more easy and familiar to your users. In that way they will love you apps as well.

2. Don’t forget to check you app in LIGHT theme – My 1st app was rejected in app market as it was unusable in Light theme: P. Look even I’m not perfect, no one is! It just that i want my friends to learn from my mistakes 🙂 Dont use lots of fancy photo in your apps background so much so that users cant even read the text. If you can don’t use image background at all unless and until its really needed in the apps principle user interface.

3. Should we use a Panorama? Or a Pivot? Or a Page? I see pages in some apps with Next and previous button/icon at the bottom. It is not iPhone app, unless the your UI does something different then physical key in windows phone back button never use back button/icon in your app.One app even used Panorama page to go through next page. It’s really hard part to learn Metro UI’s principle when all we have seen is static web pages or even single page desktop applications. But use windows phones apps more and you will learn when and where it is right to use Panorama or a Pivot page.

4. Don’t try to modify some open source games or app: Change the name and image and call it your own. We are here to learn, not to be Hero from Zero: D. If you modify someone app you might never learn what it about making app. Even worst your app will never see an update! Every app has error. My apps had 100’s of stupid errors in ver1. But i fixed most of them, now I fix bugs in my apps every week or so. In just 4 weeks my app is in ver 1.4 don’t go by numbers that means I have made 4 major fixes in that short times. If I had use someone else code I would never have fixed error!

5. It’s a Mobile App Not a website:  If you are making app don’t try to replicate the website that is already there. Jokes app is really famous, but don’t make those apps. If you can don’t make tips and tricks apps. Because you’re apps like Math ticks or how to cook might just showing copy past tips or tricks from internet in a Rich Text Box nothing more. Your apps then will see updates for every time you decide to add a new joke manually! Never do that Never! But if you can update the data source from remote site then those apps will be a charm! In that case even a joke app will be a superb one.

6. Do simple app but not very simple: Its good way to learn how to develop from simple apps like BMI METER or Love Meter. It might be fun to use once then what? Make sure you can constantly make your user comeback and use you apps again and again. Having been said that this around Feb 14th Love meter can see 1000’s of download who knows, all the best for that. Still if you have better idea that those or keep on thinking how you can keep you user, use you app again and again.

7.  TicTacToe Game: If you are making games do not try to make Tic Tac Toe! I had made a google chrome extension few years ago it was like learning ‘Hello world’ on how to make Google chrome extension. It was good for first try, but it was a game called Tic Tac Toe 😛 but if you are making game don’t make a game that already in a marketplace. What is the point of having same game? How can you differentiate your game from the other 20 same games! So when i made that game of TicTacToe i added Boys ver Girls just to make it different from other games. When i wanted to make Game for Windows Phone 7 I started with idea to make “Master Mind” I had no idea what it was called back then I had to google a lot opps sorry im a windows phone developer, so I should have binged ;). Then I found same game in 10 odd numbers in Windows market place. I discard the idea and moved to “Battle ship” yet again it was one of the classic it took me some time to find its actual name but then again it was in 5odd numbers in marketplace. Then I found the physics engine and an easy way to make realistic games. And then I developed the Bouncing Ball game. But before that I had made another game Giraffe it wasn’t that well made. Not even good enough to send to market place. Eventually send it and it’s in market place after all. But to be frank it needs lots of refinements. It was like learning app more than a real game.

I’m learning about Windows Phone 7 its apps about its games every day, every day is a learning progress. Hope you guys like what i have pointed out. If you have more tips do make a comment. I would try to include those as well. Dont forget to point out my mistakes in my apps, so that i can improve them 🙂

First Impression Windows 8 Developer Preview

25 Dec

Name – Bishal Ghimire
Email – bishal.ghimire@gmail.com
Twitter – https://twitter.com/#!/bishal_ghimire
Google+ – https://plus.google.com/u/0/103155667644430815268
Facebook – https://www.facebook.com/bishal.ghimire
Linkedin – http://np.linkedin.com/in/bishalghimire
Youtube – http://www.youtube.com/bishal33

 

Is 2011 worst or best year to get a tablet ?

25 Dec

Is 2011 worst or best year to get a tablet?

If you are in the mood of buying a tablet in this festive season and planning to spend $700 then get an iPad2 without reading further it is the best tablet around.

If you were lucky, just few days back you could have got a HP TouchPad for $99 which was $500 just a month ago. Also Blackberry Playbook goes for sale at $200 which was also $500 few months back! Surprising isn’t it? Never in tech history could you have got $300 discount overnight. Okay may be in couple of months but hey it’s more than $300 discount on a $500 price isn’t something wrong? Maybe there hardware was broken or it was faulty OS or it was in wrong market segment? But none of them are completely wrong. In fact they never tried to make a true tablet; they just tried to kill iPad.

Amazon is the only company that has made an iPad killer. Errr! Sorry Amazon never made an iPad killer it never will. It even doesn’t know what iPad is! This “iPad Killer” is just a wrong phase used by many tech blogger around the world. Amazon could have never killed iPad with a $200 price. It has never tried to be iPad in the 1st place. It’s a different machine. Or should I say it is different software. But to tell you the truth underneath a hood it’s the same software that is on every other tablet in the market an Android 2.x with just modified overlays. So how is Amazon Fire such a huge different than all other around. Is it just the $200 price point?

Where did the entire Android tablet go wrong when iPad is selling like a hot cake? If Android can easily outsell iOS in mobile market why isn’t Android Tablet version not even selling half of iOS? When it comes to app Android is miles behind iOS in tablet. But that will change in 2012, just like iOS which is the same OS in both tablet and in mobile; Android ICS4 is the same OS that will support both mobile as well as tablet. This means we will see a huge numbers of apps for Android tablet as well. Keeping number aside Samsung and Motorola are the only companies which could sell some of their tablets, rest were just busy trying to figure out what went wrong.

In the whole scenario Google and Apple are there, but who is missing? Yes! It’s Microsoft as usual; always late for the party. But it is the party changer for sure this time. Unlike in history it might not spoil the party but it will just try to change the course of the game. Two bigger players, Intel and Nokia are also in this game and supported by Microsoft. If Microsoft fails at this point Intel and Nokia might suffer from it. 2012 will be the end of PC era or as Apple calls its Post PC era. No worries Desktop PC will continue to work as it is. Developers and all the computer engineers will still need a desktop PC; its sales might not show a significant deflection in market share. But the definition of the term Personal in PC will change forever. Your desktop will be a work computer only. Personal Computer will be only those tablets. Computer has never been so personal ever.

So what is it that is coming in 2012 to change the PC forever? It’s Ultrabook, the term I hate to use to represent the laptop for 2011, but I’ll love to have in 2012. I just don’t like the term Notebook or Netbook used for laptop because it’s just not proper, there is nothing technical about Notebook it’s just a laptop. These terms are just a marketing term, a marketing hype created by companies like Dell and Hp. Today in end of 2011 Ultrabook might sound just like just yet another marketing hype created by Intel. But when Windows 8 will come to the market it will be a very important to see how it changes the game. With the help of Solid State Drives (SDD) and touch screen laptop will never be like it is today. Samsung and Dell both announced that they will end the production of lowed netbook and concentrate on Ultrabooks. All these lead to pointing finger at 2012 the year of tablet. The year where Microsoft will release the finger friendly version of Windows, Intel where to compete with AMR will have a battery friendly mobile processor once and for all.

So 2011 might be the only year in the history where you could buy a 100$ tablet with front and rear end camera, in 2012 all you get is faster tablets, basically what you call laptop today will be tomorrows tablets. It won’t have a bulky Hard disk drive or those Optical drives. They will be slim and sexy, battery will easily last 8+hours. All of them will be touch screen without a keyboard and most will come with optional keyboard duct. Soon all the mouse and keyboards will be Wi-Fi supported which mean unlike todays wireless mouse you won’t need to plug in USB to connect to computer.

Tablet will get best next year but never will you get the full option tablet for $100.
Name – Bishal Ghimire
Email – bishal.ghimire@gmail.com
Twitter – https://twitter.com/#!/bishal_ghimire
Google+ – https://plus.google.com/u/0/103155667644430815268
Facebook – https://www.facebook.com/bishal.ghimire
Linkedin – http://np.linkedin.com/in/bishalghimire
Youtube – http://www.youtube.com/bishal33