samedi 31 octobre 2015

Android webview: How to get webview to load my website

So I am currently trying to learn the android webview but have run into some issues. I got it to load youtube.com perfectly but when I try my website it will not work; I just get a blank white screen. Why is that? My website does not have https and this is my code inside the activity's .java class:

    web = new WebView(this);
    web.loadUrl("nickhulsey.com");
    web.getSettings().setJavaScriptEnabled(true);
    web.setWebChromeClient(new WebChromeClient());
    web.setWebViewClient(new WebViewClient());

    setContentView(web);

Is it some sort of security issue or is my website not built properly for the webview to work?




Jquery Not working on a Page even after linking latest jquery library

Please check the following page. http://ift.tt/1HjYUCN

Jquery is not working . I have linked the latest jquery library but still i get error like
Uncaught TypeError: $ is not a function And Uncaught ReferenceError: jQuery is not defined

Please check it and tell me what is the issue.




How is the width effected when using zoom?

Code for reference: http://ift.tt/1PXDbZn

I'm having a hard time understanding how the width of the viewport changes when i zoom in/out. I have these media queries that are triggered when the width in em changes.

My questions:

  1. Why exactly does the viewport change when i zoom? Does it have to do with the font-size increasing/decreasing?

  2. em is used for the font-size of the parent container. If the body element defaults to 16px for font size, then 1em=16 pixels. How does this change when i zoom? How is width related to zooming and em? Similar to #1

The following is based on the code i provided:

  1. For the media query at min-width:50em, changing the font size has no effect on the content of the div, why is this?

  2. At min-width:100em i'm not displaying the div "logo" anymore but the container of the div "logo" named "nav" should still be view-able yet it's not as noted from the disappearance of its border shadow. Why is this?

  3. At min-width:150em the div "logo" and it's parent div container reappear yet now no longer is the entire background color of the div "logo" colored but only it's content text, why is this?

html,
body {
  background-color: lightblue;
}

div#nav {
  position: relative;
  width: 50%;
  background: white;
  box-shadow: 1px 1px 15px #888888;
}

div#logo {
  border-right-style: solid;
  border-width: 1px;
  border-color: rgba(0, 0, 0, 0.15);
  font-family: 'Myriad Pro Regular';
  font-weight: normal;
  color: #1E3264;
  font-size: 2em;
}

@media (min-width:50em) {
  #logo {
    background: orange;
    font-size: 0px;
    
  }
}

@media (min-width:100em) {
  #logo {
    display: none;
   
  }
}

@media (min-width:150em) {
  #logo {
    display: initial;
  }
<div id="nav">
    <div id="logo">TEST</div>
</div>



PHP PDO Registration not working

I am having issues with the code below for site Sign-Up Page

I am trying to implement a login and registration system for students and staff on my university course. I have two tables in the DB, one for authorised users and then the other for registered users.

Before somebody can register, I have to enter either their student ID or email into the authorised table, otherwise it should tell the user that they are not authorised to register.

My problem is that when I register, I just get told that I am not authorised. The ID and email is in the authorised DB, so there is an issue with my code, and I cannot work it out.

Thanks in advanced.

I have this function for registering

public function register($firstname, $surname, $student_id, $email, $password) {
    try {
        $new_password = password_hash($password, PASSWORD_DEFAULT);

        $stmt = $this->db->prepare("INSERT INTO members(firstname, surname, student_id, email, password) VALUES(:fname, :sname, :sid, :smail, :spass)");

        $stmt->bindparam(":fname", $firstname);
        $stmt->bindparam(":sname", $surname);
        $stmt->bindparam(":sid", $student_id);
        $stmt->bindparam(":smail", $email);
        $stmt->bindparam(":spass", $password);
        $stmt->execute();

        return $stmt;
    } catch(PDOException $exception) {
        echo $exception->getMessage();
    }
}

And my registration page is as below.

<?php
        require_once 'dbconfig.php';

        if ($user->is_loggedin()!="") {
                $user->redirect('home.php');
        }

    if (isset($_POST['btn-register'])) {
        $fname = trim($_POST['fname']);
        $sname = trim($_POST['sname']);
        $student_id = trim($_POST['sid']);
        $email = trim($_POST['smail']);
        $password = trim($_POST['spass']);

        $email_requirement = '@chester.ac.uk';
        $email_verification = strpos($email, $email_requirement);

        if ($fname == ""){
            $error[] = "Please enter your firstname.";
        } else if ($sname == "") {
            $error[] = "Please enter your surname.";
        } else if ($student_id == "") {
            $error[] = "Please enter your Student ID.";
        } else if ($email == "") {
            $error[] = "Please enter your student email address.";
        } else if ((!$email_verification) && (!filter_var($email, FILTER_VALIDATE_EMAIL))) {
            $error[] = "Please enter a valid Chester Univeristy email address.";
        } else if ($password == "") {
            $error[] = "Please enter a password";
        } else if (strlen($email) < 6 ) {
            $error[] = "Passwords need to be at least 6 characters.";
        } else {
            try {
                $check_exist = $DB_con->prepare("SELECT student_id, email FROM members WHERE student_id=:sid OR email=:smail");
                $check_exist->execute(array(':sid'=>$student_id, ':smail'=>$email));
                $row=$check_exist->fetch(PDO::FETCH_ASSOC);

                if ($row['student_id'] == $student_id) {
                    $error[] = "That student ID has already been registered.";
                } else if ($row['email'] == $email) {
                    $error[] = "That email address has already been registered.";
                } else {
                    try {
                        $check_auth = $DB_con->prepare("SELECT student_id, email FROM authorised WHERE student_id=:sid OR email=:smail");
                        $check_auth->execute(array(':sid'=>$student_id, ':smail'=>$email));
                        $row2=$check_auth->fetch(PDO::FETCH_ASSOC);

                        if (($row2['student_id'] != $student_id) || ($row['email'] != $email)) {
                            $error[] = "You are not authorised to register. Please contact Richard - admin@cybersecurity.bloxamrose.co.uk.";
                        } else {
                            if ($user->register($fname, $sname, $student_id, $email, $password)) {
                                $user->redirect('sign-up.php?joined');
                            }
                        }
                    } catch (PDOException $exception) {
                        echo $exception->getMessage();
                    }
                }
            } catch (PDOException $exception) {
                echo $exception->getMessage();
            }
        }
    }
?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />

    <title>University of Chester (UNOFFICIAL) - Cybersecurity Notes</title>

    <meta name="description" content="Student made resource for Cybersecurity students at the University of Chester. UNOFFICIAL." />
    <meta name="author" content="Richard J Bloxam-Rose" />

    <meta name="viewport" content="width=device-width, initial-scale=1.0" />

    <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <link href="css/main.css" rel="stylesheet" type="text/css" />

</head>
<body>
    <div class="container">
        <div class="form-container">
            <form method="post">
                <h2>Register</h2>
                <hr />
                <?php
                    if (isset($error)) {
                        foreach ($error as $error) {
                            ?>
                            <div class="alert alert-danger">
                                <i class="glyphicon glyphicon-warning-sign"></i> &nbsp; <?php echo $error; ?>
                            </div>
                            <?php
                        }
                    } else if (isset($_GET['joined'])) {
                        ?>
                        <div class="alert alert-info">
                            <i class="glyphicon glyphicon-log-in"> &nbsp; Registration complete <a href="index.php">Login</a> here.
                        </div>
                        <?php
                    }
                ?>
                <div class="form-group">
                    <input type="text" class="form-control" name="fname" placeholder="First Name" value="<?php if (isset($error)) {echo $fname;}?>" />
                </div>
                <div class="form-group">
                    <input type="text" class="form-control" name="sname" placeholder="Surname" value="<?php if (isset($error)) {echo $sname;}?>" />
                </div>
                <div class="form-group">
                    <input type="text" class="form-control" name="sid" placeholder="Student ID" value="<?php if (isset($error)) {echo $student_id;}?>" />
                </div>
                <div class="form-group">
                    <input type="text" class="form-control" name="smail" placeholder="Student Email" value="<?php if (isset($error)) {echo $email;}?>" />
                </div>
                <div class="form-group">
                    <input type="password" class="form-control" name="spass" placeholder="Password" />
                </div>
                <div class="clearfix"></div>
                <hr />
                <div class="form-control">
                    <button type="submit" class="btn btn-block btn-primary" name="btn-register">
                        <i class="glyphicon glyphicon-open-file"></i> &nbsp; Register
                    </button>
                </div>
                <br />
                <label>Already registered? <a href="index.php">Login</a></label>
            </form>
        </div>
    </div>
</body>
</html>




How to get sitemap of webpages?

I am trying to analyze some page and to get all necessary information I need to know their web structure ( sitemap - map of web-pages, something like this Czech pages or Harvard pages )

Is there some online service or program to which I give URL of page and then it display sitemap (I know that there can be link to other pages but if the service would have option to search only to some level it would be great)




What are the potential security issues in this website's code?

Suppose this code.

HTML

<form>
    <input name="username" type="text">
    <input name="password" type="password">

    <input type="button" value="submit">
</form>

<div class="content" style="display: none;">
    <!-- 
         Stuff supposed to be seen and used by logged users excusively
         (e.g. leave a comment).
         Let's say the current user is stored into session by means of a Bean.
    -->
</div>

JAVASCRIPT

var username = $("input[name='username']");
var password = $("input[name='password']");
var button = $("input[type='button']");
var content = $(".content");

var execute = function(responseText)
{
    if(responseText == "success")
        content.css("display", "block");
};

button.on("click", function()
{
    $.post("Servlet", { username: username.val(), password: password.val() }, execute);
});

SERVLET

protected void doPost(HttpServletRequest request, HttpServletResponse response) 
throws ServletException, IOException
{
    final String user = request.getParameter("username");
    final String password = request.getParameter("password");

    // The class DBStuff offers static methods to query a database with.
    if(DBStuff.canLogin(user, password))
        response.getWriter().write("success");
}

I'm a newcomer to web-development and coding a mock web site just to get some practise. I've structured my html, javascript and servlets just as above and was wondering what kind of security issues might this design expose, if there are any.

