dimanche 31 juillet 2016

What is the past pathway to become a .net developer?

I want to create a learning plan for myself and for other novice students, lets say that I want to be able to create professional websites using asp.net. C#, HTML, CSS , JS ASP What do you recommend ?




New Content in ASP.NET website without reloading the page

I am trying to build a site with a "Next" button to display next question on the same page without reloading the page or redirecting to another page but I can't figure out how!




Django authenticate not keeping user logged in

I am attempting to learn Django's authentication system by contriving a basic login scenario. My views are set up such that a view, logIn, either receives a user's credentials (and prints the success/failure of the login), or it renders a login form.

A second view, privatePage, is designed as a sanity check that the user is actually logged in. The code is as follows:

views.py:

@login_required(login_url='/logIn')
def privatePage(request):
    return HttpResponse("You're viewing a private page")

@csrf_exempt
def logIn(request):
    if request.method == "POST" and \
       request.POST.get('email') and \
       request.POST.get('password'):
        user = authenticate(username=request.POST['email'], 
                            password=request.POST['password'])
        return HttpResponse('Valid login' if user is not None else 'Invalid login')
    # render login form
    return HttpResponse("<form>...</form>")

I'm finding that after succcessfully logging in via the logIn view, I am still redirected to the login view upon trying to visit privatePage. FYI, I'm attempting to visit the privatePage view directly by URL, as opposed to navigating through provided links (e.g. I'm not sure if I'm violating some CSRF rule).

Any idea what's going on?




Gaps between list items and mysterious spacing in DIV

See my codepen here: http://ift.tt/2akz3Cx

1) How do I get rid of the little gaps between the red boxes? I've set padding and margin to 0 but there's still gaps.

2) In the purple box (.container), the space on the right side is more than the space on the left. I've tried to center the UL inside .container using "margin:0 auto;" but it has no effect.

Tks!

* {
  box-sizing: border-box;
}

.container
{
  border:1px solid blue;
  width:65%;
  margin:0 auto;
}

ul {
  list-style-type: none;
  border:1px solid purple;
  margin:0 auto;
}

ul li {
  display: inline-block;
  border: 1px solid red;
  color: grey;
  text-align: center;
  width: 10rem;
  height: 8rem;
  margin: 0;
  padding: 0;
  position:relative;
}

ul li div
{
  border:1px solid green;
  position:absolute;
  top:50%;
  transform:translateY(-50%);
  left:0;
  right:0;
}
<div class="container">
  <ul>
    <li>
      <div>
        <i class="fa fa-spinner"></i><br />Home
      </div>
    </li>

    <li>
      <div>
        <i class="fa fa-spinner"></i><br />Plants
      </div>
    </li>

    <li>
      <div>
        <i class="fa fa-spinner"></i><br />Land
      </div>
    </li>

    <li>
      <div>
        <i class="fa fa-spinner"></i><br />Animals
      </div>
    </li>

    <li>
      <div>
        <i class="fa fa-spinner"></i><br />About
      </div>
    </li>
  </ul>
</div>



Should we use enums in web json result

For example, I have a web api which return a Json Http respone Body. The fields in JSON is meaningful, but the question is should I use a string to describe it ? or use a int enum?

Example A: { "user_id":123, "sex":"male", "status":"active" }

Example B: { "user_id":123, "sex":1, "status":1 }

which is better? and why?

maybe the Example can save some net flow?




HTML/Javascript: Pressing a button on a website with javascript

I'm trying to simply (in a javascript environment managed in HTML script tags) load a webpage and press a button on that page. I also want to be able to read data off of the webpage, but that should be self-explanatory once I get button pressing working. I've looked around for solutions but none seem to work.

For sake of a controlled environment, I have 2 simple websites. On the first there is a button which calls a javascript function, in which I attempt to load website 2 and press another button. On website 2, there is a single button that, when pressed, calls a javascript function and generates a dialogue box.

I can load page 2 using window.open(), and I believe that has a return type which is a handle to the website, which I save. I've tried using that handle to call the javascript function in webpage 2. I've tried getting the element by ID and using click()/submit(). And here's the code to the current attempt:

Website 1:

<html>
    <body>
        <script  language = "javaScript">
            function print() {
                //alert('Hello World');

                var win = window.open("file:///Users/Jacob/Documents/2ndWebTest.html");

                win.document.form[0].submit();
            }
        </script>
        <p><button onclick = "print()">test</button></p>
    </body>
</html>

Website 2:

<html>
    <body>
        <script  language = "javaScript">
            function testFunc() {
                alert('Hello World');
            }
        </script>
        <p><button onclick = "testFunc() id = "buttonTest"">test</button></p>
    </body>
</html>

I'm trying to navigate through a website hierarchy and pull data from it. Thanks in advance.




Generate Progressive Web App Automatically with Python

Is there a way to initialise a new Progressive Web App (i.e. Polymer-based apps) and deploy to server (Firebase maybe?) on a subdomain (subdomain.example.com) with Python script?




Scrapy get through ASPNet accept dialog using Javascript link

Here is the form on a Accept.aspx that I am trying to get through:

<form name="aspnetForm" method="post" action="Accept.aspx" id="aspnetForm">
    <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwULLTEwMDUyNjYzMjhkZH2Bd9lP6b10lpPKBuDrSTFYUEXj" />
    <input type="hidden" name="__VIEWSTATEGENERATOR" id="__VIEWSTATEGENERATOR" value="7D7EA99C" />
    <p class="content" style="text-align:center;"> 
        I have read and understood the above.
    </p>
    <p class="content" style="text-align:center;"> 
        <a href="http://ift.tt/2aHB5jm" >Click here to enter the site</a>
    </p>
</form>

What I have so far, but doesn't set the cookie:

yield FormRequest.from_response(
        response,
        formname='aspnetForm',
        callback=self.after_accept
)

When I inspect the request using the actual page no form data is sent. It's seems to be a straight forward GET request. In my after_accept function I get the Accept.aspx page back instead of List.aspx.

Any pointers would be helpful.




React will not pull data from Firebase after clicking Navbar via React-Router tag

I am creating a React app that pulls data from a Firebase object. The initial rendering on home page works fine, I get an object with data I need (Object contains data in initial rendering). However, when I navigate to a different component, and try to click the navbar-brand icon (Bootstrap 4 Navbar)back to home page via tag on React-Router, the data will no longer load. (Object is empty) Data will only re-appear if I refresh the page manually. I am using Gulp and Browserify to serve the page locally as well as bundling files.

main.jsx (my home page component)

var React = require("react");
var ReactFire = require("reactfire");
var Firebase = require("firebase");
var rootUrl = "http://ift.tt/2aor0Wm";
var Link = Router.Link;
var Navbar = require("./navbar");
var presentations = [];

module.exports = React.createClass({
    mixins: [ ReactFire ],
    getInitialState: function(){
      return {
          presentations: []
      }
    },
    componentDidMount: function(){
        console.log("componentdidmount");
        this.fb = new Firebase(rootUrl + 'presentations/');
        this.bindAsArray(new Firebase(rootUrl + 'presentations/'), 'presentations');
        this.fb.on('value', this.handleDataLoaded);
    },
    handleDataLoaded: function() {
        this.setState({presentations: this.state.presentations})
    },
render: function() {
  var data = this.state.presentations || [];
  return (
    <div className="wrapper">
      <Navbar />
      <div className="container">
        <div className="row">
          <div className="card-group col-sm-12">
            {data.map(function(slide){
                return (
                    <div key={slide.id}>
                      <div className="card col-xs-12 col-md-6 col-lg-4">
                          <Link to={"/slidedetail/" + slide.id} >
                            <img className="card-image" src={slide.thumbnail} />
                          </Link>
                        <div className="card-caption">
                          <h6>{slide.title}</h6>
                          <p className="card-conference">{slide.conference}</p>
                          <p className="card-author">by {slide.presenters}</p>
                          <p className="card-date">on {presentationDate}</p>
                        </div>
                      </div>
                    </div>
                );
              })}
          </div>
        </div>
      </div>
    </div>
  );
}
});

navbar.jsx (navbar component)

var React = require("react");
var Router = require("react-router");
var Link = Router.Link;
var ReactFire = require("reactfire");
var Firebase = require("firebase");

module.exports = React.createClass({
  render: function(){
    return(
      <div className="row">
          <div className="navbar-container col-xs-12 col-sm-12">
            <nav className="navbar navbar-light bg-faded col-xs-12 col-sm-12">
              <Link to={"/"} >
                <a className="navbar-brand p-a-2 col-md-5 col-sm-12 hidden-sm-down"><img src="../img/nm-logo.png" /></a>
              </Link>
            </nav>
        </div>
      </div>
    )
  }
});

Routes.jsx (Routing)

var React = require("react");
var ReactRouter = require("react-router");
var Router = ReactRouter.Router;
var Route = ReactRouter.Route;
var Main = require("./components/main");
var Slidedetail = require("./components/slidedetail");
var Upload = require("./components/upload");

module.exports = (
  <Router>
    <Route path="/" component={Main} />
    <Route path="/slidedetail/:id" component={Slidedetail} />
    <Route path="/upload" component={Upload} />
  </Router>
);




Subsites in a webpage (html)

I don't know how this concept is called technically, so I could not search it in the net. My question is as follows:

I have a host, and a domain, let's say : www.host.ex/~myweb, and that is my "homepage". Well, the website have many categories, and I wanted them to be accessed as follows (I have seen this in other websites):

http://ift.tt/2aHsL31

And when I put that address in the browser, it redirects me to that webpage. For my homepage, there is no problem, I have this "public_html" and index.html is there, so when I put www.host.ex/~myweb on my browser, the page is load as expected. However, trying the same approach for these "sub-sites" of my website, the approach does not work. How can this be done? Must I configure something? or put something special in my public_html?

best regards




How can update my code for a django app without earasing the existing database (Read Description)?

I have a python django application that I published to heroku by connecting to github. I want some people to be able to add some information to the database from the website. If I make changes to the code, push to github and deploy the branch the database will go back to how it was at first. How can update my code for the app without changing the database?




Getting html code of web page

