riahc3 50 Â Team Colleague

hmmm....is there another way to do it/calculate it using margin top/bottom?

riahc3 50 Â Team Colleague

Hello

I have a jQuery Thickbox window and I want to make it stick as far as possible to the top of the browser window, so the top is visible.

If the bottom is not visible, this (for now) is not a problem.

How can I do it?

riahc3 50 Â Team Colleague

Im looking at that page in IE9 and it is telling me Sorry, the browser you are using is not currently supported. To use the comments, Disqus recommends the following browsers:

What kind of bullshit is this? (Thats towards the webmaster not you, James)

riahc3 50 Â Team Colleague

First, what about using localStorage instead?

Second, cookies have a max size that is allowed. If you go past this it will do some screwy stuff.
http://stackoverflow.com/questions/640938/what-is-the-maximum-size-of-a-web-browsers-cookies-key

Hope that helps.

Tried but I cant get local storage on a PHP side right?

All my cookie stores is the word "true" or "false". Im not passing that limit.

riahc3 50 Â Team Colleague

Im problably not explaining myself correctly.

With AES:

http://www.movable-type.co.uk/scripts/aes.html

hello is 5wHNILVjTFEbxnmwSw==

I would put a function that is decrypt(5wHNILVjTFEbxnmwSw==)

and that would return hello.

BTW, Im looking on how to do it; Dont really think if it is secure or not. Ignore that part.

riahc3 50 Â Team Colleague

Firefox (since I have FireBug)

riahc3 50 Â Team Colleague

Same thing. Just disappears.

riahc3 50 Â Team Colleague

ASP.NET is problably running on a IIS server. You have to put it in the root folder of your IIS server.

Having said that...............

riahc3 50 Â Team Colleague

Hello

Im trying to make a cookie that I can use across one domain on different pages.

Lets say my domain is example.dev

var expiremilliseconds = 86400000;
var currdate = new Date();
var expirationdate = new Date(currdate.getTime() + expiremilliseconds);
document.cookie = "somecookie=true;domain=.example.dev;path=/;expires=" + expirationdate.toGMTString();

Thing is, I browse around my site and the cookie has disappeared and I cant use it on other pages. Why?

riahc3 50 Â Team Colleague

MD5 was a example of what I wanted to do.

riahc3 50 Â Team Colleague

Usually its IE but this time its Chrome....

The page is coded for Firefox. Page works in IE9, Opera, and Firefox but breaks in Chrome (and naturally Safari).

How do I apply fixes for Chrome?

Thanks

riahc3 50 Â Team Colleague

This looks easy

Im not sure thats exactly what I am looking for....

Ill use first something like this: http://7thspace.com/webmaster_tools/online_md5_encoder.html

For example, hello gives me 5d41402abc4b2a76b9719d911017c592

My program will only have decryption, not encryption. I dont mind if its easy encryption such as md5...

riahc3 50 Â Team Colleague

Hello

Dont ask why but lets say I want to encrypt "hello" and the encrypted forum is "238324"

I want to do:

String avariable=dcrypt(238324); //avariable should now hold hello

public string dcrypt(String encryptedtext)
{
//do decrypt stuff
return descriptedtext; //decriptedtext should be hello
}

Basically thats what I want.....Dont care for algoritim AES MD5 etc....

Thanks

riahc3 50 Â Team Colleague

You guys found a loophole in my post....

OK: No Javascript libraries or jQuery libraries.

riahc3 50 Â Team Colleague

BTW, jQuery is also possible BUT alone; No additional jQuery libraries....

riahc3 50 Â Team Colleague

Hello

I want to make some shortcut keys (example Alt+K) to do a "onclick" on a button. How can I do this?

Daniweb for example has that "Ctrl+B" makes the text bold.

Thanks

Troy III commented: A correct answer has been given to you - you need to say "THANK YOU!" and mark your thread as "Solved!" -2
riahc3 50 Â Team Colleague

To get the local storage variable to PHP you'll have to use an AJAX call. Whether you use a GET or POST is up to you. Personally, I'd choose a POST.

What would be the best way to do this then?

example.php

<?php

echo "hi"
$var=getlocalstoragehere.php;
echo $var
?>

Lets say that the page I use. What would be the AJAX page?

riahc3 50 Â Team Colleague