Can you help me detecting them, providing an explanation as well?

Thank you for your attention.




the types of spring framework available at my disposal

I haven't learnt spring that much. I just copy paste codes from the internet and every thing works. I jus wanted to know the types of spring framework available for a web app. i.e. boot, data etc. the others are ?




Android Application sending picture + data between phones through server

So I'm trying to figure out how to implment my thoughts.

I want my user to take a pic with the camera, and send it to another phone.

I've figured out that I need a server and a web-servic. I've read about REST.

But with what I'm struggeling is, how can I upload a picture through REST? Or are there any other services I should use for this? (I also thought about a socket connection between the phones but I dont think this is a good alternative) And If I have the picture on the server, how do I send it to the other user? (Maybe he hasnt opened the application? or has no internet connection?)

I know these are some basic questions, but I would be happy to get some experienced input.




Alfresco - Different javascript ?

I'm trying to create a new page in Alfresco, but the tutorials gives to me the information that i have to create three files: new-page.get.js new-page.html.ftl and new-page.get.xml , like Aikau - http://ift.tt/1LIAJSt

But when I'm trying to programming the javascript, "alert is not defined, window is not defined" and I see in the tutorials that I have to made models and widgets. I can't programming the javascript like a normal javascript ? Where I access more information about this javascript ? I can't programming this.




web scraping python flashscore

I'm trying to learn how to scrape websites with python. Now when I try to scrape the links of soccer games from a table from the site: http://ift.tt/1KMGgnh I get a strange code like this:

{¬ZX÷00Netherlands.011rlands00000000116000Eredivisie..010ivisie¬~AA÷0f3WSLFa¬AD÷1446231600¬AB÷3¬CR÷3¬AC÷3¬CX÷Heracles¬ER÷Round 11¬AX÷1¬BX÷-1¬WM÷HER¬AE÷Heracles¬WU÷heracles¬AS÷1¬AZ÷1¬AG÷2¬BA÷2¬BC÷0¬OA÷team¬WN÷WIL¬AF÷Willem II¬WV÷willem-ii¬AH÷1¬BB÷0¬BD÷1¬OB÷team¬AW÷1¬AN÷n¬~AA÷M34ST10g¬AD÷1445787900¬AB÷3¬CR÷3¬AC÷3¬CX÷Feyenoord¬ER÷Round 10¬AX÷1¬AV÷1445829000|}

while when I control element in my browser it just gives me normal html with tr with in there the id of the tr which is what I will need. How can I manage to get this? I just use the code:

 import requests
 from bs4 import BeautifulSoup
 r = requests.get("http://ift.tt/1KMGgnh")
 soup = BeautifulSoup(r.content)
 htmltext = soup.prettify()
 print htmltext




What are the specs for saving photo for web, mobile, print and for a large print? In terms of DPI, bits/channel etc

Hi guys needs a quick reminder on best practices as I have not got myself into this for a while and been snowed, much appreciate!




To use a JS Framework or Not to Use

I tried to use various javascript frameworks in my HTML5 mobile app projects.

I ended up, again, using a custom SingleM-V-C structure along with jQuery Mobile for the rooting and the appearance.

The code seems well structured.

  1. JQM's index.html: takes over the rooting and the views

  2. Controllers Folder Classes: Handle the dom events(via jQuery) and request data from the models,

  3. Models Folder classes: make the ajax or local db calls in order to fetch - send data.

  4. Helpers Folder classes: assist with general class (like maths etc).

THE QUESTION:

Am I missing something?

Why should I use Backbone or AngularJS or anyother that seems to have a very complex steep understanding when I am trying to do something outside the normal behaviour?

Is there an MVC framework that works well with JQM?




Ruby: How to get API and manipulate it

