mercredi 30 septembre 2015

Web form for .Net application adding

I have a problem.

I have console application, that can chose between console interface, WinForm or WPF. I have to add a some kind of Web Form to it. How i can do it? Controls on UI is dynamic and draw programly.




Using CDN for distributing resource for content curation site

I'm building a site that I'll be sharing my own collection of inspiring web content. I was going to store URLs of those I like to share on Google spreadsheet and use spreadsheet API service to retrieve those URLs in JSON format. But then I realised all web pages have different ways to show images, text that are wrapped around varying HTML tags and so on.

I can get Open Graph meta data from some URLs but not all. So I think I have a fundamental issue of preparing and sharing my resources in a maintainable way.

Today I stumbled upon an idea of using CDN service which I thought could work against my needs.

I just wonder if this is the usual way to go for creating a content curation site? I'm not looking to fill up my site with auto-aggregated content because of quality issue so I'm looking for a maintainable way to build a manual curation site and your advice will be much appreciated.




is node.js killing PHP ? What is future of PHP?

NodeJS is a platform which runs javascript on server side . So in future which web technology will win ?




Data Structure for holding parsed csv Bus route data

I have a csv file of about 10k rows x 25 columns. The csv contains information of bus routes, stops, etc. I have a select box with all the routes and the user will be able to pick a single route to show on the map, and then they will be able to click on individual stops (another select box) to get a closer look on the map. I am wanting to know what will be the best way to parse and structure to store this information and be able to perform fast queries (database?), and how should I store the result of the query (array, json object, dictionary, data Table?). I won't need all columns every time, so I will pick the useful columns to make the query a little faster.

Each time a user will select a different route, I will make a query to get all the stops and other relevant information and loop through the data to display it on the map (maybe store results of last 5 queries?). What will be the best way to store this result? Showing the specific stop information won't be too big of a deal since it will be a smaller subset of the already queried results.

Let me know if you need any additional information that will assist with the answers.




Live site does not match local site

I recently added an email form to my site. Everything worked find for Safari, chrome and IE 10. After uploading my files onto the server the live site has missing styles. The site should look like http://ift.tt/1LllDoQ but instead it looks like this http://ift.tt/1QLX3vi

<!doctype html>
<html>
<head>
<link href="//cdn-images.mailchimp.com/embedcode/slim-081711.css" rel="stylesheet" type="text/css">
<meta charset="utf-8">
<title>CloudHudl</title>
<link href="Landing_styles.css" rel="stylesheet" type="text/css">
</head>                                                          
<body style="margin: 0; padding: 0">
    <header>
          <div id= "logo"></div>
    </header>

    <div class="Organge">
    <div id= "UltimateGame">
    ULTIMATE GAME DEVELOPMENT PLATFORM
    </div>
    <div id= "CloudHudlis">
    CloudHudl is a platform for developers, artist and producers.
    </div>
    <div id= "ConnectandForm">
    Connect and Form Develpment Teams
    </div>
    <div id= "CreateandDevelop">
    Create and Develop Games Through the Web
    </div>
    <div id="WePublish">
    We Publish Your Games!
    </div>
    </div>
<div id= "StayInformed">
      STAY INFORMED
    </div>
    <div id="About">
        We are creating a platform for developers, artist, and producers from all walks of life. Our platform gives people with an idea the ability to connect with talented individuals from
        across the globe. Project management, file sharing and collaboration, and development are simple to run on CloudHudl. In addition, our publishing services for games gives producers’ 
        complete creative freedom, so they can create the content they want to create. Our platform allows talented producers and designers to create unhindered projects of any size, from 
        anywhere in the world and provides the opportunity for any project to succeed, not just exist. If you’re a developer, producer, artist, coder, or just interested in getting involved, 
        fill out our form below to stay up to date and receive a notification before our launch date.
     </div>
<div class= "Grey">
    </div>
    <div id= "bubble">
    </div>
    <div id= "sheet">
    </div>
    <div id= "controller">
    </div>       
    <!-- Sign-up -->
<div id="mc_embed_signup">
<form action="//cloudhudl.us11.list-manage.com/subscribe/post?u=e31b06ffc35cb8b0ebaa0081b&amp;id=79f3fa778c" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
    <div id="mc_embed_signup_scroll">

    <input type="email" value="" name="EMAIL" class="email" id="mce-EMAIL" placeholder="email address" required>
    <!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
    <div class="clear"><input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button"></div>
    </div>
</form>
</div>

<!--end signup--> 
    <footer>
      <address>
        Copyright 2015 &#169;
        (620) 605-2154;
      </address>
    </footer>
</body>
</html>


/* 
  Cloud Hudl
  Index stylesheet

  Author: Cameron Hall
  Date: 9/25/2015
  Filename: indexstyles.cc
*/

html, body { height: 100%; }

.Organge {
    float: left;
    background-color: #fa7862;
    width: 100%;
    height: 80%;
}
.Grey {
    background-color: rgb(242, 242, 242);
    width: 100%;
    height: 20%;
    clear: both;
}
#UltimateGame
{
    font-size: 20px;
    font-family: "MS Sans Serif";
    color: rgb(255, 255, 255);
    line-height: 1.2;
    text-align: center;
    position: absolute;
    left: 36%;
    top: 22%;
    width: 479px;
    height: 26px;
    z-index: 3;
  }
#CloudHudlis
{
  font-size: 14px;
  font-family: "MS Sans Serif";
  color: rgb(255, 255, 255);
  line-height: 1.2;
  text-align: center;
  position: absolute;
  left: 38.5%;
  top: 26%;
  width: 377px;
  height: 15px;
  z-index: 4;
 }
 #ConnectandForm
{
  font-size: 12px;
  font-family: "MS Sans Serif";
  color: rgb(255, 255, 255);
  line-height: 1.2;
  text-align: center;
  position: absolute;
  left: 16%;
  top: 50%;
  width: 110px;
  height: 26px;
  z-index: 5;
}
#CreateandDevelop
{
  font-size: 12px;
  font-family: "MS Sans Serif";
  color: rgb(255, 255, 255);
  line-height: 1.2;
  text-align: center;
  position: absolute;
  left: 45%;
  top: 50%;
  width: 132px;
  height: 26px;
  z-index: 9;
}
#WePublish
{
  font-size: 12px;
  font-family: "MS Sans Serif";
  color: rgb(255, 255, 255);
  line-height: 1.2;
  text-align: center;
  position: absolute;
  left: 76%;
  top: 50%;
  width: 135px;
  height: 9px;
  z-index: 6;
}
#StayInformed
{
    font-size: 18px;
    font-family: "MS Sans Serif";
    color: rgb(0, 0, 0);
    line-height: 1.2;
    text-align: center;
    position: absolute;
    left: 42.83%;
    top: 80%;
    width: 197px;
    height: 128px;
    z-index: 18;
}

#mce-EMAIL
{
  font-size: 20px;
  font-family: "MS Sans Serif";
  color: rgb(153, 153, 153);
  line-height: 1.2;
  text-align: center;
  position: absolute;
  width: 80%;
  height: 100%;
}
input.button
{
    font-size: 18px;
    font-family: "MS Sans Serif";
    background-color: #fa7862;
  color: rgb(255, 255, 255);
    line-height: 1.2;
    text-align: center;
    position: absolute;
  top: -1px;
    left: 80%;
    width: 40%;
    height: 120%;
}
[placeholder]:focus::-webkit-input-placeholder {
  transition: opacity 0.5s 0.5s ease; 
  opacity: 0;
}
#mc_embed_signup
{
  background-color: rgb(255, 255, 255);
  position: absolute;
  left: 36%;
  top: 85%;
  width: 25%;
  height: 3.5%;
  z-index: 13;
}
#logo
{
  background-image: url("logo.png");
  position: absolute;
  left: 36.5%;
  top: 4%;
  width: 425px;
  height: 100px;
  z-index: 7;  
}
#bubble
{
  background-image: url("bubble.png");
  position: absolute;
  left: 17.57%;
  top: 37.8%;
  width: 72px;
  height: 65px;
  z-index: 8;
}
#sheet
{
  background-image: url("sheet.png");
  position: absolute;
  left: 47%;
  top: 37.8%;
  width: 56px;
  height: 72px;
  z-index: 10;
}
#controller
{
  background-image: url("controller.png");
  position: absolute;
  left: 77%;
  top: 38.55%;
  width: 92px;
  height: 59px;
  z-index: 11;
}
#About {
    font-size: 18px;
    font-style:italic;
    font-family: "MS Sans Serif";
    color: rgb(255, 255, 255);
    text-align: center;
    position: absolute;
    top: 60%;
    margin-left: 25%;
    margin-right: 25%;
}

footer {
clear: left;
width: 100%;
text-align: center;
}

footer address {
width: 100%;
clear: left;
font-size: 1.2em;
font-style: normal;
font-variant: small-caps;
background-color: rgb(242, 242, 242);
}  




Access restricted school CMS from home

My University runs its CMS which can be accessed only in University i.e using university's computer but whenever I try to access that CMS at home I comeup with forbidden or sometimes not found error. The url to cms is : online.pucit.edu.pk I think it's kind of intranet in my university. Please tell me about the possible ways to access CMS portal from outside the university.




Professional Sports Schedule API for all sports

I noticed that this question has been answered in previous years, but the answers seem outdated.

I am developing an application that requires professional sports schedules (mlb, nhl, nba, nfl). Only the schedules are desired, not any of the additional features; ie. live scoring, player stats, etc.

Are there any good, cheap sport api's/databases that I can use for my project? I know ESPN recently stopped allowing public api keys, and other sites like cbs seem to be directed to fantasy sport leagues and don't have a regular season schedule for teams. Other resources I have exhausted had fairly large pricing demands, but also included many features that I would not use.

Any feedback/help is greatly appreciated




Redis / Memcached ReST caching for an external service

Question here about caching data from calls to an external ReST API.

There is currently a ReST service set up to generate and retrieve some specific types of reports that the UI must consume. However, this service is not meant for high volume usage, or to be exposed to the public and these reports are fairly static. Possibly only changing every 10-20 minutes. The web application resides on a separate server.

What I would like to do is, using memcached or Redis, is when a request for data comes in from the UI to the web back-end, make a call from the web application back-end to the report server to get the specified report, transform the data to the appropriate format for the UI to consume, cache it with a timestamp, and return it to the UI so subsequent requests will be available in memory on the web applications back-end without having to re-request from the report server. I would also need to check this timestamp and make a new request if the cached report has been held for longer than the specified time. The data that will be cached is fairly minuscule just some smallish JSON objects with only a handful of values holding the information the UI needs and there is NOT a ton of these objects, I would not be surprised if they could all be easily stored in memory at once so the time stamping is the only invalidation that should be necessary.