I am trying to get the HTML code of a web page in Java, but I don't actually know how it should work. That is my thoughts:

  public  String getHTML(String pageAddress) throws Exception {
    StringBuilder sb = new StringBuilder();
    URL pageURL = new URL(pageAddress);
    URLConnection uc = pageURL.openConnection();
    BufferedReader br = new BufferedReader(
            new InputStreamReader(uc.getInputStream()) );
    String inputLine;
    try {  
        while ((inputLine = br.readLine()) != null) {
            sb.append(inputLine);
        }
    } finally {
        br.close();
    }
    return sb.toString();
}

When I call

getHTML("http://www.google.com");

It returns empty string. What's wrong?

Thank you in advance!




I always get Warning: mysqli_fetch_row() expects parameter 1 to be mysqli_result, boolean given [duplicate]

$query = "SELECT question, id FROM qs ORDER BY id DESC";
$results = mysqli_query($db, $query);

while ($row = mysqli_fetch_row($results)) {
    echo "<div class='question'>".$row[0]." / ".$row[1]."</div><form method='POST' action='index.php'><input type='text' name='answer-box' placeholder='Answers'><input name='replyb' value='Reply' type='submit'></form><br><br>";
}
?>
$answer = @$_POST['answer-box'];
$button = @$_POST['replyb'];

if (isset($button)) {
    $sql_answer = "INSERT INTO `answers` (`answer`,`id`) VALUES ('$answer', '$row[1]')";
    $result_answer = mysqli_query($db, $sql_answer);
    $row_answer = mysqli_fetch_row($result_answer);
} else {

}

?>




Where to learn how to develop an auction/financial website

I would like to design a website that allows for auctions and financial purchases. Where would I begin to learn about this?




Highcharts error #13

I created a highchart element on my page. Then I wanted to rewrite it as a highstock element. I had some errors with highstock and I could`t get rid of them. Finally i copy-pasted highstock code from documentation but it also gives an error.

Full HTML:

<!DOCTYPE html>
<html>
<head>
    <title>avra</title>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" type="text/css" href="css/all.css">
    <link rel="stylesheet" type="text/css" href="font/font-awesome/css/font-awesome.min.css">

    <!-- HTML5 SHIV -->
    <!--[if lt IE 9]>
        <script type="text/javascript" src="http://ift.tt/26g2rAw"></script>
    <![endif]-->
</head>
<body>

    <main>
            <a href="#">POP-UP</a>
    </main>

    <div class="container">

    </div>

    <script type="text/javascript" src="node_modules/jquery/dist/jquery.min.js"></script>
    <script type="text/javascript" src="node_modules/highcharts/highstock.js"></script>
    <!--<script type="text/javascript" src="node_modules/highcharts/modules/exporting.js"></script>-->
    <script type="text/javascript" src="js/script.js"></script>
</body>
</html>

My JS file:

$(document).ready(function(){
    $.getJSON('http://ift.tt/NjQdCo?', function (data)    {
        // Create the chart
        var dataObject = {
            rangeSelector: {
                selected: 1,
                inputEnabled: $('#container').width() > 480
            },

            title: {
                text: 'AAPL Stock Price'
            },

            series: [{
                name: 'AAPL',
                data: data,
                tooltip: {
                    valueDecimals: 2
                }
            }],

            chart: {
                renderTo: 'container'
            }

        };

         var chart = new Highcharts.StockChart(dataObject);
        //var chart = $('#container').highcharts('StockChart', dataObject);
    });
});

Uncaught Error: Highcharts error #13: http://ift.tt/1EFIti9




How to use docker for building a web application

My question comes from try to wrap my head around traditional MySQL<->php<->html/css/js Web app. I am building an app using all latest technologies as a training exercise.

I am narrowed down to the following frameworks

  1. MongoDB in backend
  2. MemcacheDB & Memcache to store cache data
  3. ExpressJS to create APIs
  4. Angular 2 on the front end.

Each of these technologies I know how to use in isolation. How can I build it out in a way that my final goal of deploying it to AWS leveraging docker to simplify it.?

  1. I read that isolating docker containers are best. What would be my docker containers here?
  2. How would ExpressJS connect to mongoDB and store value in AWS?
  3. Will stopping my MongoDB docker container destroy its data?



How to make a Chrome Extension like Momentum Dash?

Wondering how to make a Chrome Extension like Momentum Dash (http://ift.tt/1RqyW6z) wherein a personal dashboard (which changes daily) or some sort of specific content is shown when user opens a new tab but it is not a website (there is no URL)?




Reactjs request not sending cookie

React js not sending cookie, i am using react-redux thunk for sending request,

all requests are sent are not using the cookie session id.

because of missing session id, the server generate new cookie on each request and connot identify the user requests.

how can i make it work?




3D drawing with user interactivity

I'm looking for a javascript framework that allows user interactivity such as recoloring individual elements of a already drawn 3d model, and lots more.

I've been looking at three.js, but at first glance it doesn't seem to facilitate the user-activity I'm looking for.

Im just looking for advices, if any1 have any good references




Do cookies track current tab or information from all tabs?

Reason I'm asking is because if it's the former, then that means it's safer to open web apps like online code editors or mail etc. in a new tab?




Polymer Firebase : Uncaught TypeError: Cannot read property 'signInWithPopup' of undefined

I'm a newbie with Polymer and Firebase, i am practicing with the two technologies. I am trying to implement firebase-auth for application authentication but i go a "Cannot read property 'signInWithPopup' of undefined" error.

i have this code :

<paper-toolbar>
  <span class="title">Sample!</span>
  <paper-icon-button
    icon="[[statusIcon(signedIn)]]"
    on-tap="processAuth">
  </paper-icon-button>
</paper-toolbar>
<firebase-auth
  id="auth"
  app-name="emotions"
  provider="google"
  signed-in=""
  user="">
</firebase-auth>

and the script for processAuth

processAuth: function() {
    this.$.auth.signInWithPopup();
}

and the following components were imported already:

<link rel="import" href="../../bower_components/polymerfire/polymerfire.html">
<link rel="import" href="../../bower_components/polymerfire/firebase-auth.html">

Did i missed something?

Sorry for this very noob question.




using JAVACC to read input from a text box in web

I am trying to make JavaCC use the input from a text box in web . However, I cannot figure out how to do so. I try to setup an InputStream and pass that to a StringReader, but I don't think StringReader takes this type of parameter




how to know the number of item views in a listing on a website

my question is straight forward.

I want to know the total number of view of an item in a listing of a website as in enter image description here

I want to know the total number of views ( in black ovals )

I want to create a simple webpage, I just have to enter the name of the item, and then somehow this name gets connected to the website to get the listing and get the total number of views,

my question is, how to link my webpage to the website ? and how to get this information from the page source automatically

what I am asking about is the methodology and the programming languages as I am not familiar with web programming.

I did something similar in c# using htmlagilitypack, but this time I want to create the software in a website. thanks.




Angular $apply does not update the view

I have a form, when I submit it, it pushes some object to my array. Beneath that form I have a table that shows all items in that array. I want my table to update automatically (without refreshing the page) when new item pushed.

Submit button:

<button type="submit" class="btn btn-default" ng-click="updateTable()">Pay</button>

In my controller:

  $scope.updateTable = function() {
    setTimeout(function () {
      $scope.$apply();
      $scope.$digest();
    }, 0);
  };

However, it does not work. I tried different approaches like $watch service, but i`ve got the same result.

Table

<div class="row paytable">
  <div class="col-xs-10 col-xs-offset-1">
    
    <table class="table table-hover ">
      <tr>
        <td>Id</td>
        <td>Amount</td>
        <td>Cause</td>
      </tr>
      <tr ng-repeat="item in payments">
        <td></td>
        <td></td>
        <td></td>
      </tr>
    </table>
  </div>
</div>

Controller

app.controller('mainController', [ 'user', '$rootScope', '$scope', 'payment', '$timeout', function(user, $rootScope, $scope, payment, $timeout) {

  user.getUsers();
  user.newUser();
  $rootScope.currentUser = user.currentUser();

  $scope.payments = payment.getPayments();
  $scope.newPayment = payment.newPayment;

  $scope.updateTable = function() {
    setTimeout(function () {
      console.log('apply ------------');
      $scope.$apply();
      $scope.$digest();
    }, 0);

  };

  $scope.showPayMessage = function() {
    console.log('im here');
    $scope.showSM = true;
    $timeout(function() {
      $scope.showSM = false;
    }, 2000);
  };
}]);

payment - my service for array manipulation.




$watch is not a function

I have angular directive that looks like this

    app.directive('paymentsTable', ['$watch', function($watch) {
    return {
      replace: true,
      restrict: 'EACM',
      templateUrl: '../views/paymentTable.html',
      link: function(elem, attr, scope) {

      console.log(elem.$parent.payments); // array

      scope.$watch(function(elem) { return elem.$parent.payments }, function(value, oldValue) {

      });
    }
  };
}]);

It gives me

angular.js:13920Error: [$injector:unpr]

When I rewrite first line like this