With simply ruby no rails how can I call an API (ex: http://api.anapi.com/) and later manipulate it say to get a value from it and check if it is greater than 5.

http://api.anapi.com/: Say it contains an array called "anarray" which contains hashes: in one of those hashes I want to get to value of the key name "key".

How do I do this, again with only ruby.

Right now with this:

require "net/https"
require "uri"

uri = URI.parse("http://ift.tt/1GRr2lN")
http = Net::HTTP.new(uri.host, uri.port)

request = Net::HTTP::Get.new(uri.request_uri)

response = http.request(request)
puts response.body

I get: #<StringIO:0x2cadb90>

Thank you very much. Please let me know if I need to be clearer.




A system for creating multilingual static websites

I have a website I'm working on that I wish to add another few (properly translated) language options for, and I can't find as much readily accessible information as I thought I could on producing a multilingual website.

There's a nice amount of information on how to structure your URL schema (with .com/LANGUAGE being the nicest), but if you have http://ift.tt/1n7zTmo, http://ift.tt/1innf4c, and http://ift.tt/KYWWe4 — then for a static site, how do you avoid manually duplicating code just to drop-in each language's strings?

My site has about 8 webpages with on average 400 words of content on each page. It's not enough content to require a database for. However, the website is still in development and I don't want to wait until the 'end' (it's an informational tool) of its development cycle to create static versions for each language. I also don't want to swap out variables server-side because I am under the impression this will greatly diminish SEO scoring?

So, without much information of the topic available to me, I have devised a system/program that I would like some feedback of feasibility on - or if an alternative exists (?), before I begin.

  • I am planning on creating master versions of each .html file (the only file that I actually edit for code changes) that contains a unique variable string for each instance of text
  • Create /language directories for each language, copying over all files from the master
  • Create a JSON file, structured appropriately to contain language strings for each variable
  • Using a small C program, parse each language into the appropriate variables for each language's .html file

...As I am using .git, I would also copy over only changes that need to be made, by comparing strings against existing variables. — The way I could compare files I have not yet thought through — was thinking of storing the variable for each string as a .html tag so that it is always existent in the file.

Does anybody know if a tool like this exists, or if there is a much more compelling and SEO-compliant method of performing this?

Thanks in advance.




HTML CSS Space Around Logo in Header

I've been trying to do this since a week but can't seem to succeed. What I'm trying to do is a responsive website and a responsive header for that website.

The header I'm trying to create has an empty space around the logo and is slightly transparent.

screenshot

As you see in the picture the header is transparent and you can see the background picture AND there is a fully transparent space around the logo where you can see the background image clearly.

I've been trying to do this in Adobe Muse CC but I'm about to go nuts. I tried percentage codes in HTML/CSS but can't get it to work. I tried with putting 2 different sized rectangles around logo with the spaces but when I try the responsiveness they just fill the gaps. I tried making the logo with transparent spacing and put it in only one header but then it displays the slight blue transparent header and not directly the background.

This is the HTML:

<div class="clearfix colelem" id="pu179-3">
<!-- group -->
<div class="browser_width grpelem" id="u179-3-bw">
   <div class="clearfix" id="u179-3">
      <!-- content -->
      <p>&nbsp;</p>
   </div>
</div>
<a class="nonblock nontext MuseLinkActive clip_frame grpelem" id="u83" href="index.html">
   <!-- image --><img class="block" id="u83_img" src="images/logo.png" alt="" width="147" height="37"/>
</a>
<nav class="MenuBar clearfix grpelem" id="menuu137">
<!-- horizontal box -->
<div class="MenuItemContainer clearfix grpelem" id="u138">
   <!-- vertical box -->
   <a class="nonblock nontext MenuItem MenuItemWithSubMenu MuseMenuActive clearfix colelem" id="u141" href="index.html">
      <!-- horizontal box -->
      <div class="MenuItemLabel NoWrap clearfix grpelem" id="u142-4">
         <!-- content -->
         <p>ANASAYFA</p>
      </div>
   </a>
</div>
<div class="MenuItemContainer clearfix grpelem" id="u145">
   <!-- vertical box -->
   <a class="nonblock nontext MenuItem MenuItemWithSubMenu clearfix colelem" id="u146" href="hakkimizda.html">
      <!-- horizontal box -->
      <div class="MenuItemLabel NoWrap clearfix grpelem" id="u147-4">
         <!-- content -->
         <p>HAKKIMIZDA</p>
      </div>
   </a>
</div>
<div class="MenuItemContainer clearfix grpelem" id="u153">
   <!-- vertical box -->
   <a class="nonblock nontext MenuItem MenuItemWithSubMenu clearfix colelem" id="u154" href="%c3%bcr%c3%bcnler.html">
      <!-- horizontal box -->
      <div class="MenuItemLabel NoWrap clearfix grpelem" id="u157-4">
         <!-- content -->
         <p>ÜRÜNLER</p>
      </div>
   </a>
</div>
<div class="MenuItemContainer clearfix grpelem" id="u160">
   <!-- vertical box -->
   <a class="nonblock nontext MenuItem MenuItemWithSubMenu clearfix colelem" id="u161" href="fiyat-listesi.html">
      <!-- horizontal box -->
      <div class="MenuItemLabel NoWrap clearfix grpelem" id="u162-4">
         <!-- content -->
         <p>FİYAT LİSTESİ</p>
      </div>
   </a>
</div>
<div class="MenuItemContainer clearfix grpelem" id="u167">
<!-- vertical box -->

And this is the CSS:

#u83
{
  z-index: 22;
  width: 147px;
  margin-right: -10000px;
  left: 100px;
}

#u83_img
{
  padding-bottom: 6px;
}
#u179-3,#u179-3-bw
{
  z-index: 19;
  min-height: 43px;
}
#u138
{
  width: 134px;
  min-height: 43px;
  margin-right: -10000px;
}




vendredi 30 octobre 2015

Does lynx -crawl -traversal still work?

10 years ago, Lynx could download a web page and the pages on the same site that it pointed to, using a command like this:

lynx -crawl -realm cscie12.dce.harvard.edu -traversal http://ift.tt/1is70CP

This doesn't work on my cygwin32 or cygwin64 systems, which have these respective versions:

$ lynx --version
Lynx Version 2.8.7rel.1 (05 Jul 2009)
libwww-FM 2.14, SSL-MM 1.4.1, OpenSSL 1.0.2d, ncurses 6.0.20151017(wide)
Built on cygwin May  8 2012 12:21:50

$ lynx --version
Lynx Version 2.8.7rel.1 (05 Jul 2009)
libwww-FM 2.14, SSL-MM 1.4.1, OpenSSL 1.0.2d, ncurses 6.0.20151017(wide)
Built on cygwin Apr 10 2013 12:32:36

I can't find any evidence that -crawl has worked in the past several years. When I try it now, I get errors like these:

$ lynx -traversal -crawl http://ift.tt/1is70CP
Unable to open traversal file.: No such file or directory

$ lynx -crawl -traversal http://ift.tt/1is71Xj
lynx: Start file could not be found or is not text/html or text/plain
      Exiting...

$ lynx -traversal -crawl -realm http://ift.tt/1is70CR -startfile_ok "http://ift.tt/1is71Xj"
lynx: Start file could not be found or is not text/html or text/plain
      Exiting...

I don't know if lynx is supposed to download the .mp3 files that I want, but I can't get it to download any web page at all, not even the start page. Does it just not work on cygwin, or is -crawl no longer supported, or is the 2009 version of lynx confused by changes in its libraries or in web protocols?

Is there some other simple tool to use for the common case of downloading a podcast's archives, where they are all .mp3 files that are each on a separate .html page that is linked to by a single index page?




What is the best method for me to get my simple SPA online

I have developed a very simple web application using jquery, mustache.js and bootstrap all installed using bower. I now want to put it on my server via FTP.

I have heard that copying the whole bower_components folder for the project to the server is a bad idea. What is the best way to get only the required parts on the server?

If anyone can give tips or point me in the direction of some tutorials that would be great.




POST form with JQuery using $.post()

I have the following form

<script type="text/javascript">
<input type="text" id='responseText' name="responseText" value="">
<input type="button" id='confirm' name="confirm" value="confirm">
<input type='text' id="idNum" name="idNum">
<input type='text' id='correct' id="correct">
</form>

Only the value for #responseText is actually typed in, #idNum is passed from another page, while the other fields are filled by this function:

<script type="text/javascript">
var arr = [2,5,6,7,10,16,29,42,57];
x = 0
/* idNum is passed from another page to this one */
$(document).ready(function() {
    document.getElementById('idNum').value = localStorage.memberID;
    /* when something is typed in the form */
    $('#responseText').on('input', function() {
        /* the value is stored */
    var response = document.getElementById('responseText').value;
    /* and compared with the vector arr that contains the correct answers*/
    if( response == arr[x]){
        $("#correct").attr('value', 'yes');
    }
    else{ 
        $("#correct").attr('value', 'no');
        };
    });
/* confirm is the button to send the asnwer */
$('#confirm').click(function(){
    x = x + 1;
});
}); 

</script>

And here is my php:

<?php
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}

$response = $_POST["responseText"];
$memberID = $_POST["idNum"];
$timeStmp = time();
$correct = $_POST["correct"];

$sql = "INSERT INTO colorBlind (memberID, response, correct, timeStmp)
VALUES ('$memberID', '$response' ,'".$correct."','".$timeStmp."')";

if ($conn->query($sql) === TRUE) {
    echo "New record created successfully";
} else {
    echo "Error: " . $sql . "<br>" . $conn->error;
}

$conn -> close();

?>

Now, I am sure the php is called correctly when the click event occurs on #confirm, because the timestamp invoked in the php is recorded in my db. Nevertheless, none of the value in the fields is passed in the php. Namely if do somethin like:

echo $_POST["idNum"];

I get back an empty field.

Anybody has any idea what I am doing wrong or any suggestions on how to debug it? I have been spending days on this without any progress.




Weird Characters Displayed on Build, but not on Debug

I'm developing a Java Application using Netbeans, but while I run my app in Debug, or plain running it from Netbeans, my screen looks like so: Good. Yet, when I try to run from the Built jar in the dist folder, it looks like so: Bad.

Here is the method in which I am using to receive the content. The method is intended to get the source of text file from the web.

public static ArrayList<String> getUrlSource(String urlF) throws IOException {
    URL url = new URL(urlF);
    Scanner s = new Scanner(url.openStream());
    ArrayList<String> fileLines = new ArrayList<>();
    while (s.hasNextLine())
    {
        fileLines.add(s.nextLine());
    }
    return fileLines;
}




Azure AD B2C Web Forms examples?

With the Azure AD B2C public preview out now there are plenty of examples of creating and openID connection through an MVC application, however when I try to mimic the request building method in a Web Forms application it doesn't form the request correctly. Is there an example anywhere as to how to authenticate your Web Forms application to Azure AD B2C?




Ethical or security reasons against having a user 'spoofing' tool for a web site?

I want to add a 'doppelganger' function to a website for debugging purposes. By doppelganger, I mean an authenticated user can enter another username and thereon the website will treat the authenticated user as the entered user in every way.

For example, a user has an issue adding comments to a blog. A developer would enter the user's username and the website would let the developer try to comment as that user to try to replicate the issue.

Assuming I trust the authenticated user to use the tool properly, is there any security issues I should consider?

Assuming the tool is secure, is there any ethical issues that I should consider?




How do I go about parsing a web page html code?

I need to download html code from some web page. What is the best way to approach this task? As I understand there are very few working web frameworks for Rust right now and hyper is the one most people use? But after searching it's documentation I couldn't find a way. The closest I got is this

extern crate hyper;

use hyper::Client;

fn main() {
    let client = Client::new();
    let res = client.get("http://ift.tt/mQLMLn")
        .send()
        .unwrap();

    println!("{:?}", res);
}

But it returns Response, which doesn't seem to contain any code from html body.




What are the benefits of client-side XML/XSLT page?

Could you please describe the benefits of having client-side XML/XSLT page? What are the benefits over server-side XML/XSLT, etc?




What's the good practice of retriving data from a table with millions of data?

During an interview, an interviewer was asking this question and I didn't answer well. The question is: if we have a table which has millions of records. Each record has first name, last name and telephone number. On the web page, we have three textboxes: FirstName, LastName and Telephone and a Search button. If users click on the search button, it will retrieve data from the database and display 20 records on each page. What's the good practice of retrieving the data? Should we get all matched data and put them in a buffer? or we get the first 20 records only? If users click on "Go to next page", then we retrieve the next 20 records from the database. How should we right a stored procedure for this process?




Adding site to iis and setting all configurations for api project

So, I have installed iis on windows 10 machine. I want to create my own server on my machine. I have set up remote access, got static ip, got my domain, created sub domain, but I cant find step by step tutorial to show me how to set up properly site, connect my domain to it and add published project from Visual Studio. Any help would be appreciated.




Git - Can't connect to my website

Hello I am getting the error

"ssh_exchange_identification: read: Connection reset by peer"

This is after I attempted to log into my server with the wrong password a few times. I was logging in with

 ssh username@website.com

and then i am suppose to be asked for a password but now i have an error.

I am using git bash for windows and the server is on Godaddy.

I have connected from another computer/ip address and it is fine so i think i am being blocked by my ip address or a file on this computer or the website is blocking me.

i've seen people say that "some how (they got) locked out (of) localhost with denyhosts"

Anyone have any idea?




How to deploy java project on github to Azure

So I made a simple java project with Spark and was trying to deploy it to Azure, but although it complies and says deploy successfully, it won't show any content. I used both the web+mobile deployment and the java jetty deployment, but none worked. Can anyone tell me what is the problem?

The link to the github project is http://ift.tt/1NdxDIx

And the link to the website is minitwitter.azurewebsites.net




Are there ways to identify a web element in R when CSS is not used?

I want in R to download the data I get from the following website by clicking the "Download" button on the right.

http://ift.tt/1MxxfWz

I wanted to do it with RSelenium and use SelectorGadget to find the CSS of the button. However, the button has no CSS. Are there ways to do what I want in R?

Usually I would do it like in the code below but this needs a CSS.

library("RSelenium")

startServer()
#checkForServer()

mybrowser <- remoteDriver()
mybrowser$open()

mybrowser$navigate("http://ift.tt/1MxxfWz")

wxbutton <- mybrowser$findElement(using = 'css selector', "????????")
wxbutton$clickElement()




how to pass array in place of single object as input parameter in web api

public IHttpActionResult PosttblJudgeScores(tblJudgeScores tblJudgeScores)

here tblJudgeScores is single object which adding single judge score of single round .my intention is to pass all judge score for all round at same time

      [HttpPost]
    [Route("api/judgescore")]
    [ResponseType(typeof(tblJudgeScores))]
   public IHttpActionResult PosttblJudgeScores(tblJudgeScore enter code heretblJudgeScores)
    {
        if (!ModelState.IsValid)
        {
            return BadRequest(ModelState);
        }

        var checkscore = db.tblJudgeScores.Where(o => o.fightKey == tblJudgeScores.fightKey && o.roundNumber == tblJudgeScores.roundNumber && o.judgeKey == tblJudgeScores.judgeKey);
        if(checkscore.Count() == 0)
        {
            return Ok("Judge Already Scored for this round");
        }
        try
        {
            db.tblJudgeScores.Add(tblJudgeScores);
            db.SaveChanges();
        }
        catch (DbUpdateException)
        {
            if (tblJudgeScoresExists(tblJudgeScores.idx))
            {
                return Conflict();
            }
            else
            {
                throw;
            }
        }
        return Ok("Judge score inserted successfully");
    }




Can't add controller in web api 2 odata service

I am getting below error when adding second controller in web api 2 odata service using entityframework. When i added first controller there is no error.

here is the error screenshot




Problems with Pyramid Traversal and Browsers Back-Button

I'm using Pyramids Traversal and got some problems. Let us say, I've this config:

config.add_route('main_dis','/dis/{params}/go')
config.add_route('ajax_R1', '/dis/{url:.*}ajax_R1')
config.add_route('ajax_R2', '/dis/{url:.*}ajax_R2')

whereby the first one is a view config for chameleon, and the second and third one for json. If I call http://ift.tt/1LG48wz, an ajax request will get information by calling ajax_R1. Afterwards the user can click something and go to http://ift.tt/1Mxmq6X, which calls ajax_R2. If the user want to navigate back from B towards A, the ajax request is fired, but pyramids does not finds the suitable view, so that the notfound_view_config is called. Does someone has an idea for this behaviour?

One "dirty fix" is to check the path-variable in the request of the notfound_view_config and calling the suitable method, but this is very dirty :(

Thanks, Tobias

P.S.: Hopefully my problem will not be taken the wrong way :)




How managed VPS will be helpful for highest up time?

I am looking for some advice for a provider to get the best uptime on a VPS, I have an important e commerce website that process many orders at day and I any downtime makes him lost a lot of money, right now is hosted on web host and this last Friday my client website went down and I get the following answer:




Is it possible to listen to Ableton Live mix directly from the browser?

I have a web interface which control my Ableton Live mix. So I have this :

Web -> Ableton controls

And I want to do this :

Ableton music -> Web

To code a music visualizer. Can I do it without a streaming solution ?




how to test web services using jmeter without webservices(soap.xml/rpc)request?

when i started testing using transaction logic controller there is no such option of web services(soap/xml)request tried you tube tutorials guides too.

Steps to test a web service using JMeter are - 1. First of all add a thread group. Inside thread group add a transaction controller or any other Logic Controller that you normally use for testing web applications. 2. Now inside the logic controller go to Sampler and add a "WebService(SOAP) Request" sampler. - See more at: te the WSDL URL of your web service in the textbox next to WSDL URL label and click on Load WSDL button. The Web Methods combobox will get automatically populated by the methods available. 4. Out of the method displayed choose the one you want to test and click on the Configure button. - See more at: 5. Now we have to add SOAP/XML-RPC Data. For this we need to use the tool soapUI- a. Launch soapUI. b. Create a new soapUI project and insert the WSDL URL in the initial WSDL/WADL field. - See more at: Now where ever you find "?" mark in the SOAP request, pass appropriate value e.g. you might find some text like "?" in your soap request. You just need to pass the correct "firstname" in place of "?" mark. 7. Our test script is complete now, just add Listeners in your project and we are ready to test the web service. -




jeudi 29 octobre 2015

all form fields are working fine but image is not inserted into the table , its empty and does not show any error as

HERE IS MY CODE FOR INSERTION PRODUCT , EVERYTHING IS WORKING FINE WITH DB , BUT IMAGE COLUMN STAYS EMPTY WHENEVER I INSERT IMAGE /CHOOSE FILE . IT ALSO DOESNOT HAVE ANY EFFECT OR ERROR WHEN IMAGE IS NOT CHOOSEN , BUT IF I DO NOT CHOOSE OTHER FIELD , THE TABLE IN DB STAYS EMPTY . BUT ITS OPPOSIT IN CASE OF IMAGE . I I FOUND TUTOIAL ON IMAGE UPLOADING BUT THEY ARE NOT WORKING WD MY CODE AS WELL , any suggestions ?

<?php include 'includes/overall/head.php'; 
  include 'core/init.php';

         ?>
         <script src="//tinymce.cachefly.net/4.2/tinymce.min.js"></script>
         <script>tinymce.init({selector:'textarea'});</script>
         <?php
          include 'includes/aside.php';
    ?>
  <div class="container-form">
     <div  align="center"> 
        <h1>Insert Products</h1>
    </div>
        <!--Register users here-->
    <div class=> 
    <form action="insert_product.php" method="post"      enctype="multipart/form_data">
     <div class="table-responsive">
     <table class="table" width="700" align="center" border="1">

            <tr>
            <td><strong>Car Title</strong></td>
            <td><input type="text" name= "product_title"></td>
            </tr>
          <tr><td><strong>Car Category</strong></td>

            <td>
            <select  name="product_cat">
            <option >   Select Category</option>
            <?php
            // SQL query
            $strSQL = "SELECT * FROM categories  ";
             // Execute the query (the recordset $rs contains the result)
             $rs = mysql_query($strSQL);
             // Loop the recordset $rs
             while($row = mysql_fetch_array($rs)) {

             // Name of the person
             $cat_id = $row['cat_id'] ;
             $cat_title = $row['cat_title'] ;
             // Create a link to person.php with the id-value in the URL
          $strLink = "<a href = 'person.php?id = " . $row['cat_id'] . "'</a>";
             // List link
             echo "<option value='$cat_id'>$cat_title</option>";
             //echo "<li>" . $btitle . "</li>";

            }?>
          </select>
            </td>
            </tr>

            <tr>
                <td><strong>Car Company</strong></td>

                <td>
            <select  name="product_brand">
            <option >   Select Company</option>
               <?php
               // SQL query
                $brand = "SELECT * FROM brands  ";
                // Execute the query (the recordset $rs contains the result)
                $rs = mysql_query($brand);
                // Loop the recordset $rs
                while($row = mysql_fetch_array($rs)) {

                // Name of the person
                $brand_id = $row['brand_id'] ;
                $brand_title = $row['brand_title'] ;
                // Create a link to person.php with the id-value in the URL
                 $strLink = "<a href = 'person.php?id = " . $row['brand_id'] . "'</a>";
                // List link
                echo "<option value='$brand_id'>$brand_title</option>";
                //echo "<li>" . $btitle . "</li>";

                }?>
          </select>
            </td>    
             </tr>
             <tr>
            <td><strong>Add Image</strong></td>
              <td><input name="MAX_FILE_SIZE" value="102400" type="hidden">
              <input name="image" accept="image/jpeg" type="file"></td>
            </tr>


             <tr>
            <td><strong>Car Rent</strong></td>

            <td><input type="text" name= "product_price"></td>
            </tr>
             <tr>
            <td><strong>Car Description</strong></td>
            <td><textarea name="product_description"></textarea></td>
            </tr>
     <tr>
                <td><strong>Car Keyword</strong></td>
                <td><input type="text" name= "product_keywords"></td>
            </tr>


            <td colspan="2"> <button type="submit" name="insert_product" class="btn btn-primary col-md-offset-6">Add Vehicle</button>
     </td> 


           </table>
    </div>
    </form>
    <div>
    </div>
    </div>
    </div>
   <?php

     if(isset($_POST['insert_product'])){
        //text data variables
        $product_title=$_POST['product_title'];
        $product_cat=$_POST['product_cat'];
        $product_brand=$_POST['product_brand'];
        $product_price=$_POST['product_price'];
        $product_description=$_POST['product_description'];

        $product_status='on';
        $product_keywords=$_POST['product_keywords'];

        //image names: media file or multipart data 



        $product_img1=isset($_FILES['image']['name']);
        //Temp names
        $temp_name1=isset($_FILES['image']['temp_name']);
       //validation:


         if($product_title=='' OR $product_cat=='' OR $product_brand=='' OR $product_price==''OR $product_keywords=='' 
            OR $product_description=='' OR $image='') {
            echo "<script>alert('Please fill all the fields')</script>";
           exit();
         }

here is my upload image to folder code but its not working

      //upload images to folder
      move_uploaded_file($temp_name1 , "product_images/$product_img1");
        $query= "INSERT INTO product ( cat_id, brand_id, date, product_title,    image, product_price, product_description, product_status) 
        VALUES ( '$product_cat' , '$product_brand' , NOW() , '$product_title' , '$image' , '$product_price' , '$product_description' , '$product_status')";
        $rs = mysql_query($query);
       // Loop the recordset $rs
            if($rs) {
               echo 'Successful';
      }
      }
    ?>

    <!-------------------------------------------------------->
    <?php
    include 'includes/footer.php'; ?>




c# webbrowser coding to navigate local to html

I'm trying to put a local html location address to the web browser in my C# application but always failed. I'm using debug mode now so the html files had already copied into my Debug folder because i put copy always in the copy to output option. Below is my code:

        string appPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetName().CodeBase);
        string filePath = Path.Combine(appPath, "index.html");
        webBrowser1.Navigate(new System.Uri(@"file://"+ filePath));

