Invalid Postback or callback argument . Event validation is enabled using in configuration or in a page. For security purposes, this feature verifies that arguments to Postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the Postback or callback data for validation.

I was getting this error when pressing the asp:Button that was inside the asp:UpdatePanel. The code was in a Web User Control

      <asp:TemplateField HeaderText="Fecha Expiración" SortExpression="FechaExp" ItemStyle-HorizontalAlign="Center" >
         <ItemTemplate>
            <asp:Button ID="btnExpComFecha" runat="server" Text="[+]" style="background-color: Transparent"
                BorderStyle="None" ToolTip="Mostrar u ocultar la fecha de expiración del documento"
                CommandName="ExpComFecha" CommandArgument="<%# CType(Container,GridViewRow).RowIndex %>" />
            <asp:UpdatePanel ID="panFecha" runat="server" Visible="False">
               <ContentTemplate>
                  <asp:Calendar ID="calFechaExp" runat="server" FirstDayOfWeek="Monday" CellPadding="1"
                     SelectedDate='<%# IIf(IsDBNull(Eval("FechaExp")), DateTime.MinValue, Eval("FechaExp")) %>'
                     VisibleDate='<%# IIf(IsDBNull(Eval("FechaExp")), DateTime.Now, Eval("FechaExp")) %>' >
                  </asp:Calendar>
                  <asp:Button ID="btnUpdFecha" runat="server" Text="Actualizar" CommandName="ActualizarFecha"
                     CommandArgument="<%# CType(Container,GridViewRow).RowIndex %>" />
               </ContentTemplate>
            </asp:UpdatePanel>
         </ItemTemplate>
      </asp:TemplateField>

I fixed it with this code, that I based on this http://www.dotnetspider.com/resources/29004-A-control-with-ID-button-could-not-be-found.aspx


    Private Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
      Dim oScriptManager As ScriptManager = ScriptManager.GetCurrent(Me.Page)
      For Each oRow As GridViewRow In Me.grdDocumentosSuplidor.Rows
         Dim oButton As Button = DirectCast(oRow.FindControl("btnUpdFecha"), Button)
         oScriptManager.RegisterPostBackControl(oButton)
      Next
   End Sub

Another option was to use an asp:LinkButton, that doesn’t have that problem…

 

BlackBerry 10 weird calendar problem solved!

About a month ago, my BB10 calendar suddenly died. No appointments were shown in the calendar and if you created a new appointment in the device, after you saved it, it just vanished.

If you tried to manage your calendar you got the error:

“unable to retrieve your calendar accounts”

I was royally pissed. The “Remember” app also was having problems…

Today I found that there was a problem with my Outlook (yes, Microsux, you again) in my device. The account wasn’t syncing and when I tried to type the password I got:

“There was an unexpected error and the operation was cancelled.”

Searching for that new error I found:

http://forums.crackberry.com/blackberry-z10-f254/major-issue-calendar-remember-840783/

When I deleted the Outlook account, EVERYTHING started working again…

So, Microsoft screwed it and BlackBerry too…

Excel: Highlight current row and column

Original code @ http://msdn.microsoft.com/en-us/library/office/ff820716%28v=office.14%29.aspx

I had to add code to handle the error that occurred when you clicked on headers or corner button.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

   On Error Resume Next
   If Target.Cells.Count > 1 _
   Then
      Exit Sub
   End If
   If Err.Number > 0 _
   Then
      Exit Sub
   End If
   Application.ScreenUpdating = False
   ' Clear the color of all the cells
   Cells.Interior.ColorIndex = 0
   With Target
      ' Highlight the entire row and column that contain the active cell
      .EntireRow.Interior.ColorIndex = 8
      .EntireColumn.Interior.ColorIndex = 8
   End With
   ActiveCell.Interior.ColorIndex = 6
   Application.ScreenUpdating = True

End Sub

Fedora Linux 17 64 bit: How to install libraries to compile a c++ CLI program to 32 bit executable

Fedora 17 64 bit: Como instalar librerias para compilar un programa c++ de linea de comando como un ejecutable de 32 bit

In Netbeans, go to Run -> Set project configuration -> Customize -> C++ compiler -> Architecture -> 32 bits

But I was getting this error when trying to compile to a 32 bit executable in my 64 bit Fedora system:

g++ -m32 -c -O2 -MMD -MP -MF build/Release/GNU-Linux-x86/main.o.d -o build/Release/GNU-Linux-x86/main.o main.cpp
In file included from /usr/include/features.h:386:0,
from /usr/lib/gcc/x86_64-redhat-linux/4.7.0/../../../../include/c++/4.7.0/x86_64-redhat-linux/32/bits/os_defines.h:40,
from /usr/lib/gcc/x86_64-redhat-linux/4.7.0/../../../../include/c++/4.7.0/x86_64-redhat-linux/32/bits/c++config.h:414,
from /usr/lib/gcc/x86_64-redhat-linux/4.7.0/../../../../include/c++/4.7.0/cstdlib:43,
from main.cpp:8:
/usr/include/gnu/stubs.h:7:27: fatal error: gnu/stubs-32.h: No such file or directory

