jeudi 31 décembre 2015

asp.net opc web trend controls are not showing

opc web trend (asp.net) controls are not displayed and showing Cross marks when configured with IIS7. Working fine in visual studio but when i publish this with IIS, it just shows cross marks. Below is the code.

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication7._Default" %>

<%@ Register assembly="OPCWebTrends" namespace="OPCWebTrends" tagprefix="cc1" %>
<%@ Register assembly="OPCWebControls" namespace="OPCWebControls" tagprefix="cc2" %>
<%@ Register assembly="Dart.PowerWEB.LiveControls" namespace="Dart.PowerWEB.LiveControls" tagprefix="cc3" %>

<!DOCTYPE html>

<html xmlns="http://ift.tt/lH0Osb">
<head runat="server">
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <script type="text/javascript" src="Scripts/jquery-1.7.1.js"></script>  
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div style="z-index: 1; left: 10px; top: 15px; position: relative; height: 616px; width: 1298px; background-color: #FFCC99">

        <br />
        <br />
        <div style="border-style: outset; border-width: inherit; border-color: #0000FF; height: 435px">

             <cc1:OPCWebTrend ID="OPCWebTrend2" runat="server" Height="379px" Width="490px" />
        <cc2:OPCWebRefresh ID="OPCWebRefresh1" runat="server">
        </cc2:OPCWebRefresh>

        </div>
        <br />
        <br />

        <br />

    </div>
    </form>
</body>
</html>




Detect CMS (Wordpress, etc.) based on HTML source

Is there some means to identify the CMS (Content Management System) which was used for creating a webpage based on its HTML source code?

Sometimes I see webpages and immediately wonder with which tool they were developed. With tool I mean CMS like Wordpress, Drupal, Typo3, etc. I could think of some fingerprinting-technique which could do that.




How can I add a button to Request Tracker GUI that triggers a custom action?

I'm working with Request Tracker and I would like to add a button when you visualize an open ticket that triggers a POST call to an external Java Server and it returns a PDF file with a report about the ticket. What is the best workaround?




Ignore url stem

I am trying to log something that is readable by appending something to the url. For example:

http://ift.tt/1NXuJUJ

In this way, I can see all the information I want in the url while also requesting the url and it still loading properly.

I don't believe there is a way to do so, but is there any way to add a similar "ignore" part to the front of the url, for example something like:

<<country=US>>https://www.google.com/

Where the browser would ignore that 'comment' ?




Web scrape in Python

I need to go to a website and input a zip code and press a button to submit it. Then the website will shows a new page where I can click an icon to download the generated excel file. I wonder how I accomplish this task in python. I am new to Web programming but know a little bit about python. I tried python requests but failed. Thanks.




More (most?) efficient cross-browser testing

We do a lot of cross-browser development, as i'm sure a lot of developers do in this day and age. With various versions of IE, Firefox, Chrome, etc. being targeted (in addition to mobile/responsive versions of sites) I sometimes find it very inefficient to load and cycle through numerous Virtual Machines to check out a SPA or website and test in various environments.

Automated end-to-end testing can only get you so far, and won't provide any visual cues in terms of how a browser may render things differently. I know there are a great number of tools (online and off, most with licensing fees) with allow the user to screencap across most browsers, but they don't handle redirects very well, if at all, and at times I really don't trust the results they give, not to mention a static shot of a website in a browser is close to useless.

I guess the real question is are there any good, efficient toolchains for cross-browser testing? What do other developers use? Is there a best solution for this kind of thing? Is using a VM the proper way?

I know this is somewhat similar to a number of questions already asked but I haven't found one with a comprehensive discussion, so apologies in advance if this is determined a duplicate.




IDE for web development using php

In the past I developed a web site using ASP.NET. I would like to develop a web site using php in the server side, and html,JS,CSS,Ajax in client side. Is there a recommended IDE for developing such a site? In fact, could someone please suggest me an IDE in order to reach my goal?




Download rtmp stream with a link

I try to download a mp4 file with a rtmp stream. I have a player(jwplayer) with a streamer and file (rtmp link) on other server. I would like to add a link "Download" which launch the download of file.

Have you an idea to make this link ? And how to download file with a rtmp link on website ?

Thanks you all,




Index.html file is named as parent directory?

I have an contact.html file on the server in public_html.If I Move it into directory named: Contact, & rename it to index.html,does browser's Address bar shows it like: example.com/Contact/ ? I mean the name of file doesn't show up. ANY help is appreciated.




How to visualize NLTK python results in web?

I'm a newbie to python. recently i have tried some python programming in NLTK. I found this website that display the output in a colorful way. similarly i need to display my output in a webpage. I find out Django and flask are some frameworks that allow python go web. However i wonder how NLTK output display in a browser. i'm very curious to get to know. please don't ignore my very basic question for the pros'.




How to make run app.js file on mywebsite.com?

I made an online multiplayer game. I works perfectly when I run it with node.js command prompt on localhost:3000. But I am having trouble making it run on mywebsite.com

In node command prompt i run app.js file directly but in my website my date base is looking for an index.html file. but I dont have index.html in that directory. I have it in my "public" folder. so when I go to mywebsite.com/public it runs index only but doesn't do anything with my app.js file. I would appreciate if you could help.

Here is some part of my codes:

my app.js file(myweb/app.js)

var express = require('express'),
app = express(),
server = require('http').createServer(app),
io = require('socket.io').listen(server);




var usernumm = 0;
var usernum1 = [];

app.use(express.static(__dirname + '/public'));
app.use('/js',  express.static(__dirname + '/public'));

server.listen(8080,'31.170.161.96');

//

/*
app.get('/', function(req, res){
res.sendfile(__dirname + '/public/index.html');
});
*/

io.sockets.on('connection', function(socket){


var endpoint = socket.manager.handshaken[socket.id].address;
console.log('***New connection from ' + endpoint.address + ':' + endpoint.port);

usernumm++;
io.sockets.emit('usernum', usernumm);
usernum1[usernumm] =  endpoint.port;
console.log('usernum'+usernumm+'geldi'+findusernum());


socket.on('button1socket', function(){

    io.sockets.emit('button1f', findusernum() );
    console.log('user '+findusernum()+' pressed a button');

});


socket.on('disconnect', function () {
    usernumm--;
    io.sockets.emit('usernum', usernumm);
    //sockets[usernum] = socket.port;
    console.log('***Client disconnected');
});




//finds number of online users
function findusernum(){
    for(var i = 0; i<9;i++){
        if(usernum1[i] == endpoint.port){return i;}else{}
        }
}


});

and my index.html file is at (myweb/public/index.html) even if I put my index.html file in the same driectory with app.js, it is not running app.js. it is running only index codes and other js codes that are not relevant to node or socket.




Barcode generator with web and mobile

I am creating a iOS app and website. Both needed to purchase a e ticket with a barcode. For iOS I have seen loads of sdks, will most likely go with zxing. What can I use with the website?

Im guessing they are both going to need to be using the same library. To keep everything uniform. Also bearing in mind both barcodes generated from mobile and web must been scannable by an iOS application.

What are your 2 cents? Are there any multiplatform barcode services I could use?

Thanks!




mercredi 30 décembre 2015

Using ffmpeg to download from youtube

Anyone know how I can download and directly convert to .mp3 from youtube using ffmpeg in node.js? Either direct code or a link to a tutorial would be appreciated. Thanks for all the help in advance




why class="btn btn-default" instead of only class="btn-default"

In bootstrap one thing that is kicking in my ass since many days is that I don't understand the concept behind the tag when including bootstrap classes in HTML.

Like -

<button class="btn btn-primary"> press me </button>

why there is two? btn and btn-primary. why we don't only include only btn-primary as we want a primary type btn only. What does it mean and what is the purpose of it ?

there are also many examples like this -

 <ul class="nav navbar-nav navbar-right">




HTMLUNIT generate all the same page, but should be dynamic

I'm learning python by doing some interesting stuff. Now I want to try some page parse by playing with Selenium. There is some site which gives promo-code if all three pictures would be the same. I have a code, and when I run

java -jar selenium-server-standalone-2.48.2.jar
python givetwo_promo.py

gives me all the same lines of result no matter how much I tried, kinda:

 -668px;  -167px;  -334px;
 0px;  -167px;  -334px;
 -334px;  -167px;  -334px;
 -668px;  -167px;  -334px;
 0px;  -167px;  -334px;
 -835px;  -167px;  -334px;
 -668px;  -167px;  -334px;
 -835px;  -167px;  -334px;
 -668px;  -167px;  -334px;
 -835px;  -167px;  -334px;

But when I run from Firefox(), and open browser firstly, there would be nice result. But If I switch windows right after driver opens Firefox() there would be all same lines too.

How to force HTMLUNIT return me different results? Or more interesting question: how to forge promos, on VPS without Xorg?




Jade Audio Output not working

Ive been trying to play music on the web using jade, however for some reason it doesn't play. Any way I can fix it? Thanks for all the help in advance!

   b
     audio(controls)
       source(src='../songs/Remember-The-Name.mp3', type='audio/mpeg')

path: users/Desktop/music-app/songs/Remember-The-Name.mp3

path: users/Desktop/music-app/views/index.jade




R Shiny: Combining with Rvest

I am trying to use R Shiny with the Rvest package so when a date is selected as an input I can lookup a webpage based on it and scrape some of the data. When I input the full address it works but when I try and combine the reactive input$date I get an error message that I "cannon coerce type closure to vector or type character" I have been searching around and have been unable to find a solution. Still pretty new to shiny. Thanks

ui <- fluidPage(
  column(4,wellPanel(
dateInput('date',
          label = 'Date Input: yyyy-mm-dd',
          value = Sys.Date())
  )),
  column(6,
     verbatimTextOutput("Name")
     )
)

server <- function(input, output){
  output$Name <- renderText({
paste(as.character(Name))
  })
  ds <- reactive({input$date})
  address <- paste0("http://ift.tt/1R9zGON",ds)
  BBPress <- html(address)
  Name <- BBPress %>%
html_node(".player-link") %>%
html_text()
}

shinyApp(ui = ui, server = server)




Flash cs6 AS3 1119 error, undefined property READY through a reference with static type Class. What should I do?

I need help. How to I fix the problem? I use Flash CS6 and AS3. Please Help me to fix it, and thanks a lot! God bless you. Happy New Year!

Output: Symbol 'cinematography_mc', Layer 'AS3', Frame 1, Line 31 1119: Access of possibly undefined property READY through a reference with static type Class.

import fl.video.*;
import flash.events.MouseEvent;
import flash.sampler.pauseSampling;