There always error coming out using that way. Any idea what went wrong?




Use Facebook Login for website hosted locally

I'm trying to connect a website under development, to Facebook, to login to the website using facebook login. Currently I don't own a domain name yet.

I'm using ubuntu, and nginx. They are supossed to be working properly... but I can't connect to it.

I go to the web page and "log in" but even after showing the window to aprove the facebook app, it shows me as not logged in.

I'm pretty sure it's something related to the url name given to facebook.

nginx /etc/nginx/sites-enabled/default is:

server {
listen 80;
server_name localhost;

root /usr/share/nginx/html/noche;
index index.php index.html index.htm;

location / {
    try_files $uri $uri/ =404;
    }
}

etc/hosts:

127.0.0.1   localhost
127.0.1.1   xanxo
127.0.1.1   xanxo.com

Current localhost directory:

/usr/share/nginx/html/noche

Facebook App Domains

xanxo.com www.xanxo.com

Facebook Site URL

http://xanxo.com/

I even followed this video tutorial step by step but it doens't get any better.

Any help finding the mistake will be really apreciated.

PD: If there is any observation about the way the question is made, please comment, to modify it.




ClassNotFoundException: Main class IntelliJ IDEA

I got a ClassNotFoundException and dont know why. Can somebody help me? Thanks.

The output

enter image description here

Package distribution

enter image description here

Web modules

enter image description here

Path

enter image description here




What client-side technologies can I use to retrieve web page content from url bypassing same-origin policy

My goal is to extend user browser experience, by adding some functionalities to specific pages (which url match a regular expression) on a website, possibly without reinventing the wheel (i.e. creating a browser && website specific plugin ).

Whenever the user accesses a matched page (main page), the code, would retrieve from within that page (i.e. the main page) a set of url's (secondary pages). The code would then load the html from each url (i.e. the plain html returned by the server secondary pages) and retrieve some key components using regular expressions. Finally, the code, would modify the html of the main page by adding to it, the information retrieved from the secondary pages

In short, example.com/e.html contains a set of urls: a.com/a.html and b.com/b.html, a.html contains the string "Hello" and b.html contains the string "World !". When the users view e.html, instead of seeing 2 links, they see the string "Hello World!". I do not own example.com therefore I cannot use server sided languages.

