Saturday, April 23, 2011

How to make Angry Birds Easter eggs

 Angry Birds Easter eggs01
 You wonder how I made these? Here they are! 






You will need:

- a piece of adhesive vinyl

- a punch circle ( or you can cut it by hand)

- a piece of yellow cardstock ( or yellow marker)

- a piece of white cardstock

- a black marker

- a piece of red foam

- 1 red fuzzy stick

- 1 red button

- red food coloring

- a small sponge

- pair of gloves

- a glue gun

- a pair of scissors









1. Boil the egg you are going to decorate then print the template I made for your convenience and cut out the shapes.





2. Watch the video.





3. Enjoy your new angry bird and share this link with your friends. :-)





Annie

Angry birds Easter egg decorating!

I was thinking of an unusual way to wish everyone who follows my blog Happy Easter and just before I went to bed I came up with the idea to make Angry Birds Easter eggs and I HAD to share it right away! :-) 


Angry Birds Easter eggs03


Angry Birds Easter eggs01


 If you would like to see how I decorated the real boiled eggs as Angry Birds, check out my video. 

http://artcraft.anniesartbook.com/2011/04/how-to-make-angry-birds-easter-eggs.html


HAPPY EASTER EVERYONE,
Annie

Friday, April 15, 2011

Pottery Barn inspired baby shower gifts

For some time now I have been pondering on the idea to make something that would resemble a real fabric design. 


When I was presented with the idea to make a gift for the baby shower of my son's teacher I wasn't sure where to start. Then I found out she likes a particular Potter Barn Kids comforter and I thought wouldn't it be nice if I actually made a whole gift set based on that design. It took me a couple of days to figure out how exactly I should do it but at the end I think I did very well.



This is the original design:




I decided to make the colors a little brighter, and here is what I came up with:


- a 5" by 7" card 
babyshower presents10   babyshower presents13




- Initially I planned to make a scrapbook album for the baby, but then I came up with the idea to make a scrapbook frame for the baby room. I think this worked out better, because the teacher showed me how she was missing a piece of wall art in the room, and this would fit perfect.


This is the scrapbook page before I put in the frame
babyshower presents2


It took me a lot of time to finish it, since I designed, drew, painted, glued and cut everything by hand.
babyshower presents4   babyshower presents19


babyshower presents8


And here it is framed:
babyshower presents14


- Then I made a small gift box with the same design,
babyshower presents22



babyshower presents21


