JameB 66 Junior Poster

How do you test an Android app on different devices and screen sizes (not emulator)?

So far I'm just assuming that the XML preview I get in design mode means the app would function, obviously this isn't enough.

I don't want to ask friends/family, at least not yet. So I'm looking for any services or communities that do this..!

If you're interested in helping in this matter, my (first!) app is: https://play.google.com/store/apps/details?id=com.prynk.aminoacids

JameB 66 Junior Poster

Hey Mike, one more question. What about the same thing but for mobile applications?

Thanks.

JameB 66 Junior Poster

What's the code at that line?

JameB 66 Junior Poster

Hi guys,

I'm working on a side project for a friend and I'm looking for a C++ library that allows me to put bunch of paragraphs in a PDF format. Anyone know any good libraries that can do this as simply as possible?

It will be just paragraphs and paragraphs that need to be added to a pdf with normal margins and Times font! I'm looking for a library that I can use quick so I won't have to spend much time on this... not too familiar with this area that's why I'm hoping one of you has done somehting similar and can point me in the right direction!

Thanks! :)

JameB 66 Junior Poster

Do you know any open source BB or Android apps that do such thing? Just wanted to look at someone's code...

JameB 66 Junior Poster

Hi guys,

I'm trying to make an app for iOS, Android and BlackBerry 10 that allows users to add frames to pictures. This is suppose to be a learning experience kind of thing for me!

Anyway, I'm wondering what the best image editing libraries are for each platform.. Basically, I'm looking for some sort of library that allows me to overlap two images and add text on top! :)

Thanks!

JameB 66 Junior Poster
JameB 66 Junior Poster

Yeah, you can PM me if you haven't fixed it yet.

JameB 66 Junior Poster

Are you setting something to position: fixed;?

JameB 66 Junior Poster

[double post]

JameB 66 Junior Poster

On that note, take a look at this code and work with it:

<link rel="stylesheet" media="screen and (min-device-width: 800px)" href="css_for_800px_screens.css" />

Or

<link rel='stylesheet' media='screen and (min-width: 701px) and (max-width: 900px)' href='css/medium_size_screen.css' />
JameB 66 Junior Poster

Take a look at following piece of code and adjust yours accordingly:

<script type="text/javascript">

    if (screen.availWidth<=800) //if screen width is 800px or less
        //do soemthing here
    else
        //do something else here


    if (screen.availHeight<=800) //if screen width is 800px or less
        //do soemthing here
    else
        //do something else here

</script>
JameB 66 Junior Poster

Okay so first off you need a table - use the <table></table> tags to create one...

CODE:

<tablet>
</table>

Now you want 13 rows - use the <tr></tr> tags! (I'm only going to make a table with 3 rows, you do the rest)

CODE:

<table>
    <tr>
    </tr>

    <tr>
    </tr>

    <tr>
    </tr>
</table>

Now you want three columns, in other words, three table divisions PER row - use the <td></td> tags!

CODE:

    <table>
        <tr>
            <td></td>
            <td></td>
            <td></td>
        </tr>

        <tr>
            <td></td>
            <td></td>
            <td></td>
        </tr>

        <tr>
            <td></td>
            <td></td>
            <td></td>
        </tr>
    </table>

Now, that you have a basic table, use CSS 3.0 to style the table:

  • To create a colored background, create a class called 'green_background' and give it style background-color: lightgreen;. Now in every other <tr></tr> tags, set the class to green_background
  • To create green borders, give the <table></table> and <td></td> tags green border: border: 1pt solid darkgreen;
  • You can do the font styling and anything else yourself.
JameB 66 Junior Poster

P.S. There are a lot of variables.. Like:

>     int one;
>     int two;
>     int three;
>     int launch;
>     int one_1 = 1776;
>     int two_1 = 1999;
>     int three_1 = 2012;
>     int launch_1 = 138974;

Couldn't these be in some kind of an array?

or if you do not understand arrays, you can declare them on the same line... it looks cleaner.

e.g. Instead of

int a;
int aa;
int aaa;
int aaaa;

you can write int a, aa, aaa, aaaa;

You can even declare variables - int a, aa = 25, aaa, aaaa = 10;

JameB 66 Junior Poster

Oh yes, so what you need to do is inject your custom code when FB loads. Here is what I found from a quick Google search:

  1. http://userstyles.org/styles/browse/facebook
  2. http://userstyles.org/help/stylish

So these plugins will do that for you - you can search up more on "changing facebook designs" using Google and you will find a more detailed answer. Although I am not sure you will find a "tutorial", you'll have to learn on your own by looking at someone else's finished product...

JameB 66 Junior Poster

So what you want is a message when someone has submitted the form right? From what you tell me, the same page reloads and then you want the pop up to show up right?

Well, if I had to do that, I would set a text file (or a cookie) to a value of 1 (indicating the form was submitted). If 1 is detected, then you show whatever message you wanted to show and reset it back to 0 so next time when someone submits the form, it will be set to 1 again and so on and so on...

JameB 66 Junior Poster
<form method="post" id="some_id" action="process.php" onSubmit="alert('Thank you!');" >

EDIT: Sorry I realized you wanted something on the reload and not before leaving.. What you can do is in the PHP script, add small code to change the content of a file to 1 from 0 after you do the saving of the user inputed data.

Now when the page reloads, check if the content is 1, if it is, then set it to 0 and display whatever message you like.

You can do the styling parts yourself, I hope that was clear enough! :)

