samedi 28 février 2015

JavaScript wont send

I run the Python Script then run the webpage. I get the following information?



b'GET / HTTP/1.1\r\nOrigin: null\r\nSec-WebSocket-Key: 4seUHkSKT1/gfeLQQCSXjg==\r\nConnection: Upgrade\r\nUpgrade: Websocket\r\nSec-WebSocke'
b't-Version: 13\r\nUser-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko\r\nHost: localhost:9999\r\nCache-Con'
b'trol: no-cache\r\n\r\n'


The python Script is waiting for something else? Why can't I send the string "hi". Why is the word Mozilla in the first bit of information, I don't use it? When I have Python Script connecting to Python Script it sends fine as long as I close the connection on the client side. I have tried many different ways of fixing this, Why can't Python receive the text HI?


Java Script



<title></title>

</head>
<body>
<h1></h1>
<script>
var ws = new WebSocket("ws://localhost:9999/");
ws.send("Hi");
ws.close;

ws.onopen = function() {
document.write("How do I call this function to load this line?")
ws.send("Hello Mr. Server!");

};

ws.onmessage = function (e) { alert(e.data); };

ws.onclose = function() { };



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


Python Script



import socket

sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.bind(("", 9999))
sock.listen(5)

import sys


data = []

client, address = sock.accept()


while True:

tmp = client.recv(128)

print(tmp)




How to read website data by auto-filling required fields from C#

I want to read water level data from the following website for my research purposes: http://ift.tt/1vMAzVI


When I fill the required fields of this page, it redirects to a new page: http://ift.tt/1LZ4n5r


I need the data regularly and for all stations. I have some experience in C# along with HTMLAgilityPack, but not get any point How can I do that using C#. Can anyone help me in this regard?





Web Mercator formulas spitting out blatantly incorrect values

I've been trying to convert some latitude and longitude coordinates to Web Mercator pixel form, and the formulas listed on wikipedia are spitting out blatantly incorrect values. Wikipedia says the world coordinates go from 0 to 256 on the X and Y axis when not scaled. The formulas listed on the wikipedia page easily spit out values a large amount above 256.


For example, a longitude of 87.7494 radians, when plugged into the formula for the X-axis, produces 3703.23219542. This value is way above 256.


Try it yourself: (128 / pi) * (2 ^ 0) * (87.7494 + pi)





--kiosk-printing effecting all chrome instance

I am using the --kiosk-printing with the --app=myApp option - in order to print automatically.


The problem is - that if from one hand - I afterwards open a different instance of Chrome - also over there the printing will be automatically. and on the other hand - if there is already instance of chrome open - the kiosk-printing doesnt work.


Any ideas for help? Thanks!





Cursor.find returns undefined, MongoDB [duplicate]


I am trying to convert my find cursor object into an array using the toArray() function. I have been having trouble understanding the callback required in this function and have tried implementing it in the following way but it returns undefined. Any help on how to use the toArray() method is much appreciated



var collection = db.collection('notes');
var find = collection.find(cr);
var findArray = [];
findArray = find.toArray(function(err, items){
findArray = items;});
console.log("Found: ");
console.log(findArray);




How do I delay the start of some clouds on this webpage?

I'd like to delay some clouds from starting on http://ift.tt/1EAuvBo, neither animate delay nor transition delay seem to work. How would I accomplish this?


View the code here: http://ift.tt/1Jxkg1Q





The form action of my html form isn't writing a file on my server

Just a warning, this is my first experience with any kind of html or php, so my apologies for complete oversight on my part.


My problem is that I'm using an html form to trigger an event, and the action script I'm using doesn't seem to write to a file.


Here's the code for my html file:



<html><body>
<form action="action.php" method="post">
<input type="submit" value="Trigger this event.">
</form>
</body></html>


And my php file:



<?php
$file = 'status.txt';
file_put_contents($file, "1");
header('location:/index.html');
?>


So basically I want a file to be rewritten with just a "1" so that another program that loops server-side can read that file, take an action when it reads 1, rewrite the txt back to 0, loop. There's no need for input from the user; I'm mostly using the submit button as a toggle.


When I run the php file from the command line, it rewrites the file just fine. When I click the submit button on the html site, the header function knocks me back to the index page, so I know that the browser is reading the php file. It just doesn't write to the file.


If anyone sees the problem, or has an easier way to accomplish my goal( preferably using php), please tell.


Thanks.





ODBC not connected HTML/PHP

The title may be misleading. I apologize for that. Anyways, I am confused about SQL and ODBC.


On my website, I am trying to setup a register page. Basically, on my dedicated server with MYSQL running on it, I setup some register.php files so that when a person registers on the site, it gets put into a certain database in SQL. When I try to register, I get "odbc not connected" Do I need to add a new data source? Example of the html/php file: "Register.php"



<?php
$aw=$_GET["q"];
$aws=$_GET["q2"];
$awts=$_GET["q3"];
$conn = odbc_connect('USER_MEMBERDB','Test','Test123');
//$sql="SELECT * FROM chr_log_info WHERE id_loginid = '$q'";
if ($conn)
{
$query = "select * from chr_log_info where id_loginid = '$aw'";
//perform the query
$result=odbc_exec($conn, $query)or die("Error Here!");;

// $aw = mssql_escape_string($aw);
// $aws = mssql_escape_string($aws);

$slashRead1 = "";
$slashRead2 = "";
for($i = 0; $i < strlen($aw); $i++){
if($aw[$i] == '\\'){
$slashRead1 = 'yah';
}
}

for($i = 0; $i < strlen($aws); $i++){
if($aws[$i] == '\\'){
$slashRead2 = 'yah';
}
}

if(!empty($slashRead1) && !empty($slashRead2)){
echo "Username and Password values cannot be accepted. Please change your Username and Password!";
}else if(!empty($slashRead1)){
echo "Username value cannot be accepted. Please change your Username!";
}else if(!empty($slashRead2)){
echo "Password value cannot be accepted. Please change your Password!";
}else{
if(empty($aws)){
echo "Please fill-in the form completely!";
}else{
$count = 0;
//fetch tha data from the database by row
while(odbc_fetch_row($result)){
for($i=1;$i<=odbc_num_fields($result);$i++){
$row = odbc_result($result, $i);
if(!empty($row)){
$count++;
}
}
}

if(empty($aw)){
echo "Please fill-in the form completely!";
}else if($count != 0){
echo "Sorry, the username you entered is not available!";
}else if(strlen($aws) < 6){
echo "Please enter more than 6 characters for your password!";
}else{
$query1 = "Select id_idx from chr_log_info";
$result1=odbc_exec($conn, $query1)or die("Error Here!");;
while(odbc_fetch_row($result1)){
for($i=1;$i<=odbc_num_fields($result1);$i++){
$row = odbc_result($result1, $i);
}
}
$row++;
$query2 = "Select propid from chr_log_info";
$result2=odbc_exec($conn, $query2)or die("Error Here!");;
while(odbc_fetch_row($result2)){
for($i=1;$i<=odbc_num_fields($result2);$i++){
$row2 = odbc_result($result2, $i);
}
}
$row2++;
$query3 = "Insert into chr_log_info(id_idx, propid, id_loginid, id_passwd, id_sexType) values('$row', '$row2', '$aw', '$aws', '$awts')";
$result=odbc_exec($conn, $query3) or die("Error Here!");
echo "Congratulations! You have successfully registered!";
}
}
}
//close the connection
odbc_close ($conn);
}
else echo "odbc not connected";
?>


Another HTML file that is used is this: "responsexml.html"



<?php
$q=$_GET["q"];

$conn = odbc_connect('USER_MEMBERDB','Test','Test123');
if ($conn)
{
$q = mysql_escape_string($q);

$slashRead = "";
for($i = 0; $i < strlen($q); $i++){
if($q[$i] == '\\'){
$slashRead = 'yah';
}
}

if(!empty($slashRead)){
echo "Username value cannot be accepted!";
}else{
//the SQL statement that will query the database
$query = "select * from chr_log_info where id_loginid = '$q'";
//perform the query
$result=odbc_exec($conn, $query) or die("Wrong!");

//fetch tha data from the database
$count = 0;
while($row = odbc_fetch_row($result))
{
for($i=1;$i<=odbc_num_fields($result);$i++)
{
$row = odbc_result($result, $i);
if(!empty($row)){
$count++;
}
}
}

if(empty($q)){
echo "";
}else if($count != 0){
echo "Sorry, the username is not available!";
}else{
echo "Username is available!";
}
}

//close the connection
odbc_close ($conn);
}
else echo "odbc not connected";
?>


Am I missing something? Or do I need to download certain drivers for my dedicated server for it to run. Any suggestions?





What's the name of this kind of system?

i'm about to start a project for sharing files, announcements, and other stuff between branches of a company, it must be a web based system, with all the layers as profile management, employee communication, etc... What i don't know is what's the name of this kind of systems? It's a web based system wich will only allow access to the company's personnel(still don't know how to do that - help please), and must connect the different branches.





How to Persist ALL changes in web developer (F12 mode)

Is there a way to cache the changes I make when I edit remote pages.


I am using chromes native web dev toolkit but i will switch to any extension or browser to make this work.


Often times I change the loaded css/js files but am unsure how to persist the changes so that next time I visit the website its the same.


I do know how to persist css changes, but I want to be able to persist all changes to all the code that is processed locally (like the js/dom structure)





how to get database data from a web page using PHP

In this case i want to extract data from this URL: http://ift.tt/1aCzGWj

i did use HTML_DOM but it(OBVIOUSLY) only extracts HTML DATA.

IT IS JUST FLIGHT INFORMATION!

thanks btw.





Javascript code not running in browser

I have following javascript code and I am trying to run it on Google Chrome and Internet Explorer but in both I get a blank page. I can't understand what is the error in the script? Please tell me what is wrong with it.



<!DOCTYPE html>
<html>
<head>
<title>Changing Background Color</title>


</head>