I thought of JavaScript + Greasemonkey but I cannot seem to be able circumvent the same-origin policy.

The question is: Which client-sided language would you use to implement the above ?




Is it possible to download only the HEAD tag of a page?

I've done some research about this and had no conclusive answer.

This question lays some of the path through it: How can I download only part of a page?

But then again, I don't want to download only a random part of a page, but one of the first tags, the head.

Is it possible somehow to query the page, and stream it's content to a buffer and stop downloading (discarding the rest) as soon as you find the tag closer </head> ?

EDIT: Adding stuff to the page itself is not possible, since I want to pull the header of websites on my app.

Imagine http://ift.tt/gbk8l4 is entered as the parameter. The whole page is around 240kb, but if I stop downloading the moment I hit </head>, it's only 5kb. Allowing me to save around 97% bandwidth for this page.




web application behind corporate proxy/firewall

I have a network problem, but this is absolutely not my chosen field :

  • I installed a web application on a server protected by a firewall and proxy.
  • My application has to access to some URLs which are open to the outside. When I test access to URLs on the server with a wget command I can download the index.html file for each URL.
  • Firefox is configured with the proxy just as my application.
  • The http_proxy environment variable is set to the server.
  • But when my application tries to view one of these pages, I have a "page not found" error.

Any ideas ? Where should I start my investigations ?




Online customer form system

So I have a friend that works with events. She has the following requirements for a website: 1 - Her customers have to fill a form about the event they will have. This form is fairly large (lots of questions). 2 - Customers should be able to update the form as they go. 3 - She would like to be able to also edit/see the form as customers fill it in. 4 - Her budget is extremely small (like a couple dollars per month), but I am willing to help to get this going...

This what I already tried and had a look at: A - Google forms - Seems to fill all the requirements above, pain problems are:

  • I have not figure out how to submit the form while in the middle of it. Imagine a customer has filled half of the thing and wants to just stop, currently AFAIK you have to go all the way to the last page to submit
  • Second problem is that results are saved on a gigantic spreadsheet, which is not really friendly. The expected would be for her to go to the form and be able to see it filled (or some close representation of it).

B - Survey monkey - Seems awesome, but because of requirement 1 she would have to pay a subscription which runs at about 300 per year which is too much for her.

C - I had a look at having a website with django or meteor to host her form, but I would be happy if I did not need to code the whole thing up and maintain it.

So my question is. Does someone knows any kind of service that would fit her requirements or could point me to something that is half way there? I guess it is some kind of customer form keeping?




Firebase Retrieves Item multiple times (Everything is doubled)

So I call the function that fetches data from Firebase and push that data in an Array of objects. However, for some reason I have two of everything, everything is doubled as if the retrieve function gets called twice!

Here is how it looks:

link to image

Code:

cApp.controller('HomeCtrl', function($scope, $ionicModal, $rootScope) { 

$scope.allMeals = [];


    // getting meals from database
    $scope.getMeals = function () { 
    $scope.allMeals = [];

        var mealsRef = new Firebase("https://<my app id here>http://.firebaseio.com/Meals"); 

    mealsRef.on("child_added", function(snapshot) {
    var newPost = snapshot.val();
    console.log("Name: " + newPost.name);
    console.log("Price: " + newPost.price);

      $scope.allMeals.push({
        name: newPost.name, 
        price: newPost.price
      })
  });

 };


// calling get meals function
$scope.getMeals();

This is starting to give me headache!




Three.js Rotate sphere to arbitrary position

Using Three.js I have a sphere (globe) and several sprites attached to volcano points. I can rotate (spin) the globe and the sprites stay in their positions because they're added as a group to the sphere.

Now I want to be able to spin the globe to an arbitrary position using a button. How can I do this? For example if the point I want to spin to is at the back of the globe, how can I rotate the globe so it's in the front?

This code is essentially what I have right now. A main mesh which I add sprite to.

 <html>
<head></head>
<body>


<script src="three.min.js"></script>

<script>

  var scene, camera, renderer;
  var geometry, material, mesh;

  init();
  animate();

  function init() {

      scene = new THREE.Scene();
      camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window.innerHeight, 1, 10000 );
      camera.position.z = 1000;

      material = new THREE.MeshBasicMaterial( { color: 0xff0000, wireframe: false } );

      geometry = new THREE.SphereGeometry( 159, 32, 32 );
      mesh = new THREE.Mesh( geometry, material );
      scene.add( mesh );

      var map = THREE.ImageUtils.loadTexture( "sprite1.png" );
      var material2 = new THREE.SpriteMaterial( { map:map, color:0x00ff00 } );
      var sprite1 = new THREE.Sprite( material2 );
      sprite1.position.set(100,100,100);
      sprite1.scale.set(40,40,40);
      mesh.add(sprite1);

      var sprite2 = new THREE.Sprite( material2);
      sprite2.position.set(-100,-100,-100);
      sprite2.scale.set(30,30,30);
      mesh.add(sprite2);

      var sprite3 = new THREE.Sprite(material2);
      sprite3.position.set(100,-100,100);
      sprite3.scale.set(20,20,20);
      mesh.add(sprite3);

      renderer = new THREE.WebGLRenderer({alpha:true});
      renderer.setSize( window.innerWidth, window.innerHeight );

      document.body.appendChild( renderer.domElement );

  }

  function animate() {
      requestAnimationFrame( animate );
      mesh.rotation.y += 0.01;
      renderer.render( scene, camera );
  }

 </script>
</body>
</html>




Automaticly convert php to pdf

I made a .PHP page that automatic generates a invoice from database, Now my question is is it possible to load automatic all the users out the database and create a invoice for them with the .PHP page I made.

I use know SELECT * FROM orders Where name=$name;

But I want to run the page again and again in maybe a while loop till all the users have a invoice and I want to save a copy of the php page for every users as .PDF

So my question is, How to generate a invoice for every user and save it as pdf?

Best,

Sven




Web service - custom type not deserialized

I'm currently developing an application that access to a web service, a PHP based web service. But I have an issue, one of the method returns a custom type and the system is unable to deserialize the informations. Here is the exception thrown :

Error in deserializing body of reply message for operation 'listeDemandeAcces'.
System.InvalidOperationException: There is an error in XML document (1, 577). --> System.InvalidOperationException: The specified type was not recognized: name
='demande', namespace='http://mysite/acces_net', at <demandes xmlns=''>

Here is the code of my Reference.cs generated via the WSDL of the service :

namespace TDF.OSSExtranet.BusinessProxies.ServiceReference1 {

    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    [System.ServiceModel.ServiceContractAttribute(Namespace="http://mysite/acces_net", ConfigurationName="ServiceReference1.AccesNetWsdlPortType")]
    public interface AccesNetWsdlPortType {

        [System.ServiceModel.OperationContractAttribute(Action="http://mysite/applications/accesnet/ws/ws_clients.php/list" +
            "eDemandeAcces", ReplyAction="*")]
        [System.ServiceModel.XmlSerializerFormatAttribute(Style=System.ServiceModel.OperationFormatStyle.Rpc, SupportFaults=true, Use=System.ServiceModel.OperationFormatUse.Encoded)]
        [System.ServiceModel.ServiceKnownTypeAttribute(typeof(IntervenantV2))]
        [System.ServiceModel.ServiceKnownTypeAttribute(typeof(Demande))]
        [System.ServiceModel.ServiceKnownTypeAttribute(typeof(Intervenant))]
        [System.ServiceModel.ServiceKnownTypeAttribute(typeof(Projet))]
        [return: System.ServiceModel.MessageParameterAttribute(Name="resultat_req_da")]
        TDF.OSSExtranet.BusinessProxies.ServiceReference1.ResultatReqDa listeDemandeAcces(string login, string password, TDF.OSSExtranet.BusinessProxies.ServiceReference1.RequestDAFilter filter);
    }

    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.SoapTypeAttribute(Namespace="http://mysite/acces_net")]
    public partial class Demande : object, System.ComponentModel.INotifyPropertyChanged {

        private string num_demandeField;

        private System.DateTime date_demandeField;

        private System.DateTime date_maj_demandeField;

        private string statut_dem_accesField;

        private string code_siteField;

        private string code_igField;

        private ZoneInterventionV2 zone_interventionField;

        private System.DateTime date_deb_interventionField;

        private System.DateTime date_fin_interventionField;

        private bool accompagnement_demandeField;

        private bool accompagnement_requisField;

        private string nature_interventionField;

        private string code_projet_TDFField;

        private bool impact_TDFField;

        private bool travaux_dangereuxField;

        private Demandeur demandeurField;

        private IntervenantV2[] intervenantsField;

        private string num_diField;

        private string num_btField;

        /// <remarks/>
        [System.Xml.Serialization.SoapElementAttribute(DataType="integer")]
        public string num_demande {
            get {
                return this.num_demandeField;
            }
            set {
                this.num_demandeField = value;
                this.RaisePropertyChanged("num_demande");
            }
        }

        /// <remarks/>
        public System.DateTime date_demande {
            get {
                return this.date_demandeField;
            }
            set {
                this.date_demandeField = value;
                this.RaisePropertyChanged("date_demande");
            }
        }

        /// <remarks/>
        public System.DateTime date_maj_demande {
            get {
                return this.date_maj_demandeField;
            }
            set {
                this.date_maj_demandeField = value;
                this.RaisePropertyChanged("date_maj_demande");
            }
        }

        /// <remarks/>
        [System.Xml.Serialization.SoapElementAttribute(DataType="integer")]
        public string statut_dem_acces {
            get {
                return this.statut_dem_accesField;
            }
            set {
                this.statut_dem_accesField = value;
                this.RaisePropertyChanged("statut_dem_acces");
            }
        }

        /// <remarks/>
        public string code_site {
            get {
                return this.code_siteField;
            }
            set {
                this.code_siteField = value;
                this.RaisePropertyChanged("code_site");
            }
        }

        /// <remarks/>
        public string code_ig {
            get {
                return this.code_igField;
            }
            set {
                this.code_igField = value;
                this.RaisePropertyChanged("code_ig");
            }
        }

        /// <remarks/>
        public ZoneInterventionV2 zone_intervention {
            get {
                return this.zone_interventionField;
            }
            set {
                this.zone_interventionField = value;
                this.RaisePropertyChanged("zone_intervention");
            }
        }

        /// <remarks/>
        public System.DateTime date_deb_intervention {
            get {
                return this.date_deb_interventionField;
            }
            set {
                this.date_deb_interventionField = value;
                this.RaisePropertyChanged("date_deb_intervention");
            }
        }

        /// <remarks/>
        public System.DateTime date_fin_intervention {
            get {
                return this.date_fin_interventionField;
            }
            set {
                this.date_fin_interventionField = value;
                this.RaisePropertyChanged("date_fin_intervention");
            }
        }

        /// <remarks/>
        public bool accompagnement_demande {
            get {
                return this.accompagnement_demandeField;
            }
            set {
                this.accompagnement_demandeField = value;
                this.RaisePropertyChanged("accompagnement_demande");
            }
        }

        /// <remarks/>
        public bool accompagnement_requis {
            get {
                return this.accompagnement_requisField;
            }
            set {
                this.accompagnement_requisField = value;
                this.RaisePropertyChanged("accompagnement_requis");
            }
        }

        /// <remarks/>
        [System.Xml.Serialization.SoapElementAttribute(DataType="integer")]
        public string nature_intervention {
            get {
                return this.nature_interventionField;
            }
            set {
                this.nature_interventionField = value;
                this.RaisePropertyChanged("nature_intervention");
            }
        }

        /// <remarks/>
        public string code_projet_TDF {
            get {
                return this.code_projet_TDFField;
            }
            set {
                this.code_projet_TDFField = value;
                this.RaisePropertyChanged("code_projet_TDF");
            }
        }

        /// <remarks/>
        public bool impact_TDF {
            get {
                return this.impact_TDFField;
            }
            set {
                this.impact_TDFField = value;
                this.RaisePropertyChanged("impact_TDF");
            }
        }

        /// <remarks/>
        public bool travaux_dangereux {
            get {
                return this.travaux_dangereuxField;
            }
            set {
                this.travaux_dangereuxField = value;
                this.RaisePropertyChanged("travaux_dangereux");
            }
        }

        /// <remarks/>
        public Demandeur demandeur {
            get {
                return this.demandeurField;
            }
            set {
                this.demandeurField = value;
                this.RaisePropertyChanged("demandeur");
            }
        }

        /// <remarks/>
        public IntervenantV2[] intervenants {
            get {
                return this.intervenantsField;
            }
            set {
                this.intervenantsField = value;
                this.RaisePropertyChanged("intervenants");
            }
        }

        /// <remarks/>
        public string num_di {
            get {
                return this.num_diField;
            }
            set {
                this.num_diField = value;
                this.RaisePropertyChanged("num_di");
            }
        }

        /// <remarks/>
        public string num_bt {
            get {
                return this.num_btField;
            }
            set {
                this.num_btField = value;
                this.RaisePropertyChanged("num_bt");
            }
        }

        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;

        protected void RaisePropertyChanged(string propertyName) {
            System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged;
            if ((propertyChanged != null)) {
                propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
            }
        }
    }


    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34230")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.SoapTypeAttribute(Namespace="http://mysite/acces_net")]
    public partial class ResultatReqDa : object, System.ComponentModel.INotifyPropertyChanged {

        private string nb_demandesField;

        private Demande[] demandesField;

        /// <remarks/>
        [System.Xml.Serialization.SoapElementAttribute(DataType="integer")]
        public string nb_demandes {
            get {
                return this.nb_demandesField;
            }
            set {
                this.nb_demandesField = value;
                this.RaisePropertyChanged("nb_demandes");
            }
        }

        /// <remarks/>
        public Demande[] demandes {
            get {
                return this.demandesField;
            }
            set {
                this.demandesField = value;
                this.RaisePropertyChanged("demandes");
            }
        }

        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;

        protected void RaisePropertyChanged(string propertyName) {
            System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged;
            if ((propertyChanged != null)) {
                propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
            }
        }
    }

    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    public interface AccesNetWsdlPortTypeChannel : TDF.OSSExtranet.BusinessProxies.ServiceReference1.AccesNetWsdlPortType, System.ServiceModel.IClientChannel {
    }

    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    public partial class AccesNetWsdlPortTypeClient : System.ServiceModel.ClientBase<TDF.OSSExtranet.BusinessProxies.ServiceReference1.AccesNetWsdlPortType>, TDF.OSSExtranet.BusinessProxies.ServiceReference1.AccesNetWsdlPortType {

        public AccesNetWsdlPortTypeClient() {
        }

        public AccesNetWsdlPortTypeClient(string endpointConfigurationName) : 
                base(endpointConfigurationName) {
        }

        public AccesNetWsdlPortTypeClient(string endpointConfigurationName, string remoteAddress) : 
                base(endpointConfigurationName, remoteAddress) {
        }

        public AccesNetWsdlPortTypeClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) : 
                base(endpointConfigurationName, remoteAddress) {
        }

        public AccesNetWsdlPortTypeClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : 
                base(binding, remoteAddress) {
        }

        public TDF.OSSExtranet.BusinessProxies.ServiceReference1.ResultatReqDa listeDemandeAcces(string login, string password, TDF.OSSExtranet.BusinessProxies.ServiceReference1.RequestDAFilter filter) {
            return base.Channel.listeDemandeAcces(login, password, filter);
        }
    }

}