JameB 66 Junior Poster

@JameB, It's rarely a good idea to include files using the HTTP protocol, and it's even rarer that you'd want to include a text file using the include command. Typically you'd want to read such files in using file_get_contents or a fopen handler.

Ah I didn't read all of the posts... but yeah in this case it's not the best way to do what OP is trying to do. But I was wondering, did you say that for any other reasons?

JameB 66 Junior Poster

Look up ASCII values and then if (ASCII_value_of(some var) == 30) then set the element of an integer array to <soemthing>

Also, https://www.google.ca/search?q=convert+these+char+arrays+into+integer+arrays

JameB 66 Junior Poster
<?php
    $serverdir = "http://localhost:8080/core/data/";

    include($serverdir."file_name.txt");
?>

Is that helpful?

JameB 66 Junior Poster

You still haven't told us anything! What type of customization you want? Do you want to change the timeline cover picture? Do you want to change your profile picture? Do you want your 'newsfeed' to be all about metal music or hockey or what??!

If you meant changing the colour or changing the place where the profile picture shows up, that's a little harder and you should refer to my first post.

Also, if you wanted to do the latter, Facebook will most likely not tell you how to do that for obvious reasons...

JameB 66 Junior Poster
JameB 66 Junior Poster

Not sure what kind of customizations you want on Facebook but I've seen ways of injecting your own code in some existing websites' code and re-load the page with your custom code... so it sounds like it's possible - do some research!

JameB 66 Junior Poster

Google "adding time in PHP" and that should give you a lot of results. I suggest working in minutes for this.

So everytime someone chooses 30 minutes, you add 30 to existing number, 45 min => 45 to the existing number etc.

When you want to see the total number of minutes worked that are less than 60, it would be $extra_minutes = $total_minutes_worked % 60.

now AFTER you do the above, you look at what's remaning: $hours_worked = ($total_minutes_worked - $extra_minutes)/60;

This gives you both hours and minutes that someone worked... That's just how I would do it. I'm sure there's a better way! Google it! :)

JameB 66 Junior Poster

It's not recognizing it as "time" so what's happening is it's taking the 14.45 (which YOU understand to be 14h45m) and adds 0.15 (which YOU understand to be 15m) to give a 14.6. This makes sense if it's a base 60 number system...

Anyways, this will be helpful to you: http://stackoverflow.com/questions/1370332/add-two-or-more-time-strings-in-php (look at the second answer)

EDIT: I don't know what you're using this for, but I suggest converting the time into seconds or minutes or something like that and interpreting the number when you need to use it.. so store as x seconds but when it comes to displaying it in hours and minutes and seconds, use modular functions to find the number of total hours and minutes etc.

JameB 66 Junior Poster
<?php
    $search = $_GET['input'];

    echo "<a href=\"http://www.google.com/search?q=$search\" target=\"blank\">Results</a>";
?>

and then when you call the page, go like this: www.blahblah.com/index.php?input=php script to search all of the interwebs

JameB 66 Junior Poster

Every programmer should know the difference between Google and Forums... -__-

JameB 66 Junior Poster

@Sanchixx this is in php section because site must be in php!

You can't make the entire website in PHP, you have to use HTML. PHP will supplement HTML/CSS/w.e. you want to use.

This thread should've been in the Web Design section.

JameB 66 Junior Poster
<?php
    $input = "<p>This is an example of random input you might encounter! :)</p>";

    $output = strip_tags($input);

    $output = str_replace (":)", "<img src=\"https://www.google.ca/intl/en_ALL/images/logos/images_logo_lg.gif\" alt=\"\"/>", $output);

    echo $output;
?>