<body>
<script type= "text/javascript">
document.write( "test run");
var colors={"red","orange","green","blue","brown","purple","gray","white"}
var index=0;
function changecolor()
{
for(index=0;colorindex<colors.length;index++)
{
document.bgcolor=colors[index];
}
}
function startchange()
{
setinterval("changecolor()",3000);
}
window.onload=startchange();
</script>
</body>

</html>




How to validate that a string from a textbox contains only 2 characters and 3 numbers?

I have checked other answers and am not finding what I need to know. I have a variable named nationalID which can only contain 2 characters and 3 numbers (ex. aa123) How do I say this in java? I am using Netbeans and have looked at all of the methods that pops up but I am not seeing anything that will help me. This is what I have so far.



private String validator(String nationalID, String lastName, String firstName, String dateOfBirth) {
// nationalID should have 2 characters and 3 digits ex. AB123
// dateOfBirth should be yyyy-mm-dd

if(nationalID.length() != 5 || nationalID.){
String err;
return err = "Your National ID has to be 5 characters long";
}

return "";
}




Redirect for non www to www and http to https

Hi can someone please help me? I urgently require some help with a redirect code (that will work) for my website (it is hosted on an apache server). What I require is a code that will redirect ALL traffic from non www to www as well as All traffic from HTTP to HTTPS. I have tried many codes but they either do not work fully or I get stuck on a redirect loop. So basically I want a code that will redirect: hxxp:// .example.com AND hxxp://www.example.com AND hxxps://.example.com TO hxxp://www.example.com


Please can anybody help with this?


(I have had to replace the t's in http & https for x's to allow the post)





Adding Basic Web Browser in an Android Music Application

Hey fellow programmers,


I need some help trying to figure out why my web browser in my android application is crashing. Any help would be great. I will post my codes on the affected JAVA classes that is connected to the browser, technically its quite a big program with different classes. I'll also include the android manifest file. So the last checkup that I did was I tried opening it with my tablet under Jelly Bean but its still crashing.


This is the code for the webactivity class



package com.example.gamaraza;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebView;

public class WebActivity extends Activity {

private WebView webView;

@SuppressLint("SetJavaScriptEnabled")
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.weblayout);

webView = (WebView) findViewById(R.id.buttonUrl);;
webView.getSettings().setJavaScriptEnabled(true);
webView.loadUrl("https://www.google.com");
}


}


Android Manifest would be



<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://ift.tt/nIICcg"
package="com.example.gamaraza"
android:versionCode="1"
android:versionName="1.0" >

<compatible-screens>
<!-- all small size screens -->
<screen android:screenSize="small" android:screenDensity="ldpi" />
<screen android:screenSize="small" android:screenDensity="mdpi" />
<screen android:screenSize="small" android:screenDensity="hdpi" />
<screen android:screenSize="small" android:screenDensity="xhdpi" />
<!-- all normal size screens -->
<screen android:screenSize="normal" android:screenDensity="ldpi" />
<screen android:screenSize="normal" android:screenDensity="mdpi" />
<screen android:screenSize="normal" android:screenDensity="hdpi" />
<screen android:screenSize="normal" android:screenDensity="xhdpi" />

<screen android:screenSize="large" android:screenDensity="ldpi" />
<screen android:screenSize="large" android:screenDensity="mdpi" />
<screen android:screenSize="large" android:screenDensity="hdpi" />
<screen android:screenSize="large" android:screenDensity="xhdpi" />

<screen android:screenSize="xlarge" android:screenDensity="ldpi" />
<screen android:screenSize="xlarge" android:screenDensity="mdpi" />
<screen android:screenSize="xlarge" android:screenDensity="hdpi" />
<screen android:screenSize="xlarge" android:screenDensity="xhdpi" />

</compatible-screens>

<supports-screens android:resizeable="false"
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:xlargeScreens="true"
android:anyDensity="true"
android:requiresSmallestWidthDp="240"
android:compatibleWidthLimitDp="240"
android:largestWidthLimitDp="320"/>
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />

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


<application
android:allowBackup="true"
android:icon="@drawable/glauncher"
android:label="@string/app_name"
android:theme="@android:style/Theme.Light.NoTitleBar" >
<activity
android:name="com.example.gamaraza.MainActivity"
android:label="@string/app_name" >

<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity

android:label="@string/app_name"

android:name="com.example.gamaraza.CreditActivity" >

</activity>

<activity

android:label="@string/app_name"

android:name="com.example.gamaraza.DubActivity" >

</activity>
<activity

android:label="@string/app_name"

android:name="com.example.gamaraza.AboutActivity" >

</activity>
<activity

android:label="@string/app_name"

android:name="com.example.gamaraza.SettingsActivity" >

</activity>

<activity
android:name=".WebViewActivity"
android:theme="@android:style/Theme.NoTitleBar" />

<activity
android:label="@string/app_name"
android:name=".WebBrowser" >
</activity>
</application>

</manifest>




C# webbrowser not showing some sites

I making



webBrowser1.Navigate(@"http://mathfights.com/");


but page not showing. I see 2 js error, and webBrowser1.DocumentText is equal to



<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" class="__meteor-css__" href="/016f4f321f8d86535afdfd9fefad340430e600c1.css?meteor_css_resource=true">


<script type="text/javascript">__meteor_runtime_config__ = {"meteorRelease":"METEOR@1.0","ROOT_URL":"https://mathfights.com","ROOT_URL_PATH_PREFIX":"","kadira":{"appId":"okW9u8sdBTBhxxq9B","endpoint":"http://ift.tt/1Dl0OQy","clientEngineSyncDelay":10000,"enableErrorTracking":true},"accountsConfigCalled":true,"autoupdateVersion":"6307c7400397708589df89a95daedcbaa3ad4e09","autoupdateVersionRefreshable":"2d8c01b07ebd98bd28aa1cac3a0e99ed987a3d55","autoupdateVersionCordova":"none"};</script>

<script type="text/javascript" src="/0fb3bef989a93fa8422df51c13e7cef522354fb4.js"></script>



<meta name="fragment" content="!">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>MathFights - Become a Math Champion</title>
<meta name="viewport" content="width=device-width">
<link rel="shortcut icon" href="/img/favicon.png"/>
<link href='http://ift.tt/1vIYCEO' rel='stylesheet' type='text/css'>
<script src="http://ift.tt/1doUtf9"></script>
</head>
<body>

</body>
</html>


How to solve this problem?





Scaling web page on mobile devices

I have a problem with automatically scaling web page after enter the page in browser on Iphone 6 and Android. But site is correctly look in Ipad 2 and Iphone 4 and 5. Can anyone help me with this issue? See view issue here


I want to see in screen something like this


Thank you for help)





how large websites find and sort data

here is a thing,consider a very large website that holds a load balancer M web servers and N database server,


a given user in this website has big amount of data that is spread across the N databases servers,user A


so if we would like to examine how the websites serves such a user then many programing problems appear,


first problem is : if the database servers that hold user A data are full then how the website automatically starts storing data on a new database server?


second problem is: how the website keeps track of all user A data,because consider that we wana show all of user A data on http request,then how the website finds all user A data from the given N database servers and displays it?


third problem is:consider that the websites offers a simple search function that finds records of data by a given factor and sorts the result to be displayed,then how such a search function works,how is it able to run across all of the N database servers and fetch relevant data and eventually sorting it by the given factor,i.e not only that we will have to find all matching data on the N database servers for the user but also we have to take the data on sever 1,server2, ... , server N and combine it then sort it,how is that even possible?


any answer to any problem is accepted,please dont vote this down so other not get a bad impression because i want others to read it and try to answer,


thank you





vendredi 27 février 2015

Use inclick api in php

Can anyone tell me how to integrate inclick_api to the php website .And how do we create a publisher for the ad server account using this api?? Thanks in advance





Remove .php extension and add one slash

good day


i am just stuck in the middle of something i want to remove .php extension and make one slash for example


my current url is


http://ift.tt/1AkSBcX


Now i want to change it to


http://ift.tt/18wOFQY


Is it possible to do this i am clueless to how to make this happen


thanks :)





Where can I find hive-hwi-war files?

I use apache hive 1.0.0 and I use the bin version, so I just use it. But when I want to activate the hive web interface, it's WARN me that hive war files not found on certain directory. And I check it, that files really not found. So, where can I find that's file without compiling and to activate hive HWI?


Thanks a lot.....





How do you install Scrapy on a Mac?

I'm new to using a Mac so I'm completely confused. The installation instruction page doesn't list how to install it on a Mac http://ift.tt/1ayYYoi





MIDI Javascript: how to generate a single MIDI note in javascript without libraries?

I've been reading the documentation about Web Midi API and I tried to look at different websites about the topic. Is there a way of playing a midi sound without using fancy libraries and stuff? Let's say I just want to generate a single note: how do I access the midi module that is present on your local machine? Can anyone write a small snippet of code that plays a single note and that I can simply embed in the element?





What does it mean to buy a top level domain(TLD)?

Recently I read news about Google bought .app, Amazon bought .buy, what does it mean? They own every domain name followed by .app? I can only register with google if I want to have blahblah.app, and they can say no even if no one is using it?





What can i use for create a dynamic web project in eclipse not using Maven?

i just want use Spring 4 and Hibernate 4. that's because in my company we don't have internet service for Maven or gradle.





Is there an easy way to access an authenticated web environment after manual authentication in Python?

I am not an expert in this subject, so please forgive any ineptitude in explaining what I'm trying to achieve.


There is a website from which I want to download an image regularly. I have in mind a simple operation such as the following:



while True:
urllib.urlretrieve(
"http://ift.tt/1ASfDM5",
safeFileName()
)


In order to access this website in a conventional web browser, I sign in to a login page or use an imported X.509 certificate for authentication.


In this instance, I want to download an image from a protected page. Previously, however, I've wanted to do other simple operations on other protected pages that feature different login procedures.