- I also made a small sticky note notebook ( I stamped a leaf image on all the pages, don't ask how long that took...) 
Pottery Barn Kids gift-notebook01




- And of course what is a present without a gift bag?
Potter barn kids gift set7


- Here is the whole gift set minus the notebook, because I added it last minute.
Potter barn kids gift set6


- I just couldn't but add flowers to the whole thing ( I saw beautiful yellow ones from the store). I arranged this bouquet the day of the baby shower at school.




Yellow bouquet01




Yellow bouquet06


The last finishing touch was the cake I made with the same design.


The kids from the class made a beautiful and touching gift- a book with drawings and their thoughts about the baby in writing. It was so sweet I almost cried when I listened to them. What a wonderful idea and what and awesome keepsake to share with the baby when he or she grows up!



I just wanted to take the opportunity to wish our wonderful teacher ( and amazing person) all the best for her growing family, and to let her know we will miss her very much! 

Congratulations, Mrs. H!


Wednesday, April 6, 2011

I'm feeling blue...

No, I'm not sad nor depressed, relax! :-) I'm talking about feeling blue as a color, with every fiber of your body. I have never liked blue before, as a matter of fact I have been avoiding working with it. Recently I can't help but notice that my work is gravitating towards this color. 


Art March 201111




I like how it makes me feel. I guess I miss the sea and it reminds me of it. I haven't been walking on my hometown's beach almost 7 years now. The past couple of months I have been dreaming a lot about the Black sea, touching the water, looking at the horizon. The rocks, the smell of seaweed, the crunch of the sand between your toes...I miss it. 
The awful never-ending winter here doesn't help too. Maybe that's what's making me "feel the blue" and wanting to work with it. I seriously need some Spring in my life.


Do you have a particular color you like to work with now? I would love to hear your "color inspired" stories! 


Saturday, April 2, 2011

NetBeans Database Explorer API and databases in NetBeans

At the recent NetBeans Platform Certified Training organized by Visitrend we were discussing how to work w/ the built in database functionality. NetBeans ships w/ a pretty decent database/SQL functionality out of the box - you can connect to any JDBC compliant database, add your drivers, sling queries, edit the results. It even has code completion for SQL queries - up until SQL Server 2005 it even provided better support for SQL code authoring than the built in Management tools ( and it is still better than the standard Mysql console).


Now, it turns out that for data driven applications, it is a pretty common occurrence that the users need to connect to a database. Sometimes it makes sense to hide the details of the database; at the same time, when you're dealing with sophisticated that have intimate knowledge of the underlying database schema and need to be able to deal with the underlying data, hiding the fact that they're dealing with a database just doesn't make sense. In our case, we have a team of QA Engineers who need to be able to look into all aspects of the database behind the application, so the best a tool can do is to make the setup and access to the database as easy and transparent as possible.

Thus, to solve this problem, my users need the following :
1. Make sure that the IDE has the proper drivers set up to access our test databases
2. Easy setup of the database connection with the details for a specific project/system under tes

Automatically setting up JDBC driver

Unfortunately, Microsoft's SQL Server is not one of the JDBC drivers that ships with the IDE. A new user could just navigate to the "Drivers" node in the "Services" top component and walk through the wizard to register a new driver. This can certainly be an extra step in the list of "setup instructions". But, why should a user have to remember to do that if we can do it in a module. Thus, the first hurdle we need to overcome is have a module that automatically registers the JDBC driver in the IDE :

1. First, we need to  provide the MSSQL JDBC driver.

For that, I created a new Library Wrapper module. I wanted to mention this because for whatever reason when I tried providing the JDBC driver and the XML registration below in the same module, it failed to find the JDBC driver.


In the general case for a pure JDBC driver, this should be enough. However, in order to support windows authentication, the JDBC driver needs to have a   dll included on the path. In order to sutpport jars that need native libraries, the native library needs to be placed in the release/modules/lib as indicated on Modules API Javadoc






2. Create a second module for the actual driver registration.

Add an XML descriptor for registering new drivers (named SQLServer2008Driver.xml). For MSSQL it looks like this :



<?xml version='1.0'?>
<!DOCTYPE driver PUBLIC '-//NetBeans//DTD JDBC Driver 1.1//EN' 'http://www.netbeans.org/dtds/jdbc-driver-1_1.dtd'>
<driver>
<name value='SQLServer2008'/>
<display-name value='Microsoft SQL Server 2008'/>
<class value='com.microsoft.sqlserver.jdbc.SQLServerDriver'/>
<urls>
<url value="nbinst:/modules/ext/sqljdbc4.jar"/>
</urls>
</driver>




I am not entirely sure of the meaning of the nbinst: prefix, but this works.

3. Add an entry into the layer.xml file of the second module to add the driver registration XML : 



   
       
           
       

   





Unfortunately, in the case of the MSSQL JDBC driver just adding the dll into the module doesn't cut it as it appears that the SQL Server driver also depends on other DLLs, so it actually needs to be in c:\windows\system32 . Thus, adding the jdbc driver dll would have been not needed, as the dll needs to be copied to windows\system32 directory. To do that, register a module installer  :


public class MssqlDriverInstaller extends ModuleInstall {

    @Override
    public void restored() {
        File mssqlJdbcDll = new File(System.getenv("windir"), "system32\\sqljdbc_auth.dll");
        boolean foundDll = mssqlJdbcDll.exists();
       
        if (!foundDll) {
            FileOutputStream system32MssqlDll = null;
            InputStream bundledDll = null;
            try {
                system32MssqlDll = new FileOutputStream(mssqlJdbcDll);
                bundledDll = MssqlDriverInstaller.class.getResourceAsStream("sqljdbc_auth.dll");
                System.out.println("Copying sqljdbc_auth.dll to windows system32");
                FileUtil.copy(bundledDll, system32MssqlDll);

            } catch (IOException ex) {
                Logger.getLogger(MssqlDriverInstaller.class.getName()).log(Level.SEVERE, null, ex);
            } finally {
                try {
                    system32MssqlDll.close();
                } catch (IOException ex) {
                    Logger.getLogger(MssqlDriverInstaller.class.getName()).log(Level.SEVERE, null, ex);
                }
                try {
                    bundledDll.close();
                } catch (IOException ex) {
                    Logger.getLogger(MssqlDriverInstaller.class.getName()).log(Level.SEVERE, null, ex);
                }
            }
        }
    }
}


Automatically connecting to the database


Now, the last step is, how to automate the creation of the database connection node now that we can now be sure that the IDE has the right driver to connect to the database: (the APIs used below are from the Database Explorer API, org.netbeans.api.db.explorer)  


public void createProjectConnection(DatabaseConfig dbc) {

        DatabaseConfig dbConfig = dbc;
        if (dbConfig == null) {
            dbConfig = DatabaseConfig.getDefault();
        }

        JDBCDriver sqlSrvDrv = findSqlServerDriver();

        if (sqlSrvDrv != null) {
            try {
                DatabaseConnection dbConn = createDbConnection(dbConfig, sqlSrvDrv);

                final ConnectionManager connMgr = ConnectionManager.getDefault();
                DatabaseConnection foundConn = findSameConnection(dbConn);
                if (foundConn == null) {
                    foundConn = dbConn;
                    connMgr.addConnection(dbConn);
                }

                final DatabaseConnection dbConn2 = foundConn;
                RequestProcessor.getDefault().post(new Runnable() {

                    @Override
                    public void run() {
                        try {
                            connMgr.connect(dbConn2);
                            connMgr.selectConnectionInExplorer(dbConn2);
                        } catch (DatabaseException ex) {
                            Logger.getLogger(Ats3ProjectDataService.class.getName()).log(Level.SEVERE, "Failed to connect to database", ex);
                        }
                    }
                });

            } catch (DatabaseException ex) {
                Logger.getLogger(Ats3ProjectDataService.class.getName()).log(Level.SEVERE, "Failed to connect to database", ex);
            }
        }
    }

    private DatabaseConnection createDbConnection(DatabaseConfig dbConfig, JDBCDriver sqlSrvDrv) {
        DatabaseConnection dbConn;
        String url = null;
        String userDb = dbConfig.getName();
        if (userDb != null) {
            if (userDb.contains("${username}")) {
                userDb = userDb.replace("${username}", System.getProperty("user.name"));
            }
        } else {
            userDb = System.getProperty("user.name") + "_sb_rc";
        }
        if (!dbConfig.getUseSqlAuth()) {
            url = String.format("jdbc:sqlserver://%s:1433;databaseName=%s;integratedSecurity=true", dbConfig.getServer(), userDb);
            dbConn = DatabaseConnection.create(sqlSrvDrv, url, "", "dbo", "", true);
        } else {
            url = String.format("jdbc:sqlserver://%s:1433;databaseName=%s", dbConfig.getServer(), userDb);
            dbConn = DatabaseConnection.create(sqlSrvDrv, url, dbConfig.getUser(), "dbo", dbConfig.getPassword(), true);
        }
        return dbConn;
    }

    private JDBCDriver findSqlServerDriver() {
        JDBCDriver sqlSrvDrv = null;
        JDBCDriver[] drivers = JDBCDriverManager.getDefault().getDrivers("com.microsoft.sqlserver.jdbc.SQLServerDriver");
        // we know that there should be at least one as this module registers it
        for (JDBCDriver drv : drivers) {
            if ("SQLServer2008".equals(drv.getName())) {
                sqlSrvDrv = drv;
            }
        }
        return sqlSrvDrv;
    }

    private DatabaseConnection findSameConnection(DatabaseConnection dbConn) {
        DatabaseConnection foundConn = null;
        ConnectionManager connMgr = ConnectionManager.getDefault();
        for (DatabaseConnection dbc : connMgr.getConnections()) {
            if (dbc.getDatabaseURL().equals(dbConn.getDatabaseURL())) {
                foundConn = dbc;
            }
        }

        return foundConn;
    }

Even I want " Marianne"!

Did you ever feel you would love it if someone gives you a gift that you created? This is what happened to me when I was creating this gift set. I totally would have loved to receive this one, no doubt about it.
I love this kind of  "rustic/nature friendly" look with all the warm colors. 
So if any of you ever wonder what I would like, take a look at this:


Gift set "Marianne" 
"Marianne" gift set


 

Includes...
- a bookmark

"Marianne" bookmark detail 



- a notebook







"Marianne" notebook


So, have you ever given gifts that it was hard to part with? 

Friday, April 1, 2011

Dreaming of Summer ( and it's snowing)




Art March 20112

* Watercolor, ink and Copic marker drawing on watercolor paper, 9"/12"size






How is it possible?! Seriously, it's Spring already ( technically) and it's snowing! Absolutely outrageous, Mr. April should really think about his behavior, because I'm getting tired of all these hats and scarves, and layers, and layers of clothes. 


I dream of a hot sunny day, of flip-flops and ice cream, a cold lemonade with lemon pulp and fresh mint...Aaaah.


Well, as for now, I'll have to just draw in warm colors and think positive, summer it's not that far ( I hope). 





Are YOU tired of this winter?

Popular Posts

Related Posts with Thumbnails