var flvPlayer:FLVPlayback = new FLVPlayback();
addChild(flvPlayer);
flash.events.Event.MOUSE_LEAVE;
if(!stage.hasEventListener("Leave"))
{
stage.addEventListener("Leave", __onLeaveThis);
}

function __onLeaveThis(e : Event) : void
{
myVideo.stop();
 }
 //The next line assumes you have copied the skin file to the directory
 //that contains the published SWF file. If you are testing the 
 //application in Flash Professional, this is the same directory as the
 //FLA file, too.


function readyHandler(event:VideoEvent):void
{
// Pause until the video can play till the end
myVideo.pause();
myVideo.playWhenEnoughDownloaded();
}

myVideo.addEventListener(VideoEvent.READY, readyHandler);

var mybtn:Array = new      Array(Movie1_btn,Movie2_btn,Movie3_btn,Movie4_btn,Movie5_btn,Movie6_btn,Movie    7_btn,Movie8_btn,Movie9_btn);
for (var i=0; i<mybtn.length; i++)
{
mybtn[i].addEventListener(MouseEvent.CLICK,clickhandler);
function clickhandler(event:MouseEvent):void
{

    if (event.target == Movie1_btn)
    {
        myVideo.source = "1_Bad Water Sequence.mov";
    }
    else if (event.target==Movie2_btn)
    {
        myVideo.source = "2_Nat Geo Clips_Red Wolf Docu.mp4";
    }
    else if (event.target==Movie3_btn)
    {
        myVideo.source = "3_News_Anthrax_Postal Story.mov";
    }
    else if (event.target==Movie4_btn)
    {
        myVideo.source = "4_Energy Ducumentary 2 min Clip.mov";
    }
    else if (event.target==Movie5_btn)
    {
        myVideo.source = "5_Wildlife_Scenic_Reel.mov";
    }
    else if (event.target==Movie6_btn)
    {
        myVideo.source = "6_Intro Title Sequence for Mt.Rushmore    Webcasts.mov";
    }
    else if (event.target==Movie7_btn)
    {
        myVideo.source = "7_PowWow Ancestry Dream Sequence.mov";
    }
    else if (event.target==Movie8_btn)
    {
        myVideo.source = "8_Fence Fixin-Western style-L.mov";
    }
    else if (event.target==Movie9_btn)
    {
        myVideo.source = "9_Docu_3 separate Clips.mov";
        }
        myVideo.stop()
    }
 }
stop();




Python Bottle website visible over network?

Is there a way to make my website accessible over the network that I'm connected to?

from bottle import route, run, template

@route('/hello/<name>')
def index(name):
    return template('<b>Hello {{name}}</b>!', name=name)

run(host='localhost', port=8080)




How to I make an API request in Python

I am trying to make an API request to my online website scraper at CloudScrape, the documentation shows the following example.

POST /api/runs/{runId}/execute/inputs/wait HTTP/1.1

X-CloudScrape-Access: ga09usdm8osdf8n9sodf

X-CloudScrape-Account: 87750c5f-7423-4438-b3f1-7b8b86990621

Accept: application/json

Accept-Encoding: gzip

Content-Type: application/json

Host: app.cloudscrape.com

User-Agent: YourApp/1.0

{
    "my_input_field": "My input value",
    "my_other_input_field": 234
}

I am trying to post the following parameters;

body, runId

So far, I have tried

import requests
import json

client = requests.session()

runID = '86df246f-8f77-47b9-9655-be61e3851839'
inputQuery = {"query": "1080p category:movies user:z0n321 imdb:3659388"}
data = {'body':inputQuery, 'runId':'86df246f-8f77-47b9-9655-be61e3851839'}
headers = {'X-CloudScrape-Access':'a41c493c2a31d068f1a06333311e52f7', 'X-CloudScrape-Account':'87750c5f-7423-4438-b3f1-7b8b86990621', 'Accept':'application/json', 'Content-Type':'application/json'}

response = client.post('http://ift.tt/1VqH5tN' % runID, data=json.dumps(data), headers=headers)

results = json.loads(response.content)
print results

I get this response {u'code': 404, u'error': True}

My scraper runs fine when I run it manually through their website. Am I doing something wrong?




Can't retrieve data from mongodb

I am trying to take a value from user in an input field of my index.html page and then using that value to query my mongodb collection to retrieve data. But as I print my returned object on the server side I see the object 'undefined' can't figure out why. I am using node, express, mongoose, mongodb, body parser.

Below is my server code.

var http = require('http');
var express = require('express');
var bodyParser = require('body-parser');
var mongoose = require('mongoose');
var app = express();
mongoose.connect('mongodb://localhost/MyDB');

// parse application/x-www-form-urlencoded 
app.use(bodyParser.urlencoded({ extended: false }));

// parse application/json 
app.use(bodyParser.json());
var FormSchema = new mongoose.Schema({

    title: String,
    degrees: [String]
}, { collection: "university" });


app.get("/", function(req, res) {
    res.sendFile('index.html', { root: '/Users/../Desktop/SimpleNode/'});
});

    app.post("/", function (req, res) {

    var queryuser = req.body.queryuser;

    var Form = mongoose.model("Form", FormSchema);


    var query = Form.find({ 'degrees':{$in: [queryuser]}});


    query.select('title');

    // execute the query at a later time
    query.exec(function (err, Form) {
        if (err) return handleError(err);
        console.dir(Form.title);

    })
});

http.createServer(app).listen(3000);

I am able to get the value from the front end as when I debug I see at the server side the value of the variable queryuser is what the user typed in. But at the line console.dir(Form.title); where I try to check my returned result object I get undefined. I even tried this by hard coding the query yet undefined.

And below is index.html

<html>
<body>

<form action="/" method="POST">
    <label>Add your search here.</label>
    <input type="text" name="queryuser" />
    <input type="submit" name="submit" value="make post req"/>

</form>

</body>
</html>




Audio is not playing in html

I have music stored in a separate folder that I am trying to play, however the music won't play. Any idea why? All help is appreciated and thanks in advance. Also trying to do the same thing in Jade so if you guys tell me the code for that, it would be great too!

<body>
    <li>
        <audio controls>
            <source src="./songs/Remember-The-Name.mp3" type="audio/mp3">
         </audio>
    </li>
<body>




urllib.request error!! no host given

Hi, I am quite new to Python and am currently learning it.So i have this small code

import urllib.request

x = urllib.request.urlopen('https:\\www.google.com')

print(x.read())

when i run it Python shouts out this error

Traceback (most recent call last):
File "C:/Users/The Kids/Desktop/urllib.py", line 3, in <module>
x = urllib.request.urlopen('https:\\www.google.com')
File "C:\Program Files\Python35-32\lib\urllib\request.py", line 162, in                    
urlopen
return opener.open(url, data, timeout)
File "C:\Program Files\Python35-32\lib\urllib\request.py", line 463, in open
req = meth(req)
File "C:\Program Files\Python35-32\lib\urllib\request.py", line 1163, in             
do_request_
raise URLError('no host given')
urllib.error.URLError: <urlopen error no host given>

Could i please get help at this.

Regards

Yousuf




My subdomain login service not working

Sorry if this has already been said before, but I didn't see it.
I am working on making a subdomain system, where each user gets a "url" and then hosts whatever their pretend side would host. I use this when doing a projects for friends, or kids learning about coding. I will list my code below, and then explain what error shows up.