app.directive('paymentsTable', [ function() {

It gives me another error

angular.js:13920TypeError: o.$watch is not a function

I also use uglify. So, my question is: what is going on here?




Issues with Web Query from Multiple Pages

I was wondering if someone may be able to help me. I am trying to write a code that extracts House Sale data based on user defined search inputs. These inputs are the Suburb (B2) and the State of the property (C2). The problem is the search produces 10 results per page however I am after the first 100 search results (the first 10 pages).

I recorded a macro using the web query function and modified it slightly (see below) which draws the first page of data without issues.

Code:

Sub HousePrices()

Dim wb As Workbook
Dim src As Worksheet
Dim tgt As Worksheet
Dim url As String
Dim suburb As String
Dim state As String

Set wb = ThisWorkbook
Set src = wb.Sheets("Sheet1")


suburb = src.Range("B2")
state = src.Range("C2")
url = "URL;http://ift.tt/2aTmAFK"
url = url & suburb & "%2C+" & state

Sheets.Add.Name = suburb

Set tgt = wb.Sheets(suburb)


With tgt.QueryTables.Add(Connection:= _
    url, Destination:=tgt.Range("$A$1"))
    .Name = "Page1"
    .FieldNames = True
    .RowNumbers = False
    .FillAdjacentFormulas = False
    .PreserveFormatting = True
    .RefreshOnFileOpen = False
    .BackgroundQuery = False
    .RefreshStyle = xlInsertDeleteCells
    .SavePassword = False
    .SaveData = True
    .AdjustColumnWidth = True
    .RefreshPeriod = 0
    .WebSelectionType = xlSpecifiedTables
    .WebFormatting = xlWebFormattingNone
    .WebTables = "11,15,19,23,27,31,35,39,43,47"
    .WebPreFormattedTextToColumns = True
    .WebConsecutiveDelimitersAsOne = True
    .WebSingleBlockTextImport = False
    .WebDisableDateRecognition = False
    .WebDisableRedirections = False
    .Refresh BackgroundQuery:=False
End With

End Sub The problem is when I try to extract data from subsequent pages the URL changes to something like this (dynamic elements of URL in bold):

http://ift.tt/2a8NXOH

If anybody could help me with this it would be greatly appreciated. I want the destination of info from subsequent pages to be dumped below the previous page in the same sheet.

Thanks in advance.




samedi 30 juillet 2016

Set up proper URL directory structure for web pages

Many websites use the following format for different pages throughout the site.

For example: http://ift.tt/2amWeNH

The about page URL is: http://ift.tt/2alXqNU

Currently my about page URL is http://ift.tt/1n43jzn

The URL looks much cleaner and better using the the folder structure website.com/about/

I just wanted to figure out whats the proper way web developers set this up for their website for other pages.

Do they really make a about folder in the root directory and use a index.php for the about page? So whenever they open the /about/ directory it automatically loads the index.php file for that particular page?

Thanks for any help just trying to use proper etiquette for my site




KnockoutJS - Correct Way of Writing KO BindingHandlers for Input Type Radio

I have set a custom binding for input type radio, which is like this:

"radio-yesno": function(bindingContext, dataClasses){
    return {
        click: this,
    }
},

The Html Input Type Radio binds to this is written like this:

<label class="radio inline">
   <input type="radio" name="RadioTest" id="RadioYes" data-class="radio-yesno"/>
   Yes
</label>
<label class="radio inline">
   <input type="radio" name="RadioTest" id="RadioNo" data-class="radio-yesno"/>
   No
</label>

(You may notice that I am using data-class here to bind the element, it is because I am using the ClassBindingProvider plugin)

The problem now is when the radio button is clicked, the function which contains the associated observable of this element is actually triggered and during debugging it can be seen that the value of

$('#RadioNo').is(':checked')

is actually true when the No Radio Button is clicked and is false when the Yes Radio Button is clicked.

Currently the ko BindingHandlers that I am using here is "click" only.

I have tried to add more bindingHandler which is "checked: this" and put it below the "click: this" line, but still doesn't work.

Could someone please help me to identify what is the problem here and how should it be fixed?

Thanks.




Is there a FREE Sales Tax Computation API for U.S.A?

I just finished developing an e-commerce iOS app. But I need to have the tax + cart items to be computed inside the app. The app is currently targeting the FLORIDA state of the U.S, but eventually the whole country.

I'm searching for a free sales tax API for this project. For example, I got an item that costs $9.99, and the I live in the CLAY COUNTY with Zip Code 32003 and with a rate of 0.07. (according to the sales tax table I downloaded from: http://ift.tt/2aHCLqc)

enter image description here

The total that I need to pay inclusive of tax would be: $10.69

In the API, I will just pass the tax-exclusive price: $9.99 and the Zip Code, then the API will compute the taxed price for me, which would be $10.69

Or is there an API where I can get a sales tax rate by passing a ZIP Code or address of the user?

Lastly, am I thinking this right? I mean, the way I will compute the taxed price, is this the correct way? Thank you!




Is Objective-J a good tool to develop Web Apps?

I was recently reading some articles and I found this.

http://ift.tt/1FovTH0

What was curious about this, is that I can implement my Objective-C Synthax Konwlage to develop web applications based in JavaScript. But my question comes from if Is a current well used tool to develop web apps?, will it be a good invest of time into know to use it? Thanks in advance!




Tomcat can't start up...just as picture

enter image description here

I don't no why because I am front-end.




What ports are best to use for web hosting?

Is there a range of ports I should be using for hosting websites?

I am hosting a number of web servers at home, (10+) and I have been assigning each a different port.

I started with the default at port 80, then just continued at 81, 82...

When I got to 87, Firefox blocked the port.

While I can unblock that port in my Firefox, I don't want to teach the rest of the world to do that.

It got me thinking on this subject.

Can anyone shed some light on this subject?

The OCD part of me wants the port(s) range to be consecutive, but if needed, I can probably overcome that.

Thanks, Mark.




Which one of the following is more preferred by potential employers, web designers or front-end developers?

I want to know which one of one those are more preferred by employers. As far as I know, a web designer designs the layout of the page while a front-end developer does not only designs the page if assigned to, but also add functionality to site as well. Do employers make a strict distinction between the two, or merely overlap them both out of indifference? Also, which one would be more advantageous?




Ui-router refresh issue

I have configured my ui-router like this:

app.config(function($stateProvider, $urlRouterProvider, $locationProvider) {

        $stateProvider
            .state('home', {
                url: "/home",
                templateUrl : 'home/home.html',
                controllerUrl: 'home/controller.js'
            })
            .state('blog', {
                url: "/blog",
                templateUrl : 'blogger/blog.html',
                controllerUrl: 'bloger/controller.js'
            })

        $locationProvider.html5Mode({
            enabled: true,
            requireBase: true
        });
    });

But whenever I hit Ctrl/Command + R (or refresh), it says that it cannot find the path? How can I get around this problem?




What happens when I click the like button on Facebook?

My thought process on this would be that when I click the like button, there would be a post request made from client to server to create a 'like' for the user to message. When I open the chrome console, no request is being made. What is happening that allows the like count to increase and to register as the user making the like. I assuming that there is also some front end framework that might be handling this client request.




Is powerful websites or web services using object oriented programming in client side?

Is powerful websites or web services using object oriented programming in client side.I am new in programming and want to know whta happend if I use simple programing(not oop).For example_ facebook form validation_is used oo javascript for it?




Advice for best path to working with Amazon Web Services

For the last 10+ years I have been developing desktop software. I have successfully avoided learning most Web technologies. Specifically:

  • ASP (any version)
  • HTML5
  • MVC
  • MVVM

I do know a modicum of other Web technologies, like REST and SOAP services, Javascript, and altering a Web Config file. I'd like to be able to move my career towards Web, especially these Amazon Web Services (AWS). Having looked around, it seems that they are being developed by hardcore Web developers.

To be able to develop AWS, what is my shortest (or best) path through learning some of these other Web technologies?




How to use a global variable with jquery?

I have a code as shown below.

    var globalVar = ''
    $.get("some.php", function(data, status)
    {
        alert(data)
        globalVar = data
    });
    alert(globalVar)

While the first alert shows the value of data, the second alert doesn't. It seems like globalVar was not properly assigned inside the get's function. What would be the proper way to use a global variable here?




Which techno are used to make this (Madeon)?

Can someone indicates me which techno/tools are used to develop that kind of website: http://ift.tt/2aljsAh ?

Thanks for your help.




Adding a light gray overlay to a Coverr.co video?

I'm trying to add a gray overlay on a video from Coverr.co, but still behind the text. I tried using rgba() to add the color and opacity but it doesn't seem to work for me. Heres the code:

.video-container .filter {
    z-index: 100;
    position: absolute;
    background: rgba(255, 255, 255, 0.4);
    width: 100%;
}
<div class="video-container">
        <div class="filter"></div>
          <video autoplay loop class="fillWidth">
            <source src="Productive-Morning/MP4/Productive-Morning.mp4" type="video/mp4" />Your browser does not support the video tag. I suggest you upgrade your browser.
            <source src="Productive-Morning/WEBM/Productive-Morning.webm" type="video/webm" />Your browser does not support the video tag. I suggest you upgrade your browser.
          </video>
        <div class="poster hidden">
            <img src="Productive-Morning/snapshots/Productive-Morning.jpg" alt="">
        </div>
    </div>



Different behaviour when retrieving a site from browser or programmatically

I am trying to write a basic web crawler, and I thought it would be interesting to do this with a web site I visit frequently http://ift.tt/1grjCUa. When you first visit this website, you need to login, by providing your postcode and your email-address. This is done via a POST request to the server, which looks somewhat like the following:

register-ticket=<postcode>&register-email=<email>&login=

This works fine in the browser, and returns an HTTP/1.1 200 OK response. However, when I do it programmatically using the Casablanca library, I get an HTTP/1.1 301 Found response, pointing to http://ift.tt/2aleTX2.

Does anyone have any idea what could cause the same request to give two different responses? The library I'm using doesn't seem to have any facility to print the whole HTTP request before it sends it, but I wouldn't have thought any of the other header fields should influence the request?

I'm new to HTTP, so forgive me if there is something elementary missing!




oracle weblogic admin server does not startup

i am new to oracle web-center content trying to run all the services using the following command :

"/oracle/scripts/vmctl.sh"

database and webtier start run but the weblogic admin server keeps on processing on startup and never run. there also appear an error :

"failure: repodata/primary.xml.gz from ol6_latest: [Errno 256] No more mirrors to try."

a screen shot is added in the end to give a clear understanding of problem. Please help me in this issue. Thanks in advance. Server startup Image




where can I finde a tool used in web like an Interpreter ؟

I look for a tool like Interpreter for a BNF language ... this tool can do Autocomplete for language and do syntax check and grammer check then give me a tree




Can admin of the web server see my php code?

I am making a form that will send the information to my email and I need to take another email to send that form to the main email (using PHPMailer). So in my php code, I have put the password of the 2nd email in it. I will upload my code files to the server. Can admin of the web server have ability to see the variables in my code?




Doing a web live-preview of an Ionic Application

I was browsing ionic themes and I found a plugin on their pages which showcase their mobile application based on Ionic.

Script

I was wondering where does this script come from and if there is a possibility to do the same on a website to showcase the demo ?




How to serve non-static images (from server to browser)?

I understand how to serve static images by referencing the public or assets directory in HTML img or CSS url. However, I'm not sure how to store, serve and handle private images.

Let's say we have a client-server communication like in SPA's.

First, are these private images stored in a different, private directory on the server (and their path locations in a database) or stored as base64 in a database directly?

How do you send the private image from the server after checking for credentials? Base64?




How to create SVG animation

I really keen to know how create animation like this link http://ift.tt/2ahftH5

I know that they are using Greensock, TimelineJS

But I want to learn this. Anybody has an Idea of Tutorial regarding this or how can I learn same thing.

 #wrapper {
  width:20%;
}

#walker {
  /* top padding = (h / w) * 100 */
  /* (height & width of one frame) */
  padding-top:143.7%;
  display:block;
  background: url('http://ift.tt/2aEx1Af');
  background-size:cover;
}

/* demo stylin' */
body {
  background:#abffce;
}
#wrapper {
  max-width:200px;
  min-width:130px;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%)
}