I have almost 0 experience here when it comes to caching / memcached / Redis. Is there advantages to one or the other? Is something like this possible? How would I go about implementing this? Are there other options?

Appreciate the help!




Changing bootstrap navbar scroll effects

I am making my bootstrap navbar on scroll to change the background color to red with jquery and it do not work any help please.

HTML CODE

<header class="navbar navbar-default navbar-fixed-top" style="background-color:Transparent; border-color:#e74c3c;">
      <div class="navbar-brand" style="color:white;">Podlle</div>
      <div class="nabar-item">
         <a style="color:white;" href="#"<div class="navbar-text">Sign Up</div></a>
         <a style="color:white;" href="#"<div class="navbar-text">Log In</div></a>
      </div>

Jquery Code

<script type="text/javascript" src="http://ift.tt/1GEtfQr">
$(document).scroll(function(){
  $(".navbar").css("background-color" , "red");  
})

Please Help , Thanks




Java Web: Currency Converter [duplicate]

This question already has an answer here:

I'm working on a project due for one of my classes. In it, we need to create a currency converter that converts one currency to another using an array of conversion rates. However, I can't get my program to get a conversion rate from an array.

   private static final double[][] rates = 
 { {1.0, 0.624514066, 0.588714763, 0.810307 },
   {1.601244959, 1.0, 0.942676548, 1.2975},
   {1.698615463, 1.060809248, 1.0, 1.3764},
   {1.234100162, 0.772200772, 0.726532984, 1.0} };

   public double getFxRate(final String inCurr, final String outCurr){

   int Currency1;
   int Currency2;
   double rate;

   if(inCurr == "CAD"){
       Currency1 = 0;
   }
   if(inCurr == "EUR"){
       Currency1 = 1;
   }
   if(inCurr == "GBP"){
       Currency1 = 2;
   }
   if(inCurr == "USD"){
       Currency1 = 3;
   }
   if(outCurr == "CAD"){
       Currency2 = 0;
   }
   if(outCurr == "EUR"){
       Currency2 = 1;
   }
   if(outCurr == "GBP"){
       Currency2 = 2;
   }
   if(outCurr == "USD"){
       Currency2 = 3;
   }

     rate = rates[Currency1][Currency2];
     return rate;

   }

}

You can see the array and my method of getting the number from the array. I'm getting the error that Currency1 and Currency2 might not have been initialized even though the if statements clearly initialize them. Can anyone see what I'm doing wrong?

Also, I'm sure there's a better way to set the values of Currency1 and 2 than 8 different if statements but I just want the program to work before I worry about efficiency. If you want to help me with that too I'd appreciate it but it's not a priority.

Thank you!




Using ng-repeat on a position of $scope

I have a array like:

$scope.items = [];
$scope.items[0] = {val1: 1, val2: 2}

I'm trying to use an ng-repeat like:

<div ng-repeat = "item in items[0]"> {{item.val1}} </div>

which it is the right way to use this? Thanks :D !




Image processing on the web

I want to create a very simple website, where the user uploads a picture for which edgemap and histogram is to be displayed. I am very new to web technologies. I have the code to get the edgemap and histogram in c++. I intend to use the c++ code. Can you guys guide me to the setup and tech. I am not looking for something fancy.

So when the user clicks on the EdgeMap button, I want it to use my c++ code and generate the edge image and then display it on the website. Likewise for the histogram.




Azure web app unexpected crash

I have a web app which is running in Azure. When I try to debug it in VS, I can get as far as to var newResume = new Resume() {JobId = (int)jobid}; line (I get correct jobid), but then I get "server error" and page is redirected to error page. Everything works locally. What can be the problem? Thanks for your time

            [HttpGet]
            public ActionResult Create(int jobid)
            {
                var newResume = new Resume() {JobId = jobid};

                return View(newResume);
            }




How to search the web including meta tags

All search engines only find the content with in the body tag as per our search query. I would like to search the web including meta tags. Cause I'm eager to know who is using what kind of meta tags.

In short I like to search the web page content which is with in and tags including meta and other links with in the tag, not just the content with in the body tag.




Name of the user not getting displayed in python code

I have made a signup page using python. Following is the link to the code :

Signup Page Code

As soon as a user signs up, he should be redirected to /welcome which says :

Welcome user

But I cannot display it by the above mentioned code.

Whereas when I write

self.redirect('/welcome?username = '+user)

I get redirected to a page which says

Welcome user

Why is it so?




Web development design [on hold]

Need help I just finished some courses in html// css // flash // photo shop and was wondering where to go now . What path of learning shall I go if I chose Web design or development. Pls help




Can't get file with thumbnail from Vimeo

I'm creating a portfolio page where the user uploads images or informs a video URL from Youtube or Vimeo.

When the user informs a Vimeo URL i do the following steps:

1- Get the XML file from "http://ift.tt/1WxL0FM]"

2- Get the "video_id" property from the file, with the video id (i can open the video in the browser with "vimeo.com/[video_id]", for instance)

3- Generate the embed video URL from the video id, just doing "http://player.vimeo.com/video/[video_id]"

4- Get the XML file from "http://ift.tt/1P5sliA"

5- Get the "thumbnail_medium" property from the file, with the video thumbnail


WORKS FINE:

When i try, for instance, with the video "http://ift.tt/1WxL0FQ" i do:

1- Get the XML file from "vimeo.com/api/oembed.xml?url=https%3A%2F%2Fvimeo.com%2Fchannels%2Fstaffpicks%2F130537730" - OK

2- Get the "video_id" property from the file - OK - Returns "130537730" (the video "vimeo.com/130537730" works fine)

3- Generate the embed video URL from the video id: "http://player.vimeo.com/video/130537730" - OK - Works fine

4- Get the XML file from "http://ift.tt/1WxL0FU" - OK

5- Get the "thumbnail_medium" property from the file - OK - Returns "http://ift.tt/1P5sjau"