you can also use session as session is easy to maintain. http://php.net/manual/en/function.session-start.php

Ive had problems with sessions in the past....plus I set this client side: I click on a checkbox, if the checkbox is true, something (cookie, localstorage, session, etc) must be stored that can be accessed EVERYWHERE on the site. Thats the problem I have with a cookie. Sessions get lost for some reason (problably related to the cookie problem) and thats why Im trying with localstorage....

riahc3 50 Â Team Colleague

I want to use a localStorage variable in a PHP page. Very simple but "strange".

AJAX comes to mind. Whats the best form to do this?

Thanks

riahc3 50 Â Team Colleague

Unless someone can find me a FTP Server for Windows CE .NET 4.20 with Unicode support...

riahc3 50 Â Team Colleague

If you're familiar with PHP, why don't you begin by getting it to work perfectly in PHP and become familiar with it? Then move on to C#. Also, if you have a lot of Javascript experience, check out the JS-based implementation.

First get the ones that are just copy/paste from our demo to work before moving on :)

Have you read the Step-by-step instructions in the left column next to the code on the Documentation page? That should shed some light.

Well you made already PHP examples so thats pretty easy to follow. Never worked with cURL though.

I dont have much JS expirence and the expìrence I have, I hate it as a language. I think anything with "J" or "Java" in its name, I basically hate :(

Ive perfered to soley concentrate on desktop clients when it comes to the API.

riahc3 50 Â Team Colleague

I'm actually going to make some modifications now to return detailed error messages, so the 400 Bad Request stuff will actually say things like "client_secret is wrong".

Yes, that would give some ideas for me on what to look for...

I daily (like many others on this forum) work with PHP (main), MySQL, shell scripting, Java (main), Javascript (main), C# , some C++ and today I saw Delphi. Sometimes the most simple things I cant get thru my head (reason why you'll see me autor of many stupid threads)

And yes, I think now I see that the OAuth system is similar to Google APIs where you have a key to work with the api and such. Im blown how I missed that.

riahc3 50 Â Team Colleague

Getting a damn 400 bad request reply....

Will keep at it....Dont have much to do.

riahc3 50 Â Team Colleague

I don't know C# for anything, but the following links turned up from a Google search. Perhaps some of them might be helpful
http://www.deanhume.com/Home/BlogPost/a-simple-guide-to-using-oauth-with-c-/49
http://www.dotnetopenauth.net/
http://code.pearson.com/oauth-20-password-sample-code-c

Tried that first link, but the example is ASP .NET related
Im using that library as we speak.
I like that third link; Did not see it yet, Im trying it out now...

riahc3 50 Â Team Colleague

I see youve replied in the thread; Thank you for helping.

riahc3 50 Â Team Colleague

I don't know C# at all, and I just randomly googled this, but here is a C# OAuth 2.0 library:

http://www.dotnetopenauth.net/

Here is a Google API client library for .NET that you might be able to modify to work with our API.

Thats the library Im using to try getting OAuth to work.

From what Ive been reading its a pain; Posted it in the C# section and Im trying to see if someone can give some advice.

riahc3 50 Â Team Colleague

guyz really need help on this one.

There is a reason people have created (several) third party libraries for this. The out-of-the-box way of doing is very long and/or complicated.

Are you using 1.0 or 2.0?

riahc3 50 Â Team Colleague

Has anyone worked with C# and OAuth 2.0? Documentation/examples is VERY poor on how to do a simply login.

Thank you

riahc3 50 Â Team Colleague

Working on it....

DotNetAuth.OAuth2.Providers.LiveOAuth2 l = new DotNetAuth.OAuth2.Providers.LiveOAuth2();

            DotNetAuth.OAuth2.ApplicationCredentials a=new DotNetAuth.OAuth2.ApplicationCredentials();
            DotNetAuth.OAuth2.IOAuth20StateManager i = null;

            a.AppId = "2";
            a.AppSecretId = "lolcatz";
            l.GetAuthorizationRequestParameters(a, "http://www.daniweb.com/api/access_token", "?",i);

Documentation on OAuth2 and C# is very poor

riahc3 50 Â Team Colleague

Is there a limit of applications we can register?

riahc3 50 Â Team Colleague

Damn you Dani....You removed the secret key from the documentation page because I gave you the idea of reading the page and getting it from there.

Im going to start to shut up from now on :P

My intentions are not server/client side web apps. They are desktop (and in the future, maybe mobile) apps. When you implemented your API, Im sure that was not the way it was ment to be but...

riahc3 50 Â Team Colleague

That's the purpose of OAuth :)

The purpose of OAuth is so that you can access the account of any member (aka be that member) without the need for them to give you their username or password.

The security key is not what's needed to impersonate their account. It's meant to be hard coded into the application that you write as a security measure to authenticate yourself as the application's programmer.

Try copying and pasting the OAuth 2.0 demo that I have. When you visit the page, it should say "Hi, riahc3! and a PHP variable will be set with all of your information". When I visit the page it will say Hi Dani and the variable will be set with all of my information.

Basically OAuth handles that entire process described above: It makes you log in, forces you to log in if you aren't already, checks your cookies, and then it gives the application access to variables about your account.

When you pass the client_id and client_secret into your OAuth application, that is NOT meant to be passing in the credentials of the end-user using the application. That is simply the credentials of the application's developer, meant to be hard-coded into the application.

Your application will automagically have all the credentials of the end user who is using the application at the time, including their personal profile settings, their private messages, their own recommended / watched / viewed articles, etc.

Everything was better understood until the …

riahc3 50 Â Team Colleague

OOOOOOH you know what?! I think I know what it is, riahc3!!

I didnt have this issue, it was happening to Nick Evan.

Glad you solved it Nick Evan.

riahc3 50 Â Team Colleague

BTW, thats just "working" code. I have no idea what you want to acomplish.

riahc3 50 Â Team Colleague

Work from this:

package tests;

import java.util.Scanner;

public class Tests 
{

    /**
     * @param args
     */
    public static void main(String[] args) 
    {
        Scanner scan = new Scanner(System.in);
        String names[]=new String[0];
        int rooms[]=new int[0];

        do
        {
             int choice=0;
             System.out.println("\n\nMENU ");//menu
             System.out.println("1) Add Guest");
             System.out.println("2) View All Rooms");
             System.out.println("3) Display Empty Rooms");
             System.out.println("4) Find Room From Customer Name");
             System.out.println("5) Store Program data into file");
             System.out.println("6) Load Program from data file");
             System.out.println("7) View Rooms Alphabetically");
             System.out.print("Choice: ");
             choice=scan.nextInt();
             if((choice==10) || (choice ==0))//either or
             {
                 break;
             }
             char inputChar = (char)scan.nextLine().charAt(0); //No idea what you are trying to do here
             switch(inputChar)
             {
                case 'A':
                 addGuest(names);
                 break;
                 case 'V':
                 viewRooms();
                 break;
                 default:
                 break;
             }


        }while(true);


    }


     public static void addGuest(String[] names)
     {
         //Add Guest
         Scanner sc = new Scanner(System.in);
         //sc.nextLine();
         System.out.print("Please enter your guest: ");
         String guest=sc.nextLine();
         names=addName(guest,names);
         System.out.print("Room: ");
         int room=sc.nextInt();
         rooms=addRoom(room,rooms);
         //sort rooms by ascending... don't use arrays.sort!
         for(int x=0;x<rooms.length;x++)
         {
             for(int y=0;y<rooms.length;y++)
             {
                 if(rooms[x]<rooms[y])
                 {
                     int dummy=rooms[x];
                     String dummy2=names[x];
                     rooms[x]=rooms[y];
                     names[x]=names[y];
                     rooms[y]=dummy;
                     names[y]=dummy2;
                 }
             }
         }
      }



}
riahc3 50 Â Team Colleague

Im downloading the Java 7 JDK.....

Just like others have said, we are trying to help you but we have no ideas what your main goal is and/or what you currently know.

riahc3 50 Â Team Colleague

i never said i used the etc etc i know what that means and i aint stupid to write that in the program...
i never said write the damn program for me!!
NO THANKS FOR UR HELP!!

First you need to calm the fuck down. Thats first off.
Second, posting in the wrong section and being told that Java 7 has this feature and answering you are using Netbeans means that Java is pretty new for you (Id say even programming in general is new for you but oh well...)

I see you have 2 initialise functions with different types of parameters. You should really name them differenly to know exactly what is going on in your program.

We need some more explainations on what exactly you want to acomplish.

riahc3 50 Â Team Colleague

is there any algorithm based on timestamp value?

can any one please help me to find out the answer.

Could you be more specific on what exactly you want to do?

riahc3 50 Â Team Colleague

I'm incredibly confused why you need to generate/extract/etc the Secret Key ?!?! Your own secret key should be hard coded into any app that you write.

(Personally for me) The app I am writing is not for me only; I will share it with the community and I DOUBT they will want to see my posts and information. They will want to see their own.

riahc3 50 Â Team Colleague

Thanks riahc3.

Can you help me in writing a oracle stored procedure to select mutliple columns from 3 three tables and return it as an object so that i can cast it my required VO.

I can problably help you write a oracle stored procedure to select mutliple columns from 3 three tables and return it as an object so you could cast it in your required VO........just not with Hibernate.

Not that I have a problem with Hibernate, I just have never used it.

riahc3 50 Â Team Colleague

You can start by posting your question in the java forum instead of VB.Net. Consider it moved.

I doubt it but maybe he wanted to make it simple by porting it to VB .NET (doubt it but anything is possible)

riahc3 50 Â Team Colleague

3.I dont know how to execute.Please correct if am wrong anywhere.

Ah, OK. Thats problably it :)