HTML

<div id="wrapper">
<div id="walker"></div>
</div>

JS

/* Dependencies TweenMax */

var totalFrames = 22;
var speed = 1;

var walkEase = new SteppedEase(totalFrames)
var finalPosition = '100% 0px';

var walkTL = new TimelineMax()
walkTL.to('#walker', speed, {
    backgroundPosition: finalPosition,
    ease: walkEase,
    repeat: -1
})




Struggles with html code in Apple's PrintController

I am using html to create a list of items, ready to be printed. Each list is exactly one 4A page long. Printing multiple of those lists results in something like this: http://ift.tt/2aRJBsq As you can see the top and bottom parts are kind of messed up and altogether the printer sometimes uses margins and sometimes don't. I perfect page would look like the 3rd page in my example without these vertical lines sticking from the bottom. Can someone point me in the right direction to create just nice looking pages? My page-creating-code looks like this:

    for i in 0...DataManager.sharedManager.savedLists()!.count-1 {
            DataManager.sharedManager.loadList(i)
            markupText += htmlString()
    }


    let formatter = UIMarkupTextPrintFormatter(markupText: markupText)
    formatter.contentInsets = UIEdgeInsets(top: 20, left: 20, bottom: 10, right: 20)
    formatter.perPageContentInsets = UIEdgeInsets(top: 20, left: 20, bottom: 10, right: 20)

    let printController = UIPrintInteractionController.sharedPrintController()
    printController.printInfo = printInfo
    printController.showsNumberOfCopies = true
    printController.printFormatter = formatter

private func htmlString() -> String {
    guard let user = DataManager.sharedManager.user else  {
        return "nil"
    }

    var html = "<body>
<style>
    html {
        font-family: 'verdana';
    }

    h2 {
        margin: 0px;
    }

    table,
    th,
    td {
        border-collapse: collapse;
        border: 1px solid black;
        padding: 2px;
        height: 20px;
        font-size: 12px;
    }

    th {
        text-align: right;
    }

    tr#r02 {
        text-align: center;
    }

    .contentTR {
        height: 26px;
    }

    .trFoot {
        height: 50px;
        vertical-align: top;
    }

    tr#used {
        width: 20px;
    }
</style>
<table style='width:100%'>
    <tr>
        <th colspan='2'>
            <h2>Materialausgabeliste</h2>
        </th>
        <th colspan='3'>
            <h2>Bauvorhaben</h2><br/>\(user.cause)
        </th>
    </tr>
    <tr id='r02'>
        <td>
            <h4>Menge</h4>
        </td>
        <td>
            <h4>Bezeichnung</h4>
        </td>
        <td>
            <h4>EAN</h4>
        </td>
        <td id='used'>
            <h4>Verbrauchte Menge</h4>
        </td>
    </tr>"


    if(!DataManager.sharedManager.items.isEmpty) {
        for item in DataManager.sharedManager.items {
            html += "<tr class='contentTR' style='page-break-inside:avoid;'>
<td>
    <p>\(item.amount)</p>
</td>
<td>
    <p>\(item.name)</p>
</td>
<td>
    <p>\(item.ean)</p>
</td>
<td></td>
</tr>"
        }

    }

    //SWIFT 2 UPDATE
    for _ in (1...24-DataManager.sharedManager.items.count).reverse() {
        html += "<tr class='contentTR' style='page-break-inside:avoid;'>
<td>
    <p></p>
</td>
<td>
    <p></p>
</td>
<td>
    <p></p>
</td>
<td>
    <p></p>
</td>
</tr>"
    }

    let formatter = NSDateFormatter()
    formatter.locale = NSLocale(localeIdentifier: "de_DE")
    formatter.dateStyle = .FullStyle

    html += "<tfoot>
<tr class='trFoot'>
    <td rowspan='2' colspan='2'>Datum:
        <br/>
        <br/>
        <br/>\(formatter.stringFromDate(NSDate()))</td>
    <td colspan='3'>Name:
        <br/>
        <br/>\(user.name)</td>
</tr>
<tr class='trFoot'>
    <td colspan='3'>Unterschrift:</td>
</tr>
</tfoot>
</table>
</body>"

    return html
}




(PHP) How can i hide a login form from people that are logged in?

<?php
if (isset($_SESSION['username']))
{
}
else
{
   echo '<div id="DLogin1" style="position:absolute;left:76px;top:549px;width:183px;height:196px;z-index:22;">
<form name="loginform" method="post" accept-charset="UTF-8" action="<?php echo basename(__FILE__); ?>" id="loginform">
<input type="hidden" name="form_name" value="loginform"/>
<table id="TLogin1">
<tr>
   <td class="header">Log In</td>
</tr>
<tr>
   <td class="label"><label for="username">User Name:</label></td>
</tr>
<tr>
   <td class="row"><input class="input" name="username" type="text" id="username" value="<?php echo $username; ?>"/></td>
</tr>
<tr>
   <td class="label"><label for="password">Password:</label></td>
</tr>
<tr>
   <td class="row"><input class="input" name="password" type="password" id="password" value="<?php echo $password; ?>"/></td>
</tr>
<tr>
   <td class="row"><input id="rememberme" type="checkbox" name="rememberme"/><label for="rememberme">Remember me</label></td>
</tr>
<tr>
   <td style="text-align:center;vertical-align:bottom"><input class="button" type="submit" name="login" value="Log In" id="login"/></td>
</tr>
</table>
</form>
</div>';
}
?>

This is what i have so far, but it doesn't do what i think it should be doing...

Basically, I think that it should check to see if the username is set. If it is, nothing happens, otherwise it will make the login box appear.




Badges for winner in various stages

I'm designing a application for bank exam aspirants so I need to give a name for winners for 6 various levels ex:( pawn, bishop, knight, queen and king)? I don't want the same hierarchy in the answer




Select the text below the pointer

Does anyone know if it's possible to obtain the text that the mouse pointer is over in a web page?

Some assumptions can be made:

  1. The web page will contain only text, no images. Minimal styling.
  2. The content is all from the same domain, no CORs or iFrames involved.
  3. JavaScript events can be applied anywhere, to any element, as needed to make this work.
  4. Use of 3rd party client side libs is fine. No server side libs.
  5. Use of 'modern' browser APIs is fine, but ideally we can support back to IE9 (no earlier needed)

I'm aware of the Selection API, which allows you to return the selected text. But this is almost the opposite of that: A way to track the pointer, and obtain whatever content it passes over, ideally down to a single word basis, and then select it via code.

I can think of ways to achieve this by rendering the text to a canvas, then tracking pointer movement across the canvas, but I was hoping to find a more 'normal' approach.




Creating objects dynamically and self unreferencing

guys. I'm making an endless runner in which I need some objects to come from the top of the screen and then get destroyed once they're no longer visible.

Screenshot of how it looks like right now

I created the class "banana":

function Banana() {
    this.height = 1.96;
    this.width = 3.955;
    this.pos_x = 300;
    this.pos_y = -30;
    this.banana_image = new Image();
    this.banana_image.src = 'img/banana.png';
};

And a Move function:

Banana.prototype.move = function(){
    if (this.pos_y > 500) {
        //destroy it
        this.constructor = undefined; //????
    }
    this.height += 0.5;
    this.width += 0.5;
    this.pos_y += 5;
    this.pos_x -= 2.2;
};

I created the object in my Game.Initialize function, but it only runs once so it doesn't really help me.

I want to be able to create them dynamically on my Game.update. I was thinking about using an array of objects, but since I'm new to Javascript I don't know how it would work.




vendredi 29 juillet 2016

Single search page - should have breadcrumbs?

Facing An Issue In Wordpress Framework, Single search page - should have breadcrumbs ---> Breadcrumbs are created but as per wordpress hierarchy, issue arises that all names of all categories and subcategories are coming in alphabetical order, unable to defined as Main category>> Sub category, need suggestion, please suggest.




HTTP Error 307 - Temporary redirect in python script

I have used below codes in my script, the code works fine in my personal PC, however the codes not work if i using LAN(using zscaler -firewall/gateway) and received error message "Temporary Redirect".