Now, I don't know the first thing about writing the code necessary to automatically authenticate a script to these multiple login procedures (nor do I really have the time to learn how to do this -- and to do it securely), so is there some easy way for me to do this? What I have in mind is a Python script that runs, starts up a conventional browser (ELinks, Firefox etc.) for the purposes of authentication, accesses the necessary environment information resulting from the successful authentication and then carries on to do its simple tasks, happily authenticated.


Does such an approach exist?





How to access the headers a HTTP response that you didn't send by AJAX using javascript?

I currently have a login page set up where it sends a HTTP post request to the server and then in a response message it redirects me to another page on the server. On that page I want to access the location header which contains a value that I need to perform future work with my server. Is there anyway to read that location header from the response so that I can get the value?


I know that you can access headers if you sent an ajax request by using the XMLHttpRequest object in the callback! But I am not using ajax so I cannot do that?


Thanks so much!





How to save the value of ng-model in a data store for my knitting group

I am making a website for our knitting group. The first thing I need to do is register who is coming this week. Let's start with me. I've defined a variable "name" and had the name "Gran" passed into it using this code.



<input type="text" placeholder="Please enter your name if you are attending the Knits this week" ng-model="name">
<h3 ng-show="name">Hello! My name is {{name}}.</h3>


I think the value of "name" is now "Gran", and that is stored somewhere in memory. That's nice but not a lot of use because the other group members will want to register on their computers (except Edith has an iPad so she will do it on that, and Janice doesn't do IT so I'll ring her). What is the next step I need to take to learn how to save that value permanently so it can be retrieved over the internet? What is the simplest way to do it, so I can understand, because I'm not a profesional website maker?





Is there any simple way to export PSD file into PNG images without Photoshop?

I make web apps, mostly backend, but sometimes frontend as well, and our designer sends us only PSD files, so we export what we want and how we want. However, Adobe Photoshop is not the cheapest program and although it has one month free trial, I usually need it about once a month and that means downloading and installing PS almost every time I need to export anything and that kind of sucks. Buying PS just for exporting sucks too.


Is there any easier way to get the layers from PSD as PNGs without Photoshop, so I don't have to steal the software or go crazy?





SUPER SIMPLE Web app with VERY small footprint

I need to build a SUPER SIMPLE web app that has a VERY small footprint. I mean, the server will be running on a small electronic device, so no Tomcat, etc. We're thinking HTML, HTML5, PHP, JavaScript.... All of the answers I have found for this question seem to be dated. Anything come to mind as a good way of doing this?





javascript function in td element with passing parameter

I have the following element that displays data retrieved from the database to display the followers an artist has.



<td>
<span id="followers">
<? echo empty($artist['Artist']['followers']) ? 'N/A' : number_format($artist['Artist']['followers']);?>
</span>
</td>


There are some values that are very large and go upto 6 digits. I want to write a Javascript function that will take the substring and only display first 3 digits.


How can I write a function and pass the parameter as the value of : $artist['Artist']['followers']


I can do this in php, but I need to do it in javascript!





How to implement .SCSS on my own website?

I've been experimenting on Codepen just recently and I was wondering how I could implement the code that is displayed on the website on one of my own. I realized that most of the formats used on Codepen aren't pure ".css". I learned it's something new called ".scss". I was wondering where to start and if anybody could help me out in understanding how .scss works. Especially This



body{
background:black;
font-family: 'Varela', sans-serif;
}

.glitch{
color:white;
font-size:0px;
position:relative;
width:268px;
height:654px;
margin:0 auto;
text-indent:-999em;
background:transparent url(http://ift.tt/1AREnUz) center center no-repeat;
}
@keyframes noise-anim{
$steps:20;
@for $i from 0 through $steps{
#{percentage($i*(1/$steps))}{
clip:rect(random(654)+px,9999px,random(654)+px,0);
}
}
}
.glitch:after{
content:'';
width:100%;
height:100%;
position:absolute;
left:2px;
top:0;
overflow:hidden;
clip:rect(0,900px,0,0);
animation:noise-anim 2s infinite linear alternate-reverse;
background:inherit;
-webkit-filter: hue-rotate(90deg);
filter: hue-rotate(90deg);
}

@keyframes noise-anim-2{
$steps:20;
@for $i from 0 through $steps{
#{percentage($i*(1/$steps))}{
clip:rect(random(100)+px,9999px,random(100)+px,0);
}
}
}

.glitch:before{
content: '';
width:100%;
height:100%;
position:absolute;
left:-2px;
top:0;
overflow:hidden;
clip:rect(0,900px,0,0);
animation:noise-anim-2 3s infinite linear alternate-reverse;
background:inherit;
-webkit-filter: hue-rotate(300deg);
filter: hue-rotate(300deg);
}




C# code or library to Update virtual directory contents without breaking clients

I have a lot of regularly updating static content that is made available via HTTP through IIS as a Virtual Directory. I have a C# application that needs to update this static content. The static content represents a matching set. This content changes regularly and is validated before being made available to clients. It has a manifest file with version information. I can update the manifest file last but I don't want to pull the rug from under clients that are already downloading older content and leave them with a dirty set of files. What is the recommended way to do a folder replace so that existing clients don't get a mixed up version of the file set? This must be common but I cannot find any libraries or best practice guidance to do this.





Android hide image from user gallery

i'm using the following phonegap build plugin:



com.chanthu.evri.gcs-file-transfer version="1.0.0"



to download images on devices. The download is ok but the images are visible in user's standard gallery myApp folder. How can i save the images without creating such a gallery ?


The path I use to save them is:



cdvfile://localhost/persistent/myApp/



The path on the android device become:



/storage/sdcard0/myApp/






Flow based visual programming

is there any UI library similar that can help me build Ui similar to yahoo pipes? Just UI and api to connect to my back end. I also want to connect the nodes to my python backend code





custom visual programming environments

I am trying to build a desktop application that uses python lib in backend and in front end i want to build a UI similar to Orange Canvas(visual programming) where there are widgets for each function and connect these widgets


I found this library called QT dataflow which states that it provides a generic template for custom UI but it is full of bugs and is not in active development


So doing changes in same library to get the job done ,I fixed one bug but connector events are pretty lame and not working is there any library i can use to do the same currently qt dataflow is in pyqt4...


also i want to build the same for web app .how can i approach this?





Codeigniter Aliase not working in Views

i wrote a lot of code in codeigniter but i had to restructure my database column prefixes and when i use join queries to join some of my tables in my model's queries there is some tables in one query that have the same id column , i used Alias 'As alias1' for a table name, and model runs successfully without problem but when i pass the $q = $this->db->get() variable to my controller and then pass it to my view and iterate it like this : foreach($q->result() as $res) echo $res->alias1.id; php errors that unknown $alias1.id but i declared alias1 for one of my tables whats the problem ? tnx





online compiler using API

I want to develop an online compiler or rather a website which will take the code and compile it and show the results. I found out Sphere Engine (IDEOne API) . I want to know how can I develop an website which can use the IDEOne API.





unable to view development website when XAMPP is offline

I have a website under development (stored in my htdocs folder). When disconnected from the internet I am unable to view it in safari even though XAMPP (Apache and mySQL) are running.


How do I change this so that I can develop while offline?


Thanks!





SugarCRM on Bluemix

I'm trying to deploy SugarCRM community version on Bluemix. I'm using PHP runtime, I forked out the project from the git repository of SugarCRM community and I bound a mySQL service to the application.


The application runs and came out with the standard installation page of sugarcrm, as I proceed, the screen shows me this error:


Functions associated with the Multibyte Strings PHP extension (mbstring) that are needed by the Sugar application were not found.


MB String Module


Generally, the mbstring module is not enabled by default in PHP and must be activated with --enable-mbstring when the PHP binary is built. Please refer to your PHP Manual for more information on how to enable mbstring support. Location of your PHP configuration file (php.ini): /home/vcap/app/vendor/heroku/heroku-buildpack-php/conf/php/php.ini


I looked through the installation guide of SugarCRM, it seems like I have to go to the root directory of the server to modify php.ini. But I can't find any way to do that since Bluemix is a PaaS.. Anyone can help me with this?





How to Skip column "comments" while using mysqldump

I am using LAMP stack on Ubuntu. Using 'mysqldump' command to dump 'stack_db' into file. While dumping a database to file I don't want column comments in dump.


I tried "--skip-comments and --compact options"


Looking for a solution to skip comments column fields while using mysqldump


Thanks in Advance.





Objective C - Parse JSON

I'm writing a weather app that parses temperatures from JSON file. I posted an image of my code as well as the json file side by side. I feel like i'm pretty close to solving the problem however i'm not sure why the app crashes. Any help is greatly appreciated.


Picture: http://ift.tt/1vFakk0





How to achieve two images one over the other using CSS and HTML?

I have two images. One over the other. When I resize the browser window, the images must be placed at the same position. How do I achieve that?





How to keep new line when posting data to webapi with angularjs from textarea

I have html textarea field. When i have posted data from that field with AngularJS to WebApi I have lost new lines. For example I want to post to WebApi with angularjs string from textarea:


"cm8gQUQgU2tvcGplMQswCQYDVQQLDAJJyDERMA8GA1UEAwwIKi5ta2IubjswggEi MA0GzSqGSIb3DQE2AQUAA4IBDwAwggEKApIBAQC4VhdOMe7u3tsKykWEOjRG49uD p39tLAQls2HUnbx4IMmVfsLwE8aEwQ1cVmd80Ms4Et2GEC8WD6q7LRQ1jynqP5m/ l8+pr+RnoqGD6uF4PKf01ZTneO7DMC/yrWk++PvAG/Q7rKPv1mEY+8IGxjRjKX1M mFh6swc5OzDiD7j4w7I5lp6ouCwAhk1auNn+PQKBSkBl2oGJ"


How to post string to WebApi (with AngularJS) from html textarea untouched?





Using innerHTML in HTML CANVAS

I want to add HTML content to canvas element. If I use fillText then the content is rendered, but while I try to re-size the canvas the text looks blurry and stretched. Or is it possible to re-size the canvas without making the content blurry.





jeudi 26 février 2015

