Ads 468x60px

Pages

Jumat, 28 Februari 2014

Heavy Drinking Before Motherhood Is Bad For You

And not just because it leads to "whoops!" moments.  From August 30, 2013 WXXI (an NPR affiliate):
The more alcohol young women drink before motherhood, the greater their risk of future breast cancer according to a new study published in the Journal of the National Cancer Institute.
The findings are based on a review of the health histories of 91,005 mothers enrolled in the Nurses’ Health Study II from 1989 to 2009....
They show that if a woman averages one drink per day between her first period and having her first child, she increases her risk of breast cancer by 11 percent, an average of two drinks per day means an increased risk of 22 percent and so on.
Read More..

Kamis, 27 Februari 2014

Olympic Badminton Scandal … will people ever learn

I took a course in Boston back in the early 90s called “Controlling Software Projects” by the brilliant team of Tom DeMarco and Tim Lister. Look for their terrific book called “Peopleware” if you want to see how strong teams are built (or not.)

Anyway … today’s badminton scandal is the direct result of not following the advice I got in that course. Eight players are going to lose their chance at Olympic glory – not because they cheated (although they did), but because they were forced to behave badly by the governing body’s choice to create a round robin tournament instead of a knock out tournament.

So what did I learn in Boston? Several things:

  • If you are not measuring it, it is not getting better
  • Keep your measurements simple and easily interpreted
  • People behave how you incent them to behave

That last one is directly applicable here. These people used to be incented to compete fiercely for every match, because to lose was to be bounced from the Olympics. Now, they are incented to strategically place themselves in a favorable position once they have qualified for the knock out stage. That means that the final game is disposable. Very bad idea.

When, exactly, will people learn to keep it simple and direct and to incent people to perform?


The smart ones among you knew that this next bit was coming Smile

CEOs and boards of directors had their incentives changed since the 70s and the 80s. They are now incented for short term stock performance instead of long term corporate health and their contributions to mankind (lol.)

So what happens when you do that?

Every bad thing that we have seen in the last decade … and a lot more to come …

Read More..

Selasa, 25 Februari 2014

Word found locked fields during the update

Word found locked fields during the update.
Word cannot update locked fields.
Mail Merge


Read More..

Senin, 24 Februari 2014

Special Forces 2011 If You Liked Act of Valor You Will Like This

I pulled this off Netflix, and I was a bit surprised.  No, not U.S. Special Forces, but a French commando unit sent into the tribal areas of Pakistan to free a French journalist (and relative of a French politician) from the Taliban.  This film has nearly all the strengths of Act of Valor: an exciting action film; a work of fiction, but fiction not too terribly far removed from real events; brave but human heroes; and bad guys who would have been close to unbelievably evil -- until the Taliban came along, who behave in ways that are practically cardboard cutout monsters.  And yet even the chief warlord here has his moments when brief glints of humanity intrude, before the monstrousness returns. 

Like Act of Valor, the film is exciting not just for the action sequences, but the exotic locales.  It was actually filmed partly in Pakistan and partly in Tajikistan, which is close enough to Afghanistan to do a convincing body double.  Unlike Act of Valor, these are all obviously professional actors, doing a more credible job of acting than our special ops guys did of acting in Act of Valor.  (And as I said when reviewing Act of Valor -- who cares?  Im sure our special ops guys, or French special ops guys, do a better job of acting than vice versa.)

The reviews of Special Forces are overwhelmingly negative -- and I am pretty sure that politics has a lot to do with it.  Unfortunately, it is subtitled, and as one of the few even half-fair reviews pointed out:
But the films U.S. commercial prospects are dim, given the widespread American aversion to subtitles, and its formulaic charms are unlikely to impress the art-house crowd.
The film is rated R for its violence, and the rating seems appropriate.  To its credit, a scene where someone is executed in al-Qaeda fashion is off-screen, and merely suggested.
Read More..

Sabtu, 22 Februari 2014

Any Struts 1 Experts Out There

There are several JSPs that share some forms, but not others. The first of these, w_psi_s1_11.jsp (great name, what?) has access to offenderEmploymentForm. From this JSP, we call an action method OffenderEmployment.editEmployer. This action method transfers control to w_psi_s1_16.jsp (another great name), which has access to offenderEmploymentForm and employerSearchForm. The user hits the add button, which does a submit over to action method OffenderEmploymentAction.findEmployer. (Yes, the class is not the same as the other action method that I have already mentioned.) The findEmployer action method transfers control to w_psi_s1_14.jsp, where the user gets to add a new employer to the list. This JSP also has access to offenderEmploymentForm -- however, the action method that it calls on save, EmployerAction.save, does not have access to offenderEmploymentForm.