Looking over documents, it seems it would be "doWork".

http://docs.jboss.org/hibernate/orm/3.3/api/org/hibernate/Session.html

http://docs.jboss.org/hibernate/orm/3.3/api/org/hibernate/Session.html#doWork%28org.hibernate.jdbc.Work%29

I havent worked with Hibernate too much but I have worked with stored procedures in Oracle and Java. Any more questions, please ask.

riahc3 50 Â Team Colleague

OK, there would be a small way to be able to get the secret key (I would only know how to do this in C#)

I would load http://www.daniweb.com (possible a hidden web browser control)
I would search for Member Login. It means that the user is not logged in. If not, I would hit Log Out then search again for Member Login
In the textboxs I would insert the username and password.
I would somehow be able to get the cookie (most problematic step)
If I get redirected to http://www.daniweb.com/members/lost_password and I find Join Daniweb it means Im not logged in and the login is incorrect.
If I dont, I would then go to http://www.daniweb.com/api/documentation and the secret key should be there as well.

Yes it is nasty but hey; You know my programming ;)

I dont like it too much so if anyone has better ideas, please tell me....

riahc3 50 Â Team Colleague

There's no way for you to calculate your secret key.

There is but for obvious reasons you wont tell me :P Dont worry, like I mentioned for security reasons I imagine that it would not be able to be done.