ERROR (THE FILE DOESN'T EXIST):

If i try it with the video with the URL "http://ift.tt/1WxKYxD" (it's a trailer) i do:

1- Get the XML file from "vimeo.com/api/oembed.xml?url=https%3A%2F%2Fvimeo.com%2Fondemand%2Fbendingsteel" - OK

2- Get the "video_id" property from the file - OK - Returns "134429740" (the video "vimeo.com/134429740" works fine)

3- Generate the embed video URL from the video id: "http://player.vimeo.com/video/134429740" - OK - Works fine

4- Get the XML file from "http://ift.tt/1WxKYxF" - ERROR - I don't get the file


Workaround (I don't think it's a good alternative):

The XML file from "vimeo.com/api/oembed.xml?url=https%3A%2F%2Fvimeo.com%2Fondemand%2Fbendingsteel" have a "thumbnail_url" property that returns a video thumbnail, and i got "http://ift.tt/1WxKYxH", but I wanted a smaller image for thumbnail.

Based on the thumbnail of the first video I manually changed the thumbnail of the second video to "http://ift.tt/1WxKYxL" and it worked fine, but I don't think that this is a good approach and I don't know if this will work in all cases.


I don't know if i did something wrong, or if there's a better approach, or if this occurs because the video is a trailer, but i think this is a weird behaviour because everything else works fine.

I also tried with the video "vimeo.com/36031564" (it's not a trailer) and it worked fine, but with the video "http://ift.tt/1P5sliC" (it's a trailer) the same error occured, so i think this error will happen with trailers.

I tried with other types than XML but i still didn't get the file.

Any suggestion?




MySQL Workbench missing closing parenthesis

This code was generated in Workbench after creating model for synchronizing with server. But after my trying synchronize this model, Workbench say: operation has completed with errors. I put this code into "query window" Workbench and see highlighted syntax error on line PRIMARY KEY (idGroup) COMMENT ''. Why this code incorrect? Thanks!

SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';

CREATE TABLE IF NOT EXISTS `everest_journal_db`.`Groups` (
  `idGroup` INT(11) NOT NULL AUTO_INCREMENT COMMENT '',
  `titleGroup` VARCHAR(45) NOT NULL COMMENT '',
  PRIMARY KEY (`idGroup`)  COMMENT ''
  )
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8
COLLATE = utf8_general_ci;

DROP TABLE IF EXISTS `everest_journal_db`.`table_from_workbench` ;

DROP TABLE IF EXISTS `everest_journal_db`.`simple_table` ;


SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;




How to capture all the events performed on iframe?

NOTE : The url of iframe is external link which is on different domain .

I could get a solution in which i was able to detect only a click event .

var monitor = setInterval(function(){
var elem = document.activeElement;
if(elem && elem.tagName == 'IFRAME'){
    message.innerHTML = 'Clicked';
    clearInterval(monitor);
}
}, 100);

Also , at this place it has been stated that there is no way we can capture the events of an external iFrame . I want to capture all the events . Is it possible ?




Forwarding request to a new controller

I have this two controller from two separate projects lets name them:

  • project1.controller1
  • project2.controller1

Obviously these are two Spring controllers from different projects.What I want is to make project1.controller1 a gateway all request will be sent here. And will process the request if it will go to project2.controller1 or a new controller.

Some pseudoCode:

@Controller
public class someClassFromProject1{

   @RequestMapping(value="/controller1", method=RequestMethod.POST)
   public String smsCatcher(String target, HttpServletRequest request,
        HttpServletResponse response){
           //some processing, converting request to string, etc
           if("someStringThatIsPartOfTheRequest".equals("someString"))
            //carry request and forward it to project2.controller1
           else
            //go to another external controller
         }

    }

And in project2.controller 1 will look something like this:

@Controller
public class someClassFromProject2{

   @RequestMapping(value="/controller1", method=RequestMethod.POST)
   public String smsCatcher(String target, HttpServletRequest request,
        HttpServletResponse response){
          //processing
   }
  }

I've already tried return "forward:/someUrl"; and return "redirect:someUrl";. It didn't work and it didn't reach project2.controller1. So any ideas on this one?

Edit: Forgot to add this one, different project means different war but deployed on the same sever

Thanks!




Is there any way to trace the user activity in a web application?

I have a Image manipulation application for applying effects such as zoom,pan,rotate,etc.Is there any possible to keep a track of the order the user performs these manipulations?..I have all these manipulations done in JS. So no communication with the web server.This can be easily done in a Windows app by maintaining log files;But in web application is there any way to trace the user actions(keep a record)?.Any help would be appreciated :)




mardi 29 septembre 2015

bootstrap (website) on cpanel not working well with www

I got a problem, maybe is related to CNAME or maybe to .htaccess file. website is working well if we use domain.com for example without www For example: http://domain.com is working well

but if we will use www. domain.com some part of website like css related to bootstrap icons will be disappeared. for example:

http://www.domain.com still website will be loaded but not working well.

Anyone who faces this problem, please share your knowlege how to solve this issue. Maybe we can use to force through htaccess to redirect to non https or http but in this case, how to make it work with www. ?

Thanks in advance




How can I embed a video file when it's URL keeps expiring?

I'm trying to embed a video file, but the file's url keeps expiring. Is there anyway to refresh the link or somehow keep the video file embedded on the website? I was trying to embed the video using javascript, but iframe is allowed as well.




Divide people into separate lobbies

I have a game that runs a web backend. At the moment, anyone that connects is put into the same "lobby" and joins the same game. We would like to make it so that multiple lobbies and games can be running on our server at the same time. How do I take my entire game and wrap it in something that can create new instances of my game (factory pattern?)? Right now our best way of doing it is to set up another server when we want to start a new game. If it helps, we are using Java on our backend (not my choice).




can't crawl crawl hidden form content not shown in the page source

I have to crawl the comments in this web page http://ift.tt/1KQISS8

  <section class="comments-container">
  <div class="meta-information">
  <a data-disable-with="Loading…" data-decremented-comments-count="7 Comments" class="comments-count" data-remote="true" href="/statuses/6587/comments">8 Comments</a>
    <span class="last">
    <span class="last-commenter">last comment by</span>
      <a class="user secondary-highlight-hover" href="/users/cathyl">
    <img class="avatar" src="/images/user.png" alt="User" />
      <h2>CathyL</h2>
</a>
    <span class="last-comment-time"><time datetime="2015-06-19T10:43:10-04:00" class="relative" title="Fri, Jun 19, 2015 at 10:43:10 AM" data-time-ago="2015-06-19T10:43:10-04:00">06/19/20115</time></span>
  </span>
</div>

from the page source it's form but the source doesn't show the any comments contents

when I open the website: http://ift.tt/1KQISS8, I can see the comments.

How do I crawl them when the source code doesn't show the form content? any suggestion or examples? Thanks very much!




How to make some website features paid?

I am developing a freemium web app, there are some features free and some are paid. To prepare the functions of the web app to be ready for this type of applications what is the structure of the web app must be ? How will the control panel structure look like ?




Run a script on my webserver when I click a button on the webpage on a remote machine

I want to be able to have a button on a webpage hosted on webserver x, and then have it so when button y is clicked by a remote user on webpage z, which is on server x, a script on server x will run on server x. Also if possible I want to have a text input that will be used by the script as input. I cant find anything similar to this and dont know how to go about figuringit out myself. If you know how to do this please reply. Thanks




How to write a python script to fill out forms?

I am trying to speed up the process of apply for scholarships. I want to write a script to go to the URL of a specified scholarship portal (FIGURE 1), click on THE "Apply Now" button for each scholarship, click the 2 start links (FIGURE 2), click the "submit" button and repeat the process for the next scholarship.




Inserting values into browser. Python 3

I'm doing python program which inserts specific values into browser (for exapmle registration form). Is where any way how I can put these values using python?




Managing web applications with multiple people.

How do you manage problems in a web application when different people are editing the same data?




how to login and sign up in android using web service in android

How to login and sign up in android using web service . see below: First name
Second Name Address Email

Sign up (Button)

need code of sign up using api in android




Retrieving Data From URL After Authorization Redirect

I'm currently writing a small command-line program in C using LibCurl to retrieve authenticated-user-specific information (e.g. currently live streams the user follows) from Twitch using its API.

My program's calls and parsing work fine after I am able to get the user's token from the OAuth2.0 protocol used with Twitch.

My problem is figuring out a method to get a user's token if it has not been provided. Since Twitch doesn't allow password grant flow (i.e., POST a username and password to the authorization page and retrieving the token) the user must be redirected to the authorization web page, have them enter their credentials if they are not logged in, and authorize my application to be issued a code token (which is found in the URL when the user is redirected after authorizing).

Ideally, I wanted a user to be prompted by opening up the authorization web page in the user's default broswer, have the user log in and authorize my program. And then when the user is redirected, retrieve the new URL containing the code token. My problem is I'm relatively new to web programming and I'm just not sure how to go about implementing this solution or if it's even feasible.




Chrome autofills incorrect data type

On my site, there are two fields on the sign in page: one for email, one for password. If I have already signed up, log out, and go back to sign in, Chrome autofills the username into the email text box instead of the email address.

<div class="inputs">
      <%= devise_error_messages! %>
      <label id="maincontent" class="control-label sr-hidden" for="email">Email Address</label>
      <input id="email-input" name="email" type="email" required='true' autocompletetype='email' autofocus='true' placeholder='Enter your email address...'/>      
      <label class="control-label sr-hidden" for="password">Password</label>
      <%= f.password_field :password, :required => false, :placeholder => "Enter your password...", :id => "password" %>
</div>

In addition, if I delete the password field altogether, no autofill happens at all in the email field and it is left blank. If you click in the field, the drop down autocomplete menu pops up, however.




How do I make something on a web page different by the country it's viewed in?

Let's say you wanted Image 'A' to only be visible in the US, but wanted Image 'B' to be visible in Canada instead (both of the images are in the same place on the web page). How would this fit into an HTML web page?




Django 1.8 Admin not hashing user's password

(Hi people, excuse my english)

I am using AbastracBaseUser and UserCreationForm with my Django app. When registering users througth my app, the password get hash and save in the database. But when I try to do the same thing using Django admin site, the password get save in raw.




How to build Chat in JAVA web application

I have created a web application using JAVA maven web app with small features like login, calendar, notifications and more.

Now, I need to build a Chat communication between the users in the application.

Can anyone help me to build this feature?




add install from web tab joomla error

when iam clicking to install from web tab it gives me the errors below:

JFolder::create: Path not in open_basedir paths

JFolder: :files: Path is not a folder. Path: httpdocs/tmp/install_560ac9e0129e1

JFolder: :folder: Path is not a folder. Path: httpdocs/tmp/install_560ac9e0129e1

JFolder: :files: Path is not a folder. Path: httpdocs/tmp/install_560ac9e0129e1

JInstaller: :Install: Cannot find Joomla XML setup file

any help?




Seeing the websocket data through browser developer tools

Is it possible to see the data exchange through developer tools of browsers , like chrome already has the developer tools > network > websocket, Which only displays the communication handshake but no data exchange unlike the xhr




javascript accepting multiple date format

I should preface this post by saying that I am a very elementary developer with a generic IS degree. Without going into too much detail, I was given a moderately large web application from an interning software engineer to support an enhance if need be. It was written primarily in Python, JavaScript and HTML5 and utilizes a Google Map API to visually represent the location and uses of given inputs. This leads me to my question.

There is a date picker modal that the application/user utilizes. They pick a START and END date, in the default format YYYY-MM-DD (if the user does not use that exact format (i.e. 2015-09-29) the date picker will not work), and the application then goes to the DB and picks the given inputs between those dates and represents them on the map. I have been told that, for usability, I have to make the program accept multiple date formats (i.e. September 29 2015, 09-29-2015, 9-29-2015, 9/29/2015). How would I go about doing this?




why the Web facilitates the integration of business intelligence and ERP

*

hello everyone ,

Excuse , anyone could help me my question is Discuss why the Web facilitates the integration of business intelligence and ERP ?

*




Mobile web? Desktop?

I am evaluating dev tools for my new company. I know SmartFace rocks iOS and Android but what about mobile users that don't want to download my app and would prefer using their browser on the phone?

Similar question for the desktop browser.

Does SmartFace generate perhaps an HTML5 version of the app for users on mobile or desktop browsers?




Why tag doesn't fit to child image

I've got a header like that:

<header id="top">

        <a id="logourl" href="/"><img src="/images/logo.jpg" alt="LOGO" id="logo"></a>
        <nav>
            <ul>
                <li id="firstli"><a href="<?php bloginfo('url') ?>">Home</a></li>
                <li><a href="<?php bloginfo('url') ?>/machines">Macchine</a></li>
                <li><a href="<?php bloginfo('url') ?>/resellers">Rivenditori</a></li>
                <li><a href="<?php bloginfo('url') ?>/where">Dove siamo</a></li>
                <li><a href="<?php bloginfo('url') ?>/contact">Contatti</a></li>
            </ul>
        </nav>
    </header>

With the CSS:

header{
    display:-webkit-box;
    display:-webkit-flex;
    display:-ms-flexbox;
    display:flex;
    flex-direction: row;
    justify-content: space-between;
     align-items: center;
    width:100%;

    background-color: #3498DB;

}



#logo{

    box-shadow: 0px 0px 5px #fff;
    border-radius: 50%;
    width: 20%;
}

#logourl{
    margin-top: 10px;
    margin-bottom: 15px;
    display: block;


}

header nav {
    width: auto;
    /*-webkit-align-self: flex-end;
        -ms-flex-item-align: end;
    align-self: flex-end;*/
    margin-bottom: 20px;

}
header nav ul{
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: horizontal;
    -webkit-box-direction: normal;
    -webkit-flex-direction: row;
     -ms-flex-direction: row;
    flex-direction: row;
    /*justify-content: space-between;*/
    -webkit-flex-wrap:wrap;
    -ms-flex-wrap:wrap;
    flex-wrap:wrap;
    list-style: none;
    text-align: center;
}


header nav li {

    text-align: center;
    padding: 5px 10px;
    /*border-right: 2px solid white;*/
    /*border-radius: 10px;*/
    /*margin-right: 10px;*/
    color: white;
    margin-left: 20px;

}header nav li>a {
    margin:0;
    width: 100%;
    height: 100%;
    color: #F2F1EF;
    font-weight: bolder;
        text-transform: uppercase;
    font-size: 25px;
    }

header nav li>a:hover{
    color: white;


}

The problem is that the "a" tag should fit to image size, but that's not true, because it stretches from the left to the middle of the page width, so some nav menu entries wrap to a new even in full screen.




How to debug mobile via Safari when app starts?

I use Ionic framework and have $ionicPlatform.ready method. Which way I can use to debug this piece of code? Because when my app will foreground from background, method not called, but when I close app, Safari will be closed. So when I run my app, Safari don't connected to app.




