lundi 30 novembre 2015

Should tag be placed as high as possible in website?

I'm implementing the new dns-prefetch tag for my web application and I wonder where I should place it in the <head> tag?

Should I place it as the first tag in <head> so that browser immediately starts prefetching DNS?

<html>
 <head>
  <link rel="dns-prefetch" href="//ajax.googleapis.com">
  ... other tags ...
 </head>
 <body>
 </body>
</html>

I can't find a good guide about this tag.




My website doesn't work

I think the problem is about Resource Usage :

"Your site might hit resource limits soon You had 5120 I/O usage out of 5120 max I/O usage allowed".

Well, now the I/O Usage is at 0/5 mb/s but I can't access the website. Why the site doesn't work and what can I do for this situation does not happen again?




jsp pageContext.forward with parameters in url makes error

<% pageContext.forward("controller.jsp"); %>

I checked this code is working properly.

<% pageContext.forward("controller.jsp?test=hi"); %>

<a href="controller.jsp?test=hi">

but these codes make http 500 error.

pageContext.forward with parameters in url makes error

please let me know what is the problem.




Conveyor Belt Effect

I'm creating a website for a machinery company, specifically in the sale of parts - I want to make a cool conveyor belt style thing going across the entire page and behind a logo in the center, the effect I'm looking for is essentially what was done in this

http://ift.tt/1Rik1gp

<div class="container">
  <div class="row cycle-slideshow" data-cycle-fx=carousel data-cycle-timeout=1000 data-cycle-carousel-visible=6 data-cycle-carousel-fluid=true data-cycle-slides="div">
    <div class="span2"><img src="http://ift.tt/1ydQ84e"></div>

But I need there to be no gaps between pictures. Any ideas? I tried messing with the code they supplied but with no results. If anyone knows of a simpler solution please let me know! I literally just want the image to move left, pause for a second then keep moving and each image will be a bit of the conveyor belt with a part on top of it - this is the kind of image ill be moving along the belt http://ift.tt/1Rik1gr

Thanks guys!




Prevent browser from reloading main page after mouse event

I have a web page that allows me to send serial commands to serial port on my raspberry pi. Main page is in html and its have images in it, and when i click on image javascript calls cgi file that sends command to serial. Everything is works fine on desktop browser, when i press on image im staying on the same page, but when i do it on iphone or ipad its redirecting me to location of cgi file. Here is my code 1. HTML

<img src="img/sound.png" alt="sound" id="sound_b" ontouchstart="changeImageSound()" ontouchend="changeImageSound()">

2.JavaScript

function sound() {
document.location="helpers/sound.cgi";
}

3.cgi

#!/usr/bin/python
print "Status: 204 No Content"
print "Content-type: text/plain"
print ""
import cgi
import serial
import time

# Open a serial connection to Roomba
ser = serial.Serial(port='/dev/ttyUSB0', baudrate=115200)

# Assuming the robot is awake, start safe mode so we can hack.
ser.write('\x83')
time.sleep(.1)

# Program a five-note start song into Roomba.
ser.write('\x8c\x00\x05C\x10H\x18J\x08L\x10O\x20')

# Play the song we just programmed.
ser.write('\x8d\x00')
time.sleep(1.6) # wait for the song to complete

# Leave the Roomba in passive mode; this allows it to keep
#  running Roomba behaviors while we wait for more commands.
ser.write('\x80')

# Close the serial port; we're done for now.
ser.close()




System.Data.SqlClient.SqlException: Invalid object name 'GEO.AspNetUsers'

I developed the WEB API and a login page by VS2013, the database used by the WEB API is on the Azure cloud, i run the WEB API and login page direct from the VS2013 on my laptop, and they can work quite well(i can register user and login by calling the WEB API).

But once i publish the WEB API and the login page to the Azure Web APPS, and tried to login from there, i got the error as below:

Invalid object name 'GEO.AspNetUsers'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: Invalid object name 'GEO.AspNetUsers'. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.**

I'm pretty sure that the table 'GEO.AspNetUsers' is exited in the database, and the database connection configured in the web.config is never changed.




Editing orders dont work 2.0.1.1 or sales order not deleted on openchert

trying to delete sales order so it is not working. When try to click in update order button not do anything some time give me jose error




Do web servers normally limit how much hardware resources you use?

Hello there I am currently with a host known as Site5 and they have a limit on how many "resource points" I can use. On this site, resource points are a measurement on how much hardware resources I have used. A good way of putting this into perspectives is for each query with 5 cols and 100 rows will use 1 point, and per day I'm limited to 250 points.

Since I've never used other web hosts, do other web hosts limit these sort of things?

Cheers, Joshua




How to maintain information from a database on a jsp page?

I'm writing some not very complicated web application using servlets and jsp but there's some issue I still couldn't resolve. On the jsp page I've got multiple forms filled out with information retrieved from a database. Also there's several commands that modify this information (add, delete, submit, clear). If I click the "Add" button a request is sent to the servlet which invokes some of DAO methods and forwards the request to the same jsp page with updated "dishes list". It seems that all works just fine but what the hell should I do with the other forms (like the menu) cause this information is being removed after refreshing. What is the best way to maintain all that information on the page? Should I send all that stuff with every command?




When a class that handle Web Service dies?

I have a Spring Web Service created by .wsdl file. there is a class that has the Web Service's methods. I want to add a list to this class and I need this list to be alive for the life of application. My question is what is the scope of the class that handles the Web Service's method. is it application scope???




What would the tech stack be for designing a data visualization website?

What would the tech stack be for designing a data visualization website like:

Every post on these sites accesses different data sources to build a D3JS visualization. How would the data be stored and accessed for different posts? Also, I am unable to figure out if they built the website using blogging platforms like Wordpress or did they design the website from scratch or did they use a static website generator?




Https url is not working but http url is working fine in android

Please guide me to find the problem in this code, when i use url with HTTP then it works fine but with HTTPS it's giving problem.I have googled but couldn't find a solution. It would be appreciable if someone guide me to save my time Thanks

public String doRequest() {

    String serverUrl = Constants.BASE_URL + mAction;
    Log.d("usm_serverUrl",serverUrl);
    if (mParams != null) {
        serverUrl += "?" + mParams;
    }
    Log.d("usm_serverUrl",serverUrl);
    try {
        URL url = new URL(serverUrl);
        HttpURLConnection conn = (HttpURLConnection) url.openConnection();
        conn.setRequestProperty("User-Agent", "application/json");
       // conn.setRequestMethod("GET");
        if(conn.getResponseCode() == HttpsURLConnection.HTTP_OK){
            // Do normal input or output stream reading
            Log.d("usm_requestCode","Successful");
        }
        else {
            Log.d("usm_requestCode","Failed");
           // response = "FAILED"; // See documentation for more info on response handling
        }
        //HttpURLConnection conn = (HttpURLConnection) url.openConnection();


        InputStream in = new BufferedInputStream(conn.getInputStream());
        Log.d("debug", "get-url: " + serverUrl);
        String response = IOUtils.toString(in, "UTF-8");
        Log.d("debug", "get-url: " + serverUrl + "\n post-response: " + response);
        return response;
    } catch (MalformedURLException e) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
    } catch (Exception e) {
        e.printStackTrace();
    }
    return null;
}




Splitting Webdesign and Logic?

We are planning to develop a small website with HTML and JS...

Is it reasonable to split the development of the "GUI" and the "logic"? E.g. having two different teams, one team only doing the HTML/GUI part, the other team doing the JavaScript/Logic part.

Or is it better to have teams doing complete "components", e.g. the Login View with its GUI and the Logic needed to perform a login?




How to add a max-age/expire to a transient (session) cookie

I'm using standard HTTP transient cookies (that is, cookies without a max-age/expire parameters, that expire after the user closes the browser) to track users session.

This solution works good, and easy to implement, but doesn't handle the case where a user "never" closes his browser (for example a user that always put his computer in standby without closing the browser), and the transient cookie doesn't expire.

I know that in HTTP standard there isn't a way to force a transient cookie to expire when the user closes his browser OR after a specified timespan (example: six hours). Is there a sort of "best practice" to handle the expiration of a transient cookie after X minutes/hours/day?




angular (js) alert with a large image

I have a project which involves crowdsourcing elements. As part of that, I would like it when a user enters a specific html page, that they will be prompted with a nice alert, with a "large" (Hi-Def, nice detail) image, a question below it, and a "Yes"/"No" choice.

I have reviewed SweetAlert for this, but the images are very small and unclear in it: Example of what I see when I use SweetAlert with my image

Is there any way to use SweetAlert with a larger image, or a different solution to this problem?




Changing div text layouts the whole document

I want to change the text inside a div with javascript (jQuery is ok too).
There are a few to do that:

element.innerText  
element.innerHTML  
element.textContent  
$(element).text()  
$(element).html()  

But when I use the above methods, the whole document is affected and not only the div.
See chrome timeline below which refers to this fiddle

Is there a way to update the text inside the div without affecting the whole document?

enter image description here enter image description here




Invalid object name 'GEO.AspNetUsers'

i developed the WEB API by VS2013, the database used by the WEB API is on the Azure cloud, i run the test page on the VS2013, and it can work with the WEB API quite well.

But once i publish the WEB API and the test page to the Azure Web APPS, and tried to access the WEB API by the test page, i got the error as below:

Invalid object name 'GEO.AspNetUsers'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: Invalid object name 'GEO.AspNetUsers'. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

But the object is really existed in the database, i have no idea why the server told me this error.




How to deduct one day from the date in xpath?

I write automated tests using SOAPUI free version. I have such format of date which I take from sql database:

2015-11-30 13:38:58.387

I need to convert it to a ormat like:

2015-11-30T13:38:58.387 or 2015-11-30

And deduct one day from it, so that to get the date minus one day.

I tried to use previous-day()function and substring-before() (using XPath):