Remember that you need the slashes infront of the quotes so that PHP ignores the quotes (because they're not really the end quotes).

JameB 66 Junior Poster

Find a problem at your university/college/teaching school and address it by making a website and make it look pretty since you want it all girly (no sexism intended towards fellow men who like to make their websites good looking)

JameB 66 Junior Poster

Your post isn't very clear, are you trying to change the visiting user's IP after the person visits 10 pre-defined links??

JameB 66 Junior Poster

A quick search tells me that it's not possible... http://www.blackhatworld.com/blackhat-seo/youtube/171955-truth-about-iframes-autoplay.html

.
.

I suggest you work around it (if no one else knows how to do this...) by opening a video in a new window/tab when the user presses a button (idn, call it "watch this video" button)...

JameB 66 Junior Poster

First link from Google when typing out your entire question as is: http://stackoverflow.com/questions/5349716/how-to-make-youtube-embed-code-video-auto-start

JameB 66 Junior Poster

It's just a simple website that will hold the menu, contact information, an About Us page and the payment processing page that let's people pay for take out from home.

Not to be used at the restaurant (but people can use it if they want to...)

Not going for the crazy look of the website but something simple that works

JameB 66 Junior Poster

It's a website for a restaurant so nothing major is needed (obv with the one exception).. what kind of budget for the website should I be looking at?

JameB 66 Junior Poster

I was just wondering what the standard web design projects cost.

Level of difficulty: Low
Languages: HTML + PHP

the most complex requirement is the payment processing capability.

JameB 66 Junior Poster

vishalonne, the code you wrote is exactly what I suggested!

Good luck!

JameB 66 Junior Poster

To create what you want, you should create a PHP script that adds one to the number existing in a text file somewhere.

  1. In the HTML file, you simply echo the contents of the file where needed.

    <small>This page has been visited <?php $count = file_get_contents("INSERT_PATH_TO_THE_TEXT_FILE"); echo $count; ?> times!</small>
    
  2. At the end of the same HTML page, insert a function that:

Opens a text file, reads it's contents in a variable
Adds one to the number read
Overwrites the existing file with the new number (after adding one to the existing number)
Closes the file

Hope that's clear!

JameB 66 Junior Poster

Could you not write a php function to return complete only when all data has been written... Then redirect?

Perfect, this worked like a charm! :) Thank you!

JameB 66 Junior Poster

Find the nearest FRC/FTC team and ask them, they'll be very happy to show and teach you. www.usfirst.org

JameB 66 Junior Poster

Okay so I figured out that the problem is when someone clicks SAVE, it opens a new window and runs the process2.php script and starts to write the data. HOWEVER, the user is redirected to the next page before all of the data is written. So when the next page loads, it uses the old data!

.
.

How can I fix this?? I tried to remove the target="_blank" without any improvements.

JameB 66 Junior Poster

Here's an idea: store the user's selections & display depending on whether or not user selected them.

Look up include() and/or file read/write with PHP!

I actually recently did what you want to do with HTML(+ CSS) and PHP!

JameB 66 Junior Poster

Yup correct permissions are set and yes I triple checked the input names array to make sure the right names correspond to the right file - like I said it works perfectly on some computers! It's really weird

JameB 66 Junior Poster

Oh yeah I know the script reaches the process2.php 'cause all the other files get saved but it's always one or two random input boxes that stubbornly don't save OR display the older data.

I transfer all of the files so it's not the permission issues..

I shall try the log to figure out what the problem is. I think my best solution at this point is to redirect the main screen to the process script and when it finishes take the user to where he/she wants to go - to ensure the process2.php has successfully and completely executed before trying to load the data.

JameB 66 Junior Poster

s India the 1st 2 columns of next page should contain the names n id of all the Indians from the database). The 3rd n 4th columns should be textboxes where user can enter data n that has to be stored in the database. plz help me with this.. tanq.

What have you tried so far? Post your attempt!

JameB 66 Junior Poster

Hi, As I know the barcode scanner is just like a keyboard. I want the barcode scanner scan the user ID before it enter to the system. May I know how to hide the textbox field but still able to handle the input from barcode scanner?

Use IDs: <input id="hide>

in your CSS file, #hide { diplay: none;}

or more simply, <input style="display: none;" />

THis will simply not display the input but will still "load" it...

JameB 66 Junior Poster

Okay so:

I have form2.php that people enter information into, and it looks something like this:

blah blah - unimportant code here...

<form method="post" action="/core/process2.php" name="step2_form" target="_blank">
    <div class="float_left">
        <table class="form_step2">
            <tr class="form_step2">
                <td class="form_step2 title"><p class="form_text">File Date</p></td>
                <td class="form_step2 input"><input type="text" class="box_form" name="file_date" value="<?php include($datadir."file_date.txt"); ?>"/></td>
            </tr>

            <tr class="form_step2" <?php if (display_only_if(array("nfld", "ns"), array(""), array(""), array("")) == 0) echo "id=\"hide\""; ?>>
                <td class="form_step2 title"><p class="form_text">Supply Date (<i>Required</i>) </p></td>
                <td class="form_step2 input"><input type="text" class="box_form" name="supply_date" value="<?php include($datadir."supply_date.txt"); ?>"/></td>
            </tr>
        </table>
    </div>