The problem is that when the submit on this last JSP happens, I need to update the employerId field in offenderEmploymentForm. I have the employerId visible in the JSP, but it does no good to pass it to the EmployerAction.save action method, because that class does not have access to the session form offenderEmploymentForm. I can read offenderEmploymentForm.employerId from the JSP -- but how do I write it from the JSP?

I have looked at a variety of methods around this. I thought that I could pass the offenderEmploymentForm using setAttribute in the JSP and getAttribute in the EmployerAction.save method -- but no, Struts 1 cant pass objects, and I really need to to update the existing session offenderEmploymentForm.

Our Struts expert is out sick, and I am running out of strings to Google to solve this.

UPDATE: I found a solution, but it was not very pretty.  I now understand how you switch from one action block to another.  The trick was to switch from the findEmployer action to the offenderEmployer action, invoking an action method in the offenderEmployer action.  Also, request.setParameter("employerId", the Form.getEmployerId()); in the action method from where I was forwarding, and request.getParameter("employerId") in the receiving action method.  Ugly.
Read More..

Jumat, 21 Februari 2014

spring data Supported keywords inside method names

Spring-Data: Supported keywords inside method names


KeywordSampleJPQL snippet
AndfindByLastnameAndFirstname… where x.lastname = ?1 and x.firstname = ?2
OrfindByLastnameOrFirstname… where x.lastname = ?1 or x.firstname = ?2
BetweenfindByStartDateBetween… where x.startDate between 1? and ?2
LessThanfindByAgeLessThan… where x.age < ?1
GreaterThanfindByAgeGreaterThan… where x.age > ?1
AfterfindByStartDateAfter… where x.startDate > ?1
BeforefindByStartDateBefore… where x.startDate < ?1
IsNullfindByAgeIsNull… where x.age is null
IsNotNull,NotNullfindByAge(Is)NotNull… where x.age not null
LikefindByFirstnameLike… where x.firstname like ?1
NotLikefindByFirstnameNotLike… where x.firstname not like ?1
StartingWithfindByFirstnameStartingWith… where x.firstname like ?1 (parameter bound with appended %)
EndingWithfindByFirstnameEndingWith… where x.firstname like ?1 (parameter bound with prepended %)
ContainingfindByFirstnameContaining… where x.firstname like ?1 (parameter bound wrapped in %)
OrderByfindByAgeOrderByLastnameDesc… where x.age = ?1 order by x.lastname desc
NotfindByLastnameNot… where x.lastname <> ?1
InfindByAgeIn(Collection ages)… where x.age in ?1
NotInfindByAgeNotIn(Collection age)… where x.age not in ?1
TruefindByActiveTrue()… where x.active = true
FalsefindByActiveFalse()… where x.active = false


Read More..

Kamis, 20 Februari 2014

32GB SDHC Card

I just bought one of these so that I can have my wife take HD video of me speaking on Saturday.


It cost me $20.99, including shipping that dropped it at my door Tuesday morning -- and I ordered it Sunday.  Wow!  I had ordered one of these from Amazon a couple of weeks ago, but it disappeared in transit.  When I look at the size of the device, and the packaging, I am not surprised it lost its way.
Read More..

Rabu, 19 Februari 2014

One Of Those Reminders of the Advantages of Ubuntu Linux

I am posting from the Linux box right now, a Compaq NC6000 built around 2002 or 2003, so quite ancient.  Under Windows, the maximum resolution for the displays, either on the laptop or an external monitor is 1024x768.  I never thought much about it.  Under Ubuntu Linux, the laptop will let me go to 1920x1080 on the external monitor.  This has to be entirely a function of superior device drivers.
Read More..

Selasa, 18 Februari 2014

Add Control in your form dynamically


Add Control in your form dynamically



The form designer is very fun to use and useful to create form and usercontrol. Each time you add a control in your form, you have to think about the position of each control in that form. So is a pain in the butt.


I’ll make a little sample on adding control dynamically in a form. I’m too lazy to make something complicated. I’ll make a simple table.


  adding controls to make a table
        Dim oTextbox As TextBox
        For index1 As Integer = 0 To 3 Step 1
            For index2 As Integer = 0 To 3 Step 1
                oTextbox = New TextBox()
                With oTextbox
                    .Name = "TextBox" & index1.ToString & index2.ToString
                    .Text = index1.ToString & index2.ToString
                    .Width = Me.Width / 4
                    .Left = index1 * (Me.Width / 4)
                    .Height
                    .Top = index2 * .Height
                End With
                oForm.Controls.Add(oTextbox)
            Next index2
        Next index1