how to get checkbox value from database in php for update data?

in database values are stored as "A,B,C,D,E,F" etc. now i have to fetch those data in the form for update. i have to check the checkbox if it matches the value with database value.


i am doing this kind of code(which i know is wrong)



<input type="checkbox" name="time[]" value="free" <?php if(!strpos($row['best'], 'free')=="false") { echo "checked='checked'";} ?> />Free
<input type="checkbox" name="time[]" value="Open" <?php if(!strpos($row['best'], 'Open')=="false") { echo "checked='checked'"; }?>/>Open Source
<input type="checkbox" name="time[]" value="portable" <?php if(!strpos($row['best'], 'portable')=="false") { echo "checked='checked'"; } ?> />Portable
<input type="checkbox" name="time[]" value="support" <?php if(!strpos($row['best'], 'support')=="false") {
echo "checked='checked'"; }?> />Support




as I can enlarge the '.container' Bootstrap?

I have a page in Bootstrap but i need the '.container' could be more big than now. I want to know how alter the WIDTH of this .container





How to log all redirection hops in Selenium?

I want to log all redirection hops using selenium webdriver. The redirection can be JS based or through meta http-equiv method. The re-directions are fast and some times without any referer header. Webdriver allows to navigate back through driver.back() method in python. I assume the history is maintained by selenium driver, the question is how to obtain it and does it provide all the intermediate hops to reach final destination page?





encountered an internal error while exporting form to excel JDeSurvey app

JDeSurvey. encountered an internal error while trying to export survey to excel,csv,spss and json, any one familiar with this error in JDeSurvey? Your inputs will be appreciated.





Free mp3 tag database

Im making a simple online music player with html,css and php.


Now i would like to send a small portion of the mp3 file to a database or api and receive some music informations.


Are there any databases to do this?


Greez





Any Plugins for TIFF image display Cordova app

AFAIK, TIFF image display in android browsers is a limitation. Please correct me, if I am wrong. Are there any Cordova/Phonegap Plugins that will display TIFF images in most of mobile browsers at least android & iOS. I have the TIFF image as array buffer also as base64. How to display it cordova app?





Any Plugins for TIFF image display Cordova app

AFAIK, TIFF image display in android browsers is a limitation. Please correct me, if I am wrong. Are there any Cordova/Phonegap Plugins that will display TIFF images in most of mobile browsers at least android & iOS. I have the TIFF image as array buffer also as base64. How to display it cordova app?





Web Development and Design Assistance Needed [on hold]

I am in an intro to Web Development class, and we are supposed to take the image our professor gave us and turn it into a webpage. I sorry I can't post the image, for I don't have a high enough reputation to post it, but here is the link to it: http://ift.tt/1AyvJLO . The problem is that he hasn't really taught us that much, other than the bare-bone basics, otherwise he just tells us to go to w3schools. First thing, I guess, is that is it possible to do this webpage without using CSS? We have not touched on it yet in class, and I'm clueless when it comes to it. Secondly, I would appreciate if I can just get some tips on where to get started. A lot of the little details I don't know how to do. I know it sounds like I'm just asking you guys to write this for me and post it, but that isn't my intention. Any tips, or sample code for a part in the image, or just any overall help, is greatly appreciated. Thank you.





How to make a custom clickable by index. Sounds easy huh?

I'm following this tutorial


http://ift.tt/1uTLhDs


I'm trying to make the profile photo's and the pictures posted in the post clickable.


If you visit the link you can see what it basically what it looks like.


Depending on the id of the image, I wanted to venture to a different activity. Here's what I've discovered that confusing me so much.


I've created a JSON file and saved it into a Dynamic Web Page.


"id": 1, "name": "Mark",


"id": 2, "name": "Tom",


The method (name is a textview):



name.setText(item.getName());


makes the name text view the "name" field from the JSON file.


The method:



name.setText(Integer.toString(item.getId()));


makes the name text view the "id" field from the JSON file.


What's crazy is that the values returned are a string and int variable.


So if if try



if (item.getId() == 1) {

Intent myIntent1 = new Intent(context, NameActivity.class);
myIntent1.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(myIntent1);

}



if (item.getId() == 2) {

Intent myIntent2 = new Intent(context, NameActivitySecondAttempt.class);
myIntent2.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(myIntent2);

}


Unfortunately, the if statement doesn't understand the different values for "name" or "id".


I have these if statements in the OnClickListener for the two views that I'm trying to click on. See the extended code below.