more of the same code as above .. just A LOT of it
</form>




    <div class="form_footer">
        <input type="submit" class="save_button" name="submit" onclick="javascript:goto('form')" value="SAVE"/>
        <input type="submit" class="reset_button" name="submit" onclick="javascript:goto('reset')" value="RESET"/>
        <input type="submit" class="clear_button" name="submit" onclick="javascript:goto('clear')" value="CLEAR FORM"/>
    </div>

    <script type="text/javascript">
        window.onload = function()
        {
            document.forms[0][0].focus();
        }

        window.onbeforeunload = confirmBrowseAway;

        function confirmBrowseAway()
        {
            document.forms["step2_form"].submit();
        }

        function goto(id)
        {
            if (id == "provinces")
                window.location = 'http://localhost:8080/form_1.php';
            if (id == "form")
                window.location = 'http://localhost:8080/form_2.php';
            if (id == "open")
                window.location = 'http://localhost:8080/form_3.php';
            if (id == "reset")
                window.location = 'http://localhost:8080/core/reset_index.php';
            if (id == "clear")
                window.location = 'http://localhost:8080/core/clear_index.php';
        }
    </script>
</body>
</html>

okay so when the user tries to leave the page, the form gets submitted (by the javascript) and that form data is processed by process2.php which looks something liek this:

<?php
    $directory = "./data/form_data/";

    $files = array("on_coverletter_third_paragraph.txt", "nfld_cover_list.txt", "pbx_coverletter_paragraph.txt", "file_date.txt", "supply_date.txt");

    $input_name = array( "on_coverletter_third_paragraph", "nfld_cover_list", "pbx_coverletter_paragraph", "file_date", "supply_date",);

    for ($i = 0; $i <= 4; $i++)
    {
        $data = $_POST[$input_name[$i]];
        $file = fopen …
JameB 66 Junior Poster

Hmm yeahh I realized when I posted that LOL

but what I don't understand is why does this problem only show up on other people's computers? I can, for example, close the browser and reopen it and load the updated data but when I do the same on another computer, it doesn't work! It still shows the older data :S

JameB 66 Junior Poster

Cache is fine - I have the no cache headers in.

.
.
.

form_step2 is a class so they're "tag specific" right? Meaning table.form_step2 { } is different from tr.form_step2 { }

.
.

MY Save button:

<input type="submit" class="save_button" name="submit" onclick="javascript:goto('form')" value="SAVE"/>

.
.
.
EDIT: So I don't really have a save button but I use

window.onbeforeunload = confirmBrowseAway;

function confirmBrowseAway()
{
    document.forms["step2_form"].submit();
}

to save data...
.
.
.
The script:

<script type="text/javascript">
        window.onload = function()
        {
            document.forms[0][0].focus();
        }

        window.onbeforeunload = confirmBrowseAway;

        function confirmBrowseAway()
        {
            document.forms["step2_form"].submit();
        }

        function goto(id)
        {
            if (id == "form")
                window.location = 'http://localhost:8080/form_2.php';
        }
    </script>

Like you suggested I checked the file itself and found that the file updates but when the page reloads, it loads the older version! :S

..
.
.
I think what's happening is that when the process2.php is called, a window opens and before that window has a chance to finish processing all of the data, the MAIN window (where user enters info) already refreshes and it uses the old data to load the data.

How can I prevent this?

JameB 66 Junior Poster

I have a form that takes in information from the user and saves the info and then displays it in the form field..

.
.

Form:

<form method="post" action="/core/process2.php" name="step2_form" target="_blank">
    <div class="float_left">
        <table class="form_step2">
            <tr class="form_step2">
                <td class="form_step2 title"><p class="form_text">File Date</p></td>
                <td class="form_step2 input"><input type="text" class="box_form" name="file_date" value="<?php include($datadir."file_date.txt"); ?>"/></td>
            </tr>
        </table>
    </div>
</form>

That is one of the approximately 300 inputs required... as you can see, to save the file, it calls process2.php which looks like this:

.

<?php
    $files = array("file_date.txt", "supply_date.txt");

    $input_name = array("file_date", "supply_date",);

    for ($i = 0; $i <= 1; $i++) 
    {
        $data = $_POST[$input_name[$i]];
        $file = fopen ($directory.$files[$i], "w");
        fwrite ($file, $data);
        fclose($file);
    }
?>

The problem I'm having is that sometimes, when the user presses the save button, it won't save the data or it will display the old data (the one that loaded with the page).

Any solutions to this? Unfortunately, this is not an online site so I can't link you to it..
.
.
.
Is there a better way of doing what I want to do??