Correct arcthitectural term for a Database of Web Service

Databases and Web Services have similar but slightly different roles, but imagining them to be black boxes with an access layer over the the top; what single word could you use to refer to either?

Datasource or repository don't work because they just refer to databases. I need an actual term and not just something made up. Something that is actually googleable and real.

Thanks for your help




call a webservice from an endpoint and get the forwarded data

hi everyone i am working on a web program (with PHP) that can receive data forwarded from server via a web service ...

The webservice (providing the SendData method) is designed to work as an endpoint service, that means data will be uploaded to that service. The service is not designed to request data from our servers! The workflow is as follows: The Machine sends data to our Example server which forwards the data to the endpoint service (that one that you develop) by calling the SendData method. Therefore your service must be accessible from external (our server) so your need a port forward in your firewall and an static address (e.g. http://ift.tt/1WveKTY).

but i have no idea how to do any of that i don't have any experience in this it's my first time so can anyone give a very detailed explanation about what should i do and how




CSS | importing sprites incorrect relative path

I am trying to use CSS to import my sprites and I have done it 100 times before but this one time it doesn't seem to be working. I am using relative paths too get the image from within my CSS file.

My file structure looks like so:

Root 
|
| Index.html
|
|____Content
     |____css
     | main.css
     |
     |____images
     | tips.png

The CSS I am using to try and get the items out of the file is as follows

//tips icons
.sprite-tips{
    background: url("../images/tips.png") no-repeat;
    width: 25px;
    height: 25px;
}
.tips-tick {
    background-position: 0 0;
}
.tips-cross {
    background-position: -30px 0;
}

This is how I am trying to apply it :

<div class="sprite-tips tips-tick"></div>

This code is copied from one of my other working projects and it is not working, any ideas?




Which Database and Language I should use?

I'm developing a software with database in C#.Net with SQL Server Database. Now i want my to access my data from online website, and android app. Before it, i'm going to try three different databases, then i didn't understand how i'll manage it. I know C#.Net, Java for android, and some of php too.

Have you any idea, which database and language i should use to access from 3 different platforms at a time.

For example: I put record in my database from desktop PC, then i want that record from my android app, and from my website at the same time.

Advance sorry for bad english..




Why Response.Cookies is empty?

When I run this python script

import requests

main_page_request = requests.get("http://carkit.kg/")
cookie = main_page_request.cookies.get("csrftoken", "")

I'm getting proper result, but when I run this code at C#:

string url = @"http://carkit.kg";

HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);

HttpWebResponse response = (HttpWebResponse)request.GetResponse();

Debug.Log(response.Cookies["csrftoken"]); // prints "Null"

it says that response.Cookies is empty. What is the problem?




google maps Image Recognition Query

I'm working on a web application selling gardening stuff, and I was wondering if there is anyway I can use Google API in order to define weather a range of houses within one specific street have got back gardens. because on satellite view i can clearly see the gardens so I was wondering whether its possible to use image recognition on that satellite view in order to determine green spaces and pin the streets where houses have gardens.??

Thats my first post here so I'd really appreciate any kind of help or hint . Thx




How to sort the results in AJAX Solr?

Does anyone know how to sort the results in AJAX Solr with the structure form the reuters tutorial? There's a problem with the schema.xml, because Solr says that our results are multiValued, but we've indexed it with multiValued="false"; Would be nice if someone had the same problem and could help us how to fix it.

Greets




Drag and Drop auto generate jquery scripts for html elements

I need a jquery library which alllows user to drag and drop components like charts,blogs,tables based on configurations.




ERR_CONNECTION_TIMED_OUT only happens for client and not anywhere external

On my clients network of computers when they try to access the site they get an ''ERR_CONNECTION_TIMED_OUT'' but on computers external we can seem to access it almost always. Although occasionally I have also had the same error. What could this be? I have Googled everything and nobody seems to have the same issue.




lundi 28 septembre 2015

convert google maps into jpg file

i'm making a website right now and i use google-maps-api.

i want to convert my google maps into jpg or png files, so everyone can download it or print it.

my question is, how's the script will be?? how to conver google-maps into an image file?

i have searched everywhere but i cant find how to do it.

what programming language that should i use?? php, html, or javascipt??

i hope you guys know how to solve it. please help me somebody. thanks before..




Shall I use both .com and a localised domain or Shall I use .com only?

I have a classified website and Now its running on the internet fine. It has a .com domain. In there users can put advertisments to any location by selecting the country and city.

So I also buied a local domain ( My country domain ) to deploy a site in my country.

The reason why I think it good to go for a localised domain is I beleive that any country's peoples' trust their localised domain.

But when I do that I am not going to use any localised language or any thing.

I am just upload my project from this new domain.

Also my some friends says If my country can select from .com version why you should go to localised domain?

That also make sense.

Also I am worry about SEO thing. What will happen if my country domain get a bigger traffic and then will it appear on top of the results in google? Will my .com domain come 2nd?

So What are your ideas?

What should I do? Shall I stick with .com only or Shall I use my localised domain?

I need a descriptive answer please.




Routing in polymer 1.0

I am new to web development and building an application using polymer 1.0.4. I am using the page.js routing similar to the example in start kit. Now many of the custom element that I built are using ajax and periodically refresh the data. The problem with page.js routing that It seems it loads all custom elements even if the element is not viewed by user. so all custom elements are loading the data even if it is not needed. my questions:

1- How could I fix this so the the elements load data only when they are viewed by the end users? Should I change the routing to another options like more-routing?

2- if the user filled the data in one custom element , then clicked on link to another element. The data will remains when the user goes back to the first custom element? How could I reset the polymer and html elements in the custom element when the use back to an old view?




Multiple web service instance started when 2 web pages are open