And here is the response from the service :

HTTP/1.1 200 OK
Date: Thu, 29 Oct 2015 11:01:17 GMT
Server: Apache
X-SOAP-Server: NuSOAP/0.7.2 (1.94)
Content-Length: 17798
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://ift.tt/wEYywg" xmlns:SOAP-ENV="http://ift.tt/sVJIaE" xmlns:xsd="http://ift.tt/tphNwY" xmlns:xsi="http://ift.tt/ra1lAU" xmlns:SOAP-ENC="http://ift.tt/wEYywg" xmlns:tns="http://ift.tt/1MkRD6P">
<SOAP-ENV:Body><ns1:listeDemandeAccesResponse xmlns:ns1="http://mysite/acces_net"><resultat_req_da xsi:type="tns:ResultatReqDa">
<nb_demandes xsi:type="xsd:integer">10</nb_demandes>
<demandes xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="tns:demande[10]">
<demande xsi:type="tns:Demande">
    <num_demande xsi:type="xsd:integer">579</num_demande>
    <date_demande xsi:type="xsd:dateTime">2012-02-15T16:13:27.181509+01:00</date_demande>
    <statut_dem_acces xsi:type="xsd:integer">1</statut_dem_acces>
    <code_site xsi:type="xsd:string">T59067</code_site>
    <code_ig xsi:type="xsd:string">3530703</code_ig>
    <zone_intervention xsi:type="tns:ZoneIntervention">
        <local xsi:type="xsd:boolean">false</local>
    </zone_intervention>
    <date_deb_intervention xsi:type="xsd:dateTime">2012-02-29T09:00:00+01:00</date_deb_intervention>
    <date_fin_intervention xsi:type="xsd:dateTime">2012-02-29T11:00:00+01:00</date_fin_intervention>
    <accompagnement_demande xsi:type="xsd:boolean">true</accompagnement_demande>
    <accompagnement_requis xsi:type="xsd:boolean">true</accompagnement_requis>
    <nature_intervention xsi:type="xsd:integer">0</nature_intervention>
    <code_projet_TDF xsi:type="xsd:string"></code_projet_TDF>
    <travaux_dangereux xsi:type="xsd:boolean">false</travaux_dangereux>
    <demandeur xsi:type="tns:Demandeur">
        <nom xsi:type="xsd:string">Legoff</nom>
        <prenom xsi:type="xsd:string">Yvon</prenom>
        <telephone xsi:type="xsd:string">0612345678</telephone>
        <email xsi:type="xsd:string"></email>
    </demandeur>
    <intervenants xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="tns:IntervenantV2[1]">
        <intervenant xsi:type="tns:IntervenantV2">
            <inter_soc xsi:type="xsd:string">TDF</inter_soc>
            <inter_nom xsi:type="xsd:string">Legoff</inter_nom>
            <inter_prenom xsi:type="xsd:string">Yvon</inter_prenom>
            <inter_tel1 xsi:type="xsd:string">0612345678</inter_tel1>
            <inter_email xsi:type="xsd:string"></inter_email>
        </intervenant>
    </intervenants>
    <num_di xsi:type="xsd:string">992625</num_di>
</demande>
</demandes>
</resultat_req_da>
</ns1:listeDemandeAccesResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>

If someone could help me figure out why the system can't deserialize the data, it would be nice :) .

Thank you in advance.




Android SMS hyperlink from webpage

I ideally want to be able to pre-populate a text message's to and body fields.

I've read a lot of questions here that give answers which don't seem to work on the latest Android releases.

In particular:

<a href="sms:0123456789">Link</a><br>
<a href="sms://0123456789">Link</a><br>
<a href="sms:/* 0123456789 */?body=/* test content */">Link</a><br>
<a href="sms:/* 0123456789 */&body=/* test content */">Link</a><br>
<a href="sms:+0132456789?body=link">New Link</a>

The error I get is net::ERR_UNKNOWN_URL_SCHEME

Does anyone know what I need to do?




why my css file not work well on android device

i have one little question about css stylesheet,so i write my css stylesheet and test it on chrome web browser on windows system and all work well,but when upload on server and download the page on mobile phone on android system all is wrong.

So ...is normal?

thanks all




Which web server Netbeans runs its HTML5 projects?

I'm using Netbeans for developing HTML5 projects and I would like to know which embedded web server it uses to run this kind of project, though there's no web server mapped in Netbeans yet.




Any free or public url to upload image to test