Then I found this: http://ask.fedoraproject.org/question/365/how-do-i-install-32bit-libraries-on-a-64-bit

I installed the required packages:

sudo yum install glibc.i686 libgcc.i686 libstdc++.i686 glibc-devel.i686

Thanks to Jim Blandy!

Gnome 3: How to turn off showing all the windows when the mouse moves to the hot spot in the top left corner of the screen

Gnome 3: Como apagar que se vean todas las ventanas abiertas al mover el ratón a la esquina superior izquierda de la pantalla

http://forums.fedoraforum.org/showthread.php?t=276970

Edit the file /usr/share/gnome-shell/js/ui/layout.js

Find this code:

this._corner = new Clutter.Rectangle({ name: ‘hot-corner’,
width: 1,
height: 1,
opacity: 0,
reactive: true });

Change reactive: true to reactive: false and it will disable the hot corner but still allow to activate the overview screen by clicking the Activities button or by pressing the Super (Windows) key.

Adding Windows TrueType fonts to Fedora 16

http://www.howtoforge.com/the-perfect-desktop-fedora-16-i686-gnome-p4

To install Windows TrueType fonts, open a terminal and become root again:

su

Then run:

yum -y install rpm-build cabextract ttmkfdir

rpm -ivh http://easylinux.info/uploads/msttcorefonts-1.3-4.noarch.rpm –nodeps

To check if the TrueType fonts have been installed correctly, open a word processor like LibreOffice. You should now find your new Windows fonts there:

Cannot move dialog windows on Gnome 3

http://ruionwriting.net/2011/06/cannot-move-dialog-windows-on-gnome-3/

here are those who hate, other who love and others that really don’t care why dialog windows have strange borders and don’t allow you to move them grabbing the title bar, oh wait 😛 , where is the title bar?

The solution is simple: gconf-editor to the rescue. Just open gconf-editor and untick /desktop/gnome/shell/windows/attach_modal_dialogs. Press Alt + F2, type r and press Enter (reloads gnome shell). Now you have the normal behavior back.

In case of using Arch, my home distro in this case, you need to install gconf-editor. Very easy with pacman:

$ sudo pacman -S gconf-editor

or

# pacman -S gconf-editor

Myself, with Fedora, used

# sudo yum install gconf-editor

And followed the rest of the instructions…

Vim: Global replace switching order of words

I had a bunch of lines containing selects:

select isnull(max(len(Marca)),0) from Subasta20042005.dbo.CotizMat
select isnull(max(len(Marca)),0) from Subasta20042005.dbo.CotizMatNue
select isnull(max(len(Marca)),0) from Subasta20052006.dbo.CotizMat
select isnull(max(len(Marca)),0) from Subasta20052006.dbo.CotizMatNue
select isnull(max(len(Marca)),0) from Subasta20062007.dbo.CotizMat
select isnull(max(len(Marca)),0) from Subasta20062007.dbo.CotizMatNue

But of course, in the results the name of the database didn’t show:

———–
34

(1 row(s) affected)

So I used this VIM command:
%s/\( from \)\(Subasta……..\)/ \2\1\2/

And got:

select isnull(max(len(Marca)),0) Subasta20042005 from Subasta20042005.dbo.CotizMat
select isnull(max(len(Marca)),0) Subasta20042005 from Subasta20042005.dbo.CotizMatNue
select isnull(max(len(Marca)),0) Subasta20052006 from Subasta20052006.dbo.CotizMat
select isnull(max(len(Marca)),0) Subasta20052006 from Subasta20052006.dbo.CotizMatNue

That prints a header for each select:

Subasta20042005
—————
34

(1 row(s) affected)

Even better: Try this one

%s/\( from \)\(Subasta……..\)\(\.dbo\.\)\(Cotiz.*$\)/ \2_\4\1\2\3\4/

Windows 7 Samsung laptop – No hibernate option

Crap, I’ve been looking all over internet for this, and today I discovered the reason while looking for other thing:

My Samsung laptop with Windows 7 Professional didn’t have a “hibernation” option. There was no way to enable it in the advanced power options of the control panel, and none of the tricks that I “googled” worked. The only available option was “sleep”, that was quite fast to wake up from, but heavily drained the battery (and I guess that shortened its life too).

Turns out that the culprit was a Samsung program, called Fast Start (All programs -> Samsung -> Fast Start). By default, the fast start function was on, and that disabled completely the hibernate option.

As soon as I changed the “Fast Start Function” to “Off” in the program, the hibernate option appeared in the shut down menu.