If you use the show function to display your dynamically created form, you could simply put it before you call the show function or after. If you use ShowDialog, your control will not be added in your form because your form is modal.



    Private Sub Button1_Click(sender As System.Object, e As System.EventArgsHandles Button1.Click

        Dim oForm As Form
        oForm = New Form
        oForm.Show()

        adding controls to make a table
        Dim oTextbox As TextBox
        For index1 As Integer = 0 To 3 Step 1
            For index2 As Integer = 0 To 3 Step 1
                oTextbox = New TextBox()
                With oTextbox
                    .Name = "TextBox" & index1.ToString & index2.ToString
                    .Text = index1.ToString & index2.ToString
                    .Width = Me.Width / 4
                    .Left = index1 * (Me.Width / 4)
                    .Height
                    .Top = index2 * .Height
                End With
                oForm.Controls.Add(oTextbox)
            Next index2
        Next index1
    End Sub




When you run the program, your new form will look like this:


Table created dynamically



I don’t want to make big post. That is the reason I’ll stop here. There are many things we could do here.



You could “improve” your code using a try and catch to control any program crash. This make you program better in quality. I also put the dim outside the try-catch. If something goes wrong in the loop, at least, it will display the index1 that cause the problem.




    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click

        Dim oForm As Form
        Dim oTextbox As TextBox
        Dim index1 As Integer
        Dim index2 As Integer
        Try
            oForm = New Form
            oForm.Text = "TABLE crfeated dynamically"
            oForm.Show()

            adding controls to make a table

            For index1 = 0 To 3 Step 1
                For index2 = 0 To 3 Step 1
                    oTextbox = New TextBox()
                    With oTextbox
                        .Name = "TextBox" & index1.ToString & index2.ToString
                        .Text = index1.ToString & index2.ToString
                        .Width = Me.Width / 4
                        .Left = index1 * (Me.Width / 4)
                        .Height
                        .Top = index2 * .Height
                    End With
                    oForm.Controls.Add(oTextbox)
                Next index2
            Next index1
        Catch ex As Exception
            MsgBox(ex.StackTrace & vbCrLf & "index1= " & index1 & vbCrLf & "index2= " & index2)
        End Try
    End Sub



If you like this post, leave a comment or share it.

You could also visit my web site at http://checktechno.ca



Read More..

Senin, 17 Februari 2014

Windows Live Writer Wave3 Beta

Veja o que você pode esperar e encontrar neste novo beta:

Imagem e vídeo aprimoramentos

  • Inserir vídeos de Soapboxe YouTube
  • Carregar vídeos para Soapbox e YouTube
  • É fácil deixar suas fotos incríveis em seu blog porque você pode cortar, redimensionar, girar e alinhá-las. Você também pode adicionar efeitos legais como novas bordas e inclinação da imagem.
  • Adicional fronteira estilos de imagens (como a reflexão e cantos arredondados)
  • Suporte para LightBox  e outros efeitos de visualizar imagens (como Slimbox, Smoothbox, e outros)
  • Suporte para centralizar a imagens

 Blog autoria aprimoramentos

  • Correção ortográfica em mais línguas: Holandês, Inglês, finlandês, francês, alemão, hindi, italiano, coreano, Português (Brasil), Português (Portugal), sérvio-cirílico, sérvio-latim, espanhol e sueco
  • Auto Linking
  • Smart quotes/caracteres tipográficos
  • Word count

 Experiência e melhorias

  • Novas ferramentas torna mais facil os comandos - como fonte de formatação - prontamente disponível
  • Guias de vista comutação
  • Melhorado com a categoria de busca e controle-down tipo de filtragem
  • Novo look and feel

    Download : Windows Live Writer Wave3 Beta

  • Read More..

    Minggu, 16 Februari 2014

    Mongo M101P MongoDB for Developers week 3


    Handling blobs (4 min)


    GRIDFS
    documents limited to 16MB in mongodb
    breaks up large files into chunks and store them into a collection and meta data into another
    By default GridFS limits chunk size to 256k
    GridFS uses two collections to store files. One collection stores the file chunks, and the other stores file metadata.
    collection
    videos.chunks
    videos.files
    videos_meta?



    When to denormalize (2 min)



    Trees (2.5 min)



    Benefits of embedding (2 min)


    PERFORMANCE!

    Multikeys (4 min)



    Many to many relations (5 min)



    One to many relations (5 min)



    One to one relations (4 min)




    Living without transactions (4 min)



    Living without constraints (3 min)


    Alternative schema for Blog (3 min)




    Mongo design for Blog (4.5 min)



    Relational normalization (5 min)


    relational strives for 3rd normal form
    denormalized

    Goals of Normalization:

    • frees database of modification anomalies (recall Andrews email example)
    • minimize redesign when extending
    • avoid any bias toward a particular access pattern (NOT A MONGO CONCERN)
    "When you are not biased toward a particular access pattern you are equally bad at all of them"...Andrew Erlichson



    Mongodb schema design (3 min)


    mongo does not join in journal
    joins are hard to scale
    think about what data you want to use together
    mongo has no constraints
    atomic operations on documents

    Quiz: MongoDB Schema Design







    Whats the single most important factor in designing your application schema within MongoDB?
    Read More..

    Sabtu, 15 Februari 2014

    Funniest video I’ve seen in a while …

    Cornish Rex cat screaming “Im Wet!” while being bathed … hysterical Smile

    I stole that from a friend’s timeline on Facebook … videos like this are probably Facebook’s and YouTube’s greatest strength …

    Read More..

    Jumat, 14 Februari 2014

    Remember Who Knows When Youve Been Naughty or Nice When You Are Sleeping And When You Are Awake

    Its not Santa Claus.  Its NSA.
    Read More..

    Kamis, 13 Februari 2014

    Zapbux com Payment Proofs We Pay You Every 5 Seconds

    http://www.zapbux.com/index.php?r=pinoydeal
    Signup and get your free Zapbux here.
    As Member,
    You can earn simply by viewing the advertisements we display.

    As Advertiser,
    You can advertise your website to help increase your traffic.

    About zapBux,
    We are experts at providing new business solutions.
    Main Benefits:
    • Effortless income
    • Guaranteed ads daily
    • Detailed statistics
    • Upgrade plans
    • Instant Payment
    Main Benefits:
    • Easy management
    • Reach millions
    • Affordable rates
    • Detailed statistics
    • Anti-cheat protection
    Our Company:
    • Registered Company
    • Heroic support
    • Innovative ideas
    • Secure environment
    • Instant services
    Read More..

    Rabu, 12 Februari 2014

    As ye sow … so shall ye reap … Apple wins an early battle very big but do they lose the war

    There is this somewhat silly concept called karma, which perfectly describes the concept of behaving as you would want others to behave towards you – the “golden rule” if you will. In other words, if you screw someone to get ahead, you are accruing “bad karma” …

    So when Apple won that wet dream award of $1B from some wing nut jury over their patent dispute with Samsung, things were looking pretty rosy. (Note: The award has been reduced already by a judge with a capacity for reason.)

    Things must have looked pretty rosy for Apple and I’m sure more than a few corks were popped … but as they say, karma is a bitch.

    And now Samsung is tightening the supply chain noose for displays and processors and that has Apple predicting a “divot” in their upcoming profits.

    http://www.zdnet.com/is-apple-about-to-feel-samsung-squeeze-on-iphone-costs-7000014654/?s_cid=e539&ttag=e539

    I laughed out loud when I read this paragraph quoting analyst Peter Misek:

    Apple is having to switch from in-cell to on-cell for the iPhone 6 as in-cell is proving unable to ramp to 4.8”. This new technology is unproven and Apple will incur significant costs to ramp production. We also believe that this is a stopgap technology in front of OLED. We believe it will take Apple and partners two years or more to commercialize OLED as the OLED market for smaller displays is effectively controlled by Samsung who will not supply Apple. In the meantime both LG Display and Japan Display will be forced to be on a dual track for screen technologies for Apple.

    This transition for Apple will raise screen prices by 10 to 25 percent. Remember that it is Samsung who has completely swung the market towards the larger displays and even “phablets”, a crossover tablet and phone. Think they had something in mind?

    But it gets better … I read this next and howled … Smile

    Apple is trying to switch processor manufacturing completely to TSMC and away from Samsung. The problem: Apple need Samsung for its older chips and cant cut over production. Misek said Samsung will start raising prices on legacy chips in the summer which will raise Apples bill of materials another 20 percent to 30 percent.

    This is a beautiful example of how the opponent’s next move is sometimes subtle. Apple may not yet be defeated, but I think they earned themselves this swift kick in the jewels :-)

    Read More..

    Selasa, 11 Februari 2014

    Mongo dba week 7 security backups


    Additional Resources (2.5 min)



    • Docs - mongodb.org
    • Driver docs - 
    • Bug database / feature request database [JIRA]
    • Support forums (in Google Groups) - mongodb-user
    • IRC - channel: freenode.net/#mongodb
    • Source code on github
    • Blog
    • Twitter (@mongodb)
    • Mongo Meetup Groups (MMUGs) - look on meetup.com




    Hardware Tips (7.5 min)


    Additional Features (4.5 min)


    Geospatial Indexes (5 min)


    location
    latitude and longitude things
    built on top of b-tree structures
    uses variation of geo-hash codes

    Data Recovery with MMS (4 min)


    Quiz: Data Recovery with MMS Backup





    You rack up $3.50 in MMS charges from a small backup restoration. What are your out-of-pocket costs?

    Installing MMS Backup (3.5 min)


    Introduction to MMS Backup ( min)


    Backup Strategies (3 min)


    Quiz: Backup Strategies






    Which are true statements?

    Backups (12 min)


    Intra-cluster Security (4 min)



    Security and Clients (6.5 min)




    --auth : runs it in a security mode.
    to authenticate:
    NOTE: users are added per-database
    db.addUser(...) - system.users (which is used to create credentials in mongodb)
    db.addUser( { user: "", pwd: "", roles: [] } ) - 2.4+
    db.auth(username,password) - to authenticate in the shell
    Types of users:
    admin users - created in the admin database.  has privileges across all databases
    regular users - access a specific database, read/write or read only.

    Start by adding an administrative user:
    > use admin
    switched to db admin
    > db.addUser("the_admin", "testpassword" )
    {
    "user" : "the_admin",
    "readOnly" : false,
    "pwd" : "8b7c802b3626405fd30fa921fcf41cf9",
    "_id" : ObjectId("52851114c2e7840b9b05b49f")

    }
    > db
    admin
    > show collections
    system.indexes
    system.users
    > db.system.users.find()
    { "_id" : ObjectId("52851114c2e7840b9b05b49f"), "user" : "the_admin", "readOnly" : false, "pwd" : "8b7c802b3626405fd30fa921fcf41cf9" }

    passwords are hashed (not stored in plain text [i.e. a message digest])


    Once the admin user has been added to the admin database, the rule that you can connect from the localhost no longer applies.  Meaning that we will have to authenticate or it wont let us in (even if we are on localhost).
    > show dbs
    Thu Nov 14 11:07:59.449 JavaScript execution failed: listDatabases failed:{ "ok" : 0, "errmsg" : "unauthorized" } at src/mongo/shell/mongo.js:L46
    > // now we authenticate to do useful things
    > db.auth("the_admin", "testpassword" )
    1
    > show dbs
    admin 0.0625GB
    local 0.03125GB

    test (empty)





    Quiz: Security and Clients







    Which are true?



    Security (5 min)


    Introduction ( min)

    Read More..

    Senin, 10 Februari 2014

    How Do I Download or Upload Pictures or Videos from my Camera

    This question comes up a lot. A new or used camera owner may run into camera software issues. Theyll plug in their camera, but for some reason their computer fails to see or recognize the camera. Another problem is they may lose or may never have had the USB cable or needed software that came with the camera. Is there any other way to get the photos or videos off the camera and onto their computer?

    First of all keep in mind IMO the only reason that the camera companies include a capability for cable download is to get you accustomed to using their bundled software that came with the camera. In most cases this software is rather pitiful, again IMO. If you absolutely must use photo organizing or editing software, there are much better freeware options available than what came with your camera (a future blog post is brewing).

    But as a solution to downloading your photos, I highly recommend that you instead consider using a card reader to move the photos or videos to your computer. Card readers do not require software (although Windows 98 and earlier may require drivers), are very inexpensive, are much faster downloading files from the camera, do not use the cameras batteries during the download, and are much less prone to file corruption of the photos during the download. Really, it would be better for the camera user if one of these was included with the camera instead of the cable and bundled software.

    Portable SD Card Reader/Writer

    "All in One" Multi-Card Reader/Writer

    You place the cameras card in the reader, plug the reader into the USB port, and your computer sees it as a hard drive. You simply copy/paste or drag/drop your photos onto your hard drive. For this simplicity, most professional photographers utilize card readers exclusively. Youll save yourself a lot of heartache if you convert to using one of these.

    Here are examples from Amazon. Dont be fooled by the cost. Some of the most inexpensive ones work just fine. But make sure that you do read the reviews first before purchasing. Also make sure that you get a reader that is clearly stated capable of reading your card, particularly if you use SDHC, XD, CF, or MS cards.

    For international readers of this blog, and even those in the US, heres another source for card readers (free international shipping too :-). I use the $1.95 portable SD/SDHC card model (SKU7230), and it works great. Note that the free shipping can take up to three weeks though as theyre located in Hong Kong.

    Now go throw away that cable and go download your photos.

    Read More..