Actually many a times we develop and write some POCs & test codes and need to upload some files on web to test for correct implementation. If we get some free URLs / public urls where no other setting are required just pass the url+filenmae and it will upload the file.(I agree the file size will a constraint, limiting to some MB is enough. In my case less than 1 mb is enough.) This will be quick to test.

However we can test it on some other servers but the configuration takes a lot of time like username, password, proxy, cookies, etc etc.

Is there any free or public url where we can upload an image to test?

Any help is highly appreciated.




Web based SSH client to connect to different servers

In order to enhance my web application that provides free instant linux server - InstantServer, I would like the user to be able to open an SSH client within the browser, something in line with the mongodb terminal here.

I did my research and the closest matches were ajaxterm and Gateone. AjaxTerm has procedure listed to open SSH to a particular host whereas gateone requires a license.

Please suggest if any other reusable component already exists for my requirement.




What is better to use PHP or Python to develop client management billing system for hosting companies? Something like WHMCS but more complex. [on hold]

I was thinking to use some framework for this project. But I'm not sure what to choose, php based framework or python (django). Generaly what language is better for project like this?




Use Spark-Java and Freemarker to dynamically update page content

i got a question regarding JavaSpark and Freemarker. I'm using it in a project where i want to show a list of documents being processed by my application. If a document is finished it should be removed from the list without without the need of reloading the page. Is this possible?

Best regards, Loris




Link to Ghost-Post only working with www

So I've set up my own little Ghost-Blog, and I am hosting it on evennode and have a domain at namecheap the problem now is everytime I want to go to a Blog-Post directly i have to include www so for example http://ift.tt/1O9qJW1 and if don't include www for example http://myBlog.com/post it automatically redirects me to my homepage i.e http://myBlog.com. Does somebody know why this is happening?

I guess it's something similar to Ghost blog - links does not work with custom domain but there is no real answer there

Additional info: It works fine if I look at the blog using the evennode domain (i.e http://ift.tt/1O9qJW3)

Thank you for your help!




Exception: javax.net.ssl.SSLProtocolException and Compiler Option

I am creating a web application with servlets in Java and I'm using classes type Jsoup based httpclient etc ... I have a problem with A CONNECTION SSL . MI from problems and gives me an exception to this: avax.net.ssl.SSLProtocolException : handshake alert: unrecognized_name .

I found this solution : System.setProperty ( " jsse.enableSNIExtension " , " false " ) ;

The problem is that if I start the project with the local tomcat works instead with my tomcat online on an OVH server is not working . I saw that there is another way anologo this but I did not understand . Maybe we need to set an attribute during compilation like this: = false -Djsse.enableSNIExtension

As IDE : use Netbeans




Web Development or Mobile Development? [on hold]

With mobile use gaining more dominance over desktop computers every day, I am poised to ask what you think the future will hold. And, depending on that, what would be a more realistic path would be to take.

Will mobile become so big that browser based websites are obsolete? Or do you think that websites will persist for years and years to come?

From what I see, any website that is intricate enough (more than a basic static info/blog website) has an app. Every social network, every dating site, every fitness site. They have all developed apps.

On a lesser note, do you, personally, believe it is a smarter career move to learn mobile development or web development?




I tried the below alternative code in webapi controller but couldnt see a downloading file once I call this

I tried the below alternative code in webapi controller but couldnt see a downloading file once I call this

public HttpResponseMessage ModelExport(Guid id)
{

        var lst = Repository.All<Model>(i => i.ModelConstants, i => i.QualitativeDiscretes
            , i => i.QualitativeDiscretes.Select(x => x.QualitativeDiscreteLevels)
            , i => i.QuantitativeDiscretes
            , i => i.QuantitativeDiscretes.Select(x => x.QuantitativeDiscreteLevels)).Where(m => m.Id == id).FirstOrDefault();
        var str = Serializable.SerializeObject(lst);

        var result = Request.CreateResponse(HttpStatusCode.OK);
        var builder = new StringBuilder();
        using (var writer = new StringWriter(builder))
        {

            result.Content = new StringContent(str, Encoding.UTF8, "application/xml");
            result.Content.Headers.ContentDisposition = new ContentDispositionHeaderValue("attachment")
            {
                FileName = string.Format("model.xml")
            };
             return result;
        }
        //return ResponseMessage(result);
}




How To Get Coordinates of the google maps Corners?

I'm new in Google Maps! and I don't know how to ask this question

I need to draw polygon with just four coordinates that is for the four corners of the loaded map in zoom 13 on other hand get coordinates of the whole map to show to user. ( user search the specific area with draw a polygon on the map but if he/she don't draw a polygon i want to draw a polygon in size of the projected map for him/her and show the result. )

but i don't know how ?

sorry if you confiused !




mercredi 28 octobre 2015

What is the best way to pull bank's transaction data?

Most U.S banks have an online interface where you can log in to view your transactions. Is there a way to pull these transactions using something like a Python script or web service? If so, how would you make the entire process secure? The bank I'm interested in is Wells Fargo, but the question is open to all U.S banks. Thank you!




Is it okay to store data temporarily on the server or is it safer to always save it in a database?

I'm currently playing around with some Amazon APIs. When the client makes a request to my server for some information about a product, my server makes yet another request to Amazon to retrieve that information. Since there is a lot of information, I'm hoping to store that information in server memory for the next client request rather than issue another request to Amazon (which is slow) or storing it in a database (because I don't need all the information, but I won't know what information I do need until the next client request tells me). Is this advisable or should I save it in the database to be safe?




Which browser is best for a web developer? and why?

The world of web Development was ruled by Netscape Navigator and IE.Now, the browsers are free and offer almost a similar experience . In addition to the regular suspects of Mozilla Firefox, Google Chrome and Opera there are plenty of new browsers ready to bring new perspective. Microsoft's brand spanking new Edge browser has also joined into the equation.

I have been using chrome for testing and development, but recently Firebug has impressed me. As I am using ECMAScript 6, I have to think about the browser compatibility issue.

In this scenario which browser is better suited for Testing and Development?




Login as Pinterest in asp.net

How can I integrate Pinterest api with asp.net. I have a pinterest button in my project, when I will click on it the pinterest login window should show in a new window for logging through pinterest user id and password. Please suggest important links/codes...




jQuery.post() data returns entire PHP script as string?

I've already set up a basic SimpleCart.js web shop and am trying to implement realseanp's solution for adding a promo/discount code feature.

He uses the following JavaScript to post the user's entered promo code to discount.php:

jQuery("#promoSub").click(function Discount() {
    //Interact with PHP file and check for valid Promo Code
    jQuery.post("discount.php", { code: jQuery('#code').val() } , function(data) {
        console.log(jQuery('#code').val());
        if (data=="0" || data=='') { 
            console.log("Wrong Code"); 
        }
        else {
            //create our cookie function if promo code is valid
            //create cookie for 1 day
            createCookie("promo","true",1);
            var y = (data/100);
            for(var i=0; i<simpleCart.items().length; i++){
                var itemPrice = simpleCart.items()[i].price();
                var theDiscount = itemPrice * y;
                var newPrice = itemPrice - theDiscount;
                simpleCart.items()[i].set("price", newPrice)
            }
            simpleCart.update();
            //hides the promo box so people cannot add the same promo over and over
            jQuery('#promoCodeDiv').hide();

        }
    });
});

...which echoes back a 0 or the discount percentage if the correct code has been passed:

<?php
$x = 0;
if ($_POST["code"]=="HOLIDAY") { $x = 5; };
echo $x;
?>

However, when I console.log(data) from within the success function, data appears to be the entirety of the PHP script as a string instead of the echo.

Why is this, and what modifications do I need to make to rectify it? I'm very new to PHP and having difficulty understanding why jQuery.post() isn't receiving the echo.




Sitemap : Correct

I have a dynamic page that serves different content every time it is accessed.

What is the best value to put into the last modification tag for that page in the XML sitemap?




Access document like document-details - Alfresco

I create a new html page to Alfresco, that shows information when I click on a action library button. In document-details page, we have the "preview" of the document, and what I want to do, is to make something "similar" but I want to know how to "get" the document. How I can display the document or access it? One way to access document and manipulate the document. 

Thank you so much.




Trying to disable a DOM created button given certain conditions

I am trying to traverse a 4x4 grid where the first row is off limits. Essentially this leaves us with a 3x4 grid. I have 4 buttons that control direction (UP/DOWN/LEFT/RIGHT).

If I am at location 4x2 (remember the first row should not be accessed as it is a header), and I press Right, nothing should happen as this would be the 5th spot. If I am at 1x2, I shouldn't be able to push the left button either. Finally, If I am anywhere on the bottom row (1x4,2x4,3x4, or 4x4), I should not be able to push the down arrow.

Unfortunately, I do not understand something as it goes right/left/down/up anyways. This is what I tried:

down.addEventListener("click",function()
{   
    if(document.getElementsByTagName("td")[cellCounter] != 3)
    {
        if(document.getElementsByTagName("td")[cellCounter] != 7)
        {
            if(document.getElementsByTagName("td")[cellCounter] != 11)
            {
                cellCounter += 4;
                document.getElementsByTagName("td")[cellCounter].style.border = "5px solid black";
                document.getElementsByTagName("td")[cellCounter-4].style.border = "1px solid black";
            }
        }
    }
});

So I decided maybe making a function that would disable my up/left/right/down might be easier. I decided that if cellNum == [0-3] that up could be disabled, if cellNum == [0,4,8] that left could be disabled, cellNum == [8-11] down and if cellNum == [3,7,11] that right could be disabled.

How do I implement this though? How do I disable a button that doesn't have an id and how do I identify it? You can look at my, mostly, working code here




How to combine asp and php in one domain

is that possible if we combine asp.net and php in one domain. let say that domain is http://ift.tt/NQTWb3 develop using php and hosted in linux server.

Our goal is http://ift.tt/1P5V5rc this another page is develop in asp.net and host in different server and os

if this possible how to do it




How to add additional placeholder values to Web API routes

I'm researching building a restful API using the ASP.NET Web API framework.

The basic route format that's used is "api/{controller}/public/{category}/{id}"

I've read a lot about how the framework resolves the controllers and actions to execute within those controllers, and feel pretty comfortable with that.

Ultimately, what I need to do, however, is add an additional placeholder element before the controller section which will act as a routing element to determine the endpoint the action should be executed against. Ex. "api/{endpointId}/{controller}/public/{category}/{id}"

What's the easiest way to accomplish this in the Web API framework?




Is it possible to open ios/android app without custom url scheme?

Usually applications are opened via custom:// registered url scheme with fallback to market / appstore.

Application i want to open does not have registered its custom url scheme both in Android and IOS.

Currently i have only one working solution for IOS - smart banners, but it is supported only in Safari:

<meta name="apple-itunes-app" content="app-id=APPID">

Perhaps there is a way for Android and IOS to open app without custom scheme?




De-Duplicate libraries in app within deeply nested node modules

I have a app in which i can add modules as node_modules. Now, these modules and app uses a library XYZ as node module. Also, these modules have other node modules which has their own library XYZ as a node module.

So, this is roughly how the structure of my app looks like enter image description here

I use gulp and webpack and i am trying to some how de-duplicate library XYZ. I want to build a task that would go through this nested tree of node modules and build out 1 common version of library XYZ. How can I achieve that?

I tries using deDupePlugin, where this is all i added to my gulp default task and it did not work.. Is there anything i missed?

plugins: [
            new webpack.optimize.DedupePlugin()
           // new CommonsChunkPlugin("commons", "commons.js")
        ],

OR, is there any other way to achieve that? Any help will be really appreciated




How to save HTTP object in Selnium

Problem: I want to request a website and then save all the http objects in it [that a normal browser will request].

What I tried: I am using selenium(configured to use a proxy) web driver to request a webpage and then intercept on the proxy level and save all the objects. [I can't multi thread/open multiple tabs because then on proxy, I wont know which object corresponds to a particular webpage]

What I want: Is there any way that I can save all the http object using only selenium at the same time I can also identify them for corresponding webpage.




Enforcing 1 unique websocket connection per client?

I have a webpage that establishes a websocket connection with the server. I have to make sure that a user of the site can only establish a single connection, so opening a new tab and navigating to the same page will close the previous connection.

I was thinking of maintaining a map with the session id as the key; however, as the map would have to be constantly adjusted in size as more and more clients connect I am afraid of it having performance problems, and since it's accessed concurrently you would probably have to do some kind of locking.

Any ideas for performance efficient ways of ensuring a unique connection per client? Would love to hear suggestions, thank you.




DOM manipulation even handlers

I want to add an Event handler to this button I created with an event handler. I don't know how to tell this button to go to a function MarkCell() when clicked though. I know that I will use the onClick Event but I don't know how to tell it what onClick event. I have to use DOM manipulation.

var right = document.createElement("Button");
var t = document.createTextNode("RIGHT");
right.appendChild(t);
document.body.appendChild(right);  




Google sites - Gamification [on hold]

I actually need to gamify (include game mechanics) in a business intranet, which is a google sites.

It means that i have to integrate some new functionality like missions, quests, leaderboards, user profile etc...

I need this to engage and motivate users to supply it with some information, documents etc...

Here is my question :

Do you think google sites is viable to implement what i need? It seems really hard to integrate Javascript and customize a google sites, i need my site to be really interactive and track a lot of user actions.

I tried gadgets and app script but they look like very poor and cannot interact with the main page of the site, right?

Thanks for your help :)




Code a custimizble web page

I want to create a complex form that the user can customize the fields order(actually manager of a big group of employee), type, size etc. And even add or remove fields from it. But I'm not sure how to do it exactly.

I'm submitting the form to PHP from this form and I want the form to get change from the client side only (it can be pure JS/CSS/other client technology) so the manager could modify the form in a simple way.

1) I would like to create a "Structure" file (XML/other) like this

<XML>
<page 1>
   <option 1 type=text mandatory=true>
   <option 2 type='drop-box' src='http://www.d.com/rest' mandatory ='false' dst=''>
<page 2>
   <option 3 type=text mandatory=false>
   <option 4 type=text mandatory=false>
<XML>

2) and a local webpage form that will load it