Note: i pasted the url directly in browser and noticed, browser redirects to some zscaler url (http://ift.tt/2akTksD) and went to expected page and the page is not blocked. Same not happening while running script and control goes to except block of the script.

Is there any way to avoid the redirect from my script/ other way to avoid the error ?

url ='http://ift.tt/2ak0ev4?'
    data = 'username='+username+'&password='+passwd+'&Submit=Sign+in'

      # r = requests.get(url,allow_redirects=False) 
      # print r.url
 #For cookies

    cj= cookielib.CookieJar()
    opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
    p = opener.open("http://ift.tt/2akSNa1")
    #print p.read()
 #Adding header details
    opener.addheaders=[('User-Agent','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120')]
    try:
        usock =opener.open(url, data)

    except IOError as e:
        print "error"

        print(e.reason)




Embed a 3d molecular viewer in a Django Project

This is my first question so do go easy. I am working on building a website in Django 1.8 and Python 3.4. Would appreciate it if anyone can give me any hints on how to embed a 3d molecular viewer (like Pymol, JMol etc.) in a Django app.

I am pretty new to web development, so any hints or guidelines would be highly appreciated.

Thanks for taking the time.




Multiple repositories and Heroku

I have two git repositories (frontend and backend). Say, i need to push frontend to heroku and don't touch backend. Simple static files update, right? Should be easy. But it's not. I have to manually put my static files from frontend into backend repository and push backend to heroku. Then wait for build, env install etc. All this just to upload some files. Is there another way? Maybe some manipulations with git submodule or something like that?




How to render large web pages

I have a web application that allow users to search for some products, but in some cases the returned data from server more than 1000 row, which will results in browser hanging and more time to be fully loaded.

my question is how to render the returned data without hanging in client side and less loading time.

I am not familiar with ReactJS, but if make the render to be on the server and on user request the data will be provided to him, is this way helpful ?




How to see if a form element was not posted

I have a form where e-mail is optional. To control that there is a checkbox. If that checkbox is unchecked, the e-mail textbox would be disabled and therefore not posted on submit. However, on the next page, if I have code like as shown below, it gives me an error if the e-mail textbox is disabled.

if (isset($_POST['submit'])) 
{ 
    $_SESSION["email"]      = $_REQUEST['YourEMail'];
    ....
}

To get around that problem, I progammatically enable a disabled e-mail textbox just before submitting besides setting its value to an empty string. The code for that is shown below.

document.getElementById('YourEMail').disabled = false
document.getElementById('YourEMail').value = ''

However, one annoying problem remains, which is that, if the user goes back to the original page, the e-mail textbox is enabled, since I enabled it problematically just before submitting the form. However, I want it to be disabled in that case. How, can I achieve that? Alternatively, how in the next page, I could see that e-mail box was disabled and therefore not even try to read $_REQUEST['YourEmail']?




Variable error php [duplicate]

This question already has an answer here:

Hey guys i am having a problem coding here. I want a txt file to be created to me when an user submits his name on the html form. But it gives an error in line 5 of this code:

<?php

  $name = $_GET['firstname'] 

 $fh = fopen('name.txt', 'a');
 fwrite($fh, 'Name: '."".$name ."\n");
 fclose($fh);
 ?>

it gives this error:

Parse error: syntax error, unexpected T_VARIABLE in 
         /home/a1781682/public_html/action_page.php on line 5

Any help would be appreciated!




uwp app how to make background completely black

I set page background black and when doing nothing there is no problem but when I click a textbox when keyboard opens or when I change phone layout like horizontal to vertical I see white color in edges how can i make them black.




redirect entire website to subfolder

I dont want my website to be in the root folder of my webspace! The aim of this is to create a folder that is not accessible through the web.(eg secure files, downloads)

I've tried to redirect but I dont get it to work 100%

example:

-root
--downloads
--web
---f1
--.htaccess

my htaccess file:

<ifmodule mod_rewrite.c>
    RewriteEngine On
    RewriteRule ^(.*)$ /web/$1 [L,NC]   
</ifmodule>

this works quite well url.com gets redirected to url.com/web without changing the url in the addressline.

but here the problems start as soon as i try to access a folder like url.com/f1 it gets redirected to (and displayed as) url.com/web/f1, what i dont want to be shown in the addressline.

furthermore i still can access url.com/downloads which i expected to be redirected to http://ift.tt/2ajkf56

can someone please explain to me hot to fix this, or what is the correct way to achieve this.




Send command to other webpage while key pressed, and another while unpressed

I'm assuming Javascript is likely the best method of going about the problem, but how could I accomplish the following;

While the Up key is pressed, run/load a PHP script four times a second (same directory & server, say forward.php) that performs a function - the PHP script doesn't output anything on the webpage so I'd like it to kind of load in the background.

And while the Up key is not pressed, load another webpage (say off.php) with the same frequency (and not poll forward.php).




Why Single JVM instance in J2EE Application server?

I want to ask that if we run a standalone java application using java command,for each application a new instance of JVM is created with separate heap etc. 1. But why in J2EE application server there is only one JVM instance for every each ear or war file deployed on application server instance? 2. Why we are using separate class loader for each application to distinguish between application instead separate JVM instance.?




Get Cinema Program Programmatically

How can I get the Cinema program around me programmatically in Java ? I would love to do it in a way like Google or Bing does.

Could you give me some Point to start ? I am Kind of a newbie in these Topic.




Angular [$injector:modulerr] error with ui-router

I have this code

var app = angular.module('myapp', ['ui.router']);
app.config([ '$stateProvider', '$urlRouteProvider', function($stateProvider, $urlRouteProvider) {}]);

In HTML

<html ng-app="myapp">

and it gives me an

[$injector:modulerr] error

Here is uglify output

var app=angular.module("myapp",["ui.router"]);app.config(["$stateProvider","$urlRouteProvider",function(r,e){}]);

How I load this files

<script type="text/javascript" src="node_modules/angular/angular.min.js"></script>
<script type="text/javascript" src="http://ift.tt/1Pw7PKB"></script>
<script type="text/javascript" src="minjs/all.js"></script>




Uploading necesary dependencies for Angular2 App into a web host

I am new to Angular2 and have a bit of confusion with the node.js and the angular2 framework functioning and relationship.

I can run my app with the lite-server on localhost, but my problem is uploading the app to the hosting service. There are not any tutorials or guides of what to do when the app is ready, so I have been trying to make a bundle with webpack, but I am not successful. I know it is a BAD practice to upload all node_modules installed by npm but am I correct trying to make such bundle?

Another clarification would be if my app can run my app just by uploading the html, css and js files (including those in the node_modules)? or do I need to configure a host that allows Node.js to run my application?

Any guide will be deeply appreciated.

Thanks.




Loop through divs and sub-divs (slideshow like) jQuery

I'm trying to loop through sub and sub-divs in the example below :

http://ift.tt/2ajHCi1

I want to display the widget-text classes one by one in each widget with the duration which is specified in the data property (data-duration).

Example: t = 0

  • => The first widget-text class in the widget-1 class will appear for the 2 seconds then fadeOut and shows the next widget-text in the same .widget-1 class
  • => The first widget-text class in the widget-2 class will appear for the 5 seconds then fadeOut and shows the next widget-text in the same .widget-2 class

I've tried that but it doesn't work when the duration is the not the same between the widget-text, plus I'm not quite sure if it's the right logic (in this example I get the duration dynamically but I could pass it in the data property like in this jsfiddle example)

    widgetsThatHasWidgetText.each ->
      widget_view = $(this)        
      currentInterval = 1000
      slideShowDivs = $(this).find('.widget-text')          
      $(this).find('.widget-text').each ->
        pageNumber = $(this).data('page-number')
        widgetId = $(this).data('widget-id')
        currentWidget = $(widgets).filter (i, n) ->
                        n.id == parseInt(widgetId)
        currentInterval = currentWidget[0].get_real_duration_for_widgets_text[pageNumber.toString()]
        @widgetTextInterval = setInterval =>
          self.cycleDivs(widget_view)
        , currentInterval
        self.widgetTextIntervals.push(@widgetTextInterval)


    cycleDivs:(widgetView) ->
      console.log 'CYCLE EXCETUED'
      $active = $(widgetView).find('.active')
      $next = if $active.next().length > 0 then $active.next() else $(widgetView).find('.widget-text:first')
      $next.css 'z-index', 2
      #move the next image up the pile
      $active.fadeOut 200, ->
        #fade out the top image
        $active.css('z-index', 1).show().removeClass 'active'
        #reset the z-index and unhide the image
        $next.css('z-index', 3).addClass 'active'
        #make the next image the top one
        return
      return

Can someone help to figure out how can I do that ?

Thank you,




Build web 360 View

I'm studying web 360 view. Example http://ift.tt/2a9IqmM i want to build button img, and when hover it will show img and text introduce. position and size of button not change when rotation. img always perpendicular with screen also camera rotation anywhere! but I do not know where to begin. and what should i learn ? Can you help me ? :))




Is it possible to display Apple core data in an HTML file?

Is it possible to display Apple core data in an HTML file? I was thinking about extracting data from core data, and passing it into Angular2 to populate an HTML table. But I don't know how to begin with extracting data, and most of the questions on SO seem to be about storing HTML info in core data (which is the reverse of what I want). How would I get information from core data to pass it into Angular controllers?




Where the WebSocket comes from on the client side

I`ve made a socket communication between server-side and the client-side. But where the entity of WebSocket comes from?

Client side code:

var _ws = new WebSocket(...);

That should be comming from somewhere? I mean browser knows the tag comes from HTML, and the console.log('Hi!'); is a JavaScript. But what is the WebSocket?

HTML5?

Browser build in object?




A network error (such as timeout, interrupted connection or unreachable host) has occurred.in Firebase

A network error (such as timeout, interrupted connection or unreachable host) has occurred. Navigated to http://localhost:5000/?

enter image description here




Is the HttpsServer expandable with web-Gui?

I have created some https-server with java se and in future i want to create some small web gui, where you can see some database entries. My question is, is it possible and practical to make this small webgui with java se? or should i change maybe to java ee with spring framework?

I used following code as basics:

package com.stackoverflow.q3732109;

import java.io.IOException;
import java.io.OutputStream;    
import java.net.InetSocketAddress;

import com.sun.net.httpserver.HttpExchange;
import com.sun.net.httpserver.HttpHandler;
import com.sun.net.httpserver.HttpServer;

public class Test {
 public static void main(String[] args) throws Exception {
    HttpServer server = HttpServer.create(new InetSocketAddress(8000), 0);
    server.createContext("/test", new MyHandler());
    server.setExecutor(null); // creates a default executor
    server.start();
 }

 static class MyHandler implements HttpHandler {
    @Override
    public void handle(HttpExchange t) throws IOException {
        String response = "This is the response";
        t.sendResponseHeaders(200, response.length());
        OutputStream os = t.getResponseBody();
        os.write(response.getBytes());
        os.close();
    }
  }
}

Thank you a lot, Mira




WebRTC Adaptive Bitrate Streaming

Does WebRTC support Adaptive Bitrate Streaming?

If so, Can i control or modify that in a javascript code level?

I try to apply my own adaptive streaming algorithm on WebRTC

I already use RTCMultiConnection Library of Muaz Khan for Multi-Session in WebRTC

Thank you for read this question, and Please help me as soon as possible




Build Web 3D- VR Virtual Reality

I'm studying about web 360 web. And I want to a build 3D-VR module. Example: http://ift.tt/2a41CGV It needs to be virtual reality view. The screen should be divided into 2 and mouse to change, it can only hover on the image. It isn't necessary to accept clicks! I hope to have a hint code or build example! Tks all




jeudi 28 juillet 2016

Create a static web site from a dynamic one

I have a need to create a static archive of a fairly large web site currently written in ASP and ASP.NET. The site uses a proprietary CMS, and has a set of forums.

I would like to login as a user and basically create a static version of that site based on that user's perspective.

Is there such a tool? I've used httrack in the past. I've been hearing a lot about jekyll and other tools. Would any of these work better? Anything interactive would be good too. For example, something that downloads based on me browsing to specific pages.

Any help is appreciated.




which one should i do PHP or HTML? [on hold]

I want that programming and designing both becomes easier for me and easily i can develop my website. I am done with some basics of HTML but i didn't understand actually how to use them how to link javascript and CSS it becomes difficult to me.

I am good at C++ and JAVA but it becomes little bit dificult to me




Can I set an iOS artwork for my element?

I've googled a lot and read some Apple articles but couldn't find anything about this.

So I have an <audio> HTML element on my website that I can play on iOS devices. When I lock my phone and have the sound playing in the background, there is a default, gray artwork image on my lock screen. Is there any way I can change that? Like <audio image="artwork.png"> or something? Feels like Apple would like to have that since an empty image doesn't look very clean...




100% width background image top cut off

When I use the following with a 1920x1080 pic (or for other resolutions I've tried), the very top of the picture gets cut off. Is there any way to prevent this?

div.background {
    background-image: url("/images/home.jpg");
    background-repeat: no-repeat;
    position: absolute; 
    height: 100%; 
    width: 100%;
    margin-top: 100px;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 0;
    background-position: 50% 50%; 
    -webkit-background-size: cover; 
    -moz-background-size: cover; 
    -o-background-size: cover; 
    background-size: cover;
}

div.header {
    background-color: red;
    width:100%;
    height: 100;
    margin-top: 0px;
    margin-right: 0px;
    margin-left: 0px;
    margin-bottom: 0px;
    padding: 0px 0px 0px 0px;

}

body {
    margin: 0px 0px 0px 0px;
}

<html>
<head>
<link rel="stylesheet" type="text/css" href="css/main2.css">
</head>
<body>
<div class="header"></div>
<div class="background"></div>
</body>
</html>




Issue with Ajax get request for third party log in

I'm developing a simple website. When the user opens my website, I hope to kind of redirect him to a REST endpoint that somebody else wrote, and log in there, and get the json result data from that REST API. If I open the endpoint directly from my browser, it would pop up a dialog box asking for username & password. After I enter and log in, a json string would show up saying that I logged in successfully.

This is my code

$.ajax({
    url: "http://ift.tt/2a80c9Y",
    type: "get",
    cache: true,
    crossDomain: true,
    success: function(data, textStatus) {
        alert("success " + data);
    },
    error: function(data, textStatus) {
        alert("error " + data);
    }
})

I was originally having CORS issue but that has been fixed. Now when I open my index page, it will "redirect" me to the authentication url, and the same dialog box would pop up. But after I fill in my username and password, it always returns 401 authentication failed error. If I then copy the url to a new tab in my browser, it's showing the correct json string. That means my login is correct.f016 /devsandbox/sdlpl/fliu/fliu_sdlpl/ntsdlpl/3.0/packages/Admin/Web/python/sdlw

Looks like my ajax request does not have my login info cached, or somehow does not log in. Does anyone have an idea what I did wrong and how I can fix it?

Thanks!!




Is there an api for chat on the frontend that lets you set-up your own websockets?

I've been searching all day for a chat widget to put on my website. I already have my websockets set-up on my back-end. I am just looking for something to put on my page. I am also not good with css.




How can I connected to Mysql database using JSP? where I'm wrong in my code?

How can I get connected jsp to mysql. Where I'm wrong? My index.jsp page working correctly. But I, doubt about <%@include file="DB conn"%> what is should be written in form action and my DB conn.jsp file has real error.

How can I remove error from this code using jsp.What is error in it? Your suggestion is important for me, thanks.

db conn.jsp

 <%@page import="com.mysql.jdbc.Connection"%>
 <%@page import="com.mysql.jdbc.Statement"%>
 <%@page import="java.sql.ResultSet"%>
 <%@page import="java.sql.DriverManager"%>
 <%@page contentType="text/html" pageEncoding="UTF-8"%>
 <!DOCTYPE html>
  <html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>JSP Page</title>
  </head>
   <body>
    <h1>Hello World!</h1>
   <%@ page import ="java.sql.*" %>
    <%
     Connection c1 = null;
     Statement st = null;
     ResultSet rs = null;

     Class.forName("com.mysql.jdbc.Driver");
     c1 = (Connection) DriverManager.getConnection("jdbc:mysql://localhost:3306/teacher","root", "abcde");
        {
         System.out.println("Couldn't find the driver!");
         System.out.println("Couldn't connect: print out a stack trace and exit.");
      System.out.println("We got an exception while creating a statement:" + "that probably means we're no longer connected.");

      st = (Statement) c1.createStatement();
          System.out.println("Statement Created Successfully");
             {
          System.out.println("We got an exception while creating a statement:" + "that probably means we're no longer connected.");  
           se.printStackTrace();}    //Stack Trace Added
           if (c1!= null) {
               System. out.println("Hooray! We connected to the database!");
            } else {
                System.out.println("We should never get here.");
            }}
            %>
              <%
       try{

        String name=request.getParameter("username");
        String abc=request.getParameter("password");       
        String Sql="select * from login where username='"+name+"' AND password='"+abc+"'";
        ResultSet rs=c1.st.executeQuery(Sql);   //error line
      while(rs.next())  {
      out.println("aa");}
       catch(SQLException ex)
         {
         out.println(ex);
         }
         %>


index.jsp

      <%@page contentType="text/html" pageEncoding="UTF-8"%>
      <!DOCTYPE html>
      <html>
      <%@include file="db conn.jsp" %>
      <head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
       <title>JSP Page</title>
      </head>
      <body>
      <form  method="GET " action="reg.jsp" autocomplete="on"> 
      <h1>Log in</h1> 
        <p> 
     <label for="username" class="uname" data-icon="u" >Username:</label>
     <input id="username" name="username" required="required" type="text" placeholder="Username"/>
     </p>
     <p> 
     <label for="password" class="youpasswd" data-icon="p">Password:</label>
     <input id="password" name="password" required="required" type="password" placeholder="Password" /> 
     </p>
     <p class="keeplogin"> 
     <input type="checkbox" name="loginkeeping" id="loginkeeping" value="loginkeeping" /> 
     <label for="loginkeeping">Keep me logged in</label>
     </p>
     <p class="login button"> 
     <input type="submit" value="Login" /> 
     <input type="button" onclick="location.href='reg.jsp';" value="Sign Up"/>
     </p>

    <input type="radio" name="gender" value="Teach" checked/> Teacher
    <input type="radio" name="gender" value="Student"/>Student
     </form> 
     </body>
 </html>

error

    HTTP Status 500 -
    type Exception report

    message

    description The server encountered an internal error () that prevented it from fulfilling this request.

    exception

    org.apache.jasper.JasperException: Exception in JSP: /db conn.jsp:62

    62:             while(rs.next())  {}




Use .NET's own httpClient class on Unity

I'm trying to do a HTTP Delete request from Unity and bump into the idea of use the HttpRequest class included in the System.Web namespace of .Net

How can I achieve this, I supose that some sort of import of that namespace must be done, but how?

Hope some one can give me some orientation




How to enable horizontal/side scrolling for two separate web pages?

I have two webpages, created using React with absolutely positioned elements.
I need to combine them and form a horizontally stretched website.

How can I go about doing this? The tricky thing is the elements from both webpages are positioned with respect to one webpage and one width (100%), so how can I go about smoothly transitioning from one to the another?

Do I just set each page's 'body' to 50% width and have one wrapper of 100% width and overflow-x: scroll?




JSON Data for weather is nil when I run the app, but on the web page

thank you for answering.

This has been annoying me for days now and I've tried everything I can to fix it. For some reason the data parameter in this chunk of code:

    let task = NSURLSession.sharedSession().dataTaskWithURL(url, completionHandler: {
        (data, response, error) in
        dispatch_async(dispatch_get_main_queue(), {
            do {
                let json = try NSJSONSerialization.JSONObjectWithData(data!, options: NSJSONReadingOptions.MutableContainers) as! NSDictionary

                if let main = json["main"] as? NSDictionary {
                    if let temp = main["temp"] as? Double {
                        self.temperature = String(format: "%.1f", temp);
                        print(self.temperature);
                    }
                }
            } catch (let error as NSError) {
                print(error);
            }
        });
    });

is ALWAYS nil. I've made sure the url is correct by copying and pasting it into safari, and when I go on the website, the data is on the page. Is there anything I have to fix?

Btw, here's the code that calls this part:

if (coordinate != nil) {
        info.getWeatherData("http://ift.tt/2atUfGV, its a secret}");
        print("api




How do I send value from arduino to a web form

I need to send a string from the arduino to the web form on that page http://ift.tt/2az5roz and submits the form. This is the current code of my arduino, what is wrong, or what is missing..

void SubmitHttpRequest()
{
mySerial.println("AT+CSQ");
delay(100);

ShowSerialData();// this code is to show the data from gprs shield, in order to easily see the process of how the gprs shield submit a http request, and the following is for this purpose too.

mySerial.println("AT+CGATT?");
delay(100);

ShowSerialData();

mySerial.println("AT+SAPBR=3,1,\"CONTYPE\",\"GPRS\"");//setting the SAPBR, the connection type is using gprs
delay(5000);

ShowSerialData();

mySerial.println("AT+SAPBR=3,1,\"APN\",\"internet.vodafone.net \"");//setting the APN, the second need you fill in your local apn server
delay(8000);

ShowSerialData();

mySerial.println("AT+SAPBR=0,1");//setting the SAPBR, for detail you can refer to the AT command mamual
delay(5000);

ShowSerialData();

mySerial.println("AT+SAPBR=1,1");//setting the SAPBR, for detail you can refer to the AT command mamual
delay(8000);

ShowSerialData();

mySerial.println("AT+HTTPTERM"); //term the HTTP request

delay(5000); 

mySerial.println("AT+HTTPINIT"); //init the HTTP request

delay(5000); 
ShowSerialData();

mySerial.println("AT+HTTPPARA=\"URL\",\"http://ift.tt/2aAYyQm\"");// setting the httppara, the second parameter is the website you want to access
delay(5000);

ShowSerialData();

mySerial.println("AT+HTTPDATA=1000,10000"); //100 refers to how many bytes you're sending.  You'll probably have to tweak or just put a large #
  delay(10000);
ShowSerialData();
  mySerial.println("[\"id\": \"01\",\"current_value\": \"" "\",");
delay(500);
  mySerial.println("TEST from Arduino"); //ie latitude,longitude,etc...
 delay(5000);
ShowSerialData();

mySerial.println("AT+HTTPACTION=1");//submit the request 
delay(5000);//the delay is very important, the delay time is base on the return from the website, if the return datas are very large, the time required longer.
while(!mySerial.available());

ShowSerialData();

mySerial.println("finish");
delay(100);

mySerial.println("[\"id\": \"01\",\"current_value\": \"" "\",");
delay(500);
ShowSerialData();
}




How to pass multiple arguments to a PHP web script?

I know that you can pass one argument using the ?param=value syntax. But how can I pass multiple arguments? I tried to search on the internet a lot but couldn't find any help on this.




PHP Sending Email Comma error

I am having trouble with sending emails through PHP.

So I have a form which submits to a PHP script which sends an email:

<?php

    $to  = "myemail@email.com"; 
    $subject = "[Contact Form]";
    $body    = "Someone has sent a new message from the contact form. \n \n  Message from: " . $_POST["name"] . "\n Contact Number: ".  $_POST["contactNumber"] ."\n Email: ". $_POST["email"] ."\n \n Message: ". (string)$_POST["message"]; 

    if (mail($to, $subject, $body)) {
        echo ("<p>Email successfully sent!</p>");
    } else {
        echo ("<p>Email delivery failed…</p>");
    }


?>

And the email is sent fine when for example the message is one line such as:

"Hi there how is it going?"

And fine if it is multiple lines such as

"Hi there

how is it going?"

But when I try and type a message with a comma such as

Hello there,

how is it going?

It fails?

Is there a way I can just treat the whole thing as a string possibly? Would this also fail on any other characters or is this issue just because of the way I am writing the PHP script?

This might be an obvious fix but I am new to PHP so apologies! I have tried looking around for an answer but nothing seems to fix what I am looking for.

Thanks for any help!




HTML & CSS - navigation bar won't float horizontally using float left

Trying to make a navigation bar horizontal with the logo on the left but the text won't move. Anybody got any idea why not?

http://ift.tt/2aMVmAs

CSS

body {
    width 100%;
    max-width: 960px;
    margin: 0 auto;
}

nav {
    width: 100%;
    margin: 20px 0;
}

nav ul {
    width: 100%;
    list-style: none;
    margin: 0;
    padding: 0;
}

nav ul li {
    width: 20%;
    float: left;

}

nav ul li a {
    display: block;
    width: 100%;
}




Ruby Sinatra, Serialport access

i want to write a Web-Application (Ruby/Sinatra) that can read/write from a Serialport. So far my Application is working fine when i test it on the localhost. But every time i deploy it on Heroku it gives me always an error message (Internal Server Error). I haven´t found any solutions yet.

I am using the 'serialport' gem

thanks for helping george




Android or web app which allows learn new words in different language using quizes

Don't know if this question should be posted on stackoverflow but nevertheless.

I am looking for Android or web application to learn new language(German) which allows:

  • add unknown word by searching for translation online(like search in dictionary)
  • learn new words by playing quiz game - 4 answers and 1 is
    correct.

I don't want to add translation manually. I do want to add my own words. Ideally with application should support different language pairs like: english->german, russian->english and etc

Is there an app which supports these cases?




Facebook pinging deauthorize callback url with the wrong request

I'm working on a facebook tab app. I need to know when the user uninstall the tab app from their page so that I can update my database. While facebook documentation do not specify how that can be accomplished I read that facebook would ping your deauthorize callback url.

On facebook documentation, they say that they will ping the url with a post request sending a signed_request (http://ift.tt/2ax1EXf), but whenever I remove the tab app from a page facebook send a GET request to my callback url without any signed_request, which doesn't help me to know which page had the app uninstalled.

Access log from my apache server

The 302 redirect is happening because there is no signed request.

What should I do? I can't query all the pages on my database to find out which one had the tab uninstalled because it wouldn't scale, I would need the manage_pages permission and there is no way, without a signed request, to know that the request came from facebook.




How to fix this whitespace issue between images in HTML?

Requirement

I want to create an image with multiple hyperlinks on it and email it to someone.

What I did

I used Photoshop's slicing method and added URL to the slices. I saved the composition for web. For it to work on my recipient's end, I uploaded each slice to an online photo hosting website and edited the HTML tag img src="local photo location" to img src = "online photo location". But the problem is I get multiple white-spaces between each slice which distorts the overall image.

Code

<html>
<head>
<title>General Infosheet July 25</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!-- Save for Web Slices (General Infosheet July 25.jpg) -->
<table id="Table_01" width="800" height="1034" border="0" cellpadding="0" cellspacing="0">
    <tr>
        <td>
            <a href="http://facebook.com/">
                <img src="http://ift.tt/2abnWcU" width="539" height="158" border="0" alt=""></a></td>
        <td rowspan="2">
            <img src="http://ift.tt/2aclxlx" width="260" height="452" alt=""></td>
        <td>
            <img src="http://ift.tt/2aboejM" width="1" height="158" alt=""></td>
    </tr>
    <tr>
        <td rowspan="4">
            <img src="http://ift.tt/2acm7iX" width="539" height="876" alt=""></td>
        <td>
            <img src="http://ift.tt/2aboejM" width="1" height="294" alt=""></td>
    </tr>
    <tr>
        <td>
            <a href="http://twitter.com/">
                <img src="http://ift.tt/2abnTh6" width="260" height="144" border="0" alt=""></a></td>
        <td>
            <img src="http://ift.tt/2aboejM" width="1" height="144" alt=""></td>
    </tr>
    <tr>
        <td>
            <a href="http://instagram.com/">
                <img src="http://ift.tt/2acmqup" width="260" height="134" border="0" alt=""></a></td>
        <td>
            <img src="http://ift.tt/2aboejM" width="1" height="134" alt=""></td>
    </tr>
    <tr>
        <td>
            <a href="http://photobucket.com/">
                <img src="http://ift.tt/2aboEqG" width="260" height="304" border="0" alt=""></a></td>
        <td>
            <img src="http://ift.tt/2aboejM" width="1" height="304" alt=""></td>
    </tr>
</table>
<!-- End Save for Web Slices -->
</body>
</html> 

Question

I want to remove white-space between the images. Please provide code edits that will help to remove these white-space. Thank you.




HTML - Break Line While Getting Input From TextArea

My Problem Is,

When I Type Multi Lines In TextArea I Get Output Like This,

upper one is input and lower one is output

enter image description here

But I Want To Get Output Like This,

enter image description here

In This Photo I Used <br/> Just For Making The Look What I Want But, In Real I Don't Want To Use <br/> To Break Line In Multi Line

This Is Th Code I'm Using...

<!DOCTYPE html>
<html>
  <head>
  </head>
<body>
  <TextArea id = "Input" onKeyupUp = "showResult()" style = "height: 100px; width: 100%; resize: none;"> </TextArea>
  <Div id = "output" ></Div>
</body>

<script>
  function showResult(){
    var input = document.getElementById("Input").value;
      document.getElementById("Output").innerHTML = input;
  }
</script>
</html>




Why is echo statement not generating anything in my PHP code?

In my code, I have javacript get the local time on the client side and post it to the server. On the post event, I have the following code in PHP.

<?php 
......
if(isset($_POST["dateStr"]) && strlen(trim($_POST["dateStr"])) > 0)
{
    ....
    if($fh = fopen("files/$fileID",'w'))
    {
        fwrite($fh, '<span style="color:yellow">Successfully created file!</span>');
        echo '<span style="color:yellow">Successfully created file!</span>';
        fclose($fh);
    }
    else
        echo "<span style=\"color:yellow\">Error creating file!</span>";
}
?> 

The file is successfully created, and inside that file (for debugging, to just see what echo statement generates, I dumped the same string in that file) I can the following statement as well.

<span style="color:yellow">Successfully created file!</span>

However, the message "Successfully created file" is not shown on the screen. This means the echo statement is not working. What could be the mistake that I am doing?




Gitstack git server - push to apply changes

(Sorry for the unclear title). This is the scenario. I have a local server and I installed Gitstack in it. I was able to to push and pull to this local git server. This same server runs the webapp that I am working on. My plan is to push commits to this local git server and that change must also reflect to the webapp. So instead of using filezilla to copy files from my machine to serer, I will just push the changes via git. How to do it? Or is it possible?

I tried to in Gitstack installation folder for the project's files but theres only git files inside.




Is getting page type/name from selected tab css a feasible idea?

I have a page with multiple tabs.I need to add google analytics code to the page,but as all tabs are part of same page,and I need to get tab name to have data on which phase is user interacting with.Is using css ,to check for selected tab a feasible idea or do we have other possible options to achieve the same?




Firebase set does not work

<script src="http://ift.tt/2a0fz98"></script>
<script src="http://ift.tt/2asGzfk"></script>
<script src="http://ift.tt/2ae0pOH"></script>
<script src="http://ift.tt/2asGEzH"></script>
<script src='http://ift.tt/185z2Pa'></script>
<script src='http://ift.tt/1qRgvOJ'></script>
<script>
    var config = {
        apiKey : "AIzaSyCnmZWNwp3CfjXDcDL5MADIej6GwvxWEtQ",
        authDomain : "dsmweb-ba185.firebaseapp.com",
        databaseURL : "http://ift.tt/2ae0bXV",
        storageBucket : "dsmweb-ba185.appspot.com",
    };
    firebase.initializeApp(config);
    var usersRef = ref.child("assignment");
    userRef.set(<%=submit%>);
</script>

This is my code .. And That does not work. submit variable is mean

{Testuser={date=8/8, teachername=Testuser, title=Let's do homework}}




Traffic API code is not updating city, province and country into my database, sometimes it does and sometimes its not using PHP

I am using this code to update traffic from developer here traffic api. sometimes it stores the traffic well with city, province and country. and sometimes it stores traffic but not stores city province and country. city, province and country is automatically updated via latitude and longitude that are coming from traffic api.

Here is the code view

<?php
include("config.php");
$str = file_get_contents('http://ift.tt/2az9vEK');
$data = json_decode($str);
//for($i=0;$i<count($data);$i++)
//{
//  $data->TRAFFICITEMS[0];
//}
//print_r($data->TRAFFICITEMS);
foreach($data->TRAFFICITEMS as $key=>$value)
{
    //echo $key;




    for($i=0;$i<count($value);$i++)
    {
    //print_r($value[$i]);
    $trafficItemId = $value[$i]->ORIGINALTRAFFICITEMID;        

    $eventType=$value[$i]->TRAFFICITEMTYPEDESC;


    $user_tz = 'GMT';

    $schedule_starttime = new DateTime(date('Y-m-d H:i:s',strtotime($value[$i]->STARTTIME)), new DateTimeZone($user_tz) );
    $schedule_starttime->setTimeZone(new DateTimeZone('Africa/Johannesburg'));
    $STARTTIME =  $schedule_starttime->format('Y-m-d H:i:s');

    $schedule_endtime = new DateTime(date('Y-m-d H:i:s',strtotime($value[$i]->ENDTIME)), new DateTimeZone($user_tz) );
    $schedule_endtime->setTimeZone(new DateTimeZone('Africa/Johannesburg'));
    $ENDTIME =  $schedule_endtime->format('Y-m-d H:i:s');


    $schedule_entrytime = new DateTime(date('Y-m-d H:i:s',strtotime($value[$i]->STARTTIME)), new DateTimeZone($user_tz) );
    $schedule_entrytime->setTimeZone(new DateTimeZone('Africa/Johannesburg'));
    $ENTRYTIME =  $schedule_entrytime->format('Y-m-d H:i:s');


    $todaydate = new DateTime(date('Y-m-d H:i:s'), new DateTimeZone($user_tz));
    $todaydate->setTimeZone(new DateTimeZone('Africa/Johannesburg'));
    $currentdate = $todaydate->format('Y-m-d H:i:s');


$eventDescription=$value[$i]->TRAFFICITEMDESCRIPTION[1]->content;
//echo $des.'<br>';
//print_r($value[$i]->LOCATION);
foreach($value[$i]->LOCATION as $key1=>$value1)
{
    //echo $key1.'<br>';
    if($key1=='DEFINED')
    {
        //$eventType=$value1->ORIGIN->ROADWAY->DESCRIPTION[0]->TYPE;
     // echo $type.'<br>';
         // echo $lon=$value1->ORIGIN->LONGITUDE.'<br>';
        $address =  $value1->ORIGIN->ROADWAY->DESCRIPTION[0]->content;
        //$city = $value1->ORIGIN->DIRECTION->DESCRIPTION[0]->content;

    }

    if($key1=='GEOLOC')
    {
      $latitude=$value1->ORIGIN->LATITUDE;
      $longitude=$value1->ORIGIN->LONGITUDE;


$geolocation = $latitude.','.$longitude;



$province='';

$request = 'http://ift.tt/1kDofho'.$geolocation.'&sensor=false&key=AIzaSyDk8Z2vIiQHljqoBCEFhuRMX-cZahhDWnE'; 
$file_contents = file_get_contents($request);
$json_decode = json_decode($file_contents);

if(isset($json_decode->results[0])) {
    $response = array();
    foreach($json_decode->results[0]->address_components as $addressComponet) {


        $response[] = $addressComponet->long_name; 

        if(in_array('locality', $addressComponet->types)) {
                $city = $addressComponet->long_name; 
        }

        if(in_array('administrative_area_level_1', $addressComponet->types)) {
                $province = $addressComponet->long_name; 
        }        

        if(in_array('country', $addressComponet->types)) {
                $country = $addressComponet->long_name; 
        }

    }


  }
echo '<br>';

    }
    if($key1=='INTERSECTION')
    {


    }

}

$UnixIncidentTime=strtotime($ENTRYTIME); 
$UnixExpireTime=strtotime($ENDTIME);

$rows = mysql_num_rows(mysql_query("select * from IncidentReportnew where OriginalIncidentID = '".$trafficItemId."'"));
         if($rows <= 0){
            $resultset = mysql_query("select statusCode from `StatusCode` where `Here` = '".$eventType."' ");
            $fetchStatusCode = mysql_fetch_assoc($resultset);

        $query = mysql_query("insert into IncidentReportnew(`eventname`, `eventType` ,`OriginalIncidentID`, `device_id`,`eventDescription`,`longitude`,`latitude`,`address`,`city`,`province`,`country`,`vehicleRegistration`,`speed`,`makeVisible`,`picture`,`providedby`,`areaCode`,`updatedDate`,`expirationDate`,`datetime`,`UnixIncidentTime`,`UnixExpireTime`)VALUES('".$eventType."', '".$fetchStatusCode['statusCode']."' ,'".$trafficItemId."', '','".addslashes($eventDescription)."','".$longitude."','".$latitude."','".$address."','".addslashes($city)."','".addslashes($province)."','".$country."','".$county."',' ','0',' ','Here',' ','".$ENTRYTIME."','".$ENDTIME."','".$currentdate."','".$UnixIncidentTime."','".$UnixExpireTime."')") or die(mysql_error());
         }

   }

}

?>




VB.NET Gecko Web Browser javascript function calling?

I am using Gecko Web Browser within my VB.NET (Windows Form App) and the web Browser has loaded an local html file. This html has embed in-line a svg file (human body diagram with bones and internal organs) enter image description here with a javascript function for picking up all the "ids" elements from svg document, and then call the javascript function from VB.NET (Windows form app), but I don't know to do the calling. Can anyone help me please, or give me a source code example please? All the stuff I've found is based in C#... This is my javascript function in my HTML FILE:

<script type="text/javascript">

(funcion () {

// Function to be called in VB.NET when the DOM is loaded


var SVGHandler = function () {

    // Picking up the id Root Node="CUERPO_HUMANO" into svg variable

    var svg = document.querySelector('#CUERPO_HUMANO');


    // In Items we save all the <g> which have an ID

    var items = svg.querySelectorAll('g[id], path[id]');

    //var items = svg.querySelectorAll('g[id]');

    // We loop all the nodes saved in Items and add them to click event listener 

    forEach(items, function (index, value) {

        value.addEventListener('click', function (event) {



                event.preventDefault();

                //We avoid the spread of events
                event.stopPropagation();





                return event.currentTarget.id

                // console.log(event.currentTarget.id)

            });

    });



}

// http://ift.tt/1WMAJHj

var forEach = function (array, callback, scope) {

  for (var i = 0; i < array.length; i++) {

    callback.call(scope, i, array[i]); // passes back stuff we need

  }

};



// With this method, we call a SVGHandler when DOM is totally loaded 

document.addEventListener('DOMContentLoaded', SVGHandler);

})();

IN MY VB.NET FORM: What code should I use in VB.NET for calling my javascript function each time I click on a specific bone or organ over the human body diagram loaded in Gecko Web Browser? I want to save the "id" picked up with the calling into a string variable for being used as a parameter in a SQL statement and populate a datagridview with data. Can anyone help me please? I was searching and all the stuff is referred to C# and any VB.NET example. even though I was trying to figure out the equivalence in VB.NET trying to convert the C# example to VB.NET, I have some doubts how to do the javascript call. According to my javascript function, could be like this?:

browserControl.Navigate("javascript:void(funcion())");

Please, Can anyone help me to solve this?. I would be very thankful...




What are the best options to convert video into gif in high resolution?

on website I need to put a background video.

Embeded video is not an option for me, as it has problems with autoplay on mobile.

And actually, as I don't need to control it, I decided to create a gif from this video.

I want to create several gifs, depending on screen resolution in order to optimize website loading process.

Can you please recommend me services, where I can convert 1080 video into high resolution gif? And what is an optimal size for background gif?




disable audio from keeping playing after lock screen or press home button in safari

I'm working on a project and in a case I need to play audio using tag in web. But I found out that the audio won't stop after lock screen or press home button. It just keeps playing. So is there a way to disable that? BTW I tried simplest way but the audio won't stop. Here's the code:

<audio src="./movies/1.mp3" controls="controls">
  Your browser does not support the audio element.
</audio>




mercredi 27 juillet 2016

How to use DwgViewrAcCtrl.dll in web?

I added DwgViewrAcCtrl.dll under COM Components in "Visual Studio 2012 Ultimate" and It works fine for Window form. If I try to place that control in web form that control was disabled in toolbox. How to fix this issue?




account system w/ js, html & php

I need help to make a account system in php! It will create a new document for each user with some data in it, here is what I tried:

PHP:

//> Profile Creation <//
if($_CREATEPROFILE) {
$uname = $_CREATEPROFILE['uname'];
$pword = $_CREATEPROFILE['pword'];
$email = $_CREATEPROFILE['email'];

$path = 'profiles/' + $uname + ".txt";

if(file_exists('profiles/' + $uname)) {
    //Run If Profile Already Created
    echo("<script>cantCreate();</script>");
} else {
    //Profile Creation
    $handle = fopen("profiles/" + $uname,"a");

}
}

    //> Profile Logging In <//
    if($_LOGIN) {

}

HTML:

<form action="" method="CREATEPROFILE">
    <input type="text" id="uname" name="uname" placeholder="Username">
    <input type="text" id="pword" name="pword" placeholder="Password">
    <input type="text" id="email" name="email" placeholder="EMail">

    <center><div id="accountStatus-Signup" class="accountStatus-Signup">You Have Not Done A Account Scan Yet!</div></center>

    <input type="submit" id="submit" name="submit" value="Sign Up">
</form>

Javascript:

<script>
function cantCreate() {
document.getElementById("accountStatus-Signup").innerHTML = "<h2 style=\"color: red;\">Sorry! But That Username Is Unadvaible!";
}
</script>

Please explain to me my errors! Thanks for helping me!




Error while creating a new project in the rails

I have a problem during the making of a new project in RUBY ON RAILS enter image description here

IN the windows 10




Send text to next line when not enough room?

I am having issues with a website where if I go there on a mobile device the text attempts to wrap around the picture. I am wanting the text to go below the picture if there is not enough room. Any ideas?

You can see example of what I am talking about if you go to http://ift.tt/2acs5mK and minimize browser like a mobile phone.

I have tried inline block but have had no luck.




Django: Return image and text to same Template simultaneously for display

I have a method in views.py that creates an image and also creates a text string to return to a template for display.

This code shows just the image correctly(without the string showing up since not returned):

response = HttpResponse(content_type='image/png')
image.save(response, "PNG")
return response

This code doesn't quite work right as it just displays text (the PIL photo object text string, the string is displayed correctly)

objects_to_render = {"photo":image,"string":the_string}
return render(request, "pic_text_display.html",objects_to_render, content_type='image/png')

In "pic_text_display.html":




How can I return an image and have the string available for display in the template at the same time?

Thanks for the help!!