<p> $> Connected to server... </p>
<?php
echo "$>  <br>";
echo "$> Term access started... <br>";
echo "$> Domain lookup started... <br>";
echo "$> Retrieving variable... <br>";
$domain = $_POST["dom"]; echo "$> Domain address received from login. <br>"; //log
$usern = $_POST["auth"]; echo "$> Login data revived from login. <br>"; //log
echo "$> Reading database... <br>";
$myfile = fopen("domlist.txt", "r") or die("$> #ERROR --> Unable to read database! Halting!"); echo "$> Database connected... <br>";
$d = fread($myfile,filesize("domlist.txt")); echo "$> Reading content from database... <br>";
$db = explode($d , ":");
//check clients address
$x = 0;
$c = count($db) - 1; echo "$> Database entity count: ". count($db) ."<br>";
$f = false;
 while ($x <= $c) {
    echo "Loop $x"; //loop read count
    if ($domain == $db[$x) {
        $f = $x;
    } 
    $x++;
}
 //check if the domain was found
if ($f != false) {
    echo "Domain found, named: " . $db[$f];
}
fclose($myfile);
?>

the messages where it echo:

$> blablah...

is a message to help the user know what is happening. When I load the webpage up, all it shows is white. Nothing pops up!

I run the server on a Ubuntu x86 (my stupid computer has trouble reading the x64 disk for some reason) with a full LAMP server installed, and running.




Where can I find beginner friendly HTML and CSS projects?

I coverd the basics of HTML and CSS so I was wondering if I can find some projects so I can pratice?




Simple MEAN Stack issue

I have a express route; router.get('/uni/:queryst', function (req, res) { var choice = req.params.queryst);}

Where basically I use the queryst value from the URL to use it to query something in my database. On the front end, I need to have an input field where the user types the choice and hits submit and then it translates to something like /uni/valuehere on the browser and sending GET to express where it gets caught by the router I wrote above. I don't know how can I make the input field of HTML turn into a URL of the format /uni/valuehere .

As for testing the code initially I was directly typing the URL manually with the value I intended to verify to check if the data passed. Well, users are not going to type URL's directly to search, they will need a form and that is what I can't get my head around to how to turn the input field into a URL in a format /uni/WhateverTheUserHasTypedInTheFieldShouldAppearHere

Thanks in advance for the help. I am self learning the MEAN stack and have come a long way. I need support of experienced developers as I am currently stuck here.




Why can't I find the link in a webpage which does exist in a domain?

When browsing the internet, I found that some files can be hidden from the webpage (I don't know if it's appropriate to say "hidden").

Say I am in a webpage:http://ift.tt/1MHdRzO, and there is no such a link findme (let just call this), at least I can't find it anywhere. But when I google http://ift.tt/1OxS7xK, it does strangely appear. How could this happen? How could it be hidden? Besides, how can I find the names/links hidden after the main domain http://ift.tt/1MHdRzO if I don't know anything beforehand?




Adding web controls to asp.net table at runtime

I would like to add asp.net literal web controls to a table at runtime at regular timer intervals. The controls will get there static values from an instance of a class that is an array.

I am not an OOP buff but from my understanding I need to declare this class once and then keep referring to the values it is storing since I will need these values to provide text values for the web controls.

Here is the thing I keep getting null reference exception thrown despite initializing not just the class as an array, but each of the items in the array of the class.

Why?...




Using js to determind which image of several images on a page?

I'm building a social network site for a college project and I need to use a javascript function to determind which image is clicked on a page of several images?




Access denied for user 'root'@'localhost' (using password: NO)?Unable to authenticate php/Mysql?

I am getting following error:

"Access denied for user 'root'@'localhost' (using password: NO)?" Unable to authenticate php/Mysql

I am getting this error using lamp server on ubuntu.

<?php
    $not_login = 0;
    if ($_SERVER["REQUEST_METHOD"] == "POST")
    {
        $servername = "localhost";
        $username = "root";
        $password = "";
        $con = mysql_connect($servername,$username);
        if ($con) {
            $db = mysql_select_db("ccmsdb",$con);
        }
        else{die(mysql_error());
    }
    $login = "LOGIN";

    $userid=$_POST['userid'];
    $password = $_POST['password'];
    //$password = md5($password);

    if ($db) {
        $query = "SELECT * FROM client WHERE   `userid`='$userid' AND `password`='$password' ";
        $result = mysql_query($query);
        $rows_count = mysql_num_rows($result);

        if ($rows_count>0) {

            header("Location:../welcome.php");
        }

        else
        {
            $not_login=1;
        }
        if(!empty($data))
        {

        }

    }
}
?>

<html>
       <form action=" " method="post">



        <h1>Log-In</h1>

      <p>   <label for="Userid">User Id:</label>

        <input type="text" name="userid">

    </p>

    <p>

        <label for="Password">Password:</label>

        <input type="Password" name="password">

    </p>
    <button>Login</button>

</form>




WSS works on http?

It is possible having a wss protocol over http ? i've read on a forum that ws work with http, but wss works only with https ? Is that true ?

Cause i'm trying to test it on my wamp on localhost, but not working




Want to create a search feature for my website

I want to search-based website like tripadvisor. In example; i want to create a similar search feature like tripadvisor's "Where are you going". I am not really familiar with this topic but I believe this could be done by Ajax,php and sql programming language. Right now, I'm looking to use free script,plug-in or tutorial to get this done. However, I can pay small fee too.Please advise




Python 3.4 - Downloading newly uploaded text files from pastebin.com

I want to download text files from pastebin.com. Once I start the program it should look for text files that are being uploaded and "download" them once they're uploaded. I know how to "download" them but not how to tell Python to click on one of the public files on http://ift.tt/1oE6iRf and then click on the "raw"-button to open a new tab that contains the "raw" content.

I googled a lot but literally nothing came up that would help me.

Thanks




How to check which links were clicked by a user on two variations in Google Analytics A/B testing experiment?

I have run a Google Analytics behavior experiment to choose a winner from two design variations of a website. I have found a winner but I wanna know in both variations which areas did the user interact when they visited one of the both web page variations. How can I do this? There are event tracking set in my website but that is an overall result that shows in that particular tab in Google Analytics. How can I filter out the specific events that the user has triggered on two versions of the same website or page? Please help.




Redirect to php page if index does not exists

Is it possible (using .htaccess presumably?) to automatically redirect blah.com/hello to blah.com/hello.php if http://ift.tt/1PwYIFY does not exist?

But if there is an index.php, I'd still like to show that without redirecting.




How to use php to store and read dictionary without json?

I am working on making a search engine, I have to store multiple data against one word, how it will be done using php without use of JSON. and is it a good approach to do this work in php or I should switch to another Object Oriented Programming Language ?




Php/Mysql login authentication

I am unable to authenticate using Php/mysql, using the following method. I used a form in order to login. Please check the following and help me out?

      //form.php


       <html>
       <body>
        <h2>Authentication</h2> 
        <form action="login.php" method="post">
        <label>Userid :</label>
       <input type="text" id="userid" name="userid" >
         <label>Password :</label>
        <input type="password" id="password" name="password">
      <input name="submit" type="submit" value=" Login ">
       <span><?php echo $error; ?></span>
      </form>
       </body>
       </html>



       //login.php

        <?php
        $message="";
          if(count($_POST)>0) 
             {
           mysql_connect("localhost", "root", "kami123")or
            die(mysql_error());    
           mysql_select_db("ccmsdb") or die(mysql_error());



           $result = mysql_query("SELECT *FROM client WHERE 
           userid='" . $_POST["userid"] . "' AND 
           password = '". $_POST["password"]."'");



           $count  = mysql_num_rows($result);
           if($count==0) {
            $message = "Invalid Username or Password!";
           } else 
              {
           $message = "You are successfully authenticated!";
             }
                }
                 ?>




full screen application without windows bars

I want to run an app on my PC that I'm going to connect it to the TV. The app should run in full screen. In the app you can view photos, watch videos, listen to audio files and read articles.

If I'm going to build it as a web application, I can run the browser in full screen. When you then start moving your mouse on the top of the screen, you will get to see the address bar, I don't like that. The app can only be closed with a button that I make, and when you are moving the mouse you don't see any windows (setting) bar.

What techniques and solutions can I use for this.

I can work well with C #, HTML5, Javascript / angular, ASP.Net etc ..




Eclipse Tomcat Java Web Project

There is a variable named "SITE_DOMAIN" saved in database and its value is http://192.168.0.71; A web project, running it on Eclipse Tomcat,I can get the correct value of "SITE_DOMAIN" from the database, while running it on Tomcat, the value of "SITE_DOMAIN" I got is http://192.168.0.61;

Does anybody know the reason?




mardi 29 décembre 2015

Sending Messages over Web in C++

I have a normal C++ GUI program that takes input from the user . Now I would like to consider this input as a message to another user over the web . How do I accomplish the same thing with C++ ? I have the complete base written . I just need to transfer the message over the Web to the specific person . If it is not possible in C++ . What is the best language choice to do so ?




Javascript lock service

I have a page which accesses Google spreadsheets. I want to be sure that multiple users don't change the sheet at the same time, however my page is just using front-end javascript with no real server component. The obvious solution is to use a lock, but without a server API to provide the lock, I'm not sure how this would work.

Are there any services which would let me do locking without needing to set up something on the server?




wget -- how to bypass robot.txt when mirroring website

I'm trying to get a copy of a website "http://www.xcn.one/", which seems to be interesting to me. So as usual, I tried:

wget -r -k -p -np -robots=off http://www.xcn.one/

But it does not work, all I get is only the index.html

However, all the articles are accessible from firefox (normal browsing by click the links)

so is there any explanations on what kind of mechanism this site is using to prevent site mirroring, and how to download it? Thanks.




Having issue with aligning a image in center of fixed nav bar when page size changes

I'm having some trouble with this wedding website I'm making for school. The problem being that the center decoration piece witch will eventually be a logo, doesn't align with the top of the page when the screen size is changed. On the screen I'm working on it looks fine, but on other screens it gets messed up.

Screen I'm working on. Looks fine. enter image description here

Freinds Screen is moved down or on other screens is cut off. enter image description here

I have tried everything from changing the position type and the display type, trying to set margins. To even setting it fixed and then positioning it where I want it, but always ends up messing something else up. The nav bar is fixed at the top of the screen and the surrounding links are aligned to it. I can't seem to solve it and am wondering if anyone has any solutions.

Here is a link to the download for the website:Website

@import url('http://ift.tt/V6Nv1r');
html{
    background-image: url("background.jpg");
    background-size:cover; 
    background-position:0px 60px; 
    background-attachment: fixed;
    padding:0px; 
}
body{
    margin:0; 
}
nav{
    background-color: snow;
    text-align: center;
    position: fixed;
    width:100%;
    margin:0; 
    z-index: 100; 
    
    -webkit-box-shadow: 0px 0px 25px -2px rgba(0,0,0,0.75);
    -moz-box-shadow: 0px 0px 25px -2px rgba(0,0,0,0.75);
    box-shadow: 0px 0px 25px -2px rgba(0,0,0,0.75);
}

section{
    padding-bottom: 20px; 
    text-align: center;
    position: relative;
    top: 60px;
    background-color: dimgrey;
    z-index:50; 
    margin-left:15%;
    margin-right:15%;
}
footer{
    font-size: 13px;
    z-index: 75;
    font-family: 'Open Sans','Helvetica Neue',Helvetica,Arial,sans-serif;
    color: slategray;
    margin-top:60px; 
    top:60px;
    background-color: #ddd;;
    height:60px;
    margin-left:15%;
    margin-right:15%; 
    padding: 20px;
    -webkit-box-shadow: 0px -4px 15px 0px rgba(0,0,0,0.75);
    -moz-box-shadow: 0px -4px 15px 0px rgba(0,0,0,0.75);
    box-shadow: 0px -4px 15px 0px rgba(0,0,0,0.75);
}


nav ul{
    text-align: center;
    list-style:none;
    margin: 0;
    padding: 0;
  
}

nav ul li{
    text-align: center;
    display: inline;
    margin:0px;
}
nav ul li a{
    margin-left:-2px;
    margin-right:-2px;
    color: slategray;
    display: inline-block;
    text-decoration: none;
    font-size:25px;
    font-family: Candara, Calibri, Segoe, 'Segoe UI', Optima, Arial, sans-serif;
    padding: 7px;
    text-align:center;
    padding-left: 10px;
    padding-right:10px;
    padding-top:15px; 
    padding-bottom:15px;
    height: 10%;
    width:9%; 
    -webkit-transition: background-color 0.2s;
}
nav ul li a:hover{
    background-color:#d9d9d9;
}
nav ul li a:active{
   background-color:#d9d9d9;
}
nav ul li img{
    z-index: -20; 
    align-content: center;
    position: relative;
    top: 75px;
    background-color: snow;
    width:20%;
    height:100%;
    margin-left: 15px;
    margin-right:15px;
    margin-top:-210px;
    padding-left:10px;
    padding-right:10px;
    padding-bottom:7px; 
    padding-top:5px; 
    border-bottom-left-radius:50%;
    border-bottom-right-radius:50%;
    
    -webkit-box-shadow: 0px 0px 25px -2px rgba(0,0,0,0.75);
    -moz-box-shadow: 0px 0px 25px -2px rgba(0,0,0,0.75);
    box-shadow: 0px 0px 25px -2px rgba(0,0,0,0.75);
}
.wedding{
    width:100%; 
    margin-bottom: 5px;
}
h1{
    background-color: snow;
    font-family: Candara, Calibri, Segoe, 'Segoe UI', Optima, Arial, sans-serif;
    margin-bottom:25px; 
    padding:10px;
    -webkit-box-shadow: 0px 0px 25px -2px rgba(0,0,0,0.75);
    -moz-box-shadow: 0px 0px 25px -2px rgba(0,0,0,0.75);
    box-shadow: 0px 0px 25px -2px rgba(0,0,0,0.75);
}
.footer-info{
    margin: 0;
    list-style:none;
    text-decoration: none;
    float: left;
}



.ui-datepicker,
.ui-datepicker table,
.ui-datepicker tr,
.ui-datepicker td,
.ui-datepicker th {
        margin: 0;
        padding: 0;
        border: none;
        border-spacing: 0;
}

/* Calendar Wrapper */
.ui-datepicker {
        display: none;
        width: 294px;
        padding: 35px;
        cursor: default;
    margin-left:20px; 

        text-transform: uppercase;
        font-family: Tahoma;
        font-size: 12px;

        background: snow;       

        -webkit-border-radius: 3px;
        -moz-border-radius: 3px;
        border-radius: 3px;

        -webkit-box-shadow: 0px 1px 1px rgba(255,255,255, .1), inset 0px 1px 1px rgb(0,0,0);
        -moz-box-shadow: 0px 1px 1px rgba(255,255,255, .1), inset 0px 1px 1px rgb(0,0,0);
        box-shadow: 0px 1px 1px rgba(255,255,255, .1), inset 0px 1px 1px rgb(0,0,0);
}

/* Calendar Header */
.ui-datepicker-header {
        position: relative;
        padding-bottom: 10px;
        border-bottom: 1px solid #d6d6d6;
}

.ui-datepicker-title { text-align: center; }

/* Month */
.ui-datepicker-month {
        position: relative;
        padding-right: 15px;
        color: #565656;
}

.ui-datepicker-month:before {
        display: block;
        position: absolute;
        top: 5px;
        right: 0;
        width: 5px;
        height: 5px;
        content: '';

        background: #a5cd4e;
        background: -moz-linear-gradient(top, #a5cd4e 0%, #6b8f1a 100%);
        background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#a5cd4e), color-stop(100%,#6b8f1a));
        background: -webkit-linear-gradient(top, #a5cd4e 0%,#6b8f1a 100%);
        background: -o-linear-gradient(top, #a5cd4e 0%,#6b8f1a 100%);
        background: -ms-linear-gradient(top, #a5cd4e 0%,#6b8f1a 100%);
        background: linear-gradient(top, #a5cd4e 0%,#6b8f1a 100%);

        -webkit-border-radius: 5px;
        -moz-border-radius: 5px;
        border-radius: 5px;
}

/* Year */
.ui-datepicker-year {
        padding-left: 8px;
        color: #a8a8a8;
}

/* Prev Next Month */
.ui-datepicker-prev,
.ui-datepicker-next {
        position: absolute;
        top: -2px;
        padding: 5px;
        cursor: pointer;
}

.ui-datepicker-prev {
        left: 0;
        padding-left: 0;
}

.ui-datepicker-next {
        right: 0;
        padding-right: 0;
}

.ui-datepicker-prev span,
.ui-datepicker-next span{
        display: block;
        width: 5px;
        height: 10px;
        text-indent: -9999px;

        background-image: url(../img/arrows.png);
}

.ui-datepicker-prev span { background-position: 0px 0px; }

.ui-datepicker-next span { background-position: -5px 0px; }

.ui-datepicker-prev-hover span { background-position: 0px -10px; }

.ui-datepicker-next-hover span { background-position: -5px -10px; }

/* Calendar "Days" */
.ui-datepicker-calendar th {
        padding-top: 15px;
        padding-bottom: 10px;
        
        text-align: center;
        font-weight: normal;
        color: #a8a8a8;
}

.ui-datepicker-calendar td {
        padding: 0 7px;
        
        text-align: center;
        line-height: 26px;
}

.ui-datepicker-calendar .ui-state-default {
        display: block;
        width: 26px;
        outline: none;

        text-decoration: none;
        color: #a8a8a8;
        
        border: 1px solid transparent;
}

/* Day Active State*/
.ui-datepicker-calendar .ui-state-active {
        color: #6a9113;
        border-color: #6a9113;
}

/* Other Months Days*/
.ui-datepicker-other-month .ui-state-default { color: #565656; }

.social {
  display: inline-block;
  width: 50px;
  height: 50px;
  margin: 0 10px;
  line-height: 50px;
  font-family: Entypo;
  font-size: 28px;
  text-align: center;
  color: #555;
  border-radius: 10px;
  background: #eee;
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
}
.wrapper {
  float: right;
  text-align: center;
}

.social {
  box-shadow: rgb(210, 210, 210) 1px 1px,
    rgb(210, 210, 210) 2px 2px,
    rgb(211, 211, 211) 3px 3px,
    rgb(211, 211, 211) 4px 4px,
    rgb(211, 211, 211) 5px 5px,
    rgb(212, 212, 212) 6px 6px,
    rgb(212, 212, 212) 7px 7px,
    rgb(212, 212, 212) 8px 8px,
    rgb(213, 213, 213) 9px 9px,
    rgb(213, 213, 213) 10px 10px,
    rgb(214, 214, 214) 11px 11px,
    rgb(214, 214, 214) 12px 12px,
    rgb(214, 214, 214) 13px 13px,
    rgb(215, 215, 215) 14px 14px,
    rgb(215, 215, 215) 15px 15px,
    rgb(215, 215, 215) 16px 16px,
    rgb(216, 216, 216) 17px 17px,
    rgb(216, 216, 216) 18px 18px,
    rgb(216, 216, 216) 19px 19px,
    rgb(217, 217, 217) 20px 20px,
    rgb(217, 217, 217) 21px 21px,
    rgb(218, 218, 218) 22px 22px,
    rgb(218, 218, 218) 23px 23px,
    rgb(218, 218, 218) 24px 24px,
    rgb(219, 219, 219) 25px 25px,
    rgb(219, 219, 219) 26px 26px,
    rgb(219, 219, 219) 27px 27px,
    rgb(220, 220, 220) 28px 28px,
    rgb(220, 220, 220) 29px 29px,
    rgb(221, 221, 221) 30px 30px;
   text-shadow: rgb(226, 226, 226) 1px 1px,
    rgb(227, 227, 227) 2px 2px,
    rgb(227, 227, 227) 3px 3px,
    rgb(228, 228, 228) 4px 4px,
    rgb(229, 229, 229) 5px 5px,
    rgb(229, 229, 229) 6px 6px,
    rgb(230, 230, 230) 7px 7px,
    rgb(230, 230, 230) 8px 8px,
    rgb(231, 231, 231) 9px 9px,
    rgb(232, 232, 232) 10px 10px,
    rgb(232, 232, 232) 11px 11px,
    rgb(233, 233, 233) 12px 12px,
    rgb(233, 233, 233) 13px 13px,
    rgb(234, 234, 234) 14px 14px,
    rgb(235, 235, 235) 15px 15px,
    rgb(235, 235, 235) 16px 16px,
    rgb(236, 236, 236) 17px 17px,
    rgb(236, 236, 236) 18px 18px,
    rgb(237, 237, 237) 19px 19px,
    rgb(238, 238, 238) 20px 20px;
}
<!doctype html>
<html lang="en-US">

<head>
    <title>Home</title>
    <meta charset="utf-8">
    <link rel="stylesheet" type="text/css" href="CSS/main.css">
</head>

<body>
    <nav>
        <ul>
            <li><a href="">Home</a></li>
            <li><a href="">About</a></li>
            <li><a href="">Gallery</a></li>
            <li><img src="img/hearts.png"></li>
            <li><a href="">Reservations</a></li>
            <li><a href=""="">Menue</a></li>
            <li><a href="">Contact</a></li>
        </ul>
    </nav>
    <section>
        <img src="img/wedding.jpg" class="wedding">
    </section>
    <footer>
        <ul class="footer-info">
            <li> <p>Made by Taylor Bastian and Danial Andales for FBLA competition</p> </li>
            <li><p>Copyright © 2015. SampleCorp</p></li>
        </ul>
       
         <div class="wrapper">
            <div class="social">&#62220;</div>
            <div class="social">&#62217;</div>
            <div class="social">&#62223;</div>
            <div class="social">&#62232;</div>
        </div>
    </footer>
</body>

</html>



How to add file attachment option in jquery?

I want to make a website of forum i want to add file attachment in text area how can i will achieve this?

give me suggestion

i searched it from google but do not understand the answers provided there.




How to send images from a webpage to a server?

I have a few images loaded on a webpage from a server A and I need to transfer these images to another server B. I cannot transfer data between these two servers directly as I do not own server A. Is it possible to do this data transfer using HTML/Javascript after it has been loaded in my browser? I do not want to send urls but images.




Is CSS data cached by the browser?

If I put all of my CSS in .. tags, will the browser cache that style data and apply it to either reloads of the same page or other pages on my web site?




Invoke the .typed() function multiple times

Okay so I'm currently programming a small text adventure game in JavaScript. Long story short I'm using the typed.js plugin to add a style to the text that appears after every input on the game. For some reason I can't figure out how to invoke the .typed() function multiple time.

I have figured out that 1. I had to change the source of the plugin to not delete what it types out and 2. That I needed to clear the data of the element that I'm invoking the function onto. So with those two things figured out I need to know how to make it not clear the element that the function is being invoked upon.




Apache rewrite from all http and from www https to https non-www, and with full URL

I'm looking for a rewrite phrase for Apache. I want to rewrite:

  • all non-www http
  • all www http
  • all www https

requests to non-www https. Also the URL after .TLD/ should be preserved.

Example:

  • http ://example.com/aaa/index.php
  • https ://www.example.com/aaa/index.php
  • http ://www.example.com/aaa/index.php should be redirected to https ://example.com/aaa/index.php

Thank you.




Dynamically hosting website from behind router

I built a small app on a raspberry pi, which, among other things, hosts a simple website to allow a user to control it from a mobile device. Currently, the website is available through the pi's ip address, which is only visible on the LAN. I'd like to make this visible from the WAN.

Now, to complicate matters, it looks like I'm going to be building a couple dozen of these devices, and they will not all be on the same LAN. What I was thinking, is to have the device register itself with a program running on an external server with a common domain name (which I currently have access to). Once registered, a user could access an individual pi via a domain-name with a device key (the program on the server would map the device key to the particular device's ip)

There seems to be a lot of web-sites describing using a domain mapped directly to a particular device, but that would require a lot of domain names, and I'd rather have things more dynamic. I'm wondering if this is the right approach, and if it is, how would I go about redirecting a web page to something behind a LAN?




Web pages with the same name but different extensions, where does the browser go?

I have multiple pages with the same name, test.html and test.php

I have my htaccess modified so that .html and .php files can be accessed without the extension attached.

I noticed that when I do it with my website, I am taken to the test.php page but is this standard or is it determined based on other factors?




Showing and clicking image url in command line [on hold]

I have a school project to make an e-shop.The products must also have an image.I doubt that it is possible to make the url appear in the product description and just click it right?




Is it possible to insert a video into the code for a website that will change into picture (e.g. slide show) for a person with less bandwidth

I want to insert a short clip (looping) onto a client's website but rather than it just not run for a person with less bandwidth (and/or on a mobile device) and make the page look messy, is it possible to implement a command that replaces the video with a preset series of picture's if the video size exceeds what that person's bandwidth can handle?




Web Profile Page Feedback?

Sorry about this if I put in a wrong place,I'm a new user here. I just start web design(I'm a graphic designer before, more print/creative direction), yeah I know many things make me feel little confused, so as a newbie in this area, I really need your help.

About this website background: This is about an online teaching,education website. The brand main color is red. They don't want to change their brand color and the site basic layout structure(it means keeping the user profile on the head of the site, the top-left-right layout structure) So what I do mostly is page visual part, not invole the site structure and IA.

Please check out this link below, it's just a mockup now: Profile Design Mockup Please let me know your thoughts, how to improved the website to make it looks more professional and easy to use? how about the font using, layout space, etc? Any kinds of suggestion is helpful. I'm really appreciate! Thanks in advance. (ps: I'm not a native English guy, so if some words using wrong, please guide me :)




Any automation tool to diff web pages showed in Browser

I’ve written a RestAPI which can transform html content without affecting web page rendering in Browser, next I'd like to test it by comparing transformed html with original html, the test gets successful result only if what they display in Browser are coincident. Can any one recommend any tool to automate the test?

Thanks




Disable JSP support

Tomcat takes large startup time due to TLD scanning, Jasper loading.

I am developing JAX RS webservice which has nothing to do with JSP hence I want to disable it. It will make Tomcat startup faster in development environment and efficient in production environment.




Django How do I render an imageField attribute of a model in html?

I'm using the right code for inserting an ImageField in my html page but it still won't render the image, showing a broken link instead. This is the code:

<img src=" {{ model.imageFieldName.url }}>

I'm using 1.8 with debug=truee on my windows machine. I'm new to web development so any explanations would be appreciatied.




need to echo one row in json encode

I have this php file and I want to echo one array that ticketnumber is located in it with json encode, in meaning I want to print only one array when isset POST the ticketnumber for this array, but I tried and every time I get error how to slove this problem in addition I used the loop (while) so is it correct for one array?

<?php
define('HOST', 'localhost');
define('USER', 'root');
define('PASS','');
define('DB', 'ala');

$con = mysqli_connect(HOST,USER,PASS,DB) or die ('unable to connect');


    if ($_SERVER ['REQUEST_METHOD']=='POST') {

        $ticketnumber = $_POST['ticketnumber'];

        $sql = " SELECT * FROM contact WHERE ticketnumber = '$ticketnumber' ";

        $res = mysqli_query($con, $sql);

         $result = array();

        while($get = mysqli_fetch_array($res))
        {
            array_push($result,array('ticketnumber' =>$get[0], 'subject' =>$get[1],'response' =>$get[2]));
        }
        if(isset($get)){
            echo json_encode(array("responseticket"=>$result));
        } else {
            echo " error";
        }

}

?>




IE 11 Developer tools - what is exactly Gap event

as per documentation, Gap – Time between response completion to page load event.

so it purely client side time - rendering, parsing and JS execution?

I am trying to use IE Developer tools to find out how much time it took at client(browser) side.

enter image description here




Are there any way to have some persistent id across request in MVC Web API

I am about to implement log into already existing API. I would like to be able to trace what happend after specific controller action was called.

So user can call http://ift.tt/1kpx56p

In the API GiveMeRandomMonkey call can be like : CallRandomMonkeyService -> DoSomeVoodoo -> CallMonkeyRepository -> ThereAreNoMonkeysLeftException

I would like to trace it all the way and in log be able to see that this reqest had id "20" so i can trace it.

Right now when user call GiveMeRandomMonkey i create new GUId and parse it all the way through the system. Are there any better ways?




lundi 28 décembre 2015

Change domain:port to domain

I've IIS instaled on my VPS . And i continue install Xampp on my VPS with port 86. Now i have address : http://domain:86/index.php for access my Website. I want to config domain without :port

Example : From http://domain:86/index.php To http://domain/index.php




How to trigger two events together : onblur and onclick

I have an html code as below

    <input type="text" onblur="abc()">
    <button onclick="xyz()">

When the focus is on the input tag and I click on the button tag at the same time, two events must be triggered -

  1. onblur : abc() - because the input has lost focus.
  2. onclick : xyz() - because the button tag has got the click.

But instead only the abc() method is triggered. And when I click again on the button, the xyz() is triggered since the focus in now on the button tag.

Can anyone suggest me a method to trigger both the events together.




How to create web widgets using HTML,CSS or any JS library

Want to create web widget ?

  1. It may contain Carousel.
  2. It may use web services to fetch the data

My main problem or I can say issue is that i want to create it as a widget which can be use in any website in the world and it will not collide with any other JS, CSS, and HTML.

User just have to use the JS and JS will create HTML, css and fetch data from web services.

Now I don't have much idea regarding JS lib. Which lib should i use so that my JS will colluide with any other JS which are already present in the page. HOw to localize my JS ?

How to create HTML and CSS with JS ?




how can i target EDGE network for my website?

My website is not open in edge network I need to detect the EDGE network for my website. 1. How can I detect edge network? 2. Is it possible to target EDGE network for my website?




Is it possible to write a backend that powers your web, android and ios app? [on hold]

So all you write for each platform is the client not the server and if its possible how can you do it.

Thanks




Is it possibile in css to link a background image based on a link that appears in the HTML of the page?

The page html has a link in it, that I want to use as the background image of the page. The problem is that there are hundreds pages all with different links in them and I want to use this stylesheet to affect them all. Possible?




Theming Material Light

I've been trying to port my website http://ift.tt/1RxIrRw to a more "Google Standard" but it's been really frustrating (thanks to Google, not well documenting stuff, as far as I can see :/).

I've been trying to theme this template: http://ift.tt/1OhBaFO but it isn't going so well. I can't even find how to change the color, which is the most important part.

So, how do I change the purple color to the hex value of #2196f3 ?

Any help would be appreciated. Thanks!




ASP.NET HTML Encoded Data-Bind and br tag

I'm trying to encode data that is to be displayed on a separate page (.aspx) after a user submits a form with their information and questions. There are both text input and textarea fields that the user can fill out.

I'm using the <%#: %> expression to place this data on the page since it does the HTML encoding, but have run into an issue with the encoding also encoding the br tags as text instead of actual line breaks.

Is there a way to make it so that the br tags still cause a line break, but leave everything else encoded using this method?

Example of user input:

Hi

This is what should be responded with.

Here is an example of the code that places it on the page:

<p><%#: ((DiscussionThread.Discussion)Container.DataItem).Text %></p>

What it currently displays on the page:

Hi<br /><br />This is what should be responded with.

Thanks in advanced!




Http 404 Spring java config

Hello i have problem with java config in spring. I was trying to complete it by learning from mutliple tutorials but still i have something wrong. Any clue ?

error

AppConfig.java

    package org.spring.mvc.libraryDemo.config;

    import org.springframework.context.annotation.Bean;
    import org.springframework.context.annotation.ComponentScan;
    import org.springframework.context.annotation.Configuration;
    import org.springframework.context.annotation.Import;
    import org.springframework.web.servlet.ViewResolver;
    import org.springframework.web.servlet.config.annotation.EnableWebMvc;
    import org.springframework.web.servlet.view.InternalResourceViewResolver;
    import org.springframework.web.servlet.view.JstlView;

/**
 * Created by wiktor on 28.12.2015.
 */
@Configuration //adnotacja oznaczajaca plik konfiguracyjny
@EnableWebMvc
@ComponentScan(basePackages = "org.spring.mvc.libraryDemo") //enable skan komponentow
@Import({AppConfig.class}) //na co musi jeszcze uwazac Spring
public class AppConfig {

    @Bean
    public ViewResolver viewResolver() {
        InternalResourceViewResolver viewResolver = new InternalResourceViewResolver();
        viewResolver.setViewClass(JstlView.class);
        viewResolver.setPrefix("/WEB-INF/pages/");
        viewResolver.setSuffix(".jsp");
        return viewResolver;
    }

}

SpringConfigInit

package org.spring.mvc.libraryDemo.config;

    import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;

    public class SpringConfigInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {

        @Override
        protected Class<?>[] getRootConfigClasses() {
            return new Class[] { AppConfig.class };
        }

        @Override
        protected Class<?>[] getServletConfigClasses() {
            return null;
        }

        @Override
        protected String[] getServletMappings() {
            return new String[] { "/" };
        }

    }

Controller

package org.spring.mvc.libraryDemo.controllers;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * Created by wiktor on 28.12.2015.
 */
@Controller
public class HomeController {

    @RequestMapping(value="/",method= RequestMethod.GET)
    public String sayHello(ModelMap modelMap)
    {
        modelMap.addAttribute("greeting","witaj");
        return "index";
    }
}

Web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://ift.tt/19L2NlC"
         xmlns:xsi="http://ift.tt/ra1lAU"
         xsi:schemaLocation="http://ift.tt/19L2NlC http://ift.tt/1drxgYl"
         version="3.1">
<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>
<listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
    <servlet-name>dispatcher</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
    <servlet-name>dispatcher</servlet-name>
    <url-pattern>/</url-pattern>
</servlet-mapping>
</web-app>




Post Form Data by [FromBody] in web api by jquery ajax

I have jquery code to create formData :

        var formData = new FormData();
        formData.append('ID', productID);
        $.each($('body').find('div.addMobile_photo input[name="photoSelect"]')[0].files, function (i, file) {
            data.append('file-' + i, file);
        });

and ajax like this :

        $.ajax({
            cache: false,
            url: home.url + 'admin/Mobile_Add/mobile/addphoto',
            data: { '': list},
            type: 'POST',
            dataType: 'json',
            contentType: false,
            processData: false,
            success: function (data) {
                // .... do something
            }
        });

this is actually my problem how to post formData to web api, and my web api code like it :

    [HttpPost]
    [ActionName("mobile")]
    [Route("api/admin/Mobile_Add/mobile/addphoto")]
    [EnableCors(origins: "*", headers: "*", methods: "*")]
    public string MobileAddPhoto([FromBody]NameValueCollection List, string ID)
    {
        foreach (var key in List.AllKeys)
        {
            var file = HttpContext.Current.Request.Files[key];
            file.SaveAs(HttpContext.Current.Server.MapPath("/product/mobile/" + ID + "/" + file.FileName));

        }
        return "1";
    }

this is problem how can i send formData by [FromBody] or [FromUri] ?




How to prevent execution an script on Chrome for Android?

I have script below ,please let me know that how can let execute it on all browsers except Chrome for Android?

Thanks

<script>var _AWLTBX_user = 1350811566</script><script src="//static-cdn.website.com/showad/aw-ltbx.js?v=0.2"></script>




How do I make a transparent background with elements behind it, if possible?

I'm sort of interested in making a website (currently learning) and I have seen some interesting effect where you scroll the content of the page, but some elements remain static.

Kind of an effect where you scroll the webpage and one part has transparent background and you see everything behind it.

You can see such effect when you scroll to the very bottom of http://www.noip.com/.

Is it possible to do using only HTML and CSS? I assume I have to set the appropriate material background to transparent (which I don't know), and set some static elements behind it.

Speaking of my testing website, here's the idea so you can understand easier. It looks like this;

http://ift.tt/1SjanuA

And I think setting that full-sized landscape picture as a static background behind all elements, and setting the background of that line to transparent would do the thing, would it?

Any suggestion appreciated.




Seemless live broadcast to youtube

I want to provide live broadcast functionality to users of my website using Youtube service but I am not sure if it is possible in a way I want or not.

That's what I want:

  1. User clicks on start broadcast button
  2. On server side, I insert Broadcast event and Live Stream for that user using Youtube Data API. (I don't want to ask user to login into his/her youtube account for that)
  3. Send some identifier of broadcast and streams back to client browser.
  4. Start sending audio/video (and possibly screen sharing) feed to that live broadcast, preferrably using WebRTC.

Is above scenario possible? If so, what kind of effort should be required to make it work with WebRTC? If, it is not possible with WebRTC, then do I need to develop android Application, browser extension etc? What are my options?




How to make a questionnaire type website?

0 down vote favorite I am looking to Build a website that answers specific based on series of MCQ questions. for example:-

      http://ift.tt/1oGtXUH

      http://ift.tt/1NSDjEk

The second example is a more accurate version of what i am trying to build. I know php, C++. if anyone can tell me how these sites are build? or what specific methods they use, it will be great.




When using wowbook with html link is changing [on hold]

I am using wowbook plugin with pdf combined in my html (jquery mobile based) project. Wowbook demo is running perfectly but when i am integrated in my project, it has some errors.

Real url is my project likes this; http://ift.tt/1QTXWG2

But url is changing and seems like this; http://ift.tt/1YK7SBa

Can someone help me? Thanks.




Retrive data from service in other template

I have a service

.factory('myService', function($http, $q) {

var deffered = $q.defer();
var data = [];  
var myService = {};

myService.async = function() {
$http.get('/*some json file from http adress*/')
.success(function (d) {
    data = d;
    deffered.resolve();
});
    return deffered.promise;
};
myService.data = function() { return data; };

return myService;
});

and controller (for user state mainly)

.controller('Ctrl', function( myService, $scope) {
    myService.async().then(function() {
        $scope.dataarray = myService.data();
    });
});

ui-router

  .state('profile', {
    url: '/user/:login',
    templateUrl: 'userprofile.html', 
    controller: 'Ctrl',      
  })

and in user.html(the parent state of profile) I used (after ng-repeat user in dataarray )

ui-sref="profile({ login: user.login})

to go to my template for specific user page called userprofile.html

The final question is how get in userprofile.html whole date from json file connected to the specified user.login that I send through ui-sref to display eg. his name, avatar etc. from one json data entry. I think I have to use a some sort of new controller to use in profile state.




How to measure traffic (bandwith) of static files on web

I am not sure how to keep track of bandwidth for a static file like imgur does (see pic below). I currently use node.js behind nginx. I consider two options. First one is; parsing nginx log file daily and writing to a database. Second one is; streaming the file via node.js and calculating the bytes send and writing the data on every instance.

The static files are video and image files with various sizes.

Is there another way that i can't think of yet?

imgur bandwidth statistics




how to create my own news feed to my website?

Well I have a website, and I wanted to add a feature of an articles that I write sometimes for my business, my website is only one page so i want some free plugin, that I will be able to add content without using any code every time, and not start creating a full php website. any idea guys? thanks..(the website is a full html no joomla or wordpress)




Searching inside a searchbox of a site and get related information

Hie, I am very new to C# and I want to search in a toolbox of a http site and get the result of that . Any suggestion? I would be very grateful for your kind help.




Push Notification from Web based application to Android

I have developed web based application using yii2 framework and MySQL database and my plan is i want to make an android app that can receive notification from my web based application real time and can pull data from it too. but i'm not sure how can make it works and using which methods i can implement this. can you give me some advise and source to learn it? thanks




How does Google find the duplicate contents in website?

How does Google find the duplicate contents in website?

Google shows the website is Deceptive site ahead error.




dimanche 27 décembre 2015

Upload and xml file and get a direct link to it

I'm working at an android school project and I need to parse an XML file on internet, but I did not find any useful sites to upload an xml file and get a direct link to use it as parameter in the URL() object.

Can anyone help me please?

Thank you, Tiberiu




Real-time web, what framework to use

Pardon me for beginner's question in web, might be vague. Context: I have a smart-phone app similar to Uber (you get the idea), so I need to build a web dashboard to see what's going on, who is serving who in real-time. I'm wondering what web framework to use. If you don't have a framework name, then what language best serve that purpose. I've heard some recommendation like NodeJS, but would like to hear more.

Btw, our back-end server is using Java, but it seems like a pain to use Java for front-end.

Thanks.




web service sample login using eclipse to create web service

I have below web application. Objective is to give success or failure message after database connection. In this application i am having one Login.jsp and loginHelper.java

Please help me. i need this help.

I hava a Login.JSP with below code.
-----------------------------------

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ page language="java"%>
<%@ page import="java.sql.*"%>
<%@ page import="com.test.loginHelper"%>
<%@ page import="java.util.*"%>
<%@ page import="java.text.*"%>
<%@ page import="javax.servlet.http.*"%>
 <% 
  String user = request.getParameter("uname");
    String pass = request.getParameter("pwd");
    int stat;
    //String dbURL = "jdbc:http://sqlserverlocalhost:1433;databaseName=acc";  
     loginHelper tc = new loginHelper();
     stat=tc.checkLogin(user,pass);
    if (stat!= -1) {
     %>
   {"status":"success"}   
    <% }else{
    %>
  {"status":"failed"}
 <%} %>

And i have one one Helper class with name loginHelper.java

package com.test;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;


//import com.sun.org.apache.xalan.internal.utils.ObjectFactory;

public class loginHelper {

    public int checkLogin(String uname,String pass) {
         int status=-1;
          Connection conn = null;
          String dbName = "Test";
          String serverip="localhost";
          String serverport="1433";
          String url = "jdbc:sqlserver://"+serverip+":"+serverport+";databaseName="+dbName+"";
          String driver = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
          String databaseUserName = uname;
          String databasePassword = pass;          
              try {
                Class.forName(driver).newInstance();
            } catch (InstantiationException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            } catch (IllegalAccessException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            } catch (ClassNotFoundException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
              try {
                conn = DriverManager.getConnection(url, databaseUserName, databasePassword);
            } catch (SQLException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }

             if (conn!=null) {
                 status=1;
              }
             else
             {
                 status=-1;
             }

        return status;
    }
}

When i run this in eclipse with tomcat 7 server configuration. in tomcat i get 505 error message please help me out.




WPF Web Application Not Showing

I'm a beginner programmer and I have been using WPF in C# to make programs. I have recently read, though, that you can make WPF apps for browsers so I downloaded .net 5 but I still can't make them. When I select new project in visual studio community 2015, it only shows WPF but not WPF Browser. If anyone knows how to get it then please tell me. Thanks!




Get spoken Language from Yahoo

How can I get the spoken language of a country using YQL?

My approach was:

select lang from geo.countries where name ="Italy"

But I always get English as language:

{
 "query": {
  "count": 1,
  "created": "2015-12-27T23:43:58Z",
  "lang": "en-US",
  "diagnostics": {
   "publiclyCallable": "true",
   "url": {
    "execution-start-time": "28",
    "execution-stop-time": "98",
    "execution-time": "70",
    "content": "http://ift.tt/1Zw5d0b"
   },
   "user-time": "103",
   "service-time": "70",
   "build-version": "0.2.369"
  },
  "results": {
   "place": {
    "lang": "en-US" // wrong language!
   }
  }
 }
}

Here you can play around with the YQL console: http://ift.tt/1PrFAuN




Creating an application using python

i want to build an application for my business that does simple tasks like keeping customer details and stock levels etc.

mostly im doing it as a project to learn more about user interfaces and the python language in general.

i have a linux server running at a data center up the road from me that has a super fast internet connection.

i dont want the application to to be stand alone.

i want the project to be worth while and spend time learning skills that will benefit me for future projects/job application.

should i make it web based? displayed in a browser or a UI that connects over the net to a server (i know either can be done, but i want to go with what is mostly being implemented today) A friend of mine told me that back end is dying and that front end application is where its all going...so i dont even know if python is suitable for this type of application implementation.

any advice or help appreciated...

thanks for reading




How to acess the cache of a website

I want to filter information out of a (cached?) website in C#.

If I download the html from this example page, I get the source for the site. Now, the page has several "tabs" labelled from 1-17 but I can't access the content from the additional tabs. As the URL does not change when I switch between the tabs I guess it caches the site and is pulling data out of it.

I viewed the source in Microsoft Edge and it gave me this:

Opening http://file/C:/UsersAppData/Local/Packages/microsoft.microsoftedge_8wekyb3d8bbwe/AC/#!001\MicrosoftEdge\Cache\QG0E4GTD\AK-47 _ Cartel (Battle-Scarred)[1]

I can't access this directory with the File Explorer. It doesn't exist after "MicrosoftEdge\" ("Hidden Items are showed" is checked).

I also looked into the Chrome cache and found this:

http://ift.tt/1MC8QZc
HTTP/1.1 200 OK
Server: Apache
X-Frame-Options: DENY
Content-Security-Policy: script-src 'self' 'unsafe-inline' 'unsafe-eval'      http://ift.tt/1KudDh7 http://ift.tt/WFqQ2C http://ift.tt/rzP4g5 http://ift.tt/1bdKvGt https://www.google.com https://www.gstatic.com https://apis.google.com; object-src 'none'; connect-src 'self' http://ift.tt/TQJakx http://ift.tt/1qnrM60 http://ift.tt/WFqQ2C; frame-src 'self' http://ift.tt/kbbG1A http://ift.tt/1ed0tcv http://www.youtube.com https://www.youtube.com https://www.google.com;
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Cache-Control: no-cache
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Length: 21181
Content-Type: text/html; charset=UTF-8
Date: Sun, 27 Dec 2015 18:26:39 GMT

00000000: 44 17 00 00 03 4f 57 00 72 b5 56 9e 7b 86 2e 00  D....OW.r.V.{...
00000010: 85 b7 6d 9e 7b 86 2e 00 2b 03 00 00 48 54 54 50  ..m.{...+...HTTP
00000020: 2f 31 2e 31 20 32 30 30 20 4f 4b 00 53 65 72 76  /1.1 200 OK.Serv
00000030: 65 72 3a 20 41 70 61 63 68 65 00 58 2d 46 72 61  er: Apache.X-Fra
00000040: 6d 65 2d 4f 70 74 69 6f 6e 73 3a 20 44 45 4e 59  me-Options: DENY
00000050: 00 43 6f 6e 74 65 6e 74 2d 53 65 63 75 72 69 74  .Content-Securit
00000060: 79 2d 50 6f 6c 69 63 79 3a 20 73 63 72 69 70 74  y-Policy: script
00000070: 2d 73 72 63 20 27 73 65 6c 66 27 20 27 75 6e 73  -src 'self' 'uns
00000080: 61 66 65 2d 69 6e 6c 69 6e 65 27 20 27 75 6e 73  afe-inline' 'uns
00000090: 61 66 65 2d 65 76 61 6c 27 20 68 74 74 70 73 3a  afe-eval' https:
000000a0: 2f 2f 73 74 65 61 6d 63 6f 6d 6d 75 6e 69 74 79  //steamcommunity

// Many more lines..

I tried to copy this into a .gz and decompress. Didn't work.

Is there a way to see the cache or the whole source?




How to get first picture from article?

Almost all RSS readers have this feature. They took first picture from article and show as thumbnail. Feedly for example: feedly what-if.xkcd.com How can i get this pictures? Is there a service w/ public API to get article body and images from page? I need implementation for Objective-C but maybe you have universal solution.




why am I getting error initiating class instance in a servlet running in tomcat?

I've checked multiple times but cant figure out why ,I am trying to run a simple servlet that returns the time ...please help

web.xml

<web-app xmlns="http://ift.tt/19L2NlC"
    xmlns:xsi="http://ift.tt/ra1lAU"
    xsi:schemaLocation="http://ift.tt/19L2NlC
    http://ift.tt/1drxgYl"
    version="3.1"
    metadata-complete="true">

    <servlet>
        <servlet-name>ts</servlet-name>
        <servlet-class>TS</servlet-class>

    </servlet>



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

</web-app>

TS.java

import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;

public class TS extends HttpServlet
{

    public void doGet(HttpServletRequest request,HttpServletResponse response)throws IOException    
    {
    PrintWriter out=response.getWriter();
    java.util.Date today=new java.util.Date();

    out.println(
    "<html>"+
    "<body>"+
    "<h1 align=center>  Date  is</h1> "+
    "<br>"+
    today+
    "</body>"+
    "</html>"
    );

    }//get ends
}//class ends

I placed the WEB-INF and classes folders in time and the time directory is under webapps , and I am calling the url as localhost:8080/time/ts

Error says this

HTTP Status 500 - Error instantiating servlet class TS

type Exception report

message Error instantiating servlet class TS

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

exception

javax.servlet.ServletException: Error instantiating servlet class TS
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
    org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:521)
    org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1096)
    org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:674)
    org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500)
    org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456)
    java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    java.lang.Thread.run(Thread.java:745)
root cause

java.lang.ClassNotFoundException: TS
    org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1333)
    org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1167)
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
    org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:521)
    org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1096)
    org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:674)
    org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500)
    org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456)
    java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    java.lang.Thread.run(Thread.java:745)