profilePic.setOnClickListener(new View.OnClickListener() {


feedImageView.setOnClickListener(new View.OnClickListener() {


Heres some XML



<com.pm.pmv5.listviewfeed.FeedImageView
android:id="@+id/feedImage1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:clickable="true"
android:focusable="true"
android:scaleType="fitXY"
android:visibility="visible" />

<com.android.volley.toolbox.NetworkImageView
android:id="@+id/profilePic"
android:layout_width="@dimen/feed_item_profile_pic"
android:layout_height="@dimen/feed_item_profile_pic"
android:clickable="true"
android:focusable="true"
android:scaleType="fitCenter" >
</com.android.volley.toolbox.NetworkImageView>


When the page loads the numbers or names will correctly show up in the right spot. But the i can't travel to a separate particular activity according to thats posts's name or number.


Can some one help me.


Here's How I've adjusted the class..



package com.pm.pmv5.listviewfeed.adapter;

import java.util.List;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.media.MediaPlayer;
import android.text.Html;
import android.text.TextUtils;
import android.text.format.DateUtils;
import android.text.method.LinkMovementMethod;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.TextView;
import com.android.volley.toolbox.ImageLoader;
import com.android.volley.toolbox.NetworkImageView;
import com.pm.pmv5.R;
import com.pm.pmv5.listviewfeed.FeedImageView;
import com.pm.pmv5.listviewfeed.app.AppController;
import com.pm.pmv5.listviewfeed.data.FeedItem;
import com.pm.pmv5.takeover.BoardActivity;
import com.pm.pmv5.takeover.BoardActivity2;
import com.pm.pmv5.takeover.BoardActivity3;
import com.pm.pmv5.takeover.NameActivity;
import com.pm.pmv5.takeover.StartMenuV1;
import com.pm.pmv5.takeover.StartMenuV2;
import com.pm.pmv5.takeover.StartMenuV3;

@SuppressLint("InflateParams")
public class FeedListAdapter extends BaseAdapter implements
View.OnClickListener {

private Activity activity;
private LayoutInflater inflater;
private List<FeedItem> feedItems;

Context context;
baZOOKA heyNOW;
FeedItem item;
String nueSELECTOR;
MediaPlayer mp;
NetworkImageView profilePic;
FeedImageView feedImageView;
TextView name;

ImageLoader imageLoader = AppController.getInstance().getImageLoader();

public FeedListAdapter(Activity activity, List<FeedItem> feedItems) {
this.activity = activity;
this.feedItems = feedItems;

}

@Override
public int getCount() {
return feedItems.size();
}

@Override
public Object getItem(int location) {
return feedItems.get(location);
}

@Override
public long getItemId(int position) {
return position;
}

@Override
public View getView(int position, View convertView, ViewGroup parent) {

context = AppController.getInstance();

if (inflater == null)
inflater = (LayoutInflater) activity
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
if (convertView == null)
convertView = inflater.inflate(R.layout.feed_item, null);

if (imageLoader == null)
imageLoader = AppController.getInstance().getImageLoader();

name = (TextView) convertView.findViewById(R.id.name);
TextView timestamp = (TextView) convertView
.findViewById(R.id.timestamp);
TextView statusMsg = (TextView) convertView
.findViewById(R.id.txtStatusMsg);
TextView url = (TextView) convertView.findViewById(R.id.txtUrl);
profilePic = (NetworkImageView) convertView
.findViewById(R.id.profilePic);
feedImageView = (FeedImageView) convertView
.findViewById(R.id.feedImage1);

item = feedItems.get(position);

// name.setText(item.getName());

final int ok234 = feedItems.indexOf(1);
int index = feedItems.indexOf("papa"); // index = 2

// name.setText(Integer.toString(ok234));

nueSELECTOR = Integer.toString(item.getId());

name.setText(nueSELECTOR);
// Converting timestamp into x ago format
CharSequence timeAgo = DateUtils.getRelativeTimeSpanString(
Long.parseLong(item.getTimeStamp()),
System.currentTimeMillis(), DateUtils.SECOND_IN_MILLIS);
timestamp.setText(timeAgo);

// Chcek for empty status message
if (!TextUtils.isEmpty(item.getStatus())) {
statusMsg.setText(item.getStatus());
statusMsg.setVisibility(View.VISIBLE);
} else {
// status is empty, remove from view
statusMsg.setVisibility(View.GONE);
}

// Checking for null feed url
if (item.getUrl() != null) {
url.setText(Html.fromHtml("<a href=\"" + item.getUrl() + "\">"
+ item.getUrl() + "</a> "));

// Making url clickable
url.setMovementMethod(LinkMovementMethod.getInstance());
url.setVisibility(View.VISIBLE);
} else {
// url is null, remove from the view
url.setVisibility(View.GONE);
}

// user profile pic
profilePic.setImageUrl(item.getProfilePic(), imageLoader);

// Feed image
if (item.getImge() != null) {
feedImageView.setImageUrl(item.getImge(), imageLoader);
feedImageView.setVisibility(View.VISIBLE);
feedImageView
.setResponseObserver(new FeedImageView.ResponseObserver() {
@Override
public void onError() {
}

@Override
public void onSuccess() {
}
});
} else {

feedImageView.setVisibility(View.GONE);
}
profilePic.setOnClickListener(new View.OnClickListener() {

@Override
public void onClick(View v) {
// TODO Auto-generated method stub

if (item.getId() != 1) {

name.setText(item.getName());

}

if (item.getId() == 2) {

// name.setText(item.getName());

}

}
});

feedImageView.setOnClickListener(new View.OnClickListener() {

@Override
public void onClick(View v) {
// TODO Auto-generated method stub

switch (item.getId()) {

case 1:

mp = MediaPlayer.create(context, R.raw.cameraflash);
mp.setVolume(100, 100);
mp.start();

Intent myIntent1 = new Intent(context, NameActivity.class);
myIntent1.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(myIntent1);

break;

case 2:

mp = MediaPlayer.create(context, R.raw.cameraflash);
mp.setVolume(100, 100);
mp.start();

Intent myIntent2 = new Intent(context, StartMenuV1.class);
myIntent2.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(myIntent2);

break;
case 3:

mp = MediaPlayer.create(context, R.raw.cameraflash);
mp.setVolume(100, 100);
mp.start();

Intent myIntent3 = new Intent(context, StartMenuV2.class);
myIntent3.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(myIntent3);

break;
}

}
});

return convertView;

}

@Override
public void onClick(View v2) {
// TODO Auto-generated method stub
switch (v2.getId()) {
case R.id.profilePic:

break;
case R.id.feedImage1:

break;

}
}

}




What programming language to check if a website's text has changed?

What programming language would be able to write a program where it goes and checks a website's text say twice a day to see if a certain number has dropped below a certain threshold, and then notify me by text message if it has?


For example, my friend wants me to write a program to help him register for a class, but currently the class is full. He wants the program to go to this link:


http://ift.tt/18rei5J


Then the program should somehow click on the link "Schedule for Psych 204", opening up a little box below the link with information about how many students are in the class. Currently, clicking on the link reveals



PSYCH 204 | 3-4 units | Class # 30341 | Section 01 | Grading: Letter or Credit/No Credit | LEC | Students enrolled: 33 / 30



The program should then be able to check if the Students enrolled: 33 / 30 ever drops to 29 / 30 twice a day and send me a text message if it is.


What's an easy programming language to carry this out?





Dynamic Data filtering

I am creating a web project in which user enters some filter criteria and data are rendered to a grid. The criteria will be passed to a Rest Service and will be based on properties defined in the model classes defined on the server.


Example: let's assume that the service returns chocolates and the user requests ((ChocolateColor == DarkBlack) || (ChocolateColor == White) && ChocolatePrice > 1.5 Euros) || ChocolateOwner == "ChocoMan". I want to be able to extract the filter runtime and convert it to a filter against my model classes. Instead of creating tons of code parsing the filter is there more clever way to apply my filters ?


The filters will be given directly as boolean expressions or will be constructed by using a GUI.





Dynamic Data filtering

I am creating a web project in which user enters some filter criteria and data are rendered to a grid. The criteria will be passed to a Rest Service and will be based on properties defined in the model classes defined on the server.


Example: let's assume that the service returns chocolates and the user requests ((ChocolateColor == DarkBlack) || (ChocolateColor == White) && ChocolatePrice > 1.5 Euros) || ChocolateOwner == "ChocoMan". I want to be able to extract the filter runtime and convert it to a filter against my model classes. Instead of creating tons of code parsing the filter is there more clever way to apply my filters ?


The filters will be given directly as boolean expressions or will be constructed by using a GUI.





What are the most effective ways to manage a large list of tagged hyperlinks?

I am building a webpage that will contain thousands of links.




  • I am considering nesting them using lists so that the user can navigate through topics, and then narrow in on subtopics.




  • Each topic and subtopic would start with a heading.




  • Links are categorised by the type of source of information they are (academic, journalistic, public commentary, gov't, etc). This means I need to find out an efficient way of tagging them.




  • I want to build this in a way that is manageable from the start and does not start to bloat as it becomes bigger (as I begin adding thousands of items).




Basically I need to do this in a way that makes it easy to maintain down the road.


Any suggestions greatly appreciated!





What is causing my expected-unqualified id before '{' I only get it when I add the web code


the only portion that fails is the web block half way down. exact syntax is sketch_feb26b.ino:652:1: error: expected unqualified-id before '{' token I'm thinking too many brackets/wrong place?


some of the memory calls have been omitted to save space


the includes all work #include




#include <Ethernet.h>
#include <avr/pgmspace.h>
#define DATA_1 (PORTC |= 0X01) // DEFINE a value for DATA as 1 // for UNO



the defines all work




#define DATA_0 (PORTC &= 0XFE) // DEFINE a value for DATA 0 // for UNO
#define STRIP_PINOUT (DDRC=0x3F) // DEFINE PORTC as OUTPUT // for UNO (change pins 0-5; leave PORTC 6 & 7 alone)
#define NOP "nop\n\t"
#define RED 0x0000ff
#define ORG 0x7700ee
#define YEL 0xff00ff
#define GRN 0xff0000
#define CYN 0x666600
#define BLU 0x00ff00
#define VIO 0x004040
#define MAG 0x00ffff
#define WHT 0xffffff
#define BLK 0x000000
#define R1 {RED,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK},
#define R2 {BLK,RED,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK},
#define R3 {BLK,BLK,RED,BLK,BLK,BLK,BLK,BLK,BLK,BLK},
#define R4 {BLK,BLK,BLK,RED,BLK,BLK,BLK,BLK,BLK,BLK},
#define R5 {BLK,BLK,BLK,BLK,RED,BLK,BLK,BLK,BLK,BLK},
#define R6 {BLK,BLK,BLK,BLK,BLK,RED,BLK,BLK,BLK,BLK},
#define R7 {BLK,BLK,BLK,BLK,BLK,BLK,RED,BLK,BLK,BLK},
#define R8 {BLK,BLK,BLK,BLK,BLK,BLK,BLK,RED,BLK,BLK},
#define R9 {BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,RED,BLK},
#define R10 {BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,RED},
#define RALL R1 R2 R3 R4 R5 R6 R7 R8 R9 R10
#define G1 {GRN,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK},
#define G2 {BLK,GRN,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK},
#define G3 {BLK,BLK,GRN,BLK,BLK,BLK,BLK,BLK,BLK,BLK},
#define G4 {BLK,BLK,BLK,GRN,BLK,BLK,BLK,BLK,BLK,BLK},
#define G5 {BLK,BLK,BLK,BLK,GRN,BLK,BLK,BLK,BLK,BLK},
#define G6 {BLK,BLK,BLK,BLK,BLK,GRN,BLK,BLK,BLK,BLK},
#define G7 {BLK,BLK,BLK,BLK,BLK,BLK,GRN,BLK,BLK,BLK},
#define G8 {BLK,BLK,BLK,BLK,BLK,BLK,BLK,GRN,BLK,BLK},
#define G9 {BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,GRN,BLK},
#define G10 {BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,GRN},
#define GALL G1 G2 G3 G4 G5 G6 G7 G8 G9 G10


\
PROGMEM const unsigned long chasing_RED[][10]={RALL};
PROGMEM const unsigned long chasing_GREEN[][10]={GALL};
PROGMEM const unsigned long knight_rider_red[38][10]={
{RED,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK},
{BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK},
{BLK,RED,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK},
{BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK},
{BLK,BLK,RED,BLK,BLK,BLK,BLK,BLK,BLK,BLK},
{BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK},
{BLK,BLK,BLK,RED,BLK,BLK,BLK,BLK,BLK,BLK},
{BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK},
{BLK,BLK,BLK,BLK,RED,BLK,BLK,BLK,BLK,BLK},
{BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK},
{BLK,BLK,BLK,BLK,BLK,RED,BLK,BLK,BLK,BLK},
{BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK},
{BLK,BLK,BLK,BLK,BLK,BLK,RED,BLK,BLK,BLK},
{BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK},
{BLK,BLK,BLK,BLK,BLK,BLK,BLK,RED,BLK,BLK},
{BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK},
{BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,RED,BLK},
{BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK},
{BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,RED},
{BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK},
{BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,RED,BLK},
{BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK},
{BLK,BLK,BLK,BLK,BLK,BLK,BLK,RED,BLK,BLK},
{BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK},
{BLK,BLK,BLK,BLK,BLK,BLK,RED,BLK,BLK,BLK},
{BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK},
{BLK,BLK,BLK,BLK,BLK,RED,BLK,BLK,BLK,BLK},
{BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK},
{BLK,BLK,BLK,BLK,RED,BLK,BLK,BLK,BLK,BLK},
{BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK},
{BLK,BLK,BLK,RED,BLK,BLK,BLK,BLK,BLK,BLK},
{BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK},
{BLK,BLK,RED,BLK,BLK,BLK,BLK,BLK,BLK,BLK},
{BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK},
{BLK,RED,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK},
{BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK},
{RED,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK},
{BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK},
};

PROGMEM const unsigned long knight_rider_green[38][10]={
{GRN,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK},
{BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK},
{BLK,GRN,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK},
{BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK},
{BLK,BLK,GRN,BLK,BLK,BLK,BLK,BLK,BLK,BLK},
{BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK},
{BLK,BLK,BLK,GRN,BLK,BLK,BLK,BLK,BLK,BLK},
{BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK},
{BLK,BLK,BLK,BLK,GRN,BLK,BLK,BLK,BLK,BLK},
{BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK},
{BLK,BLK,BLK,BLK,BLK,GRN,BLK,BLK,BLK,BLK},
{BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK},
{BLK,BLK,BLK,BLK,BLK,BLK,GRN,BLK,BLK,BLK},
{BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK},
{BLK,BLK,BLK,BLK,BLK,BLK,BLK,GRN,BLK,BLK},
{BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK},
{BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,GRN,BLK},
{BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK},
{BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,GRN},
{BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK},
{BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,GRN,BLK},
{BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK},
{BLK,BLK,BLK,BLK,BLK,BLK,BLK,GRN,BLK,BLK},
{BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK},
{BLK,BLK,BLK,BLK,BLK,BLK,GRN,BLK,BLK,BLK},
{BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK},
{BLK,BLK,BLK,BLK,BLK,GRN,BLK,BLK,BLK,BLK},
{BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK},
{BLK,BLK,BLK,BLK,GRN,BLK,BLK,BLK,BLK,BLK},
{BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK},
{BLK,BLK,BLK,GRN,BLK,BLK,BLK,BLK,BLK,BLK},
{BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK},
{BLK,BLK,GRN,BLK,BLK,BLK,BLK,BLK,BLK,BLK},
{BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK},
{BLK,GRN,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK},
{BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK},
{GRN,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK},
{BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK},
};

PROGMEM const unsigned long chasing_green[][10]={
{'GRN',BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK},
{BLK,'GRN',BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK},
{BLK,BLK,'GRN',BLK,BLK,BLK,BLK,BLK,BLK,BLK},
{BLK,BLK,BLK,'GRN',BLK,BLK,BLK,BLK,BLK,BLK},
{BLK,BLK,BLK,BLK,'GRN',BLK,BLK,BLK,BLK,BLK},
{BLK,BLK,BLK,BLK,BLK,'GRN',BLK,BLK,BLK,BLK},
{BLK,BLK,BLK,BLK,BLK,BLK,'GRN',BLK,BLK,BLK},
{BLK,BLK,BLK,BLK,BLK,BLK,BLK,'GRN',BLK,BLK},
{BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,'GRN',BLK},
{BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,'GRN'},
};

PROGMEM const unsigned long chasing_BLUE[][10]={
{'BLUE',BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK},
{BLK,'BLUE',BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK},
{BLK,BLK,'BLUE',BLK,BLK,BLK,BLK,BLK,BLK,BLK},
{BLK,BLK,BLK,'BLUE',BLK,BLK,BLK,BLK,BLK,BLK},
{BLK,BLK,BLK,BLK,'BLUE',BLK,BLK,BLK,BLK,BLK},
{BLK,BLK,BLK,BLK,BLK,'BLUE',BLK,BLK,BLK,BLK},
{BLK,BLK,BLK,BLK,BLK,BLK,'BLUE',BLK,BLK,BLK},
{BLK,BLK,BLK,BLK,BLK,BLK,BLK,'BLUE',BLK,BLK},
{BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,'BLUE',BLK},
{BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,'BLUE'},
};

PROGMEM const unsigned long pattern_test_comet1[][10]={
{0xfdfdfd,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK},
{0x444444,0xfdfdfd,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK},
{0x111111,0x444444,0xfdfdfd,BLK,BLK,BLK,BLK,BLK,BLK,BLK},
{BLK,0x111111,0x444444,0xfdfdfd,BLK,BLK,BLK,BLK,BLK,BLK},
{BLK,BLK,0x111111,0x444444,0xfdfdfd,BLK,BLK,BLK,BLK,BLK},
{BLK,BLK,BLK,0x111111,0x444444,0xfdfdfd,BLK,BLK,BLK,BLK},
{BLK,BLK,BLK,BLK,0x111111,0x444444,0xfdfdfd,BLK,BLK,BLK},
{BLK,BLK,BLK,BLK,BLK,0x111111,0x444444,0xfdfdfd,BLK,BLK},
{BLK,BLK,BLK,BLK,BLK,BLK,0x111111,0x444444,0xfdfdfd,BLK},
{BLK,BLK,BLK,BLK,BLK,BLK,BLK,0x111111,0x444444,0xfdfdfd},
};

PROGMEM const unsigned long red_cylon_L[][10]={
{BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,0x0000f0},
{BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,0x0000f0,BLK},
{BLK,BLK,BLK,BLK,BLK,BLK,BLK,0x0000f0,BLK,BLK},
{BLK,BLK,BLK,BLK,BLK,BLK,0x0000f0,BLK,BLK,BLK},
{BLK,BLK,BLK,BLK,BLK,0x0000f0,BLK,BLK,BLK,BLK},
{BLK,BLK,BLK,BLK,0x0000f0,BLK,BLK,BLK,BLK,BLK},
{BLK,BLK,BLK,0x0000f0,BLK,BLK,BLK,BLK,BLK,BLK},
{BLK,BLK,0x0000f0,BLK,BLK,BLK,BLK,BLK,BLK,BLK},
{BLK,0x0000f0,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK},
{0x0000f0,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK},
};

PROGMEM const unsigned long star_trek_bridge[][10]={
{0x0000f0,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,0x0000f0},
{BLK,0x0000f0,BLK,BLK,BLK,BLK,BLK,BLK,0x0000f0,BLK},
{BLK,BLK,0x0000f0,BLK,BLK,BLK,BLK,0x0000f0,BLK,BLK},
{BLK,BLK,BLK,0x0000f0,BLK,BLK,0x0000f0,BLK,BLK,BLK},
{BLK,BLK,BLK,BLK,0x0000f0,0xf000f0,BLK,BLK,BLK,BLK},
{BLK,BLK,BLK,BLK,0xd000d0,0xd000d0,BLK,BLK,BLK,BLK},
{BLK,BLK,BLK,0x0000f0,BLK,BLK,0x0000f0,BLK,BLK,BLK},
{BLK,BLK,0x0000f0,BLK,BLK,BLK,BLK,0x0000f0,BLK,BLK},
{BLK,0x0000f0,BLK,BLK,BLK,BLK,BLK,BLK,0x0000f0,BLK},
{0x0000f0,BLK,BLK,BLK,BLK,BLK,BLK,BLK,BLK,0x0000f0},
};

const int arduinoPin2 = 2;
const int arduinoPin3 = 3;
const int arduinoPin4 = 4;
const int arduinoPin5 = 5;
const int arduinoPin6 = 6;
const int arduinoPin7 = 7;

void setup() {STRIP_PINOUT;

Serial.begin(9600);
pinMode(arduinoPin2, INPUT);
pinMode(arduinoPin3, INPUT);
pinMode(arduinoPin4, INPUT);
pinMode(arduinoPin5, INPUT);
pinMode(arduinoPin6, INPUT);
pinMode(arduinoPin7, INPUT);
delay(1); reset_strip();
}



loop works fine with out web/ethernet portion




void loop(){

if (digitalRead(8))
{
client.print(” LED is <font color=’green’>ON</font>”);
}
else
{
client.print(” LED is <font color=’red’>OFF</font>”);
client.println(“<br />”);

}



web button problem from here




client.print("<FORM action=\"http://192.168.2.118/\" >");
//client.print(“<FORM action=\"http://192.168.1.177/\” >”);
client.print(“<P> <INPUT type=\”radio\” name=\”status\” value=\”1\”>ON”);
client.print(“<P> <INPUT type=\”radio\” name=\”status\” value=\”0\”>OFF”);
client.print(“<P> <INPUT type=\”submit\” value=\”Submit\”> </FORM>”);



web problem to here




break;
}


send_1M_pattern(chasing_WHITE, 10, 35); delay(1500);
send_1M_pattern(chasing_WHITE, 10, 35); delay(1500);
send_1M_pattern(chasing_WHITE, 10, 20); delay(300);
send_1M_pattern(chasing_WHITE, 10, 20); delay(300);
send_1M_pattern(chasing_WHITE, 10, 15); delay(20);
send_1M_pattern(chasing_WHITE, 10, 20); delay(20);
send_1M_pattern(chasing_WHITE, 10, 15); delay(50);
send_1M_pattern(chasing_WHITE, 10, 25); delay(50);
send_1M_pattern(chasing_WHITE, 13, 25); delay(50);
send_1M_pattern(chasing_WHITE, 13, 25); delay(50);
send_1M_pattern(chasing_WHITE, 10, 20); delay(20);
send_1M_pattern(chasing_WHITE, 10, 20); delay(20);
//
send_1M_pattern(pattern_test_comet1, 10, 70); delay(500);
send_1M_pattern(pattern_test_comet2, 10, 70); delay(500);
send_1M_pattern(pattern_test_comet2, 10, 70); delay(500);
send_1M_pattern(pattern_test_comet2, 10, 70); delay(500);
send_1M_pattern(pattern_test_comet2, 10, 70); delay(500);
send_1M_pattern(pattern_test_comet2, 10, 70); delay(500);
send_1M_pattern(pattern_test_comet2, 10, 70); delay(500);
send_1M_pattern(pattern_test_comet2, 10, 70); delay(500);
send_1M_pattern(pattern_test_comet2, 10, 70); delay(500);
send_1M_pattern(pattern_test_comet2, 10, 70); delay(500);
send_1M_pattern(pattern_test_comet2, 10, 70); delay(500);
send_1M_pattern(pattern_test_comet3, 10, 70); delay(500);
//
send_1M_pattern(rainbow1, 10, 255); delay(2000);
send_1M_pattern(rainbow1, 10, 10); delay(1000);
send_1M_pattern(rainbow1, 10, 10); delay(1000);
send_1M_pattern(rainbow1, 10, 10); delay(1000);
send_1M_pattern(rainbow1, 10, 255); delay(1500);
send_1M_pattern(rainbow1, 10, 255); delay(2000);
send_1M_pattern(rainbow1, 10, 255); delay(2500);
send_1M_pattern(rainbow1, 10, 255); delay(1000);
send_1M_pattern(rainbow1, 10, 255); delay(1500);
send_1M_pattern(rainbow1, 10, 255); delay(1000);
send_1M_pattern(rainbow1, 10, 255); delay(1000);
//
send_1M_pattern(chasing_RED, 10, 30); delay(25);
send_1M_pattern(chasing_RED, 10, 30); delay(25);
send_1M_pattern(chasing_RED, 10, 30); delay(25);
send_1M_pattern(chasing_RED, 10, 30); delay(25);
send_1M_pattern(chasing_RED, 10, 30); delay(25);
send_1M_pattern(chasing_RED, 10, 30); delay(25);
send_1M_pattern(chasing_WHITE, 10, 30); delay(25);
send_1M_pattern(chasing_WHITE, 10, 30); delay(25);
send_1M_pattern(chasing_WHITE, 10, 30); delay(25);
send_1M_pattern(chasing_WHITE, 10, 30); delay(25);
send_1M_pattern(chasing_WHITE, 10, 30); delay(25);
send_1M_pattern(chasing_WHITE, 10, 30); delay(25);
send_1M_pattern(chasing_BLUE, 10, 30); delay(25);
send_1M_pattern(chasing_BLUE, 10, 30); delay(25);
send_1M_pattern(chasing_BLUE, 10, 30); delay(25);
send_1M_pattern(chasing_BLUE, 10, 30); delay(25);
send_1M_pattern(chasing_BLUE, 10, 30); delay(25);
send_1M_pattern(chasing_BLUE, 10, 30); delay(25);
//
send_1M_pattern(chasing_WHITE, 10, 20); delay(25);
send_1M_pattern(chasing_WHITE, 10, 20); delay(25);
send_1M_pattern(chasing_WHITE, 10, 20); delay(25);
//

send_1M_pattern(chasing_RED, 10, 30); delay(5);
send_1M_pattern(chasing_WHITE, 10, 30); delay(5);
send_1M_pattern(chasing_BLUE, 10, 30); delay(5);
send_1M_pattern(chasing_RED, 10, 30); delay(5);
send_1M_pattern(chasing_WHITE, 10, 30); delay(5);
send_1M_pattern(chasing_BLUE, 10, 30); delay(5);
send_1M_pattern(chasing_RED, 10, 30); delay(5);
send_1M_pattern(chasing_WHITE, 10, 30); delay(5);
send_1M_pattern(chasing_BLUE, 10, 30); delay(5);
send_1M_pattern(chasing_RED, 10, 30); delay(5);
send_1M_pattern(chasing_WHITE, 10, 30); delay(5);
send_1M_pattern(chasing_BLUE, 10, 30); delay(5);
send_1M_pattern(chasing_RED, 10, 30); delay(5);
send_1M_pattern(chasing_WHITE, 10, 30); delay(5);
send_1M_pattern(chasing_BLUE, 10, 30); delay(5);
send_1M_pattern(chasing_RED, 10, 30); delay(5);
send_1M_pattern(chasing_WHITE, 10, 30); delay(5);
send_1M_pattern(chasing_BLUE, 10, 30); delay(5);
send_1M_pattern(chasing_RED, 10, 30); delay(5);
send_1M_pattern(chasing_WHITE, 10, 30); delay(5);
send_1M_pattern(chasing_BLUE, 10, 30); delay(5);
send_1M_pattern(chasing_RED, 10, 30); delay(5);
send_1M_pattern(chasing_WHITE, 10, 30); delay(5);
send_1M_pattern(chasing_BLUE, 10, 30); delay(5);
//
send_1M_pattern(chasing_GREEN, 1, 500); delay(500);
send_1M_pattern(chasing_GREEN, 2, 500); delay(500);
send_1M_pattern(chasing_GREEN, 3, 500); delay(500);
send_1M_pattern(chasing_GREEN, 4, 500); delay(500);
send_1M_pattern(chasing_GREEN, 5, 500); delay(500);
send_1M_pattern(chasing_GREEN, 6, 500); delay(500);
send_1M_pattern(chasing_GREEN, 7, 500); delay(500);
//
send_1M_pattern(chasing_BLUE, 10, 500); delay(500);
7 send_1M_pattern(star_trek_bridge, 10, 500); delay(300);
send_1M_pattern(rainbow1, 10, 100); delay(100);
send_1M_pattern(cylon_test_red, 100, 100); delay(900);
send_1M_pattern(red_cylon_L, 10, 70);
send_1M_pattern(red_white_blue, 10, 100); delay(300);

digitalWrite(arduinoPin2, LOW);
digitalWrite(arduinoPin3, LOW);
digitalWrite(arduinoPin4, LOW);
digitalWrite(arduinoPin5, LOW);

if (digitalRead(arduinoPin2) == HIGH)
{send_1M_pattern(chasing_RED, 10, 70);}

else

if (digitalRead(arduinoPin3) == HIGH)
{send_1M_pattern(chasing_GREEN, 10, 100);}
{send_1M_pattern(knight_rider_red, 38, 100);}
{send_1M_pattern(knight_rider_green, 38, 100);}//}

void send_1M_pattern(const unsigned long data[][10], int pattern_no, int frame_rate)

{int i=0;
int j=0;
uint32_t temp_data;
for (i=0;i<pattern_no;i++)
{
noInterrupts(); // Turn OFF Interupts for more precise Pulse Timing using MCU processing cycles
for (j=0;j<10;j++)
{
temp_data=pgm_read_dword_near(&data[i][j]);
send_strip(temp_data);
}
interrupts(); // Turn ON Interrupts after data is sent
delay(frame_rate); // ion of each FRAME, before the next series is sent;
}}
void send_strip(uint32_t data)
{int i;
unsigned long j=0x800000;
int d;
for (i=0;i<24;i++)
{if (data & j)
{DATA_1; for (d=1;d<13;d++)
{__asm__(NOP);}
DATA_0; // Set OUTPUT PIN LOW ;
}
else
{DATA_1; for (d=1;d<5;d++)
{__asm__(NOP);}
DATA_0;
__asm__(NOP);
__asm__(NOP);
__asm__(NOP);}
j>>=1;
}}
void reset_strip() {DATA_0; delayMicroseconds(20);}




I can't browse an specific website by c#

I really need to get some information from an specific website, but I can't. My code works for other websites but not for this. It returns some bad symbols. I think it's because of website security, and also I can't reach the website by using webbrowser control. I'm not very well in web application :( Is there any one who knows what is the problem? Thanks,





How to make a "Dont ask me again" Option?

I'm trying to make a Dialog in my website using css3 which pops up if the user is using adblock. The dialog basically asks the user to enable ads on my website but I don't to annoy the user with the dialog popping up each time he/she visits my website so i want to give the use a "Dont show me again" option but i have no idea how to implement this.


Here is an image of the dialog


enter image description here


This is the java script code that detects the adblock user and opens the dialog



<script> window.setTimeout(function(){
if(adsbygoogle instanceof Array) {

// adsbygoogle.js did not execute; probably blocked by an ad blocker
window.location = '#PleaseUnblock'

} else {
// adsbygoogle.js executed
}
}, 2000);
</script>


This is html code for the dialog



<div id="PleaseUnblock" class="modalDialog">
<div style="margin-top: 70px;padding: 5px 12px 13px 15px;width: 380px;">
<a href="#" title="Close" class="close">X</a>
<div style="padding: 0; margin: 0;">
<h1 class="ad-di-title">You Are Using AdBlock &#58;&#40;</h1>
</div>
<div style="margin-left: auto;margin-right: auto;width: 350px;height: 332px;background: url(/assets/please.jpg);background-size: 350px;background-repeat: no-repeat"></div>
<p class="ad-di-para" style="margin-bottom: 3px;">All content made on WEBSITENAME is free. As you use Adblock, we wont get any revenue from the content we make. We promise that we will not show annoying ads and we only ask you to enable ads in our site.</p>
<a style="margin-left: 300px" href="#" class="kbtn">Ok</a>
</div>
</div>




Web-Usability choice of color?

I'm writing a Thesis on Web usability. Now I would like to mention the choice of colors. Which one should you use and which not. Now I have searched on the internet but found nothing suitable to the subject. It actually does not matter what color I use. But should I rather use bright colors or rather dull colors? what color stands out more in the eye? Why?


If somebody can help with web-usability, this will be grateful.





ASP Contact form error Server object error 'ASP 0177 : 800401f3'

One of my websites contact/reservations form has suddenly stopped working and I now receive the following error.


Server object error 'ASP 0177 : 800401f3'


Server.CreateObject Failed


/contact2.asp, line 51


800401f3


I've done a bit of research and it seems to relate to classic ASP commands but my knowledge of ASP is limited.


Here is the full code:-



<%

name = request.form("name")
email = request.form("email")
phone = request.form("phone")
guests = request.form("guests")
datum2 = request.form("datum2")
info = request.form("info")
time_hour = request.form.item("time_hour")
time_minute = request.form.item("time_minute")
moda_event = request.form.item("modaEvent")
sign_up = request.form.item("signup")

If name="" or email="" Then
url = "reservations.asp?reqd=* indicates required field&name=" & mname & "&email=" & memail
If name="" Then
url = url & "&mname=*"
End if

If email="" Then
url = url & "&memail=*"
End if

response.redirect url & "&foobar=foobar#form"
response.end
End if


Dim objCDONTS ' Email object
Dim strFromName ' From persons' real name
Dim strFromEmail, strToEmail ' Email addresses
Dim strSubject, strName, strPhone, strEmail, strGuests, strDate, strHour, strMinute, strEvent, strInfo, strSignup 'Message
Dim misccompo


strSubject = "Reservation Form"
strFromName = Trim(Request.Form("name"))
strFromEmail = Trim(Request.Form("email"))
strToEmail = "reservations@modarestaurant.co.uk"
strName = Trim(Request.Form("name"))
strPhone = Trim(Request.Form("phone"))
strEmail = Trim(Request.Form("email"))
strGuests = Trim(Request.Form("guests"))
strDate = Trim(Request.Form("datum2"))
strHour = Trim(Request.Form.Item("time_hour"))
strMinute = Trim(Request.Form.Item("time_minute"))
strEvent = Trim(Request.Form.Item("moda_event"))
strInfo = Trim(Request.Form("info"))
strSignup = Trim(Request.Form.Item("signup"))

**Set objCDONTS = Server.CreateObject("CDONTS.NewMail")**
objCDONTS.From = strFromName & " <" & strFromEmail & ">"
objCDONTS.To = strToEmail
objCDONTS.Subject = strSubject
objCDONTS.Body = "--------------------------------------" & vbcrlf & vbcrlf & "Name: " & strName & vbcrlf & "Contact Number: " & strPhone & vbcrlf & "Email Address: " & strEmail & vbcrlf & "No. of Guests: " & strGuests & vbcrlf & "Date: " & strDate & vbcrlf & "Time: " & strHour & ":" & strMinute & vbcrlf & "Event: " & strEvent & vbcrlf & "Additional Info: " & vbcrlf & strInfo & vbcrlf & "Newsletter Signup: " & strSignup &vbcrlf & "--------------------------------------------------------------" & vbcrlf & "MESSAGE ENDS: End of info"
objCDONTS.Send
Set objCDONTS = Nothing

response.redirect "thank-you.asp"
response.end
%>


I have ** the line 51 error.


Any help would be greatly appreciated.


Mark





Blocking Aggressive/Incoherent Bot

I have a weird bot pummeling my site. It COULD be some sort of low-level denial-of-service attack, but I think that's unlikely. I'm looking for suggestions on blocking it because it's rapidly chewing through all of my CPU and bandwidth allotments.


Here's what it does:




  1. Roughly 650 page requests per minute, like clockwork, constantly, for weeks




  2. Large list of IPs -- hundreds, rotating, with Geolocations randomly scattered all around the world




  3. Rotating user agent strings, many of which are for legit browsers




  4. HTTP_REFERER is often, but not always, filled with a spam site




  5. And weirdest of all, the GET requests almost always generate 404 errors because most are for fully-qualified URLs which are NOT MY SITE. When they are not full URLs, they are for pages or resources that don't exist, never have, and don't even appear to be exploit attempts.




Here are some sample records from my server logs:



80.84.53.26 - - [24/Feb/2015:06:15:43 -0600] "GET http://ift.tt/1wrNNHT HTTP/1.1" 404 - "http://ift.tt/1zhQiqZ" "Opera/9.20 (Windows NT 6.0; U; en)"
54.147.200.126 - - [24/Feb/2015:06:15:44 -0600] "GET http://ift.tt/1zhQgiX HTTP/1.1" 404 - "-" "Mozilla/4.0 (compatible; Ubuntu; MSIE 9.0; Trident/5.0; zh-CN)"
91.121.161.167 - - [24/Feb/2015:06:15:44 -0600] "GET http://ift.tt/1wrNPzH HTTP/1.1" 404 - "http://78.37.100.242/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"
185.2.101.78 - - [24/Feb/2015:06:15:43 -0600] "GET http://mail.yahoo.com/ HTTP/1.1" 200 269726 "-" "Mozilla/4.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.21022; .NET CLR 3.5.30729; MS-RTC LM 8; .NET CLR 3.0.30729)"
142.0.140.68 - - [24/Feb/2015:06:15:44 -0600] "GET http://ift.tt/1zhQir2] HTTP/1.0" 404 - "http://ift.tt/1wrNNI0" "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/532.0 (KHTML, like Gecko) Chrome/4.0.206.1 Safari/532.0"


This is the third time I've dealt with these same conditions. It last happened about six months ago. For reference, my site is a blog about baseball (on a blogging platform I built myself) with a few hundred regular visitors. I'm in the US, but my site contains no state secrets!


For now I've redirected all 404 errors to a script which dynamically modifies my .htaccess file to instantly ban IPs that make incoherent requests. That works, but I don't think it's sustainable.


What is this thing? And what's the best practice method of blocking it? Thanks.





Change custom url to base url in godaddy shared hosing

I want to redirect www.xyz.com to www.xyz.com/public or If I type www.xyz.com in my addres bar, i want to see contents in www.xyz.com/public. How will I do this in my shared godaddy hosting. In localhost I did this by editing my virtual host. How will I edit my virtual host in shared webhosting in godaddy??


can anyone help??





How to read a JSON file on a web?

I am coding a craftbukkit plugin, and I need to read a JSON file on a web. I am almost new and Java and I don't find a good tutorial. Thank you


The JSON will be similar to this: http://ift.tt/1wjyETi





Can websites tell what other programs you are running?

Suppose I have a file open in a word processor or a pdf open in a PDF viewer while I'm viewing a website. Can the website tell that I have a word processor or PDF viewer open, and can it tell what the name of the file is?





Creating an interactive text box in Jaws

I need to create a text box like four tex boxes in the following address: http://ift.tt/1BgvHJd


Is it a AJAX text box or something else?





Java Stripes Framework Plugin for Netbeans

I want to have a closer look at Stripes using Netbeans. I downloaded and installed the Stripes plugin for Netbeans on enter link description here . I am using Netbeans 8.0.2. I created a new project with the latest version of JEE and Tomcat selected. I did not make any changes yet and the empty project builds fine, but when running it, I get a 404 error. I do not know enough about stripes to modify the URL mapping, can anyone assist?


here is the web.xml generated by Netbeans:



<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.1" xmlns="http://ift.tt/19L2NlC" xmlns:xsi="http://ift.tt/ra1lAU" xsi:schemaLocation="http://ift.tt/19L2NlC http://ift.tt/1drxgYl">
<filter>
<filter-name>StripesFilter</filter-name>
<filter-class>net.sourceforge.stripes.controller.StripesFilter</filter-class>
<init-param>
<param-name>LocalePicker.Locales</param-name>
<param-value>en:utf-8,cs:utf-8</param-value>
</init-param>
<init-param>
<param-name>ActionResolver.Packages</param-name>
<param-value>TODO -- enter comma separated packages with Action Beans here</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>StripesFilter</filter-name>
<url-pattern>*.jsp</url-pattern>
<dispatcher>REQUEST</dispatcher>
</filter-mapping>
<filter-mapping>
<filter-name>StripesFilter</filter-name>
<servlet-name>DispatcherServlet</servlet-name>
<dispatcher>REQUEST</dispatcher>
</filter-mapping>
<servlet>
<servlet-name>DispatcherServlet</servlet-name>
<servlet-class>net.sourceforge.stripes.controller.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>DispatcherServlet</servlet-name>
<url-pattern>*.action</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>




301 Redirect CakePHP

I've recently started a new job and I noticed that a page linked to in one of our mailing lists no longer exists. I'm a developer / sysadmin so I thought it would be simple to set up a redirect, however our site is running CakePHP on the backend which I've got no experience with.


I want to redirect http://ift.tt/1DWbSHI to just oursite.com


I've tried Router::redirect('/page/online-store', 'http://www.oursite.com', array('status' => 301)); at the bottom of that file but it doesn't seem to be working, it just hangs at page load until I comment that line out.


Relevant lines in routes.php:



// login and register
Router::connect('/login', array('controller' => 'accounts', 'action' => 'login'));
Router::connect('/register', array('controller' => 'accounts', 'action' => 'register'));

// home
Router::connect('/', array('controller' => 'site', 'action' => 'home'));
Router::connect('/admin', array('controller' => 'users', 'action' => 'login', 'admin' => true));

// dashboard
Router::connect('/admin/dashboard', array('controller' => 'pages', 'action' => 'dashboard', 'admin' => true));

// search
Router::connect('/search', array('controller' => 'products', 'action' => 'search'));

// pages
Router::connect('/page/site-map', array('controller' => 'site', 'action' => 'map'));
Router::connect('/page/home', array('controller' => 'site', 'action' => 'home'));
Router::connect('/page/*', array('controller' => 'pages', 'action' => 'index'));


I'd appreciate any help.





I'm creating a python web interface. You complete the form, it sends it to a background python function, stuff happens.


I'm having trouble with one of these background functions, it's stumped me because it's not my first time creating a quick project like this, and I haven't encountered this error before.


I have three files: commands.py, header.py and product.py


product.py looks like this:



#!/usr/bin/python
import sys
import os
import cgitb
cgitb.enable()

sys.path.append(os.path.abspath("/var/www/cgi-bin/includes/"))
from header import *

page = get_page_name(sys.argv[0])

printDefaultPage(0,page)


and this is the route it takes through header.py:



def printDefaultPage(error,page): #this prints the page
printHTTPHeaders() #print headers
printHeader(page) #print header.inc
printPage(page)
printFooter() #print footer.inc


the above function prints out the headers, the head, the body of the page and the footer, all by calling other functions.



def printPage(page):
if page == "product":
print """<form method='post' id="register_form" name="client_frm"></br>
<label for="id">Enter the subscription to use:</label>"""
list_subscriptions()
print """<a href="/cgi-bin/index.py"><input class="login" type="button" value="Back"></a>
</form>"""


as you can see, printPage calls a function, list_subscriptions() which looks a bit like this:



def list_subscriptions():
subscriptions=get_subscriptions()
print """<select name = "sub">"""
for s in subscriptions:
id = s
price = subscriptions.get(str(s)).get('price')
scans = subscriptions.get(str(s)).get('scans_per_month')
print """<option value ="""+str(id)+"""">"""+str(price)+""" - """+str(scans)+"""</option>"""
print "</select>"


this in turn calls get_subscriptions, which exists in a file called commands, which is imported at the top:



#!/usr/bin/python
from commands import *


for completeness, here is get_subscriptions:



def get_subscriptions():
subscriptions=proxy.get_subscriptions()
return subscriptions


and on the other end:



def get_subscriptions(self):
subscriptions=self.store.find(Subscription)
subs = {}
for sub in subscriptions:
subs[str(sub.id)] = {}
subs[str(sub.id)]['scans_per_month'] = sub.scans_per_month
subs[str(sub.id)]['price'] = int(sub.price)
return subs


get_subscriptions() returns a dictionary. The more baffling thing is when I run printPage("product") in the python command line, it works.



Python 2.7.6 (default, Mar 22 2014, 22:59:56)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from header import *
>>> printPage("product")
<form method='post' id="register_form" name="client_frm"></br>
<label for="id">Enter the subscription to use:</label>
<select name = "sub">
<option value =1">19 - 20</option>
<option value =3">59 - 100</option>
<option value =2">39 - 50</option>
<option value =5">0 - 0</option>
<option value =4">0 - 1000</option>
</select>
<a href="/cgi-bin/index.py"><input class="login" type="button" value="Back"></a>
</form>


Yet when I go to product.py in the browser expecting to see a nice select box instead I get this gross error:



/var/www/cgi-bin/includes/header.py in list_subscriptions()
7
8 def list_subscriptions():
=> 9 subscriptions=get_subscriptions()
10 print """<select name = "sub">"""
11 for s in subscriptions:
subscriptions undefined, get_subscriptions undefined