Ads 468x60px

Pages

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..