I am new Java web service programmer and I am looking to see why I see 2 instances of my service being created when I have 2 web pages open to it (One over localhost and another from a different PC using the server PC's IP address and web service URL).

Stack details: Using Tomcat, Java web service under Windows 7 PC.

I have a small web service that connects to a black box internally. Each time I bring up the web service and open up a URL associated with it, I can see the details from the black box. The problem is, when I have 2 web pages open to the web service (One over localhost and another from a different PC using the server PC's IP address and web service URL), I see two instances of the service being created and that are trying to connect to one black box at the same time. I need the ability to start the connect to the black box remotely or locally. But, only the localhost connection should win. I tried creating a servlet to start the service when Tomcat startup but not much luck with it. With the servlet, I see my autowired Datasource connection is null.

Any idea on this would help.

@Repository public class HServiceDAO {

@Autowired
private DataSource mySql_dataSrc;

web.xml

<servlet>
    <servlet-name>StartWebApp</servlet-name>
    <servlet-class>com.StartWebApp</servlet-class>
    <load-on-startup>1</load-on-startup>
</servlet>   




Grunt serves up on port, but cannot access with remote machine

So my grunt file cooks up my site and runs it on a port on any machine (i.e. localhost:9000), but I cannot access that running page/site via machinename:9000. Had gotten a 502 error that din't make sense. Any suggestions here?

Thanks much.




How to fix this error "Notice: Undefined offset" and save records to database?

I'm working on fee management system and getting error "Notice: Undefined offset"

Notice: Undefined offset: 32 in H:\USB-Server\root\include\PayFee.php on line 14
Notice: Undefined offset: 1 in H:\USB-Server\root\include\PayFee.php on line 17
Notice: Undefined index: 7-H in H:\USB-Server\root\include\PayFee.php on line 20
Notice: Undefined offset: 0 in H:\USB-Server\root\include\PayFee.php on line 23
Notice: Undefined index: 2015-09-02 in H:\USB-Server\root\include\PayFee.php on line 26
Notice: Undefined index: Cash in H:\USB-Server\root\include\PayFee.php on line 29
Notice: Undefined index: dffd in H:\USB-Server\root\include\PayFee.php on line 32
Notice: Undefined index: 2015-09-23 in H:\USB-Server\root\include\PayFee.php on line 35
Notice: Undefined offset: 1000 in H:\USB-Server\root\include\PayFee.php on line 38
Notice: Undefined variable: fee_concession in H:\USB-Server\root\include\PayFee.php on line 41
Notice: Undefined index: in H:\USB-Server\root\include\PayFee.php on line 41
Notice: Undefined offset: 0 in H:\USB-Server\root\include\PayFee.php on line 44
Notice: Undefined offset: 0 in H:\USB-Server\root\include\PayFee.php on line 47
Notice: Undefined offset: 0 in H:\USB-Server\root\include\PayFee.php on line 50
Notice: Undefined offset: 1000 in H:\USB-Server\root\include\PayFee.php on line 53

 

And also whenever i'm trying to save records in database it save as in following picture

enter image description here

And i'm using following codes:-

if(isset($_REQUEST['submit']))
{
$errorMessage = "";
$s_student_id = mysql_real_escape_string($_POST['studentID']);
$student_id = $_POST[$s_student_id];
$s_school_id = mysql_real_escape_string($_POST['schoolID']);
$school_id = $_POST[$s_school_id];
$s_fee_classsec = mysql_real_escape_string($_POST['classID']);
$fee_classsec = $_POST[$s_fee_classsec];
$s_fee_status = mysql_real_escape_string($_POST['feeStatus']);
$fee_status = $_POST[$s_fee_status];
$s_fee_dueDate = mysql_real_escape_string($_POST['fee_dueDate']);
$fee_dueDate = $_POST[$s_fee_dueDate];
$s_fee_mode = mysql_real_escape_string($_POST['fee_mode']);
$fee_mode = $_POST[$s_fee_mode];
$s_fee_info = mysql_real_escape_string($_POST['fee_info']);
$fee_info = $_POST[$s_fee_info];
$s_fee_paidDate = mysql_real_escape_string($_POST['fee_paidDate']);
$fee_paidDate = $_POST[$s_fee_paidDate];
$s_fee_amount = mysql_real_escape_string($_POST['fee_amount']);
$fee_amount = $_POST[$s_fee_amount];
$s_fee_concession = mysql_real_escape_string($_POST['fee_concession']);
$fee_concession = $_POST[$fee_concession];
$s_fee_lateCharges = mysql_real_escape_string($_POST['fee_lateCharges']);
$fee_lateCharges = $_POST[$s_fee_lateCharges];
$s_fee_vat = mysql_real_escape_string($_POST['fee_vat']);
$fee_vat = $_POST[$s_fee_vat];
$s_fee_serviceTax = mysql_real_escape_string($_POST['fee_serviceTax']);
$fee_serviceTax = $_POST[$s_fee_serviceTax];
$s_fee_grandTotal = mysql_real_escape_string($_POST['fee_grandTotal']);
$fee_grandTotal = $_POST[$s_fee_grandTotal];
$insqDbtb = "INSERT INTO fee_info (
student_id, 
school_id, 
fee_status, 
fee_classsec, 
fee_due_date, 
fee_paid_date, 
fee_amount, 
fee_late_charges, 
fee_concession, 
fee_vat, 
fee_service_tax, 
fee_total, 
fee_mode, 
fee_info) 
VALUES ('$student_id',
'$school_id',
'$fee_classsec',
'$fee_status',
'$fee_dueDate',
'$fee_paidDate',
'$fee_amount',
'$fee_lateCharges',
'$fee_concession',
'$fee_vat',
'$fee_serviceTax',
'$fee_grandTotal',
'$fee_mode',
'$fee_info')";
mysqli_query($link,$insqDbtb) or die(mysqli_error($link));
echo 'Record saved...';
}

Anyone can help me to fix this issue? I didn't recognize the issue :(




Web design scroll library (like recyclerview android)

Are there any libraries which are equivalent to Androids RecyclerView?

Need this as I will be populating a long list of items.

I am looking for a very efficient library which minimizes the impact of browsers. (Hopefully which utilized css animations etc as much as possible)




Web service to get diff between to files

I am looking for a web service which provides diff between two files in html format ( with red, green coloring if possible). Is there any such service available?

Thanks, Kailas




Automating Web traffic interception

I would need to have a web proxy which would intercept the web traffic and automate the work like following,

  1. Check the request and response of the loaded page
  2. Check the various values of the js loaded. performance etc.

I don't want to do the same manually, I was wondering if there is any tool which helps me automate the monitoring and modifying things as required.




Creating a swipe left and right(using the mouse) web based application

I want to create a web application using jquery/angular where I am going to use the mouse to swipe left and right between stored pictures(pretty much like tinder). For the swiping part I am thinking of using jquery's on drag and drop. Can I get advice on how I can approach this?

thank you




What are the technics to create a platform?

I would like to know what are the technics to create a platform where the user can easily create a own webpage with choosed feautures?

Something like WIX. I am not saying that I want make it, just curious to know little more about it.

Thanks.




problems about making my website

I would like to make a website for my math club in my school.

So, basically, the website is about giving questions on math and i want to have multiple choices questions. Once the user select the answer and submit, it will display whether user gets the right answer.

My question is that is there any website template helping me build this website? Should I use some website content management system, like wordpress, phpBB?




vlookup in etherpad acts weird

I have a small ethercalc table (see http://ift.tt/1ViuVGS ) and want to use vlookup, but I get a #REF! Error. I can't see why.

In short: the table looks like:

Date       ||Value
01-Sep 2015||1
   ...
28-Sep 2015||28

This is just an example to produce the error. What i did is:

=vlookup(today(), $A$2:$A$31, 3, 0)

Instead of getting the right number, I get a #REF! Error. But if I set the column value to 1:

=vlookup(today(), $A$2:$A$31, 3, 0)

I get the correct date value. What am I missing here? I would appreciate any suggestion.

thanks in advance Hannes




Two Columns With Flexible Scroll Overflow

I have a two column layout. The left column is a list of repeated messages and the right column several different menus. I want the two columns to always be the same height as the right column and the messages in the left column should overflow to scroll. There is also a header in the left column that should not scroll.

The problem is that without explicitly setting the height of the scroll div it will expand to contain all spans and never overflow. How do I make the left column the same hight as the right with the overflow scrolling? For an example of what I want, uncomment the height:120px line in .scroll. Here is a JSFiddle

Here is a mock up of the basic structure

<div class='table'>
<div id='c1' class='column'>
    <h4>Column 1</h4>
    <div class='scroll'>
        <span></span><span></span><span></span>
        <span></span><span></span><span></span>
        <span></span><span></span><span></span>
    </div>
</div>
<div id='c2' class='column'>
    <h4>Column 2<h4>
</div>
</div>

And the css

div.table {
    display:table;
    width:500px;
}

div.table div.column {
    display:table-cell;
}

#c1 {background-color:blue;}
#c2 {background-color:red; height:150px;}

.scroll {
    background-color:#ccc;
    overflow-y:auto;
    //height:120px;
}

.scroll span {
    height:28px;
    background-color: #999;
    display:block;
    margin-top:2px;
}

I am trying to do it without any JS - but I may have to use it. I tried a solution using display:flex but was unable to get that as close as this one.

Edit: I don't actually know the height of the right column. It changes based on dynamically generated content - and can grow if someone expands menus. I want to the left column to stay fixed to the right columns height with the overflow scrolling. I've updated the jsFiddle: http://ift.tt/1GbWFRs




How to make web-portal ( http://ift.tt/1MAAmJZ )?

i have an idea for a web-portal, aiming for a place where people can find jobs international, (for example they can get a job in other countries before move-ing there etc)

i wonder if there will be possible to earn money on this idea? and how should i go further to make project real, if it turns out to be a good idea?, and how to get users?.

i need real programing expertise ti find out if this project earn the right to live, and if it will gain users?

i might be a mobile app aslo.

-k




Earn Moneny from google adsense..?

Hi friends i'm new to stack overflow... any way my question is it is possible to earn money from google adsense. I have a web hosting company i'm given to all users free web hosting service... and i put some ads in cpanel it's good or not... In cpanel comes with...

cPanel Unlimited Disk Space Unlimited Transfer Unlimited Email Accounts World Most Popular Softaculous Web Builder Cloud flare

I'm given to all this features are free....at http://zingri.in please guide me how to attract people to my site and how to earn money from adsense quickly...and also how to increase traffic....thank lot...




Create custom format string

I want to ask how to create custom format string brother, for example i want to create format string like this CALL 34/40 so, if I enter a value other than that, it will not be processed..

anyone can help me with this problem please, im really appreciate for your answer




FPS drops in Canvas

This is my first post in stackoverflow. I am a newbie in this, but I have decided to make a game, which generates some random pillars in every 2 seconds. The game is not complete, I am facing FPS drops from 60 FPS to ~7 FPS in about 10 - 15 seconds.

My Javascript is included below:

var canvas = document.getElementById("canvas");
var ctx = canvas.getContext("2d");
var SCALE = 2;
var CONST_DIMENTION_SIZE = 25;
var HEIGHT = 9*SCALE*CONST_DIMENTION_SIZE;
var WIDTH = 16*SCALE*CONST_DIMENTION_SIZE;
var PILLAR_FREQUENCY = 2000; //in milli-seconds, it will reduce as level increases

var pillar = new Array(); //pillar object array
var tempTime = new Date().getTime();
var player = new Player();

canvas.width = WIDTH;
canvas.height = HEIGHT;

main();

//Rendering Methods//
function init(){}
function render(){
    var i;    
    console.log("FPS: " + 1000/((new Date().getTime()) - tempTime));        
    if((new Date().getTime()) - tempTime >= PILLAR_FREQUENCY){
        pillar.push(new Pillar());
        tempTime = new Date().getTime();
    }    
    for(i=0;i<pillar.length;i++){
        pillar[i].x--;
        if(pillar[i].x <= -pillar[i].width)
            pillar.shift();     //remove the pillar if the pillar is outide the vision of the screen

    }
    refresh();        
    window.requestAnimationFrame(render);

}
function refresh(){    
    ctx.fillStyle = "white";
    ctx.fillRect(0,0,canvas.width,canvas.height);    
    for(var i=0;i<pillar.length;i++)        
        pillar[i].draw();   //drawing all the pillars
    player.draw();
}
//.Rendering Methods//

//objects//
function Pillar(){    
    this.height = Math.floor(Math.random()*(canvas.height-(canvas.height*0.1))+70);
    this.width = 50;
    this.x = WIDTH;
    this.y = new Array();
    this.y[0] = 0;
    this.y[1] = HEIGHT - this.height;
    this.color = "#3f3f3f";
    this.shadowColor = "#696969";
    this.shadowOffset = 3;
    this.selectedY = Math.round(Math.random()*1);
    this.draw = function(){                
        ctx.fillStyle = this.shadowColor;
        ctx.fillRect(this.x + this.shadowOffset,this.y[this.selectedY],this.width,this.height - this.shadowOffset);        
        ctx.fillStyle = this.color;
        ctx.fillRect(this.x,this.y[this.selectedY],this.width,this.height);                
    }
}
function Player(){
    this.x = WIDTH*0.5;
    this.y = HEIGHT*0.5;
    this.radius = 20;
    this.color = "#dd3c13";
    this.draw = function(){               
        ctx.fillStyle = this.color;
        ctx.arc(this.x,this.y,this.radius,0,2*Math.PI*this.radius,false);        
        ctx.fill();
        console.log("Circle Drawn");
    }
    this.moveUp = function(){
        this.x--;
    }
    this.moveDown = function(){
        this.x++;
    }
}
//.objects//

//Main Function//
function main(){    
    var animFrameID;
    ctx.fillStyle = "white";
    ctx.fillRect(0,0,canvas.width,canvas.height);
    pillar.push(new Pillar());
//    ctx.fillStyle = "#696969";
//    ctx.fillRect(0+5,0,30,60 -5);        
//    ctx.fillStyle = "#3f3f3f";
//    ctx.fillRect(0,0,30,60);        
    animFrameID = window.requestAnimationFrame(render);    
}

My full source codes can be seen at: http://ift.tt/1LgdiTl Any help is greatly appreciated specially regarding the performance.

Thanks, Tathagata




Is there a way to automatically initialize a variable if null

I have this code in jsp:

String foo = request.getParameter("bar");
if (foo == null) { 
    foo = ""; 
}

There are multiple values checked this way, now I am by no means an expert on java or jsp but have this code on my table. In other languages I would probably be able to do something like this:

String foo = request.getParameter("bar") || "";

I was really just wondering if there is an equivalent since I have some values which all needs checking so any ideas would be greatly appreciated. (It's really not a big issue, it's mostly just my tidy side preferring not to do multiple lines of checking for null, as it makes the code harder (imo) to read).

thanks in advance.




Do I need to learn SQL before using Google app engine datastore?

I'm learning web-development. I want to use Google app engine datastore. Should I learn SQL fully before using datastore?




how to solve wordpress white blank page on blog and their admin also

Suddenly blog site got blank i am not able to find the reason why it's happen. neither my blog opening nor admin both are showing white blank page without any error.




dimanche 27 septembre 2015

Launch web app failed

Here is the web.xml:

http://ift.tt/LU8AHS">

<context-param>
    <param-name>contextClass</param-name>
    <param-value>org.springframework.web.context.support.AnnotationConfigWebApplicationContext</param-value>
</context-param>

<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>learning.RootConfig</param-value>
</context-param>

<listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

<servlet>
    <servlet-name>appServlet</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <init-param>
        <param-name>contextClass</param-name>
        <param-value>org.springframework.web.context.support.AnnotationConfigWebApplicationContext</param-value>
    </init-param>
    <init-param>
        <param-name>>contextConfigLocation</param-name>
        <param-value>learning.WebAppConfig</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
    <servlet-name>appServlet</servlet-name>
    <url-pattern>/</url-pattern>
</servlet-mapping>

Launch command: gradle appRun.

Then I try to access the web app through browser, it returns the file list(WEB-INF, resources, web.xml). It seems the spring web app is not work. Could you give me some advice, thanks.




How to keep query string parameters in URL when accessing a route of an Angular 2 app?

I have an Angular 2 test app running the latest alpha (37). There are just three routes, that look like this:

@RouteConfig([
  { path: '/', component: Home, as: 'home' },
  { path: '/errors', component: Errors, as: 'errors' },
  { path: '/about', component: About, as: 'about' }
])

I can access the routes, and when I place query string params in the URL I can read them just fine. However, a few instants after I read the parameters, I noticed that the route loads fine and the URL refreshes, removing the query string parameters.

In other words, accessing this route:

http://localhost:5555/errors?test=abc

Loads the /errors route, but right after the application loads the URL turns into:

http://localhost:5555/errors

That would be confusing to a user. I would like to keep the query string parameters in the URL.

I know, it's in alpha, but is this a bug or I forgot to set something up on the router? How can I keep whatever query string parameters in the URL?

Thanks!




Using github source control with a website

So I just want to set up Git on my server, but I'm running into a million problems so forget that.

Can I set up a normal git repo and then have my web server "auto" sync (just read, I guess) with the git repo?

I'm just part of a 2 person team and would prefer to use Git over any other version control.

Thanks




How would a webpage like this be created?

http://ift.tt/1AVwd1m

I am looking to create a website making content and displaying it similar to that seen in the link above. I would just like to know where to start.

Thank you.




Loading page with phantomjs and casperjs not working on indeed.com

Hi I'm trying to apply for jobs on indeed.com assisted by a script written in casperjs but the problem is that when i try to access

http://ift.tt/1FBHKF2

The page is not loaded. Everywhere else is working relatively good. Any questions?

Thanks




DJango unzip file when I upload?

How can i do to Unzip a file when I Uploading it?

'Cause I have to upload a SCORM file and then show it in the screen, but i can't show a zip file obviously, so I think that I have to Unzip to the show the index then. Help me, please...




MediaType of Png. HTTP request

I've a web app with some static content. For example, I've an image /images/Head.png.

Now, I'm doing a Http request to this image.

ResponseEntity<String> entity = new TestRestTemplate().getForEntity("http://localhost:" + + this.port + "/images/Head.png", String.class);

Http request to localhost:8080/images/Head.png

And I wan't to know which content has this entity. It should be image/png, but it isn't.

I get an exception here:

assertEquals("Wrong content type:\n" + entity.getHeaders().getContentType(), MediaType.valueOf("image/png"), entity.getHeaders().getContentType());

Which content shoud I write?

Thanks.




Commit HttpServletResponse without output anything

I'm working on a web project(java + jsp). In my project there is a download function, which will call HttpServletResponse.getOutputStream() to write into a output stream and download the file. And afterwards I can call outputStream.flush() to commit the HttpServletResonse, and then the page stop loading.

In another module I want the same behavior: stop loading the page. I can do it with the following code:

OutputStream out = response.getOutputStream();
out.write(1);
out.flush();
out.close();

the whole page stops loading but one file(the "1") will be download. That is not what I want. I want nothing to be download. So I tried:

OutputStream out = response.getOutputStream();
out.flush();
out.close();

But in this case the page-loading didn't stop at out.flush(), but at out.close(), and the worst thing is the whole page turn blank. I'm a noob for web programming, and I really don't understand what is happening. Could anyone explain this to me? And what I want is the page stop loading but doesn't turn blank and doesn't download anything. Thank you!




dedicated server image hosting

I'm building a web-app that is a personal project for some months now. The project revolves a bit around the idea that people can save pictures and share them. Thus I need a high storage space for my pictures. I'm totally clueless when it comes down to webhosting, I never hosted a website etc. At the moment the project is running on localhost and the images are saved on my computer. However I checked a bit some dedicated servers options and I saw the internal storage space was kind of limited (2TB or so). I also see that when uploading an image here on stackoverflow there is a little message " powered by imgur ". So I'm wondering what are my options here ? Should / Can I make an account on imgur and save in there an infinite amount of images ? Or are there other options like ( excuse my ignorance) the cloud or special servers to save images ? Reddit for instance seems to save their file on a personal server, links of images on reddit look like this : (http://ift.tt/1JwUPuw)




How to make the online viewing of documents on the site?

I have some objects in my page (such as libraries, schools, etc.). It is possible to add files to a specific object (.pdf, .doc, .xls, .png, .img). Files are stored in a file system on a server.

Now, I must implement a function for online document viewing directly on the site in the selection of the object, ie when the user clicks on an object, it opens at the bottom of the list of its documents, and when he clicks on a specific doc, it opens the online viewing.

Q: How can I make online viewing directly on the site?

There are services that are loaded in the doc and it gives you a link and you just embed code to your page, but the problem is that I have to dynamic loading docs and a lot of them.




Implementing a web system

I am trying to create a teaching/learning web system which is real-time and can be accessed on laptop, tablet, mobile and so on. It should have mainly 3 modules, which are uploading of lecture notes and videos for students to watch, instructors can write on lecture notes during lecture and students can see in real-time , 1 module for instructor to release in-class self-test or after-class self-test which can be multiple choice or short questions and instructor can get the answers(text and drawing or choices) and have a look, 1 module for a live in-class Q&A box for interaction using audio, text and drawing. How to get started on making the system , what languages to use, where to do research and how to implement the system. Please give me some idea.




2 navbar without space

I want to make something like this Two colored navigation bar

When I made 2 navbar, there is a white gap separating them, how to remove this gap?

I've read somewhere that if I change the size of the navbar's elements will automatically increase its height , but it didn't work out.

If I need to make a custom class for a navbar, what properties should I change?




change size of card-view in materializecss

I am using materializecss framework , I want to know that how I can change the size of the components in that , For example I am using hoverable card view and I want to resize its width to 400px , Here's the code I was using <div class="card hoverable small"> <div class="card-image"> <img src="images/sample-1.jpg"> <span class="card-title">Card Title</span> </div> <div class="card-content"> <p>This is simple card.</p> </div> <div class="card-action"> <a href="#">This is a link</a> </div> </div>




Trying to login to a site using Java and HTML Unit

Below I've attached the full code, this is the part where it crashes HtmlSubmitInput button = (HtmlSubmitInput) form.getInputByName("login");

The problem I seem to be having is getting the program to click the button. I right clicked on the button and used the inspect element in chrome to find the name of the button and then used getInputByName but I seem to be missing something.

**

    import com.gargoylesoftware.htmlunit.WebClient;
    import com.gargoylesoftware.htmlunit.html.HtmlForm;
    import com.gargoylesoftware.htmlunit.html.HtmlPage;
    import com.gargoylesoftware.htmlunit.html.HtmlSubmitInput;
    import com.gargoylesoftware.htmlunit.html.HtmlTextInput;

    public class GoogleRobotSearch {
     private String bUrl;

     public GoogleRobotSearch (String url) throws Exception {
      bUrl = url;
     }

     public void search () throws Exception {
      WebClient wb = new WebClient ();
      HtmlPage p = (HtmlPage) wb.getPage(bUrl);

      HtmlForm form = p.getFormByName("frmLogin");
      HtmlTextInput text = (HtmlTextInput) form.getInputByName("username");    

      HtmlSubmitInput button = (HtmlSubmitInput) form.getInputByName("login");

      text.setValueAttribute("Ziplok Java");

      HtmlPage resultPage = (HtmlPage) button.click();
      System.out.println(resultPage.asText());



     }

     public static void main (String args[]) throws Exception {
      GoogleRobotSearch xyro = new GoogleRobotSearch ("http://www.pof.com/");
      xyro.search ();
     }
    }

**




samedi 26 septembre 2015

website development with java servlet backend

I am new in the field of website development. I have created a small java application, I want to make a website where I can upload my java application along with it I also want to make a web application using java Servlet having same functionalities as my java offline application to make it work online.

I will upload the application in .zip format and I also want some download monitor feature to count the number of download. I have gone through some features of wordpress and joomla. But I found that these are php based CMS and does not support java servlets.

Please some one help me finding the right Solution to make the website. Which CMS I should choose or can I make website without CMS if yes what are steps to do that.




php read data from sql database

So, I'm trying to learn php and I can't read any data from my database! I know the connection to the server is live and working but this line seem to be giving me problems

$result = $conn->query($sql);

Where $sql = "SELECT firstName, middleName, lastName FROM Base"; I'm not sure what the problem is but any hints or answer are appreciated

<!DOCTYPE html>
<html>
<head>
</head>
<body>

<h1>My first PHP page</h1>

<?php



//connect to database
$user_name = "superUser";
$password = "";
$database = "Base"
$server = "127.0.0.5";

//open connection to the server
$conn = new mysqli($server, $user_name, $password);
//echo "Connection to the server is open";

//check connetion
if($conn->connect_error)
{
    die("Connection failed: " . $conn->connect_error);
}else
{
    print "Connection to the server is open";
}

//load the data from the table
$sql = "SELECT firstName, middleName, lastName FROM Base";
//echo $conn->server_info;
$result = $conn->query($sql);


if($result)
{
    echo "Table was found";
}
else
    echo "no";

/*while($row = $result->fetch_assoc()) {
    echo "id: " . $row["id"]. " - Name: " . $row["firstname"]. " " . $row["lastname"]. "<br>";
}
print $result["firstName"];// ": Number of Rows!" ;*/


//if ($result->num_rows > 0) {
// output data of each row



//close server connection
$conn->close();
?>

</body>
</html>




Is there a way to launch a Cinder project as a web application?

I cound't find a way to do this.

I have done this with several other things like Python programs so I was wondering if I can implement a Cinder project in a website.




Best Web Development Tool to build HTML and CSS

I've been building websites like crazy and the whole HTML/CSS thing is really tedious - especially when it comes to aesthetics of the webpage. I was wondering if there is a good tool that will allow you to build a website by dragging things on the screen and then you can edit the code once everything is in place and see the source and change the id's. I'm thinking something similar to Netbeans Design mode but better.

It would be really helpful for me because making good looking websites takes a long time to do from scratch. I know of dreamweaver, but it sounds like it doesn't have as much interactivity with the code itself, and you have to pay monthly.

Suggestions?




Q&A web with loggin

I'm a bit new in programing languages for websites, I just did some C# before and I need your help now.

I need to do an easy Q&A website where people will have some sort of questions on house association. And there will be only one person who can answer these questions - the owner of flat (the one who will be logged on). Everyone can put questions on the website and it will be instantly showed on the website. I don't need any spam protection for now, I don't even need it secured as it will be small web for few people. So any ideas how to do it the most easy way and what all languages should I use or any suggestions how to do it? Or where to look after these things? How to do that only logged person can answer the questions?

This is the example of how should it look: http://ift.tt/1LTXfFg

My thanks!




Introducing new designs and retiring old ones

What is your process for introducing new design patterns and retiring old ones in your web design. I'm looking for better ways to be sure that I am introducing new and improved design.




How to interrupt the loading of a webpage?

I know the title is a bit confusing. I will describe my task:

Now I'm writing a webpage, which allow me to download some data or do some other stuff. The front end is jsp and the back end is java. So every time when I do something on this page(e.g. sort the data or download the data), a request will be sent to java and after data processing the .jsp page will be refreshed and loaded again(of cause after sorting it should be refreshed). But I just found that if I download a data with the following code, the refreshing will be interrupted:

OutputStream out = response.getOutputStream(); // response is HttpServletResponse
doSomeOutput(out); // Just write something into OutputStream

out.flush(); // **PAY ATTENTION**. The refreshing is interrupted here!
out.close();

When I was debugging, the page was keeping loading until the third line. And then the page was not refreshed and the data was download.

I hope you can understand what I'm talking about:(

So now I have 2 questions: 1. How can I let the process keep working after out.flush();? 2. In my task I need the same behavior(the process is interrupted) in some other modules, but there's nothing to be download. So how can I interrupt the process besides out.flush();?

Thank you guys!!




Java Web Application. Spring Boot. Locating Images

I`ve recently solved a problem of locating images in this comunity. You can look here.

However, one answer said:

Your app is a Spring Boot app. I think that you can also try to use the facilities provided by Spring Boot for serving static content. Anyway, you are doing it right now because you are using webjars for css and js libs!!! Be consistent with the tech that you are using.

This means, it's recommendable to locate the images files in /src/main/resources and not in /src/main/webapp.

How could i use the facilites that Spring Boot provides me?

Thanks




What is the best way to learn HTTP?

HTTP is the protocol for the web, it's literally everywhere, evey language or platform has an interface or a way to deal with it.

I'm quite familiar with HTTP requests, responses, methods (GET, POST...) but I feel like that It's not enough and I want to dig deeper into it building blocks and how do I make the most of it when it comes to creating robust and performant web applications.

I was wondering if there's any good resources, courses, books, articles, or anything that covers HTTP and it's fundamentals that every professional developer should know.




Where do I begin creating a service status indicator for a website?

I coded a website for our business (a small computer store) and would like to have some kind of status for services we are working on. I am thinking of it as a simple search box that would somehow search a textfile? database? for a last name and return either the string "In Process" or "Completed". I can handle html/css no problem but have to idea where to or how to begin here and am not farmiliar with databases but am more than willing to learn if need be. Also need it to to be simple to update on my end, such as editing an html file and uploading or something. Thanks.




Java Web Application. Problems in locating images

I'm making a java web app, and I want it to display an image. However, it doesn´t find my image.

I`ve made a folder in /src/main/resources/images

Also, in the .jsp file, I´ve tried with the following sentences.

< img src="/src/main/resources/images/Head.png">

< img src="< c:url value='/src/main/resources/images/Head.png'/>">

Is there anything bad I'm doing?

Thanks




How to send a multipart request with php

I'd like to know how I can send a multipart/form-data encoded post request out of php. I already found this code here:

$destination = "http://ift.tt/1iSqaTy";



$eol = "\r\n";

$data = '';


$mime_boundary=md5(time());


$data .= '--' . $mime_boundary . $eol;

$data .= 'Content-Disposition: form-data; name="somedata"' . $eol . $eol;

$data .= "Some Data" . $eol;

$data .= '--' . $mime_boundary . $eol;

$data .= 'Content-Disposition: form-data; name="somefile"; 
filename="filename.ext"' . $eol;

$data .= 'Content-Type: text/plain' . $eol;

$data .= 'Content-Transfer-Encoding: base64' . $eol . $eol;

$data .= chunk_split(base64_encode("Some file content")) . $eol;

$data .= "--" . $mime_boundary . "--" . $eol . $eol; // finish with two 
eol's!!


$params = array('http' => array(

                  'method' => 'POST',

                  'header' => 'Content-Type: multipart/form-data; boundary=' 
. $mime_boundary . $eol,

                  'content' => $data


               ));


$ctx = stream_context_create($params);

$response = @file_get_contents($destination, FILE_TEXT, $ctx);

(http://ift.tt/1qgevwr) My question is: How can I define the file that should be sent? (Just to explain what I like to do: The User uploads a file with a simple http form, the php script receives it and should "resend" the file to another url). I also have to send 1 variable in a json array along with the file.

Thanks in advance for an answer

With best regards

Daniel




File not access centos web panel

I have installed Web Panel on my VPS om LAN.

I am able to access default home page of root via IP.

I have created folder for my website and past html files.

But I am unable to access this folder from browser, whereas default html page is accessible.

please help .




Handle situation when image cannot be rendered

I have spring application. For UI I use jquery.

Sometimes on our site we can see that in html exist img tag but actually url is broken.

Now we want show default image for all these situations.

How can we handle it in single place and we should hit at this place only when we want to load image.




angular js ngRoute remove # url default

i've tried ngroute and remove # from default url angular with this way:

I added this line into my config routeProvider:

if(window.history && window.history.pushState){
  $locationProvider.html5Mode(true);
}

and put inside <head> like this :

<base href="/inventoryApp/">

this way correctly and work, but i must opened url from base localhost:2205/inventoryApp, and i have link transaksi and worked if i click that, but if i opened directly from localhost:2205/inventoryApp/transaksi and i get below error -

status object not found




WWW class does not work (unity)

public class Controller : MonoBehaviour {

    // Use this for initialization
    public string url = "http://ift.tt/1iBlctx";
    IEnumerator Start() {
        WWW www = new WWW(url);

        yield return www;

        Debug.Log (www.bytes.Length);
    }

WWW class does not work, it returns 0 bytes. What's the problem? This code is the example code of www class in unity docs.




How custom domain feature in website builders works?

I want to built custom domain option in my web application, how the website builders like wix weebly configure the external domain to there website. I don't know where to start. I need some clear idea how to implement this feature.




Service listing website: What front end and back end tools would be good?

I have been learning HTML, CSS and have created basic bootstrap websites. I would like to know what technologies are needed to create a simple service listing website?




Creating translation for i18next via web application

do you know if there's some software (I'd prefer a web application) that allows us to translate languages as a team? It would be nice to assign a person to languages, so that he / she could translate the texts and an administrator could export that into a json file for the use with i18next.

I'm afraid that could be too specific but I'd try to ask anyway :)

If you don't know an application for exporting a hierarchical language file do you some more generic?




vendredi 25 septembre 2015

Strange error in Phoenix logs

I am getting following error in the phoenix webapp, I am developing. This is a simple app with few models and a page, where all models create form is added in a multi-tabbed form.

I am getting following error in the logs, However at browser's end things are working fine. From the logs also I am not able to understand what is wrong and how to debug this.

[error] #PID<0.1603.0> running MyApp.Endpoint terminated
Server: localhost:4000 (http)
Request: GET /
** (exit) an exception was raised:
    ** (Plug.Conn.AlreadySentError) the response was already sent
        (plug) lib/plug/conn.ex:428: Plug.Conn.resp/3
        (plug) lib/plug/conn.ex:415: Plug.Conn.send_resp/3
        (my_app) web/controllers/personal_info_controller.ex:1: MyApp.PersonalInfoController.phoenix_controller_pipeline/2
        (my_app) lib/phoenix/router.ex:265: MyApp.Router.dispatch/2
        (my_app) web/router.ex:1: MyApp.Router.do_call/2
        (my_app) lib/my_app/endpoint.ex:1: MyApp.Endpoint.phoenix_pipeline/1
        (my_app) lib/plug/debugger.ex:90: MyApp.Endpoint."call (overridable 3)"/2
        (my_app) lib/phoenix/endpoint/render_errors.ex:34: MyApp.Endpoint.call/2
        (plug) lib/plug/adapters/cowboy/handler.ex:15: Plug.Adapters.Cowboy.Handler.upgrade/4
        (cowboy) src/cowboy_protocol.erl:442: :cowboy_protocol.execute/4




crawler to start with Google search instead of seed page?

How can a crawler be designed to start by going to Google and entering keywords to find relevant pages to crawl... As opposed to starting with a seed page and only crawling the links from that page?




How do I update user profile? Laravel-5

Just want to start by saying I have no clue what I'm doing... I have a user_info table that looks like this

    Schema::create('user_info', function(Blueprint $table){
        $table->increments('id');
        $table->unsignedInteger('user_id');
        $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade')->onUpdate('cascade');
        $table->string('address');
        $table->string('city');
        $table->string('state');
        $table->string('zip');
        $table->text('description');
        $table->text('experience');
        $table->timestamps();
    });   

I'm having trouble creating the update controller which looks like this right now.

public function update(Request $request)
{

  $user = $request->user();
  $data['description'] = $request->input('description');
  $data['experience']=$request->input('experience');

  $user->user_info -> $data->save();
}

again...no clue what I'm doing...

and this be my form:

    <div class='col-md-10 well form-well'>
        {!! Form::open(['method' => 'PATCH', 'action'=> ['UserController@update', Request::user()->id]]) !!}
        <div class='row'>
                <div class='form-group'>
                    <div class='col-md-2'>
                        {!! Form::label('description', 'About You')!!}
                    </div>
                    <div class='col-md-7'>
                        {!! Form::textarea('description', null, ['class'=>'form-control', 'rows'=>'3'])!!}
                    </div>
                </div>
        </div>
        <div class='row'>
                <div class='form-group'>
                    <div class='col-md-2'>
                        {!! Form::label('experience', 'Experience and Skills')!!}
                    </div>
                    <div class='col-md-7'>
                        {!! Form::text('experience', null, ['class'=>'form-control'])!!}
                    </div>
                </div>
        </div>
        <div class='form-group'>            
            {!! Form::submit('Save Changes',['class'=> 'btn btn-md btn-success']) !!}
            {!! Form::close()!!}
    </div>

Any help is appreciated. Thank you!




Annotation exception with Dagger 2

I'm trying to integrate Dagger 2 as my dependency injection framework with Vaadin. However it looks like there is a possible conflict with the Guava version included with Vaadin and Dagger's Guava dependency. I've narrowed down the build command to vaadin:compile in IntelliJ which results in the following:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.0:compile (default-compile) on project vaadin: Compilation failure
[ERROR] Failure executing javac, but could not parse the error:
[ERROR] 
[ERROR] 
[ERROR] An annotation processor threw an uncaught exception.
[ERROR] Consult the following stack trace for details.
[ERROR] java.lang.NoSuchMethodError: com.google.common.collect.Multimaps.filterKeys(Lcom/google/common/collect/SetMultimap;Lcom/google/common/base/Predicate;)Lcom/google/common/collect/SetMultimap;

I've tried changing the scope of Dagger compiler in my build path to provided but still encounters the issue.

Is there a way to resolve this compile time issue between Vaadin and Dagger?




AngularJS use index from ng-repeat inside html attribute

I am looking to use ng-repeat on an image and at the same time set the id to the index of the ng-repeat loop. Is there a way to do this?

<img src="/myimage.png" ng-repeat="item in sequence" id="{{$index}}" >




ASP.NET WEB API 2.2 and ODATA v4 export to excel

I'm using ASP.NET Web API 2.2 and ODATA v4 to query against the database. The API currently returns the data in JSON format. I want to be able to export the data in Excel format. Is there anyway I can do it?

Appreciate your support. Thanks!




Technique to create static URLs and web pages for Q&A, discussion forums?

I want to create a discussion forum on my Web Site. The title of the forum should become a static URL on my website domain address. This is very similar to how Stackover flow does it. Example : If my domain address is http://ift.tt/1NZhLuj, then for every question posted on the web site, I want to create a GET request like : http://ift.tt/1iAIrUF
How to create such URLs and their corresponding pages.




Using Google Place Web Services API to display business hours in a table

I've been presented with the opportunity to development a component that uses Google Place Web Services API to display business hours of a place based on the input of the Place ID. I've read the documentation but I'm frustrated with where to begin with the code. I need to be able to get a JSON response from the server, then display the html attributes of the business hours to the user. I would also need to indicate if the business is currently open, closed or indicate if there are no business hours. Different css styling would apply to each state. Can someone that knows javascript, HTML and API's help me out with coding?

Thanks!




How to scrape images from a flickr group?

Recently for a project I have to create a scraper that can download all the pictures in a group pool. Unfortunately, I am not sure how to do this since all the pictures are by different users and none of the pictures specifically end with .jpg or .png, etc.

I have tried to use someone's github code, linked here, and the error

Traceback (most recent call last):
  File "flickr_scraper.py", line 83, in <module>
    main()
  File "flickr_scraper.py", line 73, in main
    for i, photo in enumerate(photos):
  File "flickr_scraper.py", line 37, in get_photos_for_person
    pages = get_flickr_page(nsid)['photos']['pages']
KeyError: 'photos'

I would greatly appreciate if someone could provide code, or atleast point me in the right direction, I already have a flickr API key.




Offline produce page to print from web application

I have a web application and need to print some custom auto generated pages. What I want to be able to do is to have a button and when I press it : 1) the automatically generate a page which will not be displayed at all on screen and after that 2) to send that page directly to a printer that is defined on that system.

What I thought to do, is : the print button to send an SQL query with all needed data to a database and then create a static application that will work like a print spooler, to constantly poll the database for new "printing requests" and then send them to a defined printer.

Can you please suggest of any simpler and more direct solution ?

Thank you in advance.




E-shop; Debit/credit card payment method

I want to make an E-shop with Debit/Credit card payment method included, but I dont know how to do that / what do I need.

Is there any program by bank itself to setup the payment to account i want (do I need special account in my bank?)

I'm not very experienced in these things and this is like an experiment, but I would rly like to know, even I will propably not use it now, but I might use it later, thanks for answers!




sed decodes html encoding. Need explanation how

Following sed expression decodes HTML URL Encoding (exactly as required): sed 's/%/\x/g' HTML encoding reference can be found here: http://ift.tt/1iJoiug

However, I can't get how it works. Regex seems to say: find "%" and replace it by "\x" in the string, but it does much more then that. Why does it do decoding here ?

Example:
$ echo "This%20%2C%20character%20is%20comma" | echo -e "$(sed 's/%/\\x/g')"
This , character is comma




Creating a triple-store of links using Scrapy

I'm using Scrapy to crawl over websites and create a set of links. I want to be able to create an RDF Document using this data set;

My triples will be of the form,

<ParentURL> - <HTML Text associated with Link> - <LinkURL>

Any pointers on how to proceed? Help is appreciated.




Cannot access phpmyadmin in mac pro

After following all the steps to setup the development environment , everything is working: PHP,MYSQL. When i enter the"localhost/myusername/" the phpmyadmin login page does not show up. DID you miss this symbol "~" in front of your username ????

The solution is to enter"localhost/~yourusername/" That is how I did it . Thanks




Can the size of web page forms be determined without passing the date through the browser?

For example I am automatically sending a GET-request to a specific website with python/java. Then I want to build a DOM-tree, and calculate the size (ex. length, width, position relative to (0; 0) point for my screen resolution) for the nodes, which correspond to separate "forms" on the page. Is this at all possible?

Unfortunately I am almost not familiar with web-development. The question is related to determining the "main" content of the web site (an process only this data further).




How do I pause an HTML video and resume automatically over a loop?

I have a 4 second long video embedded in my HTML page using video tag. I need to pause the video for 2 secs first at 2.99s, 3.44s and then at 4.00s. For that to happen the video needs to resume from previous instance.

But after long hours of effort I haven't been able to find a solution. Thus far I have just been able to get the video paused for >=2.99s but it does not resume even after I had used setInterval function.

Here is the code:

var vTag = document.getElementById('video');

setInterval(function() { pVideo();}, 2000);

function pVideo() {
      vTag.ontimeupdate = function(e) {
      cTime = vTag.currentTime;
      (cTime >= 2.9 || cTime >= 3.44 || cTime >= 4.00) ? vTag.pause(): vTag.play();
 };
};

PS: The video is being used as a background video for header section.




Without putting object in header or body, how can you update an object

Interview question. If you are not allowed to put your object info in header or body how can you update it?




which is best tool for web-service Virtualization?

I want to virtualize web services both soap and rest. I have worked with service virtualization tool i.e. CA LISA but found that it is too costly as well as heavy for the web service virtualization. Do we have other tools for service virtualization which are cost effective and light weighted?




How to sort mysql result by select menu

I am working on a project where i have to display data from the mysql which i have done successfully but now i need to sort the result based on high views, low views, newly added and old, all this options using select dropdown menu.

Html file

<form action="index.php" method="post" >                
    <select name="q">                
        <option value="DESC" name="DESC">High views</option>    
        <option value="ASC" name="ASC">Low views</option>                   
    </select>                        
</form>

PHP File

<?php

    $servername = "localhost";
    $username = "root";
    $password = "";
    $dbname = "movie_db";
    $q = $_GET['q'];

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

    $sql = "SELECT `title`, `poster`, `descrip`, `movie` ,`Duration`, `views`,`director` FROM `movie_db` ORDER BY `views` ".$q ;
    $result = $conn->query($sql);

    if ($result->num_rows > 0) {
         echo "<p1>";
     // output data of each row
         while($row = $result->fetch_assoc()) 
        echo " <div class=\"imgc\"><a href=".$row["movie"]."><img src =" . $row["poster"]. "></a></div></p1><p2><b><a href=" .$row["movie"].">" . $row["title"]. "</a></b></p2><br><p3><b>Duration : </b>".$row["Duration"]." Mins</p3> &nbsp; <p3><b> Views : </b> ".$row["views"]."</p3><br><div><p3><b>Description :</b>".$row["descrip"]."</p3></div><br><p5> By ".$row["director"]."</p5><br>";


    } else {
         echo "0 results";
    }

    $conn->close();
?> 

</div>

Php and html are in the same file that is index.php




How can i handle "refresh" event on my page?

I want to display a confirmation popup "Do you want to refresh this page" once user clicks "refresh". If user selects yes in popup, then page should refresh otherwise it should stay as is.

Thanks




Does google bots follow svg xlinks?

I want to make my website main page vector based and i am going to use vector shapes instead of my main menu items like this :

  <a xlink:href="mysite.com/products" target="_self">
    <text x="0" y="15" fill="red">Products</text>
  </a>

I am concerned about my SEO performance. Will google bots follow svg xlinks?




jeudi 24 septembre 2015

Как сделать Просмотр документов на своем сайте

Добрый день ! Есть на сайте объекты (скажем , библиотеки , школы и т.д ) . Есть возможность добавления файлов на определенный объект (.pdf, doc , xls , .png , img ). Файлы хранятся в файловой системе на сервере . Теперь должна быть реализована функция онлайн просмотра документа прямо на сайте при выборе объекта , т.е когда юзер кликает на объект , внизу открывается список его документов , а когда он кликает на определенный док , открывается его онлайн-просмотр . Вопрос : Как можно сделать онлайн-просмотр прямо на сайте ? Есть сервисы , в которые загружаешь док и он выдает тебе ссылку , а ты просто вставляешь код на свою страницу , но проблема , в том что доки загружаются динамично и их много .

Подскажите , пожалуйста 




how do I use eras light itc?

I have looked a similar question about this, but the answer did not work for me. I tried this code:

font-family: "Eras ITC", "Eras Light ITC",  sans-serif ;

However, my text came out bold, when I was trying to use light. Is there any link I can put in the head like with Google Fonts? I can't have the text bold. The code is on GitHub.