previous-day(substring-before((//*:Results/*:ResultSet/*:Row/*:VALIDFROM/text()), ' '))

But it always gives an error like:

net.sf.saxon.trans.XPathException:XPath syntax error at char 87 {../*:Row/*:VALIDFROM/text()..}: Unknown system function previous-day()

Why doen't these functions work?

Thank you




How do I get a value from query and add the value by 1 on Rails

I really appreciate any respond for this simple question.

test = Model.find_by_sql("SELECT number FROM tbl_one LIMIT 1").each do |a| p = a('number') puts p end

Look, I mean, after store a value to 'p', how do I add the 'p' value by 1. Hide Copy Code

puts p + 1

I tried it but doesn't work. Based on what I saw, the 'p' doesn't really store the value, but I don't really sure. Anyway, I'm new on Ruby and Rails

Any solution? Thanks.

Note: I asked this question in ^cp also. Just to make sure quick responds. Thanks.




Website Design to upload and share large file size

I am planing to design a website for our company employee and extranet / visitors use. I need to allow them to upload, share uploaded link, and download any documents that they need with any restriction to the size of the document. Also by allowing only internal employee to create any dummy user credentials to share it with the visitors just to allow them to use in uploading any needed documents by our employees.

I tried that using sharepoint and i stuck with it and IIS with a restriction of maximum 3.99 GB size of uploaded files.

Which web design application could help me in achieving my needs, and may you advice me with a proper / General Guide line to fulfill my needs ?

Is there is a ready template which i can use and you could advice me with to acheive my needs?

Thank you in advance!

by

L




How to solve "the connection was reset " while loading my website ?

I have developed a website(still under construction) named www.drissho.com . I hosted it 1 month ago , but everything was all right till yesterday. After adding a banner(120 kb) and some other changes everytime my website loads the firefox browser says

"The connection was reset

The connection to the server was reset while the page was loading.

The site could be temporarily unavailable or too busy. Try again in a few moments. If you are unable to load any pages, check your computer's network connection.

If your computer or network is protected by a firewall or proxy, make sure that Firefox is permitted to access the Web."

I know a solution of cleaning cache of mozilla firefox , but it's work only once.the second time it display the same message again.

What should I do , Is it my browser problem or my coding or logical problem or banner image size(120kb) loading problem ... Please help.




Domain name without www is not working

Everything was working perfectly, but now, without www I end up with the following page :

f493168dba83126a

I am using cloudflare and it redirects to the same ip, and here is my apache configuration for this website

<VirtualHost *:80>
    ServerAdmin contact@domain.com
    ServerName domain.com
    ServerAlias www.domain.com

    DocumentRoot /var/www/domainfolder
    <Directory />
            Options FollowSymLinks
            AllowOverride All
    </Directory>

With of course domain replaced by my domain.




Why dont number ,square and cube show when I run the code?

Im studying javascript with a book and there is this exercise: Calculate the squares and the cubes of the numbers from 0 to 10 and display values in an html table. They are supposed to display like this : Table

My code is this :

<head>

<script type="text/javascript">
<!--
var square;
var cube;
document.write("<table border='0'>");
for (var number = 0; number <=10; number +=1){
    square = number*number;
    cube = number*number*number;    
    document.write("<tr>");
    document.write("<td>");
    document.writeln(number);
    document.write("</td>");
    document.write("<td>");
    document.writeln(square);
    document.write("</td>");
    document.write("<td>");
    document.writeln(cube);
    document.write("</td>");
    document.write("</tr>");
}   
document.write("</table>");         
// -->
</script>
</head>

Problem is,when I run this I dont get the title which says Number Square Cube

I only get the numerical results...where is my mistake?




Entering text in website textbox using c#

I am trying to automate fill the textbox of a website in c# and i used:

 private void button1_Click(object sender, EventArgs e)
    {
        System.Windows.Forms.WebBrowser webBrowser = new WebBrowser();
        HtmlDocument document = null;
        document=webBrowser.Document;
        System.Diagnostics.Process.Start("http://www.google.co.in");

        document.GetElementById("lst-ib").SetAttribute("value", "ss");
    }

I am getting An unhandled exception of type 'System.NullReferenceException' and the compiler is not processing the last line of the code. I have also tried innertext instead of setAttribute. I am using console application.




dimanche 29 novembre 2015

Is there any way to start external application and get pid of application and kill them using java or php

I need to start any application using java and get their pid and then using pid kill them using java code or php code in Linux env




How should I use div to effectively align content on a page?

I want to use div to align content on my page. Suppose I want to align a menu on the left (20% of the page) and an article on the rest of the space on the right (80% or less). I am currently creating two divisions inside a single div and floating left and right and setting widths in percentages. This method works sometimes and sometimes it doesn't work. Some friends suggest that I should use tables. Should I? I think tables are just a short term solution and don't follow the actual way of coding a page. Is there any other, more efficient, way?




I wish to run my own DNS server, but am not too technology advanced

I have been trying to use DNS software, but am unable to understand anything the thing said, or asked of me. I am running a personal network, for me and friends when doing competitions, and I also love the fact of running a virtual economic simulation. Short Hand: I want to make a DNS server, but I am unsure how to. Does anybody know of a DNS hosting software even the most basic tech noob could use.

Sorry I've been hard to understand.




Is meteor.com made with Meteor?

I'm new to Meteor so I would like to know if I can look at meteor.com as an example of what can be done with Meteor or if it's made using other web technologies.

Since such website is more like a set of static pages rather than a single-page web application (I think Meteor is more suitable for the second one), I think the answer is no but perhaps I'm wrong.




Google technical mechanism for chilling effects or lumendatabase.org

How technically does Google eliminate search results? What is the technical mechanism that stands beyond it? How does google eliminate pictures from search results? Is there a way to retrieve back results that Google hide both from search results and from pictures? I heard that there are some web sites which index back the missing results how can I find them?




How to add single option tag data to other HTML pages?

For example:

**index.html**
<body>
<option><select>1></select>
<select>2</select><select>3</select></option>
</body>

and having another file:

**page1.html**
<body>
here I want to have the same OPTION data
</body>

Is there any way to write the OPTION tag once, and then use it in multiple pages. I have to use them with up to 10 pages.




Variable name error in python 3

In my python 3 program for web scraping, searching, showing the date, and timers, there was a syntax error for a variable name. It's named LISA. Here's the code:

import urllib
import time
import json
import urllib.request, urllib.parse
while 1:
    def input1():
        main_input = input('LISA, ')

    def sinput():   
        search_input = input('LISA, search ')


    def tinput():  
         timer_input = input('LISA, timer for ')




def showsome(search_input): 
      query = urllib.parse.urlencode({'q': search_input})
      url = 'http://ift.tt/NaLSBv' % query
      search_response = urllib.request.urlopen(url)
      search_results = search_response.read().decode("utf8")
      results = json.loads(search_results)
     data = results['responseData']
      print('Total results: %s' % data['cursor']['estimatedResultCount'])
      hits = data['results']
      print('Top %d hits:' % len(hits))
      for h in hits: print(' ', h['url'])
      print('For more results, see %s' % data['cursor']['moreResultsUrl'])


def timer(timer_input): 
    timer_input = int(timer_input)
    for x in range(1, timer_input):
        t = 0
        t = t+1
        time.sleep(1)
        print(t)
        if t == timer_input: {
            print('TIMER DONE!!!!!!!')
            }




 def calender():  
     print(time.asctime())


input1()
    if main_input == 'search': {
        sinput()
        showsome(search_input)
        }
    elif main_input == 'timer': {
        tinput()
        timer(timer_input)
        }
    elif main_input == 'calendar': {
        calendar()
        }

It seems like the problem is the url variable when i run it, but there are a couple other errors. Please reply quickly because i am releasing the program on Christmas Eve.




Google maps application with "Earth View" enabled?

When I go to maps.google.com and hover over e.g. Oslo, if I click the "earth view" button, I get a beautiful 3d model of the city that I can rotate etc right in the browser. It's an extreme upgrade from the old "satelite view".

How do I make a google maps web app where "earth view" is enabled? I've been googling around for ages, but I cannot figure out how to do this. Now I stumbled over a site that said that google earth api is deprecated. Are they talking about Google Earth (the desktop client), or Google Maps with earth view (in the browser)?

Does anyone have a working jsfiddle (or similar) with googlemaps with earth view on? (Centered around a city that is 3d-modelled, such as NY, Oslo or Barcelona)..?




Interfacing with Java Application from Web App

I have created a simulation engine in Java. I want now to be able to expose it through a web App. How can I make it available to my users so that they can interact with the simulation engine in runtime? Basically the process should be similar to: 1) User access my application and configures his simulation parameters 2) Simulation starts 3) User is able to remotely modify/call some methods on specific objects during the simulation.

My idea was to expose a set of web services that will be used by users trough my Web App interface. However, I still have no idea how to connect this WSs to my "runtime". One of my ideas was to use directly DB to communicate ... but I guess there are better ways to do it (with probably better performance).

After some research I got to know about 2 approaches that I feel could be useful for my use case, but I don't know much about them. Those are: 1) Creating a thread and run it in the Servlet Context Listener Executor Service of a Tomcat Server 2) RMI

But still have no clear vision about implications of each one or even if there's any other better alternative




How to launch a python script from java ee? [duplicate]

This question already has an answer here:

I usually do python example.py in terminal for execution. Can we do this in Java? Can we launch a python script from java ? Because I want to launch some python commands from my website Java EE. I don't mean to execute the python code in java, but just let java to call python to do it.

example.py

print "hello world"

Is it possible ? Where should I get started ?




Cannot read property 'getElementById' of undefined

hey i have some code that not working in Chrome and FF, but it is working in IE.

this is the JS code:

var topAppFrame = getFrameByName("smart_payslip");

function getFrameByName(sName) {
    sFrame = "self";

    while (eval(sFrame + "." + sName) == null && eval(sFrame) != top)
        sFrame = sFrame + ".parent"

    if (eval(sFrame + "." + sName) == null)
        return self.top;
    else
        return eval(sFrame + "." + sName)
}


function NavigateSlip(target, linkC) {
     
    var l;
    try {
        for (x = 1; x <= 11; x++) {
            l = topAppFrame.frames["HMain"].document.getElementById("link" + x);
            l.style.backgroundColor = "#003366";
        }
    } catch (e) {

    }
    
   
    var linkC = topAppFrame.frames["HMain"].document.getElementById(linkC);
    linkC.style.backgroundColor = "red";

    topAppFrame.document.frames['SlipArea'].location = target;

}

and this is the C# code:

ClientScript.RegisterClientScriptBlock(this.GetType(), "Msg2", "<script language='javascript'>NavigateSlip('SlipArea.aspx','link2');</script>");

any idea ? I'm really lost... thanks




samedi 28 novembre 2015

Generate number on click then pass that to another function

Say I have some text and a button:

<p id="text-box">placeholder text</p>
<button id="text-btn">New Quote Please.</button>

When I click the button I want something new to appear in the #text-box. So I create an array and some jQuery functions:

var textArr = [word0, word1, word2, word3, word4...];

$(document).ready(function() {
  $( "#text-btn" ).click(function(){
    x = Math.floor(Math.random()*textArr.length); //This line is the problem.
  });
  $("#text-box").html(textArr[x]);
});

The idea is when the button is clicked a random number is generated then that number is used to select an item in textArr to display in #text-box. I am fairly certain that the problem lays in the commented line. I think that the x value in the $("#text-btn") function is either not being created at all or is not being passed into the $("#text-box") function.

Thank you for your time.




Error Depedency PHP

After I upgrade php53 to php56 emerge several error on my freebsd 8.4 this error from pkg check -Bd

pkg: fstat() failed for(/usr/local/lib/python2.7/xml/dom/xmlbuilder.py): No such file or directory pkg: fstat() failed for(/usr/local/lib/python2.7/xml/etree/ElementPath.py): No such file or directory pkg: fstat() failed for(/usr/local/lib/python2.7/xml/etree/init.py): No such file or directory pkg: fstat() failed for(/usr/local/lib/python2.7/xml/etree/cElementTree.py): No such file or directory pkg: fstat() failed for(/usr/local/lib/python2.7/xml/parsers/init.py): No such file or directory pkg: fstat() failed for(/usr/local/lib/python2.7/xml/parsers/expat.py): No such file or directory pkg: fstat() failed for(/usr/local/lib/python2.7/xml/sax/init.py): No such file or directory pkg: fstat() failed for(/usr/local/lib/python2.7/xml/sax/handler.py): No such file or directory pkg: fstat() failed for(/usr/local/lib/python2.7/xmllib.py): No such file or directory Checking all packages: 100% gio-fam-backend has a missing dependency: perl5.14

Missing package dependencies were detected. Found 1 issue(s) in the package database.

pkg: No packages available to install matching 'perl5.14' have been found in the repositories

Summary of actions performed:

perl5.14 dependency failed to be fixed

There are still missing dependencies. You are advised to try fixing them manually.

Also make sure to check 'pkg updating' for known issues.




Is there a way to check if a user is connected to a site through Tor using JavaScript?

I would like to be able to display a message or etc if the user is connected through Tor. This will not need to be completely secure, and it should be client side. It can use an external API or site to get the IP address or something similar if necessary.




Stand-alone angular module with web worker

I am looking to build a standalone angular js module that makes use of web workers for some heavier processing. This module will be used by another angular web application that I'm building and potentially others.

I want this module to be installable through bower with the web worker scripts packaged in. The problem is that the web worker scripts need to be external files (unless you use the Blob/Url technique, but my understanding is that it's not supported by IE). I don't want the client application using this module to have to put the worker scripts in a public directory or anything like that. I want them to include my module and have everything just work.




How to Embed Google Search

I have always wondered how to embed Google on a webpage. Is it possible to put it in an iframe? I know that some websites use Google CSE, but I want the real Google. If so, how can I do this?




Using javascript to send an object through a form

I'm stuck trying to pass an object to another page , using javascript. I hope you can give me a hand . Thanks.

Here the object created and sent through a form and input.

var cars = {nombre : "luis", apellido: "heya"};

var form = '<form action="RegisterOrder.php" method="post">'+'<input type="hidden" name="arrayDatosProductos" value="'+cars+'"></input>'+'</form>';
$(form).submit();

In the page that receives the object :

var a = new Object(<?php echo $_REQUEST['arrayDatosProductos']; ?>);
alert(a.nombre);




Cannot Get Index.html File Changes to be Read (Apache 2.4)

So I am at my wits end with this problem of trying to configure a simple Apache Web Server for one of my assignments. For some reason my changes to index.html are no longer being read, even though I got it to change previously.

I had this problem previously, where I would change index.html and it would still show the default "It works!" message. It ended up that, because my file extensions weren't shown, I had accidentally named the file index.html.html, and so obviously it wasn't locating it.

However, now that my file extensions are showing, I am having this problem again (the last fiasco was about a week or two ago). I tried changing the contents of index.html again, just a simple text change, and it is still loading my previous page. I have tried restarting Apache through Administrative Tools > Services since the Apache and httpd commands in the command line won't work for me. I even tried deleting the index.html file and leaving htdocs empty and it's still displaying my old web page!!!

I have no idea why it's doing this and I can't find any other answers. I checked my DirectoryRoot and DirectoryIndex values and they all point to index.html (and plus, I haven't touched httpd.conf since installation anyways). Running Windows 8.1. Any help greatly appreciated.




Do not print a variable used in the query

I have a query like this:

SELECT ?names ?country ?city
WHERE {
  ...
}

However my hw says to print only the names and the city, not the country. How can ask SPARQL not to include ?country in the result set?

If it can't be done, I would like to know of course, so that I can stop searching Google.




Comments in query?

Can I write comments in query, so that only God but also me remember what I was doing?

I just started learning SPARQL, so forgive my ingnorance.

For example:

SELECT ?names
WHERE {
  ?names dbo:award :Turing_Award // get names that won Turing award
}

that throws a parsing error.

A negative answer will also be accepted!

I am using SPARQL endpoint over the DBpedia data set at http://ift.tt/UeVHu1 .




Uncaught ReferenceError: username_text is not defined?

Bonsoir, j'ai une page html login.html son script est dans un fichier login.js, après une authentification réussite l'utilisateur est redirigé vers une autre page html menu.html son script est dans un fichier menu.js Je veux afficher en haut de la page menu.html "vous êtes connecté en tant que username " , mon problème c'est que lors de l'affichage de menu.html j'obtient l'erreur suivante " Uncaught ReferenceError: "username_text" is not defined?




How to serialize form stored in a variable jQuary

form = '<form action="javascript: this.preventDefault">'+

    '<input type="hidden" name="term" value="'+term+'" />'+

     '<input type="hidden" name="course" value="'+course+'" />'+

      <input type="hidden" name="seq_no" value="'+seq_no+'" />'+

'</form>';

var url = 'Add_Row.php?edit&',//relative path to PHP processing script

input = form.serialize();

Greetings All,

Here I am trying to place a form into a variable form after which I want to serialize that form then send it off to be processed.

However I keep getting this error from the browser:

Uncaught TypeError: form.serialize is not a function

Your help will be much appreciated

Blessings STM .




Is device's orientation event dead?

Is 'ondeviceorientation' event dead for moblie? Because mobile (android) Chrome (latest) does not react for this code:

window.addEventListener('deviceorientation', function() {console.log('event')});

Desktop Chrome works fine. If that's dead, is there another way to mobile parallax with the device's API?




Finding a specific link in a webpage

I'm writing a program that has to find a specific link from a webpage, so I connect to the webpage and read in the HTML. I'm not sure what to do next.

The link is always in the same place and has the same link text. The link is always a link to a FTP if that helps.

Here is my code:

URL exchange = new URL("**********"+codeArr[i]);

System.out.println(exchange);

URLConnection connection = exchange.openConnection();

BufferedReader URLIn = new BufferedReader(new InputStreamReader(connection.getInputStream()));

Thanks




How to host a bot on a free hosting web server for testing which is return in python programe? [on hold]

I have a sample bot programme written in python, But i want to test it by hosting it on a free based web hosting servers. Can I know what are the best and secure based servers where i can upload my bot programme and test. And How to Host a bot programme on a web server????

Thankyou




Website or Application? or What..? [on hold]

I'm a beginner to the web development world, and someone asked me to make a database for his shop. I know the idea is everywhere and isn't new, but I decided to make it from scratch for the learning purpose.

So I started on localhost and made a php page, all it does is insert/search in a mysql database. The person who asked me for this, wants to be the only one who has the access to this page, so I thought first about installing the localhost in his machine and let the database on a mysql server,
or maybe I should make an application, but he uses different OSs (his machine's Windows, and his phone's android, and he also has IPad) and it's not easy to make applications for every OS.
That's why I chose making a website and make the design responsive so he can enter it in every OS.

My question is: Should I make the website and make it private even from Google search engines? or should I even make a username and password for the website?

Or what should I exactly do?




Create a New Folder like a dropbox, google drive, etc

I would like to create a folder inside the index of my site. I searched on google, but I'm actually not knowing what to really search! I want to click with the right mouse button, and play some options as it appears in google drive. Where do I begin? What should I use to do that?




How can I enable the users delete and edit the objects they create in Django?

Now I have a model called lyric. The detail is as below:

class Lyric(models.Model):
    title = models.CharField(max_length = 200)
    body = models.CharField(max_length = 12000)
    pub_date = models.DateTimeField('date published')
    user = models.OneToOneField(User)

I have a form that user can create lyric. Next I want to enable the user can edit and delete the lyrics. Now I have implemented the form of editing and the function of delete. But how can I limit the permission? Thank you in advance!!!




Preload/store external webpage to faster loading in Android

I have an android app, which loads external webpage and then it shows just some divs in which on button click it start some scripts. When I open the app, whole webpage needs to be loaded from server and it's time and data consuming. What I want to do is to preload/store webpage on phone storage so when i open app, it shows immediately and when I click button then it will connect to the server and execute script and return response.

Is something like this possible? Thanks!




Languages and structure to use for data driven web application

I am going to create a web application that will take some user submitted data, process it and display it graphically like a graph, chart, etc.

Apart from HTML, CSS and PHP what other languages would you recommend i would learn and use for this project? I am especially confused about all the different javascript frameworks like AngularJS, backbone, JQuery and so on since i will need javascript for this.

I would like to use something like Java or Scala for back-end if you think that would be useful since it will give me extra credit from the University.

Thank you in advance for any help regarding this!




should i use DWR in my new javaEE web project. (2015) [on hold]

i want to know whether DWR (directWebRemoting) to use or not in newer javaEE web project. What are its benefits and limitation of using it. or any better subtitution for DWR if you can suggest?




Filtering out specific values from an array

destroyer([1, 2, 3, 1, 2, 3], 2, 3) should return [1, 1], but it returns [1, 2, 3, 1, 2, 3]. What is wrong with this code?

function destroyer(arr) {
  // Remove all the values
  var arg_num = arguments.length;

  var new_arr = arguments[0].filter(function(a){
    for (var i = 1; i < arg_num; i++){
      if (a === arguments[i]) a = false; 
    }
    return a;
  });

  return new_arr;
}

destroyer([1, 2, 3, 1, 2, 3], 2, 3);




Create a ASP.Net web service and deploy on a remote server

I need to create a web service in either 3.4 or 4.5 version of .net framework and deploy it into a windows server 2012 R2 OS. IIS is been configured on the 2012 SEREVR R2 OS already. Can anyone provide step-by-step information for this? This web service would be consumed by a java client for my project.

Also, would like to know what should be the approach, whether i need to wcf service & deploy the same in target server's IIS.

If I create:

  • asp.net web application in 4.5 framework and add a web service -asmx -file will that be sufficient for me to deploy onto the target server?
  • How to take the web service code from my dev machine to another machine also.



How do i programmatically update content in SquareSpace?

Foreword: i am very very new to square space and also to CMS in general. so please pardon any "dumb" questions

Let's say i own a squarespace page. Let's say i want to randomly update the home page with a random greetings every day (or every 2 days..etc.) I feel that since this is a CMS, the right way to go is to basically somehow set up a remote server that can scp into my specific square space server instance. the remote server will update some file (or generate some content), and scp the "index.html" file over to the square space instance.

alternatively, if i have my own server running at home, it looks like i can write some bash scripts to modify (commit & push) and deploy using git??

is this the right idea? what other CMS services provide this?




Got a TypeError of the upload form in Django

Now I want to add a form which is to update the existing lyrics for users. Here is my code:

urls.py:

from django.conf.urls import url 
from . import views
from django.conf import settings
urlpatterns = [
url(r'^$', views.lyric_list, name = 'lyric_list'),
url(r'^lyric/(?P<lyric_id>[0-9]+)/$', views.lyric_detail, name ='lyric_detail'),
url(r'^add_lyric/$', views.add_lyric, name = "add_lyric"),
url(r'^delete/(?P<pk>\d+)$', views.delete_lyric, name = 'delete_lyric'), 
url(r'^update/$', views.update_lyric, name = 'update_lyric'),
url(r'^update/(?P<pk>\d+)$', views.update_lyric_page, name = 'update_lyric_page'),]

views.py:

@login_required
def update_lyric(request, pk):
  lyric = get_object_or_404(Lyric, pk = pk)
  form = LyricForm(request.POST, initial = {'title': lyric.title, 'body': lyric.body})
  if lyric:
    username = lyric.user.username 
  if form.is_valid():
    title = form.cleaned_data['title']
    body = form.cleaned_data['body']
    lyric.title = title 
    lyric.body = body
    lyric.save()
    update_topic(request.user)
    return HttpResponseRedirect(reverse('rap_song:lyric_list'))
return render(request, 'rap_song/update_lyric_page.html',{'pk':pk})         

@login_required
def update_lyric_page(request, pk):
  lyric = get_object_or_404(Lyric, pk = pk)
  form = LyricForm()
  return render(request, 'rap_song/update_lyric_page.html', {'pk': pk, 'form':form})

update_lyric_page.html:

<div class = "col-md-6 col-md-offset-3">
<form action="{% url 'rap_song:update_lyric' lyric_id %}" method="post" class="form">
  {% csrf_token %}
  {% bootstrap_form form layout="inline" %}
  {% buttons %}
  <button type="submit" class="btn btn-primary">
  {% bootstrap_icon "star" %} Edit
  </button>
  {% endbuttons %}
</form >

But I got a error: TypeError at /rap_song/update/

update_lyric() missing 1 required positional argument: 'pk'

The whole Traceback is as below:

Traceback:
File "/Users/yobichi/wi/lib/python3.5/site-packages/django/core/handlers/base.py" in get_response
132.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/Users/yobichi/wi/lib/python3.5/site-packages/django/contrib/auth/decorators.py" in _wrapped_view
22.                 return view_func(request, *args, **kwargs)

Exception Type: TypeError at /rap_song/update/
Exception Value: update_lyric() missing 1 required positional argument: 'pk'

Anyone can help me with this issue? I have been struggling for this issue for a whole day. Thank you in advance!




vendredi 27 novembre 2015

How to create a investor relations website?

Any idea on how to create a investor relations website? How can I integrate the investor information like price, chart into a website?




Can I use this domain name safely?

I own, or rather my company owns a domain name say john.com. My main server is accessed from john.com.

I wish to setup a server that will communicate with my main server on guys.john.com. Can I do this safely without risking complications of a domain name clash or copyright brouhaha? especially since I'm not registering guys.john.com




wordpress plugin WPdeposit, how to use the functions

I have installed the plugin WPdeposit on my wordpress site, it allows users to deposit into their account balance. I am trying to manipulate users balances when they press an anchor tag on the page.

In the directory plugins/models/user.php there are many functions, I think im interested in this one:

 /**
 * Update Regular balance to given amount (Will overwrite whatever value is in the db!)
 *
 * @param int $amount
 * @return boolean
 */
public function updateRegularBalance($amount) {
    if (floatval($amount)) {
        return (bool) update_user_meta($this->_id, WPDEPOSIT_NAME.self::USER_AMOUNT, $amount);
    } else {
        throw new \Exception(__('Amount is not a number', WPDEPOSIT_NAME));
    }
}

when I try to call this function to the page on the theme's index.php like so:

updateRegularBalance(5);

but I receive this error. Fatal error: Call to undefined function updateRegularBalance()

is there a way to access the use of this function so I can pass in the value I want to update the balance to?




Get variable in while loop based on what user chooses?

I stored values from an sql query in an array by looping it. I need the value from that array based on which one the user chooses and store it in another variable. This is my code:

 while ($row = mysql_fetch_array($loop))
 {
  $proID = $row['product_id'];

 echo "<table border='0' width='100%' align='center' class='centrebox'><tr>
 <td width='25%'>".($row['product_name']) . "</td> " . "
 <td width='35%'>".($row['product_disc'])."</td>";

 echo '<td width="40%"><img width="100%" height="300"  src="data:image/jpeg;base64,'.base64_encode( $row['product_image'] ).'"/></td></tr>
 <td><form method="post" action="deleteupload.php">
 <input type="submit" name=$proID value="Delete"></form></td></table><br>';

}

This while loop iterates through the sql table and echos the columns (product_name, product_disc, and product_image in the second echo). If I echo product_id, it gives me the id for that specific row. As you can see, I have a Delete button that posts to deleteupload.php. I need the id from the form on that specific index to use. I don't know if I explained it well enough, but please bare with me. Thanks




How get data about seed from torrent file with Ruby or PHP

I have torrent-files. I need get seeder amount for this torrent files. How to make it? thanks




respond a url for download file with other server with WebClient.GetWebResponse Method or other Method

I have:

1.Host Download (there is all my file , i want to share them)
2. localhost server (simple)

I have file: test.zip on SERVER 1 (HostDownload - Direct Link ex:http://ift.tt/1LDOwq7) AND I want to response download link for download file by user in SERVER 2 using function but The user does not know the actual address
i writhed this but not work :

 public  WebResponse GetWebRequest()
        {
        string address =(@"http://ift.tt/1LDOwq7");
            WebRequest request =WebRequest.Create(address);
        request.Method = "POST";
        request.ContentType = "application/x-zip-compressed";

        WebResponse response1 = request.GetResponse();

        return response1;
        }




Web Service method name isn't valid

I have tried lots of solution but my problem isn't solved. What is the problem in this code omg.

I am posting this with fiddler :

{"No":1,"Name":"sss","LastName":"ssss","Age":1}

User Class:

 public class Users
{
    public Users() { }
    public Users(int no,string name,string lastname, int age)
    {
        this.No = no;
        this.Name = name;
        this.LastName = lastname;
        this.Age = age;
    }
    public int No { get; set; }
    public string Name { get; set; }
    public string LastName { get; set; }
    public int Age { get; set; }
}

Webmethod :

[WebMethod]
    public void updateUser(Users usr)
    {
        Users temp = userList.Where(i => i.No == usr.No).FirstOrDefault();
        userList.Remove(temp);
        userList.Add(usr);
    }

This is the error :

{"Message":"Invalid web service call, missing value for parameter: \u0027usr\u0027.","StackTrace":"   at System.Web.Script.Services.WebServiceMethodData.CallMethod(Object target, IDictionary`2 parameters)\r\n   at System.Web.Script.Services.WebServiceMethodData.CallMethodFromRawParams(Object target, IDictionary`2 parameters)\r\n   at System.Web.Script.Services.RestHandler.InvokeMethod(HttpContext context, WebServiceMethodData methodData, IDictionary`2 rawParams)\r\n   at System.Web.Script.Services.RestHandler.ExecuteWebServiceCall(HttpContext context, WebServiceMethodData methodData)","ExceptionType":"System.InvalidOperationException"}




Style all letters on any webpage

I'd like to color all letters on any webpage without breaking scripts, styling entities etc. (if possible). It could be JS+CSS, but could be not.

I currently use JS+CSS in Greasemonkey, coloring select visible tag types by inserting tags per letter. I'm detecting page changes and coloring new elements. I also dropped in text-shadow for readability. The result is quite nice, but works partially and it's too slow (but not sluggish). Main problem is with text in divs, etc.

What for? Self-induced synesthesia seems to increase IQ permanently by 12 points on average. Synesthesia is mixing senses that some people experience constantly, weird example (whoah, weirder) is seeing letters in colors. Source: http://ift.tt/1OkAmk3 (end of page 4).




I would like to create a simple web page , which just show the contents of a file generated from a shell

I would like to create a simple web page , which just show the contents of a file generated from a shell .

Using digital ocean for example.

What do you recommend ?




Running background task from a web server on linux

I have a completely new web project and I'm free to use what language I want as long as it works well on Linux. My background is strong in PHP but I do have experience with Java, C# and a little Python.

I have no problem developing the back-end part of the website in PHP using a framework such as Laravel or Zend. However, there are going to be a lot of background tasks or at least long running background tasks (an hour possibly). I know there are PHP commands I could use to execute PHP scripts in the background when I receive a web request but that just doesn't feel like good design. I'm not adverse to learning a new language either, as long as the learning curve is not too steep. I did consider learning to use Java EE for this but I'm not sure that is necessarily the correct way.

Additionally, some of the guys responsible for data have been considering various solutions, including the use of Cassandra, MongoDB and Hadoop so whatever language I choose would potentially have to have interface into those products as well.

I'm sorry if this might be an open ended question but could someone give me some pointers please? I have been researching on the net for the past 5 hours and seem to be going in circles a little. The background processing will be crunching CSV files, inserting into databases, analyzing data sets etc.




Making text "non-readable"

I am in a weird situation, in where I have to put my name and contact information on a webpage and I think it is fine, as long as the text can't be read by robots, copied, etc.

Basically what I want is a text block that looks like normal text, but behaves like an image. I cannot, however, use an actual image because the background and other stuff is preventing me to.

Is there some way to overcome this issue of mine? I was thinking I could type everything backwards and use that one control character that reverses the text direction... or maybe I could add invisible letters in between the real ones somehow, so that the text remains readable by humans, but not by site crawlers.




What is the

What does the <title> tag in HTML (Hyper Text Mark-Up Language) mean and what is it used for? Where do you use the <title> tag?




How to run a remote python app from a browser?

I would like to know if it is possible to run a python application remotely (i.e. on a server), and have the GUI somehow on the client's browser?

For example, I could have a big canvas element which would get regularly updated to reflect the GUI of the python application, and mouse/keyboard events sent to the python app.

Many thanks for any help!




Connect Google chrome and Android to each other via webrtc

I have an idea for an app and chrome extension. But I already ran into a problem, I need to link the android phone and browser to each other so that the pc can send commands (For example that the phone needs to open a specific video on youtube). A friend of mine said shat this would be possible by using webrtc but I dont think it will work. I have tried to do it using sockets but that isnt working.

Hope someone has an some kind of framework that makes this job super easy.




how do I use Repl.it in my web application?

I am a novice programmer trying to make a site like codecademy labs. So I figured that codecademy uses jsrepl for their code execution. But I am having problems to embed in my website. Also I only want python as my language. So how do I configure the source to meet my requirements?




Can HTTPS web pages be permitted to load data over HTTP?

If a web page that's only served over HTTPS tries to load data (e.g. JSON) that's only available over "insecure" HTTP, Chrome blocks the request with a message that "This page is trying to load scripts from unauthenticated sources".

Is there a meta tag that can be added to the HTML page to override this, allowing the data to be loaded?




Respnose.Redirect then wait for button to be clicked on that web page

I have an API that receives raw xml data. I use that data to create a web page with a form where the user will have to enter in more information then submit it. The form is submitted back to the API for further processing. After that the I post the results to a specified URL that was in the original received xml.

The created web page is redirected to from the API, so I lose that initial connection between the page that did the xml post and the API which means I cant do a normal http response. I want to be able to do a normal http response back to the page taht did the xml post in the first place which means I need to be able to do something like a Wait task that waits for the form to be submitted..

Is this sort of thing possible?




Uber like Car animation in Google maps javascript

Need Help on Implementing marker moving animation by updating latitude and longitude of the location like UBER in web (javascript). I used below code but the marker won't rotate when using car as marker.

         var lat;
         var lng;
   function initialize() {
       console.log("Google Maps Initialized")
       map = new google.maps.Map(document.getElementById('map-canvas'), {
       zoom: 15,
       center: {lat: lat, lng : lng, alt: 0}
    });

  map_marker = new google.maps.Marker({position: {lat: lat, lng: lng}, map: map,icon:"car.png"});
  map_marker.setMap(map);
}

// moves the marker and center of map
function redraw() {
  map.setCenter({lat: lat, lng : lng, alt: 0})
  map_marker.setPosition({lat: lat, lng : lng, alt: 0});
  pushCoordToArray(lat, lng);

  var lineCoordinatesPath = new google.maps.Polyline({
    path: lineCoordinatesArray,
    geodesic: true,
    strokeColor: '#2E10FF',
    strokeOpacity: 1.0,
    strokeWeight: 2
  });

  lineCoordinatesPath.setMap(map);
}


function pushCoordToArray(latIn, lngIn) {
  lineCoordinatesArray.push(new google.maps.LatLng(latIn, lngIn));
}
function updateMarker()
  {
    lat="some latitude";
    lng="some longitude";
    redraw();

}




PHP: login system not working in real world but works fine in WAMP/MAMP :(

I just finished building the first website in my life! Everything works fine in my MAMP/WAMP. So excited but when I am testing it in real environment today with hosting software C-Panel, but it turns out my login page doesn't work. The website does nothing when user submit the form where the user should be redirected to main.php.

My face turns from :) into :( just now. Below is my login.php, could anyone help to point out what might be the problem?

<?php if(!SESSION_id()) SESSION_start();?>
<html>
<head><title>login with your account</title></head>
<body>
    <form action="login.php" method="POST">
    <input type="text" name="email" placeholder="Email">
    <br>
    <input type="password" name="password" placeholder="Password">
    <br>
    <input type="submit" value="Log in" name="submit">
    </form>
</body>
</html>

<?php

require ("connect.php");



//declair the variable
$email=@$_POST["email"];
$password=@$_POST["password"];
//encrypt the password
$psw_en=sha1($password);

if(isset($_POST["submit"])){

    if($email || $password){
        if($email){
            if($password){ 
                $sql="select * from users where email='$email'";

                $result=mysqli_query($conn,$sql);
                $check_rows=mysqli_num_rows($result);

                    if ($check_rows !=0){
                         while ($row=mysqli_fetch_assoc($result)){
                            $db_email=$row["email"];
                            $db_psw_en=$row["password"];
                            $db_full_name=$row["full_name"];
                            $db_id=$row["user_id"];
                            $db_topics=$row["topics"];
                            $db_date_of_registration=$row["date_of_registration"];
                            $db_pic=$row["pic"];
                         }

                         if($email==$db_email&&$db_psw_en==$psw_en){
                            $_SESSION["id"] = $db_id;
                            $_SESSION["email"] = $email;
                            $_SESSION["full_name"] = $db_full_name;
                            $_SESSION["topics"] = $db_topics;
                            $_SESSION["date_of_registration"] = $db_date_of_registration;
                            $_SESSION["pic"] = $db_pic;
                            $_SESSION["password"] = $db_password;


                            header("Location: main.php");


                         }
                         else{
                            echo "password is wrong";
                         }

                    }
                    else {
                        echo "you are not registered,yet. Click here to <a href=\"register.php\">register</a>";
                    }

            }
            else{
                echo "it looks like password is empty";
            }
        }
        else{
            echo "it looks like email is empty";
        }
    }
    else{
        echo "it looks like everything is empty";
    }
}







?>




How to make pjax work in java web application?

I am trying to make pjax work at my existing java applications. And I am testing on the basic uses but I can't find any useful resources or example for java application.

As github page says:

Magic! Almost. You still need to configure your server to look for pjax requests and send back pjax-specific content.

The pjax ajax request sends an X-PJAX header so in this example (and in most cases) we want to return just the content of the page without any layout for any requests with that header.

The example at github page is for rails :

def index
  if request.headers['X-PJAX']
    render :layout => false
  end
end

Does this do the same thing like @ResponseBody of Spring MVC?

I have configured a filter and use:

System.out.println("pjax---------------->" + (httpServerRequest.getHeader("X-PJAX")));

and find that this header is true so the pjax requests did send to the server,but how can I set the right response with java in order to make pjax work correctly?




jeudi 26 novembre 2015

Get all checkbox value generated by JSP for loop

I'm new at JSP and web development, I have a form which used to do a multiple choice test and I want to do that when user click on submit button my page will calculate number of correct answer but my problem is I don't know how to collect user's anwser to count number of correct answer. Can you show me how to solve it? Sorry for my bad English and thanks for your help! Here is my form:

        <form class = "exam" action="#" method= "get" language = JAVASCRIPT name="A1Exam">
    <%
                        A1DrivingTest a1DrivingTest = new A1DrivingTest(
                        DatabaseConnection.connect());
                        Question[] question = a1DrivingTest.getLawQuestions();
                        for (int i = 0; i < question.length; ++i) {
                    %>
                    <table border="2">
                        <tr>
                            <th>NỘI DUNG CÂU <%=i + 1%></th>
                        </tr>
                        <tr>
                            <td><img alt="image" src=<%=question[i].getImageUrl()%/></td>
                        </tr>
                        <tr>
                          <td id name>
                            <ul class= "listRadioBtn">
                            <li>
                                <input type="checkbox" name="checkbox" value = "1"/>
                                <p id="number">1</p> 
                            </li>
                            <li>
                                <input type="checkbox" name="checkbox" value = "2"/>
                                <p id="number">2</p>
                            </li>
                            <li>
                                <input type="checkbox" name="checkbox" value = "3"/>
                                <p id="number">3</p>
                            </li>
                            <li>
                                <input type="checkbox" name="checkbox" value = "4"/>
                                <p id="number">4</p>
                            </li>
                            </ul>

                            <p id= "correctAnswer">correct answer: <%=%></p>

                            </td>
                        </tr>

                    </table>
                    <%
                        }
                    %>
        <p id = "numbOfCorrectAnswer"></p>
        <input type="submit" id="submitBtn" language= JAVASCRIPT name="submit" title="Submit" />
    </form>




Lightgallery with images in separate divs

I have multiple images in rows and I want Lightgallery (http://ift.tt/1HJbRHZ) to capture all the images on my page. I can only seem to get separate light galleries for each row instead of one big gallery. The problem occurs because I have sets of images inside divs, with multiple divs in one big container. How can I get all the images in retreats-image-container to merge/join/combine into one gallery?

   <div class="container-fluid" id="retreats-image-container">
                <div class="row row-center">


                    <a href="img/retreats/retreats1.jpg">
                        <div class="col-lg-3 col-sm-12 text-center retreats-img">
                                <img src="img/retreats/retreats1.jpg" width="100%" height="100%" title="Special events" alt="Special events">
                        </div>
                    </a>

                    <a href="img/retreats/retreats2.jpg">
                        <div class="col-lg-3 col-sm-12 text-center retreats-img">
                                <img src="img/retreats/retreats2.jpg" width="100%" height="100%" title="Beauty and makeup" alt="Beauty and makeup">
                        </div>
                    </a>

                    <a href="img/retreats/retreats3.jpg">
                        <div class="col-lg-3 col-sm-12 text-center retreats-img">
                                <img src="img/retreats/retreats3.jpg" width="100%" height="100%" title="Special events" alt="Special events">
                        </div>
                    </a>

                    <a href="img/retreats/retreats4.jpg">
                        <div class="col-lg-3 col-sm-12 text-center retreats-img">
                                <img src="img/retreats/retreats4.jpg" width="100%" height="100%" title="Special events" alt="Special events">
                        </div>
                    </a>
                </div>

                <div class="row row-center">
                    <a href="img/retreats/retreats5.jpg">
                        <div class="col-lg-3 col-sm-12 text-center retreats-img">
                                <img src="img/retreats/retreats5.jpg" width="100%" height="100%"title="Special events" alt="Special events">
                        </div>
                    </a>

                    <a href="img/retreats/retreats6.jpg">
                        <div class="col-lg-3 col-sm-12 text-center retreats-img">
                                <img src="img/retreats/retreats6.jpg" width="100%" height="100%"  title="Special events" alt="Special events">
                        </div>
                    </a>

                    <a href="img/retreats/retreats7.jpg">
                        <div class="col-lg-3 col-sm-12 text-center retreats-img">
                                <img src="img/retreats/retreats7.jpg" width="100%" height="100%"  title="Special events" alt="Special events">
                        </div>
                    </a>

                    <a href="img/retreats/retreats8.jpg">
                        <div class="col-lg-3 col-sm-12 text-center retreats-img">

                              <img src="img/retreats/retreats8.jpg" width="100%" height="100%"  title="Special events" alt="Special events">
                        </div>
                    </a>
                </div>
</div>

The javascript:

This creates 2 galleries of 4 images

$(document).ready(function() {
    $(".row").lightGallery();
});

This doesn't work, but it's essentially what I want to do to get one gallery of 8 images

$(document).ready(function() {
    $("#retreats-image_container").lightGallery();
});




Cannot interact with uploaded images from my website

When uploading images from my website into the designated folder I can see the file in the directory, but cannot open the files nor display them on the webpage.

                            $directory = "./profiles/".$user_id;

                            if (!is_dir("profiles/".$user_id))
                            {

                                mkdir("profiles/".$user_id, 0777);


                            }

                        $temp_name=$file["tmp_name"];
                        $new_count = $images + 1;
                        $file_name=$user_id."_".$new_count;
                        $full_file_name ="profiles/".$user_id."/".$file_name.".jpg";

                        move_uploaded_file($temp_name ,$full_file_name);




Is a bad idea add multiples libraries to a web app project?

thanks for reading!

I am developing a web app in android (offline) and i am wondering how many perfomance is lost by adding a library like knockout, for example. Now i am using jquery mobile only. I guess that if the app was online, the performance may be considerable no? But, offline...Matters?




Web stats direct entry informatiom

I was testing the Piwik web statistics application. What is supprise to me is that this app can tell if the entry to the certian page is a "direct entry" or entry from some other website.

How does it work? How does the Piwki app obtains this information?




Display something for people who like or not like our facebook page

I search solution for my problem like this: Facebook how to check if user has liked page and show content?

But, the sulution from 21/11/2012 doesnt work anymore. Demo HERE. Did someone know why?

Body

<div id="fb-root"></div>
<script src="http://ift.tt/pDm2SS"></script>
<script>
  FB.init({
    appId  : '179378788777832',
    status : true, 
    cookie : true, 
    xfbml  : true  
  });
</script>

<div id="login">
    You are not logged in to FB, Please click<a href="#"> here </a> to login.
</div>

<div id="container_notlike">
YOU DONT LIKE
</div>

<div id="container_like">
YOU LIKE
</div>

JS

var hideLogin = function(){
   $("#login").hide();
}

var showLogin = function(){
   $("#login").show();
}


var doLogin = function(){
    FB.login(function(response) {
      if (response.session) {
           hideLogin();
           checkLike(response.session.uid)
      } else {
        // user is not logged in
      }
    });
}

var checkLike = function(user_id){
    var page_id = "40796308305"; //coca cola
    var fql_query = "SELECT uid FROM page_fan WHERE page_id = "+page_id+"and uid="+user_id;
    var the_query = FB.Data.query(fql_query);

          the_query.wait(function(rows) {

              if (rows.length == 1 && rows[0].uid == user_id) {
                  $("#container_like").show();

                  //here you could also do some ajax and get the content for a "liker" instead of simply showing a hidden div in the page.

              } else {
                  $("#container_notlike").show();
                  //and here you could get the content for a non liker in ajax...
              }
          });        
}

$(document).ready(function(){
    FB.getLoginStatus(function(response) {
      if (response.status === 'connected') {
        hideLogin();
        checkLike(response.authResponse.userID)
      } else {
        showLogin();
      }
     });

    $("#login a").click(doLogin);
});

CSS

body {
width:520px;
margin:0; padding:0; border:0;
font-family: verdana;
background:url(repeat.png) repeat;
margin-bottom:10px;
}
p, h1 {width:450px; margin-left:50px; color:#FFF;}
p {font-size:11px;}

#container_notlike, #container_like, #login {
    display:none
}

I search solution for hours. But i didnt find anything what works. Thank you for help.




Application setup similar to REST

I am setting up a system which will take requests, query a database and provide a response (in its simplest form).

The setup will be as follows.

A client. @ http://ift.tt/1MGib5T A server. @ www.example-api.com

The client will make a Ajax request to the server. The server will authenticate the origin. Query the DB and provide a response.

What methods should I look into for me to authenticate, server/api side that the request has come from http://ift.tt/1MGib5T.

I understand this is / is similar to a RESTful api. However I do not really require for the client to login. It will all valid requests will only come from http://ift.tt/1MGib5T.

In the future they may come from mobile apps ect. However this does not need to be dynamically validated.

Thank you




how to lock process in tomcat?

I have a web application running on tomcat. I have a jersey2 application there. So when an incoming request comes, I need to lock the process associated with this request until getting response from an external service. How to do that without getting the system working slower or even crash?




text box accepting numbers in browsers and ipad but not in android mobile

i have a following code in the keydown textbox event for my meteor app, this textbox is accepting the numbers, it is working in browsers and ipad, but not in android mobile phone. Not sure what is wrong?

'keydown .clsAmount':function(eve){
        var keyid=eve.which;
        //console.log("the key press for amount is:"+keyid);
        if((eve.which>47 && eve.which<58) || (eve.which>95 && eve.which<106)|| eve.which==8 || eve.which==9 || eve.which==13 || eve.which==110) {
            //console.log("its a number");  
        }else{
            alert("Not a number, Enter only numbers");
            $(eve.target).val('');
            eve.preventDefault();
        }
    },




MusicXML playback embedded in a webpage

In my (entry level) Music Analysis class we work on many small scores in MusicXML format.

For educational purposes, we would like to share those scores on the web: the webpage should render the score and provide basic playback capabilities (start, stop, playback line are enough).

I looked at the Sibelius Scorch plugin, its feature set it fantastic but the plugin is not supported anymore (neither by the company nor by recent browsers).

The only MusicXML players I could find are cloud based services: you upload the scores to their cloud, and they render the score with playback features. Those cloud based services are either targeting music publishers or professional musicians and are all paid services. So they are not suitable for educational (non-commercial) purposes.

Some of them provide free accounts but they allow only a limited number of scores.

Is there a web plugin or JavaScript library or anything else that I can embed in a webpage to render and playback a score hosted on my server?

The solution should be open source (free) and allow an unlimited number of scores (that I can host on my web server). No, the idea is not to write my own plugin/library.

Thanks a lot in advance!




Get server-side php output through select2 x-editable

I am using select2 v3.5.4 and X-editable v1.5.0

I have an editable using select2 sending data via POST to a PHP script running on server and I am trying to print the server output into the js console. I am attempting this using the success() function but all I get in the Chrome console upon selecting values and hitting the confirmation button, is just undefined.

The Javascript:

$(".sel").editable( {
  source  : [{id: '1', text: 'One'},
             {id: '2', text: 'Two'},
             {id: '3', text: 'Three'}],
  select2 : {multiple: true},
  url     : "animalsDetailsEdit.php",
  dataType: 'JSON',
  success : function(response, newValue) {
              console.log(response);
            },
  error   : function(){
              console.log("Error");
            }
});

The serverside PHP:

<?php
  echo json_encode("TEST MESSAGE");
?>

I have tried multiple combinations of paramaters but to no avail.




Open a directory with different -but linked- files?

I'm using sublime text. I have linked an external JavaScript file to an HTML file, and placed both files in the same directory. How can I open this directory in my browser in order to preview the website?




Opening a url in a *new window* (python)

I've been trying to use Python in order to open a certain webpage in a new window, and not in a new tab. From what I've heard :

import webbrowser
webbrowser.open_new('www.google.com')

should be used for a new window.
However, when I run the program, it opens the page in a new tab, and not in a new window.

Any suggestions? Thanks in advance.




How to configure / consume a web service in BizTalk 2013

My Greetings!

I need some help in integrating web services into Biztalk 2013

Scenario is, we have several existing Web services which need to be configured in BizTalk 2013. From now onwards the consumer will access the webservices from Biztalk in stead of original URl.

I request to all members of the community If someone has done this activity, my humble request is kindly share the steps along with screenshots or links having step by step details which can be referred and integration task can be accomplished. This is very much critical.

Your earliest help is appreciated.

Regards Baijnath




Website not working with www for domain in hostmonster

My domain is hosted on hostmonster. It's been there for the past two years and had no problem. Suddenly from yesterday my website stopped working if i use www (i.e) it works if I just type https://mywebsite.com. But if I type in www.mywebsite.com or mywebsite.com or mywebsite and ctrl + enter it doesn't work.

In chrome it shows the error the error code as ERR_NAME_RESOLUTION_FAILED

The webpage at http://ift.tt/tv1JJF might be temporarily down or it may have moved permanently to a new web address.

And in IE it shows This page can’t be displayed error.

Yesterday for few hours hostmonster website was down. So I believe it is something wrong going their side. Since their website was down is it something like the dns settings got refreshed and it might take 24-48 hours for the dns to work properly? Or is it something I need to do?




enabling mutual ssl authentication only for a single controller url for SelfHost Asp.net Web API

Is it possible to have configure client credential type individually for different endpoint when using selfHost asp.net web api(HttpSelfHost) listing on same port. For example

https://myserver:550/api/products ==> SSL auth

https://myserver:550/api2/item ==> mutual ssl auth(client credential= certificate)

I did not find anything similar to service binding configuration in WCF server where client credential behavior for individual endpoint can be configured. Any pointer here would be great.

Thanks

Lal




Dependent Dropdown menus

Hi everyone I'm fairly new and unfamiliar with JavaScript/Web Dev and I'm trying to make two dropdown menus, where the second menu changes depending on what they choose on the first one

for example

Choice1
Choice2
Choice3

and if they choose Choice1 the next drop down might be

Choice1.1
Choice1.2

and a follow up question would be, how can I get what the User chose? This also does not have to be written in javascript. Any help/resources/readings would be very helpful (I've tried doing google searches but I couldn't find anything) Thank you!




Best library to log into a webite and interact with it in Python?

This is an often asked question, yet the answers seem to be varied and I have specific requirements so I thought I'd ask anyways.

I want to go to a specific webpage, click on a log-in button that will redirect me to somewhere else, enter the log-in information - this should lead to me returning to the page I first arrived on - then clicking on some buttons. That's it.

I've seen a number of libraries recommended (urllib/urllib2,urllib3,requests,splinter/selenium) and I'm not sure what to pick. I want to login, I think every one of those can do it, requests seems to be the easiest, I want to click on buttons, know I can do that in selenium/splinter not sure about the others, want to be redirected after logging in which I think means cookies need to be saved, is that done automatically? I don't know.




Javascript clicking a button removes key listener?

I am currently using an EventListener on 'keydown' to move objects about on the screen. My problem is that I have buttons on the page at the same time. I have found that after clicking buttons, keys won't trigger an event again until I click in a blank area of the screen.

My problem is basically that I need to click on the screen before keys will trigger events. I was wondering if there is a way to automatically give the EventListener focus (if that makes sense) so that I can switch between button input and key input smoothly without having to click anywhere on the screen again after every button click?

I'm looking for a similar fix in the way that text boxes can 'request focus' on a webpage so that you can type automatically without having to click in the text box.




ClientScript.RegisterClientScriptBlock not working in chrome

i have some code that work in ie but not in chrome and ff.

ClientScript.RegisterClientScriptBlock(this.GetType(), "Msg", "<script language='javascr`ipt'>NavigateSlip('SlipArea.aspx','link2');</script>", true);

any idea why?

thanks




Sublime, how to Find & Replace All for all documents in a project

I'm working in a large folder directory in a Sublime project. When I do the Find & Replace All feature within the Find window, I'm having trouble saving to all the different documents.

In the past, I've just double-clicked on the document (within the Find window) and saved the document individually. I've also tried to go to File -> Save All, but it doesn't seem to save everything. I'm wondering if there's an easier way to Save All the changes. Any help would be appreciated.

Sublime Text 2




Ajax data disappeared when I come back

I make a html page and there is ajax call for get some data.

after success ajax call, I render to html element with the json data which is from the ajax call.

But, If I go to other page by click some link, and when I come back there is no data at all.

how can I preserve the data element when I come back from other page.

<!DOCTYPE HTML>
...
...
<body>
<div id='data'>
</div>
<a href='/next'> NEXT </a>
<script type='text/javascript'>
$.ajax({
    type : 'GET',
    url : '/data/user',
    ...
    ...
    success: function(json) {
        $('#data').append(json.username);
    }
    ...
</script>
</html>

When I click 'NEXT' and history back. the username is go away.




What is the accepted practice for URL login in API REST?

If I have: users, and I need to log in with api rest. What's the best way to do it?

1 /users/id/password

2 /users?id=id&password=pass

If I use the second option, I will need to validate if there are get parameters. If not, It will return all results.

This is not the answer I want now: REST API Login Pattern




How to run Corba on different computers via lan

Resently I learned how to run CORBA app on single PC by this video http://www.youtube.com/watch?v=BpefT4giUoU I have done the same and everything worked well on single pc. But I need to run corba app on two PC's via lan and I don't know how to do it. Maby some config of of client ORBD? I tried to run orbd and server on one PC with -ORBInitialPort and ORBInitialHost params and run client on different PC with ORBInitialPort and ORBInitialHost from remote ORBD, but it doesn't helped




Web api stops after some time but works when I republish it but then again it stops after some time

I am experiencing a weird issue with web api on VS2013. When I publish the api in local IIS, it works perfectly but stops working after some time and throws this error

Could not load file or assembly 'Reporting.Models, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Access is denied.

I have checked Reporting.Models DLL, it exists but the strange thing is if I republish, the api works perfectly but again after sometime it complains the same error.

Any idea why this is happening?




Track Changes in CKEditor

I'm using ckeditor lite plugin in my web based application for track changes but when I wrote "," or "." in starting of any sentence ckeditor converts it into 1/4 and 3/4 respectively. Is there any way to over come this issue?




Django HttpResponseRedirect(reverse()) with not url variable

How can I send the "not url related" variable when I use the HttpResponseRedirect(reverse())?

Below code is sample verifying module, and the syntax must be sent self

at the same time when user upload some file.

views.py :

# -*- coding: utf-8 -*-
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse

from myapp.models import Document
from myapp.models import upload_to_unqiue_folder
from myapp.forms import DocumentForm

def list(request):
    # Handle file upload
    if request.method == 'POST':
        form = DocumentForm(request.POST, request.FILES)
        if form.is_valid():
            newdoc = Document(docfile = request.FILES['docfile'])
            newdoc.save()
 #############is vaild?#####################

      #      exVar = newdoc.docfile.name
        #    arg = /root/cSite/xxxxx
      #      exx = subprocess.Popen(arg, shell=True)
            filename = 'media/' + newdoc.docfile.name

            if(filename.split('.')[1]) != "png":
                 syntax = 'this is not PNG file'

            infile = open(filename, "rb")
            header = infile.read(8)

            if header != '\211PNG\r\n\032\n':
                syntax = 'not a valid PNG file'

            else:
                syntax = 'valid';


        # Redirect to the document list after POST
            return HttpResponseRedirect(reverse('cSite.views.list'))
    else:
        form = DocumentForm() # A empty, unbound form

    # Load documents for the list page
    documents = Document.objects.all()

    # Render list page with the documents and the form
    return render_to_response(
        'list.html',
        {'documents': documents, 'form': form},
        context_instance=RequestContext(request)
    )




Select SQL data in php and sort

Hi guys new to PHP and mySQL and have a question regarding how to display SQL records within a web page, ideally it would be displayed in a box where a scroll bar could be used to sort through the records.

It would be perfect if the fields could be displayed like; |ID|John|Shoes| for example.

Any advice on how to make this happen is greatly appreciated. If anyone could advise on how to generate an incremental onvoice number like #001>#002 that would be a bonus.




Deploying Telerik Reporting to Azure Server

I am using telerik Reporting in my MVC application which is working fine on local machine.now when i have deploying my application to azure server it is not deployed and give me the error of not finding Telerik.Reporting namespace.

For solving this issue ,what i do is in my project-

*Set all telerik.reporting.dll property Copy Local=true

*On azure server physically i have copy telerik reporting dll to bin folder .

But i am not any solution .Please Provide the solution . Thanks in advance.




Extract total number of google search results for custom search using python

Extract total number of google search results for custom search using python. I could observe that approx. number of results are display for normal search, but for custom search it doesnt display total results.




angular calling web api delete

Here's my service:

mystuffServices.factory("Country", function ($resource) {
    return $resource("/api/countries/:id", { id: '@Id' }, {
        update: {
            method: 'PUT'
        }
    });
});

routeprovider

mystuffApp.config(['$routeProvider',
  function ($routeProvider) {
      $routeProvider.        
        when('/countries', {
            templateUrl: '../Views/Countries/index.html',
            controller: 'CountryListCtrl'
        }).
        when('/countries/create', {
            templateUrl: '../Views/Countries/create.html',
            controller: 'CountryCreateCtrl'
        }).
        when('/countries/:Id', {
            templateUrl: '../Views/Countries/detail.html',
            controller: 'CountryDetailCtrl'
        }).
        when('/countries/:Id/edit', {
            templateUrl: '../Views/Countries/edit.html',
            controller: 'CountryEditCtrl'
        }).
        otherwise({
            redirectTo: '/countries'
        });
  }]);

I can delete a country from CountryDetailCtrl in this way:

mystuffControllers.controller('CountryDetailCtrl', ['$scope', '$routeParams', 'Country','$uibModal','$location',
    function ($scope, $routeParams, Country, $uibModal, $location) {
        $scope.country = Country.get({ Id: $routeParams.Id });

        $scope.deleteCountry = function (country) {
            country.$delete(function () {
                $location.path('/countries');
            });
        };

        $scope.confirmDelete = function (size) {

            var modalInstance = $uibModal.open({
                animation: true,
                templateUrl: '../Views/Modals/deleteCountryModal.html',
                controller: 'ModalInstanceCtrl',
                size: size
            });

            modalInstance.result.then(function () {
                $scope.deleteCountry($scope.country);
            });
        };
    }

]);

But when I'm trying to do the same from CountryListCtrl (when I see the list of countries, I don't want to enter country's details to delete it) I see "405 Method Not Allowed", "The requested resource does not support http method". I can see that it works if request url is http://localhost:59673/api/countries/id but it fails when it is http://localhost:59673/api/countries.

Here's my delete attempt in CountryListCtrl:

mystuffControllers.controller('CountryListCtrl', ['$scope', 'Country','$uibModal',
    function ($scope, Country, $uibModal) {

        $scope.countries = Country.query();    

        $scope.deleteCountry = function (country) {
            country.$delete(function () {
                $location.path('/countries');
            });
        };

        $scope.confirmDelete = function (size, id) {            

            var modalInstance = $uibModal.open({
                animation: true,
                templateUrl: '../Views/Modals/deleteCountryModal.html',
                controller: 'ModalInstanceCtrl',
                size: size
            });

            modalInstance.result.then(function () {
                $scope.country = Country.get({ Id: id });                
                $scope.deleteCountry($scope.country);
            });
        };
}
]);

I believe I should change my factory code to be able to use delete in my 'custom' way but I don't know how. I'm terrible sorry, if I'm asking about some common, easy things. I just started learning angular and web api, trying to make an app editing codes which I found over internet and learn this way.

Thank you.




Client- side (browser) 3D Viewer

I am looking for a browser based viewer for 3D objects. The model(s) are going to be fairly large (millions of faces).

Additional requirements:

  • GIS capabilities
  • ability to stream the model
  • smooth and fluid view

Many thanks :)




A purely ajax-oriented front-end paradigm?

I am new to web development. I am considering a general working paradigm for front-end web pages as below:

enter image description here

  1. First, client will request server on some URL, and server will return a pure static HTML page to client. Note that this static HTML page MUST be readily wired up with CSS and Javascript. It may contain placeholders that will be filled later.
  2. Second, once the page is loaded in the client browser, a init() script will be invoked and send an AJAX call to the server's RESTful API. The server will respond some data to client for initial display. i.e. to fill the placeholders in step 1.
  3. Now client page is ready with all placeholders filled. Customer can view the page and perform activities on it. These activities can trigger ad-hoc AJAX calls to the server's RESTful API to get necessary data.

I think this paradigm has the following benefits:

  1. The initial response is quick because it is purely static HTML and no server-side process involved for the first request.
  2. No need to learn various detailed syntax such as JSP, Expression Language, scriptlet, etc.
  3. Simple development paradigm. Server side just need to provide a init() API and other business-related APIs, all RESTful.

Is this paradigm OK? Is there any limitations or flaws?




mercredi 25 novembre 2015

Odoo : Main JS file is not loading on mobile device?

I host my odoo on server and modifying theme using html editor . but there occurred an error . Website navigation is not working on mobile but in browsers mobile it works fine.Because its not working on mobile , For this we use developer tool of andriod to find out the problem . On mobile main js file of odoo is not working we open that file in browser. Which was empty . Name of this file "website.assets_frontend.js" it compile every time when we reload page. Location of this file "8069/web/content/4796-3ea3e05/website.assets_frontend.js" "4796-3ea3e05" this folder generate by odoo with new name while reload page.




css color issues. some colors of my website doesn't display on laptop screen

I have a strange problem. Some parts of the my designed website colors on LCD monitors and screen of mobiles is displayed but the colors do not represent the laptop screen.What's the problem?




BootStrap not displaying correctly on chrome

I just started learning BootStrap and when I tried to implementing this template, it doesn't get displayed correctly on Gooogle Chrome, but does on FireFox. What might be the problem? Is Chrome not compatible?

        <nav class="navbar navbar-default">
          <div class="container-fluid">
            <!-- Brand and toggle get grouped for better mobile display -->
            <div class="navbar-header">
              <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
              </button>
              <a class="navbar-brand" href="#">Brand</a>
            </div>

            <!-- Collect the nav links, forms, and other content for toggling -->
            <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
              <ul class="nav navbar-nav">
                <li class="active"><a href="#">Link <span class="sr-only">(current)</span></a></li>
                <li><a href="#">Link</a></li>
                <li class="dropdown">
                  <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Dropdown <span class="caret"></span></a>
                  <ul class="dropdown-menu">
                    <li><a href="#">Action</a></li>
                    <li><a href="#">Another action</a></li>
                    <li><a href="#">Something else here</a></li>
                    <li role="separator" class="divider"></li>
                    <li><a href="#">Separated link</a></li>
                    <li role="separator" class="divider"></li>
                    <li><a href="#">One more separated link</a></li>
                  </ul>
                </li>
              </ul>
              <form class="navbar-form navbar-left" role="search">
                <div class="form-group">
                  <input type="text" class="form-control" placeholder="Search">
                </div>
                <button type="submit" class="btn btn-default">Submit</button>
              </form>
              <ul class="nav navbar-nav navbar-right">
                <li><a href="#">Link</a></li>
                <li class="dropdown">
                  <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Dropdown <span class="caret"></span></a>
                  <ul class="dropdown-menu">
                    <li><a href="#">Action</a></li>
                    <li><a href="#">Another action</a></li>
                    <li><a href="#">Something else here</a></li>
                    <li role="separator" class="divider"></li>
                    <li><a href="#">Separated link</a></li>
                  </ul>
                </li>
              </ul>
            </div><!-- /.navbar-collapse -->
          </div><!-- /.container-fluid -->
        </nav>
                ...
              </div>
            </nav>

enter image description here




Django code 414, message Request-URI Too Long

i have this error on django 1.8. I need increase the url of django server for avoid this message.

Thank you.




How to connect dot.fm domain name to a hosting?

So I have a hosting on hetzner and a domain name on dot.fm, but I can't figure out how to befriend them.

dot.fm admin panel doesn't allow me to specify the ip of the machine, only nameservers, which, if I understand it right, is not enough, and domain apps which I don't understand, though it doesn't seem like something I need here.

dot.fm admin panel

For nameservers I used the ones specified here (Germany ones)

I'm running uwsgi \ nginx on Ubuntu 15. My nginx config has the following lines:

server {
    # the port your site will be served on
    listen      80;
    # the domain name it will serve for
    server_name 78.47.157.155 guardian.fm www.guardian.fm;
    # ...
}

That doesn't seem to help though.




How to determine the price for custom software?

I am working for a company that has just entered the field of software development, and we do not know how to price out custom software.

There are so many factors at play, and man hours (to develop the software) are only a fraction of determining the cost. I think we must look at how this will benefit the customer, and how much they value the software. But, we also don't want to scare them, or ask for anything outrageous.

The current project is a web application built with Laravel. It's pretty complex - there's an administrator backend, which has a lot of administrative tasks, such as adding users, adding projects, adding calendars, etc. Then, there's a frontend for the employees, where they are able to download and view calendars, handbooks, and other downloads. They can also submit time off requests, update personnel records, submit VA-4 and W-4, direct deposit, and other forms. Then, there is a frontend for the contractors. The contractors portion of the site is for their contractors and subcontractors to login and view/download project plans. And, finally, there is an extremely complex portion that is for tracking equipment usage, employee time on job sites, materials (expenses) for job sites, and other things. They use to do this through Excel, but then they decided to bring everything web-based, so that their employees can work on this in the field on iPads. As such, this portion of the application mimics excel, and is laid out as spreadsheets. The application as a whole tracks user activity (what they are doing, pages they are viewing, actions they make) and has notifications for essentially everything.

I've only briefly explained the project above, and this is the first custom software we have developed for a client. We don't know what to charge them, and we believe that somewhere between $75,000 and $100,000 is reasonable. Without knowing too many details, and from my brief explanation, does this sound fair? What is necessary to determine the cost of custom software? How do most software companies do this?