<html table>
   <options in page 1 by the type >
<html table>
   <options in page 2>
<submit>

3) and the logic using JS

<forcing mandatory true and more logic>

Is that possible to make a complex form and let a user modify the instructor and fields order and type like that?




MySQL not using data from php function? [duplicate]

This question already has an answer here:

The function is not working. I would like ot add each line to the mysql database to the description field, and a number to the value field

 $fp = fopen($filename,"r");
    $number=0;

    //parse the csv file row by row
while(($row = fgetcsv($fp,"500",",")) != FALSE)
{
    $number++;
    //insert csv data into mysql table
    $sql = "INSERT INTO 'description' (descID`, `desc`) VALUES($number ,$row)";
    if(!mysqli_query($connection, $sql))
    {
        die('Error : ' . mysqli_error());
    }
}




my php form have a three text box each text box have ID and Name.

my php form have a three text box each text box have ID and Name. The ID and Names are dynamically created (like my student id is act as text box ID with the help of php. Name also from Database), Right now i need to calculate student marks from all the three boxes but the three box ID is dynamic now how to retrieve using java script?




How to Open Any Website in Android Application in Android Studio

I just started a new appliction using android studio .. but i need to open a web page in my application i tried using web view but it doesnt worked out... when i open my app it crashes down

<WebView
    android:id="@+id/web_view"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" />

and i included in java class file

private  WebView wb;


@Override
protected void onCreate(Bundle savedInstanceState) {

 wb=(WebView)findViewById(R.id.web_view);
    WebSettings webSettings=wb.getSettings();
    webSettings.setJavaScriptEnabled(true);
    wb.loadUrl("http://ift.tt/Rvp0MX");

    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_references);
}

In manifest xml file i included

<uses-permission android:name="android.permission.INTERNET"/>

but still my app crashes pllzz help me

android #android-studio




how can i get the size of a soft kayboard working with javascript and jquery?

I have a big problem with this, I have been working with a bewsite that contains an iframe, I had no problems until i tried to test it into my mobile phone.

I have 1 iframe with 3 divs, all of them with position relative (if i change it they go out of my mobile). 1 of them has an input, and when i click on it, the soft keyboard appears. My screen does not resize, so I only am able to watch 1 of the 3 divs. I have been reading about this, and i have a solution that i do not know how to programme.

Here: Get viewport height when soft keyboard is on

I found this: This solution is a bit convoluted, but it might work...

Detect whether or not the keyboard is active. Grab the viewport width/height Subtract the height of the keyboard.

I know when the keyboard is active, because is when i click on the input, but i am not able to get the size of the soft keyboard.

If someone could help me I would greatly appreciate it.

(it is my first time writing here, so if you need more information just let me know)




How to make pdf using mpdf that have big data in codeigniter?

I have some problems were using mpdf with a large data.

I'm using Codeigniter as backend framework and the database is SQL Server

I have set the memory limit to -1 =====> ini_set('memory_limit', -1); It works when I have a small data, e.g. 100 rows.

But, now I have 1000 rows and I got this error

Fatal error: Out of memory (allocated 823394304) (tried to allocate 230352 bytes) in C:\xampp\htdocs\simas\application\third_party\mpdf\mpdf.php on line 14487

what's wrong with my code? or how to fix this mpdf?

queries in model :

SELECT t.tgl_buku as tglbuku, t.kd_brg as kdbarang, b.namabarang, t.no_aset as qty, t.jns_trn, t.rph_aset as jumlah,t.asal_perlh as asal, t.merk_type as merk, t.keterangan, t.no_bukti as nobukti FROM as_transaksi t join ms_barang b on t.kd_brg = b.kdbarang WHERE t.jns_trn like '1%' and year(t.tgl_buku) = '2013' and month(t.tgl_buku) <= 6

table in view :

<table width="100%">
            <thead>
                <tr style="background:#C0C0FF; text-align:center;">
                    <center>
                    <td>Tgl Buku</td>
                    <td>Kd Barang</td>
                    <td>Nama Barang</td>
                    <td>Qty</td>
                    <td>Nilai</td>
                    <td>Supplier</td>
                    <td>Merk</td>
                    <td>Keterangan</td>
                    </center>
                </tr>
            </thead>
            <?php
            if (!empty($isdata)) {
                $total=0;
                foreach ($isdata as $row) {
                    $total=$total+($row->jumlah*$row->qty);
                    echo "<tr>";
                    echo "<td>". date('d-m-Y',strtotime($row->tglbuku))."</div></td>";
                    echo "<td>".$row->kdbarang."</div></td>";
                    echo '<td>'.$row->namabarang."</td>";
                    echo "<td>".$row->qty."</div></td>";
                    echo "<td>".$row->jumlah."</div></td>";
                    echo '<td>'.$row->asal."</td>";
                    echo '<td>'.$row->merk."</td>";
                    echo '<td>'.$row->keterangan."</td>";
                    echo '</tr>';
                }
            }else{
                echo "<tr>";
                echo "<td></td>";
                echo "<td></td>";
                echo "<td></td>";
                echo "<td></td>";
                echo "<td></td>";
                echo "<td></td>";
                echo "<td></td>";
                echo "<td></td>";
                echo "</tr>";
            }
            ?>
            <tr>
                <td></td>
                <td colspan="3">Total</td>
                <td><div align="right"><b><?=convertrp($total);?></b></div></td>
                <td></td>
                <td></td>
                <td></td>
            </tr>
        </table>

Please someone help me :)




Rust read_to_end function in the read trait ignores whitespace when reading markdown

My function is as follows:

fn read_file () -> String {
  let mut file = File::open("./assets/postdata/lorem_ipsum.md").unwrap();
  let mut buffer = Vec::new();
  let read_variable = file.read_to_end(&mut buffer).unwrap();
  let filestr = String::from_utf8(buffer).unwrap();

  return filestr;
}

The file is a markdown file with four paragraphs of lorem ipsum text. This function, when called by a handlebars record generator, prints to a webpage producing a wall of text. I'm obviously missing something, how can I make the Rust compiler recognise the whitespace. Can anyone help?