Torrent Web Player

Want to make a webpage that integrate a Web Player so I can play video torrents without any add-ons or extensions. Anybody know how to achieve something like this?




Create inbox page with angularjs and firebase

I'm developing a web application with Angularjs for my front end side and for my back end I'm using Firebase as a baaS. I'm new in Firebase and I want to ask if there is any good source about how to develop an inbox page where users can send messages one to each other.

Thanks




Yii2 - The directory is not writable by the Web process | frontend/web/assets

I have searched this issue on internet but none of them helped me. Also this one doesn`t:

**chgrp apache /path/to/mydir
chmod g+w /path/to/mydir**

My server is centos 7. Can you help me?




Floating icon above desktop

I write a c# application and I want a it to have a floating icon above the desktop(like the facebook messenger in mobile).

Ive been searching the internet but couldnt find anything usefull.. Any articles? Ideas?




How to communicate with website?

Lets say i need to grab some info from economical site, so i need to know how and wich programming language can do this:

1) Establish connection to site
2) Handle this connection
3) Read Data from site
4) Read updated information from site (site updates information via ajax, and programming language must handle connection and read these updates)
5) Can fill and send forms (simple textbox and buttons wich send request to server)
Thanks for Answers!




Developing Web Applications: frameworks

I know this may have been asked many times, but I read too much and I feel confused :)

Up to now, I developed web application mostly for myself in php interacting with Unix shell and Mysql/Pgsql. So, basically the code is "technical", meaning that the web pages do lots of things underneath but often prints an output string or nothing.

This is like when I learned C, I did lots with C but basically the console output was empty, I tried to learn C++ to interact with windows api but it was too hard; after some time I found out C# with SharpDevelop: now I'm able to quickly deploy good-looking applications without reinventing the wheel with a nice interface and without writing all by hands, thanks to the huge c# library and the capabilities of the ide to "design" the ui.

Now I'd like to do this step forward with web applications: now I'm writing all standard html by hands, using jquery to try to do something dynamic, without using css because it takes too much time to write all the styles for the dom components. Hence, I need a ide and a framework that let me to spend time to think what the application must do instead of wasting time to write all by hands. I tried also to look for new languages perhaps better than php (like java or ruby on rails) but in this way I'd need to learn that from the start: if it's worth it I'll do it but I'm not sure.

What would you recommend me? Thanks a lot, I hope I made myself clear.




Online sdk, post code manage db

I have been developing web applications for many years. SDK and dependencies are always a big problem for beginners. I did some research to find online SDK which - allows to create web applications front end - manage db - build web services - deploy live etc.

Simply, i have VPS where i want to install some software and don't want to access it anymore (build everything and manage via web browser - online sdk)

would be great to hear your suggestions (I already tested cloud9, wordpress post source code, JSFiddle)




Using ajax with acts_as_votable

I am developing a site and using acts_as_votable gem so i want to enable ajax so the user wont refresh to upvote Using ajax with acts_as_votable.




how to disable all refresh events by PHP code?

I need disable all refresh events

Example. 1. F5, 2. Mouse right click option (refresh/reload), 3. CTRL+R, 4. Menu bar -> view -> refresh and 5. URL refresh/reload button

How to disable these all events by using PHP or JS




Bad loading of page slider

Img: Web with slider

Hi, can you give me some tips how to fix this bad loading of slider ?
Web: GameSector.eu

Thank you!




Change bootstrap 3.3.6 navbar collapse breakpoint

Currently when the browser width drops below 768px, the navbar changes to collapsed mode. I want to change this width to 992px so when the browser is below 992px the navbar changes to collapsed mode.. Im using bootstrap 3.3.6

im using this code but it doesnt work for me

@media screen and (max-width: 992px) {
.navbar-header {
    float: none;
}
.navbar-left,.navbar-right {
    float: none !important;
}
.navbar-toggle {
    display: block;
}
.navbar-collapse {
    border-top: 1px solid transparent;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
}
.navbar-fixed-top {
    top: 0;
    border-width: 0 0 1px;
}
.navbar-collapse.collapse {
    display: none!important;
}
.navbar-nav {
    float: none!important;
    margin-top: 7.5px;
}
.navbar-nav>li {
    float: none;
}
.navbar-nav>li>a {
    padding-top: 10px;
    padding-bottom: 10px;
}
.collapse.in{
    display:block !important;
}

}

thanks!




How can I return the ID based from its first name and last name in autocomplete in PHP?

Here is the index.php code (i got this online, credits to the owner):

 <HTML>
 <HEAD>
  <TITLE> Ajax php Auto Suggest </TITLE>

  <link href="css/style.css" rel="stylesheet" type="text/css">

 <SCRIPT LANGUAGE="JavaScript" src="js/jquery.js"></SCRIPT>
 <SCRIPT LANGUAGE="JavaScript" src="js/script.js"></SCRIPT>
 </HEAD>
 <BODY>
 <center>

   <div class="main">
      <div class=""><a href="http://ift.tt/1ShxGVq">scriptime</a></span></div>
         <div id="holder"> 
         Enter Keyword : <input type="text" id="keyword" tabindex="0"><img src="images/loading.gif" id="loading">
         </div>
         <div id="ajax_response"></div>

   </div>
 </center>

 </BODY>
</HTML>

And here is the .php code (the config is working just fine).

<?php
include("config.php");
$keyword = $_POST['data'];
$sql = "select idPerson, firstName, middleName, lastName from ".$db_table." where ".$db_column." like '".$keyword."%'";
//$sql = "select name from ".$db_table."";
$result = mysql_query($sql) or die(mysql_error());
if(mysql_num_rows($result))
{
    echo '<ul class="list">';
    while($row = mysql_fetch_array($result))
    {
        $str = ($row['idPerson']);
        $str1 = ($row['firstName']);
        $str2 = ($row['middleName']);
        $str3 = ($row['lastName']);
        //$start = strpos($str,$keyword); 
        //$end   = similar_text($str,$keyword); 
        //$last = substr($str,$end,strlen($str));
        //$first = substr($str,$start,$end);

        $final = '-'.$str.' '.$str2;

        echo '<li><a href=\'javascript:void(0);\'>'.$str.' - '.$str1.' '.$str2.' '.$str3.'</a></li>';
    }
    echo "</ul>";
}
else
    echo 0;?>      

THIS IS THE OUTPUT: If I click the value, I want that the textbox would return its ID only. How can I do that? I really need help. I still suck at this.




samedi 26 décembre 2015

adobe arabic font does not show correctly in web

I create a website and i use adobe arabic font in this page, I installed the font on my pc and it works well in ms word , but when i add it on my web page the 'ه' does not show correctly, how can i fix it and what is my problem?

problem in web page

The same text typed with same font in word




Emergency!! Need help uploading XAMPP website to web server

So I made a website using XAMPP (PHP website that has login functionality and connects to a database on Amazon Web Services) and I am using MySQL as the database language. To connect to my website, I just go to: http://localhost/users/index.php

So now, after the website has been made, (login works, and gets the specific information from the AWS database corresponding to that user, and I've done all the testing already) I then uploaded all the files inside the users folder into a directory in the web server (using Netfirms as the host) but I get the following error:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Can anybody please help me with this? I need the website live by year end and I am freaking out!! Please and thank you all!




What should I write a facebook autocommenter in?

I have an running joke with a friend in that whenever he updates his profile picture, I immediately comment 'angkor wat' in his profile picture. I am thinking of writing a little script or robot that will do it for me. I don't want to use python because I'm looking to use something new that I haven't done before. Any suggestions?




Retrieve user's image selection from website

I am trying to make a website where the user needs to pick one image from a selection presented on the site. When the user selects a picture, i.e. clicks on it, I somehow need to retrieve the name/ID of the selected photo, and have this available on the server.

This is because I must run a bash script on my server, with the selected image ID as input.

What is the simplest way this can be achieved?




Parse - About sessionToken and be logged in to few devices at the same time from the same user

There is a way to login to the same user from different devices? I have an Android app and web app and I want to be able to be logged in for both apps at the same time. I'm getting error 209 "invalid session token" when logged in at the second app(web or android). I'll glad to get some information about that error and how can i solve my problem. Thanks!




Web developer questions - Aurelia framework

I have questions about Aurelia javascript framework, css and other basic questions that I need to clear off my head. I have come to that point where I want to stop doing web development because I feel like struggling too much. I am still at a young age, and I know I can do this by forcing myself to get the answers I need to continue my journey. (I know some basic javascript, and I have now moved on to Typescript with Aurelia framework.)

I have gone through the get started docs for Aurelia, and I have tried to explore the Aurelia framework. But the more I explore, the more advanced it gets.

  1. Why is jQuery included in Aurelia? I thought jQuery was another Javascript framework?Screenshot
  2. What is bootstrap actually? What does it mean by Bootstrap w/Less and Bootstrap w/Sass?
  3. What differs ASP.net from Node.js?
  4. What is Dependency Injection? (Any video suggestions?)
  5. How do I convert javascript to typescript?

I appreciate for every answer I get, if not all. I am shy, even on the internet. I want to learn, but too afraid my questions are too stupid or too easy. If anyone has a book about learning typescript or in general about web development, I'd be happy to know. Also if there is something else I can do to improve myself in web development, be open-minded and come with examples.




Django 1.8 reports library

I need to generate reports in my Django project, I tried django-report-tools but it has incompatiblity with Django > 1.6 versions.

Can somebody recommend one that works with 1.8?

The reports I need are very simple, pie charts, bar charts and the like.




I need to find external API service which get me words with sound similar

I'am looking for external free service with API, which gives me words which sound similar with my word. Could somebody help me? Does anybody use this kind of thing?




How to get the bar names from Google Chart api

I am stuck for a couple of days!
I making an app that show cat breeds and when they are discovered in europe.

This is my code:

Since I can't post my code here because the forum want to reformat it.
Check my Google drive:
My code
http://ift.tt/1OeOsCZ

And It returns a good looking chart that looks like this:
The Chart

What I trying to do is getting the name that's inside a bar of the timeline. As an example, if I click on "pers(ion)" , I want to make dynamicaly a div with more information about the pers(ion). But because it doesn't get a class or id I can't get it.

Does anybody now an easy way do do this?




How to resolve assembly version references conflict easily and what are the best practices

I know this has been discussed for individual scenarios, but as a novice to web development I feel it is ok to ask. I started learn web in .Net platform, then I felt that it is a nightmare to resolve conflicts related to assembly references if you are using old applications.

For example when I try to learn through an online course which had sample files, but most of them had old version numbers for assemblies used (eg - Web.Mvc, Web. System.Web.WebPages, System.Web.WebPages.Razor). So I had to go and load the newest assemblies first from Nuget ( I do not know how to load an old version with nuget gui client. maybe have to try in command prompt) and then correct each and every place in .config files (web.config) to use those versions.

I think this is not a good approach when migrating a large application or try to use old applications in a new VS IDE.

I have few questions

  1. I would like to know what are the ways of resolving assembly version mismatches?

  2. What is the use of public key token specified in references. Although I changed version no I did not change the public key. But they worked. What is the connection between each assembly and public keys?

  3. What are the best practices when using such assembly information .config files where we can easily move the application between different machines/servers with different versions(probably a higher version).




D3JS - Display both circles and triangles in a scatter plot

I have a dataset displayed on a D3JS scatter plot. Basically, points of the dataset are (x, y, category) and I would like to plot "Category A" as orange circles and "Category B" as blue triangles.

[TODAY] colors are ok but all points are circles :

[ ... ]
      var color = d3.scale.ordinal()
          .domain(["Category A", "Category B"])
          .range(["#f76800", "#000066"]);

  // draw dots
  svg.selectAll(".dot")
      .data(data)
    .enter().append("circle")
      .attr("class", "dot")
      .attr("r", 7)
      .attr("cx", xMap)
      .attr("cy", yMap)
      .style("fill", function(d) {
           return color(d.category);
      ;})
[ ... ]

I found this thread Triangle scatter plot with D3.js so I was trying - with not much success - something like :

[ ... ]
      var color = d3.scale.ordinal()
          .domain(["Category A", "Category B"])
          .range(["#f76800", "#000066"]);

  // draw dots
  svg.selectAll(".dot")
      .data(data)
    .enter().append((d.category == "Category A") ? "circle":"path")
      .attr((d.category == "Category A") ? "CIRCLE attr":"TRIANGLE attr")
      .style("fill", function(d) {
           return color(d.category);
      ;})
[ ... ]

Is it a reasonable try ?

EDIT : Attempt

[ ... ]
  svg.selectAll(".dot")
      .data(data)
    .enter().append((d.category == "A") ? "path":"circle")
    .attr((d.category=="A") ? ({"d":d3.svg.symbol().type("triangle-up"), "transform":"translate(" + xMap + "," + yMap + ")"}):({"class":"dot", "r":7, "cx":xMap, "cy":yMap}))
      .style("fill", function(d) {
           return color(d.category);
      ;})
      .style("opacity", .95 )
      .style("stroke-width", function(d) {
            if (d.category == "A") {return 0.95}
            else { return 0 }
      ;})
[ ... ]

Result : "ReferenceError : d is undefined" in Firebug console

Edit 2 - data subset

May this help : to see the full code, here is the actual website : http://ift.tt/1J9AK3Z . Note that field "d.category" mentioned here for educational purpose, is in fact "d.site".

Data subset : Data come from a MySQL request, fields include : "prix" (for Y value), "date" (for X value), and "site" i.e. category above. Other fields are irrelevant here. Please find a data subset here : http://ift.tt/1OlWJkm




Vertical scrollbar fades off on mobile Chrome browser (if not touchmove), a true?

Context :

The behavior described here seems to be the default one for Chrome for Mobile (I have not found anything in my code which can be linked with what I observe ; while I am developing a website which supports both most of devices PC and mobiles).

Fact

On mobile devices, the vertical scrollbar is not shown permanently for scrollable elements. This is a great difference of ergonomy opposite to PC environment (If the scrollable content and sized larger than the container then the scrollbar is permanently shown - overlay-y:scroll; -)

Details

I observe on mobile with Chrome that it is only when a "touchmove" event is issued into the element that the scrollbar appears and fades off when touch is ended.

Why a problem ?, Interpretation and point of vue

This can be a meaning information but different from PC and I think that it creates a lack and I am seeking to a good solution.

There is nothing which indicates to the user that the content of element is scrollable. Sometimes it is obvious but not always.

What say the scroll bars in the two cases ?

  • On Mobile the given information is : when you perform a touchMove : you are using a a scrollable zone" and the visible zone is "the length of the bar regardless the height of the element.

  • On PC the given information, is always "here is a scrollable zone" and the visible zone is "the length of the bar regardless the height of the element.

So the problem is, in my opinion, to add, in mobile use case, the information : this is a scrollable zone (So necessarily using a symbol because of the need of the optimization of the space).

What is the best way to do it ?

Best regards

Trebly


Note 1 : I got the (common) case when the content of top elements in scrollable viewport (a viewport into a general viewport) could be alone : the user doesn't understand that there here something else available to access by a scroll.

Note 2 : It is possible using js (and JQ) to check sizes and CSS parameters to show an icon (for example add .element-container::before { content: icon; }), but it not at all a light solution . As the icon, that I could develop, would not be a standard... there is no for now good solution, isn't right ?




Disable google search input focus

I'm trying to develop chrome extension to save users favourite urls, so user will click in a button and a popup will appear infront of the website he is visiting allowing him to save his url. The point is when this popup is been shown while user vistiing google.com, user can't write anything in the popup because google's input is automatically in focus so what should I do to disable this behavior? enter image description here

Note: This is only happening with google.com




Resources for web development?

I want to start learning web development(front end especially). Could you tell me some good, very good sites to learn? I know w3schools, codeacademy. Is there any other resources? This question is for the developers, because I know you had learned on the internet, but what sites had a good impact for you? Thank you and have a Merry Christmas!




How can I use a function in server.R using R, shiny?

I just started using shiny to design an app.

How can I design a function in server.R and use it?. For example, here is my code:

  datatable <- reactive({
    inFile <- input$file1
         if (is.null(inFile))
        return(NULL)
      read.csv(inFile$datapath, header=input$header, sep=input$sep, quote=input$quote)
  })

So, here, datatable is a reactive object storing a data.frame from the .csv file.

  output$singletable <- renderDataTable({
    a <- subset(datatable(),!is.na(datatable()$actualfailureyear))
    b <- count(a,c(input$sfactor))
    c1 <- datatable()[!duplicated(datatable()$AssetID),]
    c <- ddply(.data = c1,.variables = input$sfactor,function(x){sum(x$length)})
    d <- merge(b,c,by=input$sfactor)
    e <- ddply(.data = d,.variables = input$sfactor,function(x){data.frame(failcount=x$freq,length=x$V1,failrate=x$freq/(x$V1*0.00001)/21)}

I will use the code a-e all the time, so I really need to put them into a function and use it anywhere I want. Could you please show me how to do it with more details?