@Riahc3, I'd find that of use, I've looked into it briefly but didn't figure it out in the short time I had to look at it.

Im not sure if it can be done; Ill try to take a look at it as well.

riahc3 50 Â Team Colleague

Question:

Is there a way I can calculate the member ID and the secret key using just the username and password? Or is this not implemented for security reasons (eg, a for/while loop that tries every combination possible to crack a password)

riahc3 50 Â Team Colleague

There's really just two things to port: Using OAuth to gain an access token

I think one; OAuth....

Ill try my best to make a proof of conecept of OAuth authentication in C#

riahc3 50 Â Team Colleague

1: Is Hibernation neccesary?
2: (99% of all SQL related problems are because of this) Have you ran the actual SQL query by itself to make sure the actual SQL is legal/correct?
3: Another thing, I dont see you actually executing the query, just preparing it.

Please comment on these three things and maybe I can help you further.

riahc3 50 Â Team Colleague

BTW, I see that Dani has started to put PHP and Javascript examples; I could try my best to do all of them in C#/Java........Would anyone be intrested? And what language do you perfer? (If you say Java, you deserve to die......slowly)

riahc3 50 Â Team Colleague

BTW, what does http://www.daniweb.com/api/members return? It returns some users but is there some kind of condition?

riahc3 50 Â Team Colleague

Works fine for me??

http://www.daniweb.com/api/members?username=Dani

I dont know if you made changes or not but that did not work at the time I started the C# proof of concept, I assure you.

BTW, do you have a log of who accesses it? This was you could help us troubleshoot in case we have a problem developing with the API...