mardi 31 mars 2015

how to give spacing between these images

i have put 6 images in a rectangle form one kept next to another somewhat like this my home page


all the images like car mobile and all. i want to see them with some amount of space between them,because i want to do some hover and other stuff over the images for various categories and for that images needs to look little separated(for better UI).my div section which covers the blue area you see having categories inside them is :



<div class="jumbotron">
<h1>categories</h1>
<p>
<img class="book" src="book_main.jpg" alt="book face" style="float:top;width:150px;height:130px" href="">
<img class="mobiles"src="mobile_main.jpg" alt="mobiles face" style="float:left;width:150px;height:130px" href="">
<img class="vehicles"src="vehicle_main.jpg" alt="vehicles face" style="float:left;width:150px;height:130px" href=""><br>
<img class="animals"src="animals_main.jpg" alt="animals face" style="float:left;width:150px;height:130px" href="">
<img class="jobs"src="jobs_main.jpg" alt="jobs face" style="float:left;width:150px;height:130px" href="">
<img class="furniture"src="furniture_main.jpg" alt="furniture face" style="float:left;width:150px;height:130px" href=""><br>
</p>
</div>


and other style sheet i am using here is bootstrap.min.css(for jumbotron ,available on their link :http://ift.tt/PPrDZs). how to give spacing ?any ideas?





Can I insert image into another image in Polymer?

If I have two images (one includes frame and another includes the picture), can I show it in the same image by using Polymer? I think it looks like bitmap in android and I want to do in web but I really don't know how. Can anyone help me? Thanks for reading.





How can I invoke a form when an item from the navigation menu is clicked?

I am trying to develop a website where I want to have a 'Contact Us' tab in the navigation menu on all pages however, I don't want it to take the user to a new page where he can do his submission. I want to invoke a new dialog/window when this is clicked that has the form. After the submission, the dialog/window is closed with a message of successful submission and the user remains on the same page as where he was when he clicked 'Contact Us'. Any help would be appreciated. Thank you.


Details: I am using WordPress for my website and the plugin - Quforms for the form.





want to open window on button click and then perform a button click event from code behind on the opened window web applicationc#

i have very basic requirement where i have to open a page (window) . then on the opened page , i have one link i want to perform a click event on that page , which will open another page. in c# web application is it possible to get the window object and then perform a search to get the link which i want to click .


i have tried to open window using javascript and then in code behind get the object of the opened page , but the page doesnt load at the time when server side code start to execute . i always get "Access is denied" error when i try to access the opened page .





I want to prevent Hotlinking of a particular web page, not an image using htaccess

I have a web page, example.com/a.php. I want to ensure that visiting example.com/a.php redirects the user to example.com. The only way you can visit example.com/a.php is through example.com. I have done a lot of research into .htaccess but none of them addresses this issue.





Is it possible/feasible to limit website access to a geographic area?

I'm interested in building a very simple website that would allow users within a certain distance of a geographic point to login and post to a message board. Is limiting access to a website by IP ranges a reasonable means of accomplishing a task like this? If not, is there another means that exists?





C# HttpRequest: Not found error

I have this code:



HttpWebRequest spAuthReq = HttpWebRequest.Create(new Uri(myURL, UriKind.RelativeOrAbsolute)) as HttpWebRequest;
spAuthReq.Method = "GET";
spAuthReq.BeginGetResponse(new AsyncCallback(GetResponsetStreamCallback), spAuthReq);

void GetResponsetStreamCallback(IAsyncResult callbackResult)
{
try
{
HttpWebRequest request = (HttpWebRequest)callbackResult.AsyncState;
HttpWebResponse response = (HttpWebResponse)request.EndGetResponse(callbackResult);
Stream streamResponse = response.GetResponseStream();
StreamReader reader = new StreamReader(streamResponse);
responseString = reader.ReadToEnd();
streamResponse.Close();
reader.Close();
response.Close();
string result = responseString;
}
catch (WebException ex)
{
responseString = ex.ToString();
}
}


I need to get some messages but I get error: System.Net.WebException: The remote server returned an error: NotFound. Also I need to post token to server because it requies login, I have token but I don't know how to post token with GET method. Anyway, without token I should get response from server that I'm not logged in but I end up with exception.





If the video is already streamed in my browser then where the video file is stored?

If the video is already streamed in my browser then where the video file is stored in my system, because now it is playing offline until I refresh the page.





Get the ip address of the connected user

I want to get the address of the computer of the connected user (not 127.0.0.1 or the address given by InetAddress ) because i want to restrict the access to my website to only some countries Code frequetly found in the internet:



java.net.InetAddress i = java.net.InetAddress.getLocalHost();
System.out.println(i); // name and IP address
System.out.println(i.getHostName()); // name
System.out.println(i.getHostAddress()); // IP address only




pull links and their link text only from lines on web page and insert into a dictionary using python

I am trying to pull only the links and their text from a webpage line by line and insert text and link into a dictionary. Without using beautiful soup or a regex.


i keep getting this error:


error:



Traceback (most recent call last):
File "F:/Homework7-2.py", line 13, in <module>
link2 = link1.split("href=")[1]
IndexError: list index out of range


code:



import urllib.request
url = "http://www.facebook.com"
page = urllib.request.urlopen(url)
mylinks = {}
links = page.readline().decode('utf-8')


for items in links:
links = page.readline().decode('utf-8')
if "a href=" in links:
links = page.readline().decode('utf-8')
link1 = links.split(">")[0]
link2 = link1.split("href=")[1]
mylinks = link2
print(mylinks)




HTTP POST method callbacks

I want to use this service OnWebChange to monitor when a website changes and change mine accordingly. It would notify me via a URL callback to my website URL with a HTTP POST method. Can somebody explain in general how do I "catch" those HTTP POST callbacks?


I guess I need to write/use a program on my server that would be always listening for those callbacks. I just need some guidance what tools to use.





real time web site workflow

I am a PhD student in flood management, I am a beginner in development (Intermediate level in Python) I would like to develop a web site with "live" and an "archive" pages. The archive page will contain flood maps for past years (The idea is for a user to select a storm and a google map pops with flooded area). The "live" side will show all the active storms in real-time by retrieving the real-time measures from gauges (other servers).


I would be happy if you give me some first guidelines (recommendations, convenient programming language, different components that I will need, things to learn to start…) Thank you very much!





REST - WEB API - Design Approach

The scenerio:


The consumer provides a large XML input as a request. I will have to parse the XML and get the results from the Database and provide the XML result as a Response.


Example Input:


< XML >< PARTS >< PART >123123123< / PART >< PART >123123123< / PART >< PART>4535345< /PART>< /PARTS>< / XML>.


Actual input is big. Say for 10,000 parts.


Output i will have to provide the part description, unit of measurement, etc etc by parsing the xml input, find the details from the database and respond back with xml or json.


How can i design REST based WEB API in .NET? What is the best approach?.





Need help to deploy oracle database in godaddy server



Am Developing a website which is connected to an oracle 12c database(installed in my local windows laptop). It uses the database to recover user data once logged in. Am planning to deploy the website in godaddy. I have the following Questions before deploying.



  1. If I deploy my database in go daddy, do i need to pay for oracle ?

  2. If I have to pay oracle, Is there any other options which makes use of database free ?

  3. Also planning to use the same database for Android App which i will develop after few days. Please suggest If i can able to make use of the database which is on godaddy.


Thanks in advance.





Windows phone 8 - Download html code not wating

I am downloading html code 5 times and I want to wait that phone can download html code and turn into text. Can I do that, that my general function wait for respond and then continue working?



public string izvuci_sliku(string linka)
{
WebClient webclient = new WebClient();
link = "";
webclient.DownloadStringCompleted += webclient_DownloadStringCompleted3;
webclient.DownloadStringAsync(new Uri(linka));
//wait upper line and then go one
return "";
}




Interactive videos on my page

I have some videos and i want to do it interactives. For example a video of a guy running where you can click on a part of the video , for example on the t-shirt and then open other page where you can buy this t-shirt. Are there any tools to make interactive videos?, can i make this on java? or java fx for example?,thanks you.





htaccess redirect for multilanguage sites

Ive an Homepage with 15 Languages, i tried to redirect the old linkstructure to the new Sites but ive some Problems with the redirects.


The Languages differentiate by: domain.com/de/ domain.com/en/... If you type and url without an language after it it automatic redirects to /de/


The old Links look like this: domain.com/com/


when i try to redirect from domain.com/com/ to-> domain.com/de/ this does not work right for me.



Redirect 301 /com/page.asp?id=604 /de/produkte


produces this url /de/com/page.asp?id=604



Redirect 301 /en/product.asp /en/products


this redirects works





Custom login page in java open single sign on (JOSSO)

For single sign on I am using JOSSO (http://www.josso.org) for integrating two applications using IDP (using DB), the login page of both the applications are some,but my requirement is that, I want to segregate the login page for both the applications, how can I achieve this. Both the application is hosted in different servers.


lets assume one application default login is localhost:8080 and another one is localhost:80


So if I hit url localhost:8080 , it will show a login page of app1 and if I hit url localhost:80 it will show a login page of app2


Can I achieve this using a hidden variable passed and handle the same on myLoginForm.jsp as described in below URL-


http://ift.tt/1EYcz0e


However, I want to know if this is feasible or not and what is the best practice for implementing this requirement.


thanks.





Cannot connect web application to a server I get A network-related or instance-specific error

I am building a web application so I want to connect the web application on local machine to a company server. When copying the connection string from the same web application sitting on the server to my local web config I get the following error "A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)". Your help will be appreciated....





why is my background image changing for each page?

I have made one image for the background of my site, its the same image for each page but when i navigate to each page the height changes


Heres my site, any help would be great


http://ift.tt/1C0w6ek





Web-based code editor with syntax highlighting and image showing

Is there a web-based code editor with syntax highlighting and image showing like this: enter link description here


I've tried using code mirror but it seems like code mirror can not display image. I've tried some tools which can display image well but it can not highlight the code.


So, is there a web-based tool can achieve that?





How to Call Web Service in Web Socket in iOS?

currently i am making chat application using Web Socket. My question is How to Call Web Service in Web Socket ?





Backbone.js updating a collection in bulk

I have a collection of objects which will be updated in bulk (not necessarily all at the same time, but more than one).


Therefore I need to send updates to the server in bulk (i.e. not one request for each updated object), and I need to do partial updates (i.e. only update objects which have changed).


What is a clean, elegant way to achieve this?


I have researched and tried a few things, but all solutions are rather kludgy and over-complicated - which is unacceptable for a framework which is meant to simplify these sort of things.


Surely there is a decent way to do such a common thing in Backbone. Or should I use another framework e.g. Angular JS?





cant use service in aws.amazon.com

I had a problem when use Amazon Web Service. I signed up succesfully Account in AWS.amazon.com, but I cant use amazon sevice. I dont know why. My visa card is no money in there. Amazon support sent me two mail



  1. Greetings from Amazon Web Services,


We received an error while confirming the payment method associated with your Amazon Web Services account.


To use some Amazon Web Services, you must provide a valid payment method. Please update your payment method information at the following page:


http://ift.tt/1gVC9In


Some common reasons why an authorization might fail are:




  • Amazon is not set up to accept the CVV2 security code associated with credit cards. Your bank may be able to temporarily lift this requirement.




  • The authorization is for a low dollar amount ($1.00), which your bank may decline.




  • If you signed up for multiple AWS services, a $1.00 authorization may be performed for each service. Your bank may approve the first authorization and decline subsequent ones depending on their security policies.




  • Some banks have restrictions on Internet transactions. You may want to check with your credit card company to see if they have such a restriction.




We recommend you contact your bank to determine the exact reason for the decline, or to ask them to take steps on their end to approve the authorization. Once your bank is ready to approve the authorization, please contact us back and we will retry this authorization for you.


If you feel you have received this e-mail in error, please include these details in your case.


Thank you for using Amazon Web Services. Sincerely, Amazon Web Services


Amazon Web Services, Inc. is a subsidiary of Amazon.com, Inc. Amazon.com is a registered trademark of Amazon.com, Inc. This message was produced and distributed by Amazon Web Services Inc., 410 Terry Ave. North, Seattle, WA 98109-5210


Please help me... Thanks all





Is there any way to send the webpages as demo for testing? like .ipa files in ios

Am developing website using php, is there any way to send the demo of the pages to colleague for testing.


Am asking because in ios we can send .ipa package as like android also possible.What about this web development.


Thanks in Advance.





lundi 30 mars 2015

How the ideal concept for View of multi level user in web development

I have a question, how the standart for ideal organization view for multiple user on an application? For example, in web development, we have 3 level users, as administrator, super user, and the lowest is user. 3 users have different view on web page. is the right way if we use one file to handle 3 users? How if we have more then 3 levels? is there another way?


Need help please...





should aspx and html page be integrated in a single project?

I'm working on a web app and wants to know whether integrating aspx pages and html pages should be used simultaneously? just to decrease or reduce laoding time of some static pages in the web app ?





Bootstrap template not working correctly Django

I have a Bootstrap template that I am attempting to use with Django, and I have places the bootstrap resources in the template directory with the html file that I am trying to display. My problem is that when trying to display the html file, It only comes out as text in the browser window, so this would lead me to believe that the Bootstrap resources are not being properly used.


Here is the template I am trying to use: http://ift.tt/Yhd4E5


Here is what my template directory looks like:



css
font-awesome
fonts
img
js
index.html


I am aware that It uses CDN links, but the resources were with the template when I downloaded the zip, so I left the in there. I am very new to Bootstrap and fairly new to Django as well so please go easy on me, and If I have something wrong in my terminology, please correct me. Thanks.





Display image on top of gif

I have a gif centered in the a middle of a webpage. Once the gif stops playing I want to display three icons on top of the gif and have them light up when users hover over them. How do go about coding the images so they are visible only when the gif has completed loaded/played? Is it possible to do this without javascript?





How to delete records of checked tasks?

I am making a python todo list application with Flask. I am not aware of how to delete the records of tasks checked in the database. I am using sqlite3.



{% extends 'base.html' %} {% block heading %} Todo List {% endblock %} {% block content %}
<div class="tasks">
<form action="/deletesel" method="post">
<input type="submit" value="Delete Selected">
<br>
<br> {% for todo in todos %}
<label class="task">
<input type="checkbox" class="checkTask">{{ todo.todo }}</label>
<br> {% endfor %}{% with messages = get_flashed_messages() %} {% if messages %} {% for message in messages %} {{ message }} {% endfor %} {% endif %} {% endwith %}
</form>
</div>
<div>
<form method="post">
<input type="text" name="newTask">
<input type="submit" value="Add"> </form>
</div>{% endblock %}




How to change start url of my site?

Well, I have very annoying problem. When I tipe www.example-site.com, I would like to change url to http://ift.tt/1CF3Seb. I want to do that only for start page. How can i do that? Does anybody know?


I have done some research on google, but i did not find appropriate answer yet. I have tried something with .htaccess RewriteRule, but it messed up my other RewriteRule`s.


Thanks!





Javascript: text selection including special characters

I'm using this javascript code to grab the word immediately preceding the caret:



sel = window.getSelection()
var selectedRange = sel.getRangeAt(0);
sel.collapseToStart();
sel.modify("move", "backward", "word");
sel.modify("extend", "forward", "word");


This gets the word, even without trailing whitespace (ex. "word") but omits special characters on the end of the word (ex. instead of "word:" gets just "word").


If I include the colon inside of a word, like "wo:rd", this gets all 5 characters.


I really need to get trailing special characters, though. How can I do this?





How can I insert image in the text instead of a color using CSS3?

I have a text heading which is white in color. I want to put an image instead of white color to the text. The Text is big enough to show the image which will be filled in.


image


This is what I basically want.. There's completely different background image behind the text and I want to fill in another image on the text.





Web Scraper cause socket timeout on server

On our application we have a web scrapper written in java which uses URLConnection to fetch html content from sites. The applications crawls about 20 sites (parallel)- between 1 and 100 url requests per site, theses requests are generated each second and awaiting to be regenerated when a result is returned from the site. (all of the requests are managed by thread pool limited to not overkill the server). The problem that we are facing with is that after a certain amount of time our server just goes bananas..the sites start to give SocketTimeoutException one by one until all of the sources end up with SocketTimeoutException. We are using DSL-6740U router and even after switching to a different router of the same model the problem still occurs. (ping seems to be fine and the network and sited are working fine on the browser)


Is there anything we can do to eliminate the problem ? maybe configure the router etc.


(We are using windows xp , i7 with 8gb ram and 100mb network speed)


Any help would be appreciated Thanks in advance





How do I click on the text in the page source vb.net help this method is not?

"See others"


"see others" want to click on the article


Dim h1 As HtmlElement For Each h1 In W.Document.GetElementsByTagName("div") If h1.OuterHtml.ToLower.Split("""")(1) = "f u" Then



h1.InvokeMember("Click")

End If
Next


this does not encode .help me?





Web - The best option for content change inside Div?

stacks.


I want to know what is the best option for changing content inside div!





Tech Interview Prep advice? [on hold]

Hey stack world this is my first time posting on Stackoverflow so please excuse my wording if I'm not specific enough with the question.


Im fresh out of a coding bootcamp and am looking into the job market for a web developer position. I've read the "Cracking The Code" book as well as reading articles but I really wanted to hear about others experiences and advice for approaching tech interviews?


Anything anyone could suggest would be awesome and I would really appreciate it.





How to reverse engineer Php application for UML and system architect design? [on hold]

Im looking to create documentation for software engineering for an already existing application what is the best rout to go on about this. Is there any reverse engineering software for Uml diagrams and system architect design.





HttpPostedFileBase via Angular to Web Api always null

I'm trying to upload large files for Azure which I can do via jQuery and standard MVC controller.


However I want to upload via AngularJS to a Web Api to perform the upload. I've the Angular form as...



<div class="jumbotron" ng-app="myAppModule">
<div ng-controller="myAppController">
<span>Choose Video</span>
<input type="file" id="file" name="file" class="upload" />
<input type="submit" ng-click="save()" value="Upload" />
</div>
</div>


The controller.js is...



app.controller('myAppController', function ($scope, myAppService) {
$scope.save = function () {
var f = document.getElementById('file').files[0];

var FileUpload = {
FileName: "Filename Temp",
Description: "Description Temp",
File: f
};

var promisePost = myAppService.post(UploadFile);
promisePost.then(function (pl) {
// do something..
}, function (err) {
console.log("Err" + err);
});
};
});


The service.js is...



app.service('myAppService', function ($http) {
this.post = function (UploadFile) {
var request = $http({
method: "post",
url: "/api/uploadapi",
data: UploadFile
});
return request;
}
});


My model is...



public class UploadFile
{
public string FileName { get; set; }
public string Description { get; set; }
public HttpPostedFile File { get; set; }
}


And for testing only my Web Api "post" is...



public void Post(UploadFile thePostedFile)
{
//do something...
}


Stepping through I can see the filename, description and file itself via console.log right through to the service.js file. The api gets called and I can see filename and description in the UploadModel model, but the HttpPostedFileBase file is always null.


I find this AngularJS method quite clean and compact but I'm stuck on how to get HttpPostedFileBase populated.


Can anyone advise please if/where I'm going wrong?


Thanks.





PowerShell - why doesn't certain request types work?

This is really odd to me.. The ones for http and https appear fine.. The ones for port 8080 and 8443 do not..



$ip="1.2.3.4"
$urls = "http://$ip","http://"$ip":8080","https://$ip","https://"$ip":8443"
foreach ($u in $urls)
{
"$u"
}


The results show:



PS C:\Documents and Settings\user> D:\WORK\ps\test.ps1
Unexpected token 'ip' in expression or statement.
At D:\WORK\ps\test.ps1:2 char:37
+ $rsaurls = "http://$ip","http://"$ip <<<< ":8080","https://$ip","https://"$ip":8443"
+ CategoryInfo : ParserError: (ip:String) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : UnexpectedToken


If we remove the quoting..



$ip="1.2.3.4"
$urls = "http://$ip","http://$ip:8080","https://$ip","https://$ip:8443"
foreach ($u in $urls)
{
"$u"
}

And the results show:
PS C:\Documents and Settings\user> D:\WORK\ps\test.ps1
http://1.2.3.4
http://
https://1.2.3.4
https://


I think I need to escape the ":"..


I am closer..



$ip="1.2.3.4"
$urls = "http://$ip","http://$ip^:8080","https://$ip","https://$ip^:8443"
foreach ($u in $urls)
{
"$u"
}


and the results:



PS C:\Documents and Settings\user> D:\WORK\ps\test.ps1
http://1.2.3.4
http://1.2.3.4^:8080
https://1.2.3.4
https://1.2.3.4^:8443


Thanks!





Draggable text in html / javascript

I want to make a paragraph movable. I have tried to search the web but i can't find anything. So is it possible?


I tried this but i can't move it:



<p draggable="true">This is a test</p>


I get this.





Why do my javascript and jquery source files consistently not load?

I quite frankly run into this problem every time I try to code html or anything web related.



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


Sometimes it works, sometimes it doesn't. I try a hard refresh, doesn't work. I try changing the file name sometimes. It may work for a few. I try a new page, it doesn't work. I'm really lost on what to do here. If I create a /js folder, and stick my freaking js files in it, what can I do so that it will pick up on them every time, without fail? This isn't related to other coding mistakes, because I'm taking code directly from working examples, and they do not work because of it not picking up on the jquery source file.





How should do to install two tomcat web instances?

I have one tomcat instance installed and run well. Now I need to copy another one instance from this running one. After I copied it and modified the conf/server.xml, the new instance could not be started.(sudo /xxx/restart_tomcat.sh /xxx/www/mynewInstance) I didn't modify startenv.sh, do I need to modify this file too? catalina log is like this:



SEVERE: Error listenerStart
Mar 31, 2015 1:02:39 AM org.apache.catalina.core.StandardContext start
SEVERE: Context [] startup failed due to previous errors
Mar 31, 2015 1:02:39 AM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
SEVERE: The web application [] registered the JBDC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
Mar 31, 2015 1:02:39 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak.
Mar 31, 2015 1:02:39 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named [Timer-0] but has failed to stop it. This is very likely to create a memory leak.
Mar 31, 2015 1:02:39 AM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-19033
Mar 31, 2015 1:02:39 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 2761 ms




Website crashes when taking picture with camera

I've got a simple page that allows you to take a picture with your phone and then upload it to the server.


To achieve that, I'm using HTML5's input as file, so when I click (or tap on) Choose File two options are displayed:



  1. Use the phone's camera (I'm using an iPhone with iOS8)

  2. Select a picture from the library.


If I select the picture from the library everything works just fine, as for now I'm only displaying it on screen, but if I use the camera, after taking the picture the page crashes. I haven't been able to debug because it never hits my breakpoints since the debugging session crashes as well.


Here's the code. Any help will be highly appreciated.



<!--Seg:openPage-->
<script>
function resizeImg(img, canvas, ctx){

var MAX_WIDTH = 500;
var MAX_HEIGHT = 300;
var width = img.width;
var height = img.height;

alert(width + " " + height);

if (width > height) {
if (width > MAX_WIDTH) {
height *= MAX_WIDTH / width;
width = MAX_WIDTH;
}
} else {
if (height > MAX_HEIGHT) {
width *= MAX_HEIGHT / height;
height = MAX_HEIGHT;
}
}

canvas.width = width;
canvas.height = height;
//var ctx = canvas.getContext("2d");

//var dataURL = canvas.toDataURL(img, 0.5);
//img.src = dataURL;

ctx.drawImage(img, 0, 0, width, height);
}


function drawOnCanvas(file) {

var reader = new FileReader();

reader.onload = function (e) {

var dataURL = e.target.result;
var c = document.querySelector('canvas');
var ctx = c.getContext('2d');
var img = new Image();

img.src = dataURL;
//****img.onload = function() {
//c.width = 200; //img.width;
//c.height = 200; //img.height;
if (img.complete) {
resizeImg(img, c, ctx);
//ctx.drawImage(img, 0, 0);
} else {
img.onload = function () {
resizeImg(img, c, ctx);
//ctx.drawImage(img, 0, 0);
};
}
//ctx.drawImage(img, 0, 0);

//****};
//****img.src = dataURL;
};

reader.readAsDataURL(file);
}


function upload(file){

var encodedB64 = window.btoa(file);
var reader = new FileReader();
reader.readAsDataURL(file);
reader.onloadend=function(){
if(file){
//reader.readAsDataURL(file);
console.log(reader);
//alert(reader.result);
$('.output').val(reader.result);
}

submit_form('f','GO');
}
}


$(document).ready(function(){

var input = document.querySelector('input[type=file]');

input.onchange = function () {
var file = input.files[0];

//upload(file);
drawOnCanvas(file);
//displayAsImage(file);
};

});
</script>

<style>
/**
#canvas-container {
width: 100%;
height: 100%;
}

#canvas-container #myCanvas{
width: 100%;
}**/
</style>
<div class="container" style="padding-top: 10px;">
<div id="page_content">
<form name="f" method="POST" action="@&PGM " class="sigPad">
<input type="hidden" name="output" class="output">

<!--Add file input-->
<p>Choose a picture from your device or capture one with your camera now:</p>
<input type="file" id="picManager" accept="image/*" capture="camera">

<!--Add canvas-->
<p>Photo:</p>
<div id="canvas-container">
<canvas id="myCanvas"></canvas>
</div>

<button type="submit" class="btn btn-primary">View</button>



</form>
</div>
</div>
<!--End:openPage-->




Can't figure out how to get a background image into my working right

I'm just learning the basics now. I'm following the Udemy course and the images do not display at all.



<!doctype html>
<html>

<head>
<title>CSS Basics</title>
<meta charset="utf-8" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style>
#main {
width:800px;
height:1000;
margin-left: auto;
margin-right: auto;
background-color: #82b3ae;
padding:20;
}
h1 {
text-align: center;
color: green;
font-size: 50;
}
#jumbotron {
background-image: url('../assets/banner.jpg');
height: 200px;
width: 800px;
}
</style>
</head>

<body>
<div id="main">
<div id="jumbotron">
<h1>Neil Harper's Website</h1>
</div>
<p>Lorem ipsum dolor sit amet, eros elit recteque ex pri, mei iusto oratio te. Duo equidem dolorum antiopam ea. Munere electram suavitate has an. An mei ornatus sensibus eleifend. Vero tritani pro id.</p>
<p>Ut quo esse porro honestatis, vis ad nisl vidit, id assum voluptaria his. Eos ei tibique vituperata, ridens mentitum persequeris mei in. Habeo doctus partiendo eu nam, dicant appetere vim ex, quo et esse regione. Pri habeo soleat commune cu.
Ei possit prompta commune vim, cu latine nostrum vix.</p>
</div>
</body>

</html>




excel VBA web service give error METHOD OR DATAOBJECT NOT FOUND in german Excel

I originally had a problem which you can find on the following link. I am not sure if I should have continued my question on that old post or I should start a new one, so I apologize if I did it wrong.


excel VBA web service give error METHOD OR DATAOBJECT NOT FOUND


Basically a web service within Excel VBA was working fine on some computers, but giving the error mentioned on other computers.


After further research, it appears that it only happens in German Excel/Office instalations.


Is anyone aware of any difference between german Office versions and other versions which might cause this too happen and most importantly, is there a way to make it work on all computers, regardless of language version ?


thanks in advance.





Automatically go to subdirectory index page .htaccess rule

I want that when I click on a link like this: <a href="settings/">Settings</a> it will go to the subdirectory, and load index.php. When I try this right now I get a 404 error


It works if the link is as so: <a href="settings/index.php">Settings</a> but I don't want index.php in the url.


Does anybody know how can I write an .htaccess rule to achieve this ?


.htaccess



DirectoryIndex index.php index.html

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]




Query about different types of web applications

I was wondering what the difference was between: - heterogeneous web applications - distributed web applications - service-driven enterprise web applications


And the benefits and disadvantages of each.


Any help would be much appreciated :)





PHP rename array keys in dinamycally created array

In my php code I have an array and each key of it starts with "@a" charachter. How can I remove that symbol? I never know what keys exactly I'll get, but I need to delete "@a". Thanks.





Which of these url structures is better practice

I just had a quick question about URL structures. Out of these structures which is more commonly used, and should be used more for best practice. Or if you had any other ways that are even better, that would be appreciated.


Create all add type pages with a prefix of add- and then the rest



http://ift.tt/1xPaKFR


or create a folder for all adding functionality



http://ift.tt/1IfZqSS




How to run a web app using sbcl+restas+apache?

Recently I get a work to write a web app with others.The have chosen to use apache,so I have to use it.But I was writing my program in sbcl using restas.So I got confused how to run my app behind apache. I have tried the mod_lisp,but it seems unuseful.All I get is a page saying :Internal Server Error.When I check the apache error log ,I find :


[core:error] [pid 18294:tid 140614142228224] [client 127.0.0.1:44049] AH00135: Invalid method in request server-protocol


[:error] [pid 18295:tid 140614150620928] (70014)End of file found: error reading from Lisp


Now I get confused more....





Mysqli prepared statement working in SQL but not in my application

I'm trying to retrieve the most recent date out of my DB with this:



$stmt2 = $conn->prepare("SELECT reportDate FROM reports WHERE bot=? ORDER BY reportDate DESC LIMIT ?");
$limit = 1;
$stmt2->bind_param("ii", $id, $limit);
$stmt2->execute();
$stmt2->bind_result($lastSeen);


I get the error:



PHP Fatal error: Call to a member function bind_param() on a non-object



I know this usually happens when there's a syntax error in the SQL statement, but I've tried running it in phpmyadmin and it works like a charm. Any suggestion?





Entity States in a web application and in a desktop application

When we're using Entity Framework, an entity maybe in one of the following states: Added, Unchanged, Modified, Deleted or Detached. In a desktop application, state changes are typically set automatically but in a web application we have to manually set the entity state.



I want to know why?





Image floats and Positioning

![personal webpage][1]


Hi guys! I need help with my personal website page. I have gaps in between my images that i don't want there. the images floated on the left are in their own containers and the image floated on the right is inside its own container. Thanks for your help! I have tried putting the images on the left inside their own containers. The images on the top are in their own container, and the images on the bottom row are also in their own container.


here is a link to my page


file:///home/raphael%20rodriguez/Desktop/INTERACTIVE_3/index.html





How to find what file contains the code on a website

Hi' i'm not sure if my question perhaps makes full sense. However allow me to elaborate. Me and my buddy are working on a forum for our e-Sport team and he writes alot of the stuff. I mostly do artwork and some basic troubleshooting. Only problem is that some of it is written in french and i dunno how to locate the file. I wanna finish this off to a nice quality but he is no longer with our team and so wont work on it. Any tips? I've tried using chrome element sources ect





Circular file references are not allowed for user control

I have created 3 user controls in three difference directories(Comment,Comment1,Comment2) like Comment.ascx Comment1.ascx Comment2.ascx


Reference those as per give below:


Comment.ascx > Comment1.ascx Comment1.ascx > Comment2.ascx Comment2.ascx > Comment.ascx


And getting error like:



Circular file references are not allowed.

As per some of forum I have set



batch="false"

in web config file but still I am getting error. Is there any solution for that ?



Angular UI router - Check parent state?

TLDR; Is there a function similar to state.is() to check for a state which has a lot of child states, from one of its child states?


This is my setup:



Parent 1
Child 1.1
Child 1.2
Child 1.3

Parent 2
Child 2.1
Child 2.1.1
Child 2.1.2
Child 2.2
Child 2.3


I want to hide a certain element on all the children and grandchildren of Parent 2. Currently I am using the ugly way of checking each and every state.





MATLAB web command

when I open a local HTML-file with the web command, it´s possible to execute MATLAB-commands within the browser, which will be executed in MATLAB. Is it possible to fire commands in the other direction? E.g. Execute a JS-method from MATLAB-code using the browser handle?





Bootstrap: how to clear images in a gallery?

first a link to the site through github http://ift.tt/1HWqV7j


This is directly to the gallery.


I'm using bootstrap to create a gallery with the grid system. Unfortunately, I've been trying to get things to line up correctly for the past few days. I cant quite seem to get clearfix to work correctly, I don't know if I'm putting the code into the wrong spot into the html or not.


Also tried nth-child code, but I'm stuck on that as well.


I'll continue to research as I wait for answers, but could definitely use some help.


Here is some code snippets from my html:



<div class="container">
<div class="row">
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-3 image-wrapper"> <a href="img/nasarow-fo-to1.jpg" class="img-thumbnail">
<img src="img/nasarow-fo-to1.jpg" class="img-responsive img-height">
</a></div>

<div class="col-xs-12 col-sm-6 col-md-4 col-lg-3 image-wrapper"> <a href="img/nasarow-fo-to2.jpg" class="img-thumbnail">
<img src="img/nasarow-fo-to2.jpg" class="img-responsive img-height">
</a></div>

<div class="col-xs-12 col-sm-6 col-md-4 col-lg-3 image-wrapper"> <a href="img/nasarow-fo-to3.jpg" class="img-thumbnail">
<img src="img/nasarow-fo-to3.jpg" class="img-responsive img-height">
</a></div>


</div>


Suggestions?


In CSS I have the height limited to 300px. You can see that some of the pictures are higher than others, and I think this is what's causing the break, but just cant figure out how to keep the pictures from dropping down to the next row instead of having the 2 or 3 pictures I need in each row.


Background: student of HTML and CSS right now. Updating my site as I go through Treehouse courses.





Saving external resources in java web application

I'm developing a web application and I need to parse and download lot of images from the web.


I would like to know if it is a good practice save them in the application WebContent folder (in a dedicated folder) or if I should use instead an external folder, and why should I prefer one choice to the other.





Stardog web console doesn't show

The Query and Browse pages in the Stardog web console don't show. When I look at the page source, it shows the file contents of stardog/webconsole/stardogweb/webconsole.html. There's nothing in the logs. I've tried with the latest Chrome and Firefox. Any pointers are very welcome!





.NET WebAPI - automatic pdf generation

I have developed an ExtJS 5 + .NET MVC WebAPI RIA for reporting purposes. Now the client is requesting a feature to subscribe to some reports. The reports (pdf) should be generated automatically and then the server should send them per mail to the user who subscribed a report. It would also be a nice to have that the user can specify the date and time when he will receive the report.


Currently the application has already a PDF export where the user can save these reports. In this case the applications sends the html of the report section to the server and the server is working with wkhtmltopdf to generate the pdf.


For my new feature i have the following questions:




  1. Can i implement this new feature service in my WebAPI (e.g. as a thread which ill start on startup) or should i write an independet service for it.




  2. Would it be appropriate to just load the site on the server with the reports and execute the process which i am already running for my PDF export to get the pdf out of it?




I am thankful for every advice.





how I can browse this arborescene to extract infor using zend framework 1.11

I have web service client and the file php consume this web service i want to user the file to stock the data in mysql with zend framework 1.11 ,can you tell me how can i extract this info about this arborescence on zend framework i do that $data['code']=$param->ThirdParty->Identification->Thirdpartycode on ClientController it's correct? this structure of web service :



<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://ift.tt/ra1lAU" xmlns:xsd="http://ift.tt/tphNwY" xmlns:soap="http://ift.tt/sVJIaE">
<soap:Body>
<GetThirdPartyInfoResponse xmlns="http://ift.tt/19zfraZ">
<GetThirdPartyInfoResult>
<ThirdParty>
<Company>string</Company>
<Establishment>string</Establishment>
<Identification>
<Seq>int</Seq>
<ThirdPartyCode>string</ThirdPartyCode>
<KeyWord>string</KeyWord>
<Name>string</Name>
<Name_>string</Name_>
<Address>string</Address>
<Address_>string</Address_>
<Zip>string</Zip>
<City>string</City>
<ProvinceSeq>int</ProvinceSeq>
<Province>string</Province>
<Country>string</Country>
<Tel>string</Tel>
<Fax>string</Fax>
<Mail>string</Mail>
<Contact>string</Contact>
<Rep>string</Rep>
<Color>string</Color>
<Language>string</Language>
<Notes>string</Notes>
<Type>CUSTOMER or SUPPLIER or PROSPECT</Type>
</Identification>
<Invoicing>
<SalesTaxNb>string</SalesTaxNb>
<TaxCode>int</TaxCode>
<TaxType>int</TaxType>
<Currency>string</Currency>
<Factoring>NOT_ENABLED or ENABLED</Factoring>
<Copies>int</Copies>
<InvoiceNote>string</InvoiceNote>
<PaymentMethod>ON_RECEIPT_OF_INVOICE or ON_RECEIPT_OF_STATEMENT</PaymentMethod>
<PaymentMode>CHEQUE or BANK_DRAFT or BANK_TRANSFER or PROMISSORY_NOTE or OTHER or CHEQUE_BY_ORDER</PaymentMode>
<PaymentExpiry>int</PaymentExpiry>
<PayDay>int</PayDay>
<InvoiceDiscount>double</InvoiceDiscount>
<InternalIncrementReduction>double</InternalIncrementReduction>
<PaymentDiscount>double</PaymentDiscount>
<PayBefore>int</PayBefore>
<GeneralAccount>string</GeneralAccount>
<CreditLimit>long</CreditLimit>
<Bank>string</Bank>
<Position>string</Position>
<Account>string</Account>
<Key>string</Key>
<Branch>string</Branch>
<Branch_>string</Branch_>
<CompanyNo>string</CompanyNo>
</Invoicing>
<Other>
<Type>string</Type>
<SalesArea>string</SalesArea>
<Staff>string</Staff>
<Turnover>int</Turnover>
<CompanyLegalStatus>UNKNOWN or TRADER or LIBERAL_PROFESSION or FARMER or SALES_AGENT or OTHER_ENTITY or COOPERATIVE or GENERAL_PARTNERSHIP or LIMITED_LIABILITY_COMPANY or LIMITED_COMPANY or ECONOMIC_INTEREST_GROUP or CIVIL_PARTNERSHIP or PUBLIC_SERVICES or TERRITORIAL_COMMUNITY or ENTERPRISE_COMMITTEE or ASSOCIATION or OTHER</CompanyLegalStatus>
<EstimateCreditCheckAction>NO_CONTROL or WARNING or BLOCKING</EstimateCreditCheckAction>
<OrderCreditCheckAction>NO_CONTROL or WARNING or BLOCKING</OrderCreditCheckAction>
<DeliveryCreditCheckAction>NO_CONTROL or WARNING or BLOCKING</DeliveryCreditCheckAction>
<Manufacturer>string</Manufacturer>
<isCustStockView>boolean</isCustStockView>
<MarginCode>int</MarginCode>
<LabourMup>double</LabourMup>
<MaterialUp>double</MaterialUp>
<OutsourceUp>double</OutsourceUp>
<Creation>dateTime</Creation>
<LastEstimate>dateTime</LastEstimate>
<LastInvoice>dateTime</LastInvoice>
<Target>string</Target>
<ContactMode>int</ContactMode>
<EstimateCreationBlocked>boolean</EstimateCreationBlocked>
<JobCreationBlocked>boolean</JobCreationBlocked>
<DeliveryCreationBlocked>boolean</DeliveryCreationBlocked>
</Other>
</ThirdParty>
<Contacts>
<Contact>
<ThirdPartyCode>string</ThirdPartyCode>
<Seq>int</Seq>
<Title>MR or MRS or MISS or OTHER</Title>
<LastName>string</LastName>
<FirstName>string</FirstName>
<Position>string</Position>
<Address>string</Address>
<Address_>string</Address_>
<City>string</City>
<Zip>string</Zip>
<ProvinceSeq>int</ProvinceSeq>
<Province>string</Province>
<Country>string</Country>
<Tel>string</Tel>
<Tel_Extension>string</Tel_Extension>
<Portable>string</Portable>
<Fax>string</Fax>
<Mail>string</Mail>
<IsFirst>boolean</IsFirst>
<Note>string</Note>
<Company>string</Company>
<Establishment>string</Establishment>
</Contact>




searching for nearby restaurants , grocery stores and clinics in a particular loaction

I am working on a project where the user enters his current location and selects a service eg. Nearby restaurants, Grocery store, Clinic and gets pop up's of selected service eg. grocery store in a google maps kind of interface. Which is the best API or tool to use for this Web application ?





Integrating google analytics with web version and mobile version of same application

I have an sapui5 application. It has to be deployed to be run on a browser also i have to integrate an pack it as a mobile app using xcode and cordova. Now I have to integrate GA analytics in both web version and mobile version. Question is do i have to use separate tracking ids for each version ? and is there some common method that can be applied so that it works on both versions?





How to download files from db in codeigniter

I am creating a resource site for my campus where teachers upload files to folder and reference of that filed stored in db, and students can download those files using download option in student view side, and all these I have done in codeigniter using model view controller..., I need help for coding to download files.....I managed to display set of files but could not download yet, can anyone please help me with this? Il be so thankful





PHP Rest Web API multiple functions in single file

I'm new to the PHP/Web world so excuse me if this is a simple question.


I have seen many links on how to make a web-api using PHP, and all of the examples would put each "function" in a different file. I once helped my friend develop an asp.net C# web api where a single file would contain multiple functions.


Can this be done in PHP? i.e can a single PHP file contain multiple functions that a web-api can call? If so can you kindly give me an example of how it is done, or refer me to a link where this is explained?


Thank you for your time.





dimanche 29 mars 2015

What method used to dynamic pull data to display based on user keystrokes

http://ift.tt/MgaLVA


The form in this site has a Travel form with Select Countries as a field. When user starts keying in letters, the field will dynamically filter through to display the replace by results. How is this done?





Exporting Java Program for Web

I've searched around for a while now can I can't find a good bit of advice or tutorials on how to get an Asteroids game I created to run on my website. I have here 4 classes that are packaged together plus an external jar, and when I export it as a runnable jar in Eclipse, it works fine on the desktop. I'm running into roadblocks exporting it as a WAR file, which I believe is what I should use. When I get to the window that says to select "Web project", the list is empty and I can't proceed. I've also read that it needs to be a Java Applet to run on a website, so I have no idea how to convert what I already have into that. I can do Run As > Java Application which works.





Lost gmail because internet died

In Gmail, I sent an email while my internet connection was down. I reconnected, but somehow, Gmail can't reconnect, even after I've clicked repeatedly on the 'Try now' button. I opened Gmail again in a separate window, and it has forgotten the email completely. I can't find it in my Drafts or Sent folder.





How to judge a website whether using analog static technology?

Is there any way to analyze whether a website using analog static? (e.g UrlRewriteFilter), please give me some clues, thanks in advance:)





Web app from internet connection have to connect swarm

I need your ideas and comments.


I need a web app. This page for a cafe or restaurant, for usage example;


after the user connect the wireless in our restaurant, we dricet the user a web page or web app, this page have written you have to share this post like "I am here" with swarm or facebook or twitter or vk


what I need for the develop this application. if someone give me advice i am really glad


if you know a similar applications can you share me.





Connecting Android device to Oracle WebLogic 9.4 server

I'm trying to implement a RESTful service for my Android app and I've decided to use Oracle WebLogic to act as a server on my PC. I have the phone and PC connected to the same LAN and ports 7001 and 80 on my PC allow TCP connections with other devices. I have tried the following solution(in AsyncTask):



protected Void doInBackground(String... params) {
String url = "http://ift.tt/1BUseLT";

queryResult = new ArrayList<String>();

try {
URL uri = new URL(url);
HttpURLConnection urlConnection = (HttpURLConnection) uri
.openConnection();
InputStream in = new BufferedInputStream(
urlConnection.getInputStream());

Scanner scan = new Scanner(in);

while (scan.hasNext()) {
queryResult.add(scan.nextLine());
}

scan.close();

urlConnection.disconnect();
} catch (Exception ex) {
ex.printStackTrace();
}
return null;
}


The IP address is the address of my PC(ipconfig), CookBook is the dynamic web project that is being hosted on my server. When I input this URL in my browser(both on PC and on Android web browser) I get the correct results, but when I try to connect to it this way, the getInputStream() method executes forever(no exceptions). Also, if I replace the URL with something I know it works, like "http://ift.tt/fyw30c", it works normally, I get the HTML of the site at the given URL. What am I overlooking here?





No adapter set exception when setting multiple connections in li3

I am attempting to set-up multiple connections in my li3 project but when I do I get an uncaught exception. I set my connections in the app/confi/bootstrap/connections.php file which is then loaded in by the bootstrap.php file. Here is what I have for my connections:



Connections::add('default', array(
'development' => array(
'type' => 'MongoDb',
'host' => 'localhost',
'database' => 'web_app'
),
'test' => array(
'type' => 'MongoDb',
'host' => 'localhost',
'database' => 'test_web_app'
)
)
);


When I have it set like this and try to browse to my project I get this error:



Fatal error: Uncaught exception 'lithium\core\ConfigException' with message 'No adapter set for configuration in class `lithium\data\Connections`.' in /var/www/site/libraries/lithium/core/Adaptable.php:233


However when I just have a single default connection set-up it works fine. Has anyone else ran into this issue?





go language web framework design thread wise

What is the threading design of GO net/http library? I heard this talk a few days ago and I was really curious about how GO developers implemented their web framework design, thread wise. I know node.js uses 1 Computational thread reading events and a pool of I/O threads. ASP.NET uses a thread per call... how does GO handle the C10K problem?





Making a vertically equal partition on a Centralized Webpage, without using Frames and Table concept ?

I'm trying to make a vertical split in a centralized webpage. I'm doing the split with the concepts of frames and tables but its not satisfying my expectation.


I tried using div for separation but found it difficult to mange and running into conflict. I google for solution but not find anything related. I'll be sorry if it is very basic. Any help and suggestions would greatly appreciated.


Thanking in Advance, Regards...





Python flask render_template not working

when I run it on the browser (chrome) I get:


"500 Internal Server Error


The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application."


here is the code:



from flask import Flask, render_template

app=Flask(__name__)

@app.route('/')
def home():
return "hello world"

@app.route('/welcome')
def welcome():
return render_template("welcome.html")

if __name__ == '__main__':
app.run(debug=True)


Here is the welcome.html file which is in the templates directory:



<!DOCTYPE html>
<html>
<head>
<title>Flask Intro</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="static/bootstrap.min.css" rel="stylesheet" media = "screen">
</head>
<body>

<div class="container">
<h1>Welcome to Flask!</h1>
<br>
<p>Click <a href="/">here</a>to go home.</p>

</div>

</body>
</html>


I'm using Python anywhere for this project. When I try the other route ('/'), it works, which means it's only a problem with the render_template route.





Sharepoint 2010 Content Web Editor Yahoo Weather

I'm trying to get this result: http://ift.tt/1EkoA4R


However, I'm still unable to get the yahoo weather to display.


First of all, I have already extracted the zip file and saved it in this folder structure:


Style Library/Scripts/ and dumped all the files in there.


Secondly, I used this code provided in the link above and saved it as YahooWeather.txt. Basically this is to invoke the yahoo weather.



<script src="http://ift.tt/t0Y3fx" type="text/javascript"></script>
<script src="http://ift.tt/1Ns64sX" type="text/javascript"></script>
<script src="http://mysharepointsite:8000/Style Library/Scripts/jquery.zweatherfeed.js" type="text/javascript"></script>

<script type="text/javascript">
$(document).ready(function () {
$('#weather').weatherfeed(['90210', '75201', '37201', '33101'], {}, function (e) {
$("div.scrollable").scrollable({
vertical: true,
size: 1
}).circular().navigator().autoscroll({
interval: 3000
});
});
});

</script>

<body>
<div class="scrollable verticalweather">
<div id="weather" class="items" ></div>
</div>

<div class="navi" ></div>


Lastly, I added in the content web editor web part in http://mysharepointsite:8000/SitesPages/Home.aspx and for the content link, i added this url /Style Library/Scripts/YahooWeather.txt


However, nothing is displayed. Is it due to the wrong linkage of url?





samedi 28 mars 2015

getting an empty array after I pushed some Json objs to it [duplicate]


I could not figure out why my userProjects at the end prints an empty array.



var express = require('express');
var router = express.Router();
var idea = require("../models/idea_model");
/* GET home page. */
router.get('/', function (req, res, next) {
//var sess = req.session;
var userProjects = []
try {
if (sess.user.email) {
console.log("see.user.projects: " + sess.user.projects);
var proj_length = sess.user.projects.length;
for (var i = 0; i < (proj_length); i++) {
console.log("project name: " + typeof (sess.user.projects[i]) + " " + sess.user.projects[i]);
idea.findOne({
title: sess.user.projects[i]
}, function (err, docs) {
if (!err) {

if (!docs) {
console.log("error saving project to user");
} else {

userProjects.push(docs);

}
} else {
console.log(err);
}
});
}
console.log("vvvvvvvvvvvvvvvvvvvvvvvvvvvv");
console.log(userProjects); //Problem!!!!!!!!!!!!!!! empty array!!!
res.render('user_dash', {
user_proj: JSON.stringify(userProjects)
});
if (sess.cookie.maxAge <= 0) {
sess = null;
}
}
} catch (e) {
res.render('login');
}
});

module.exports = router;




How can I get the value at index in codeigniter?

I have generated the array containing session data as,



Array ( [session_id] => 8f9286115a38df9ed54a65b135d4e8c0 [ip_address] => ::1 [user_agent] => Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.101 Safari/537.36 [last_activity] => 1427600580 [user_data] => [roll_no] => 111416 [is_logged_in] => 1 [email] => [user_data ] => Array ( [email] => ) [0] => stdClass Object ( [name] => durex [email] => durex@gmail.com [year] => 2 [semester] => 4 [branch] => CSE [parent_email] => parent@durex.com ) )


How can I echo name(durex) using the above session $userdata?





Is it ok to use bower components when deploying a website or app?

I've been working more and more doing web development. I use mainly bower to get all the necessary libraries and widgets to user for my apps and websites. But I wonder, what are the best practices when deploying a finished product? Specifically, what files should I include? How can I make the reload times faster?





How can I prevent my web crawler from slowing down over time?

I made a web crawler in C#. It starts from one URL, finds all URLs in that URL and then visits all other URLs, and so on...


I add the URLs to a string array with a pre-defined size and a Dictionary so I can check if the URL has already been crawled (I use Dictionary's ContainsKey() method because it's faster than a linear array search).


It is very fast when it starts working, but over time it gets painfully slow. The reason for this is that the Dictionary's Contains() method takes a lot of time when the Dictionary is very big (100K+ URLs, for example), and that means my web crawler is slowing down quickly over time.


What can I do about this? I have to check if a URL has been added already, and a Dictionary lookup is the fastest way, but even this way gets slow after the Dictionary gets large enough.





J48 Algorithm using python web base application?

Sir i'm looking for implementation of J48 Algorithm using python web-based.


Is there any python web based application to run J48 Algorithm using weka engine like python-weka-wrapper?


Thank you





Framework for user oriented sql administration (for non expert users)

I'm used to building PHP/Sql/Javascript/Css web apps, which is pretty easy using tools like jQuery and Twig.


However, once the database is configured and the app is running, there is a need for an administration panel for user to send content. I personnaly use PhpMyAdmin for database deployement, but this tool is to complexe and generic to be an acceptable interface for users to insert content into the database.


Developping a specific tool (ie administration interface) ends up being more complexe then developping the app itself.


Is there a framework which, given a simple description on the database structure would provide an elegant web interface for non expert administration (inserting / editing data into the database) ?





Web API 2 - how to get dynamic value using string instead of key?

I have a Web API controller looking similar to this:



public void Post([FromBody]dynamic postData)
{
foreach (var row in postData)
{
var email = row.email.Value; // ok
var eventType = row.event.Value; // cannot use because "event" is reserved by .NET, C# or whatever
}
}


I'm getting a JSON from external system which contains this "event" property (outside of my control), that I'm unable to retrieve. I've tried dozens of workaround, but none of them seemed to work in this scenario. Hopefully there is some easy way of retrieving it.


The best bet I had was using reflection like:



row.GetType().GetProperty("event").GetValue(row, null);


But didn't work as I had expected. Is there something else I can try?


Thank you for any advice.





Writing a simple sniffer in web

We have a simple Client-Server sniffer (Wireshark like UI). Server is listening to messages, parsing them and send a parsed messages to the client. We want to move it to Web platform (Web UI instead client) What is a proper way to do this?


I thought about sending ajax requests to server every x seconds, and update the html, with a new packets. But I don't know if this is a good idea, when we have a big amount of messages. And how many time will packet filtering take, implemented in jQuery (scanning the whole html and hide a not relevant rows)


I see many problems with such solution. Maybe there is a better way to implement this? Maybe there is a way to get asynchronous messages?





Download AJAX generated content using java

I have a webpage on which a list of movies is being displayed. The content is created using AJAX (as far as my limited knowledge would suggest...).


I want to download the content, in this case the movie playing times, using Java. I know how to download a simple website, but here my solution only gives me the following as an result instead of the playing times:



ajaxpage('http://ift.tt/1D0IccR', "kinoprogramm");



How do I make my program download the results this AJAX function gives?


Here is the code I use:



String line = "";
URL myUrl = http://ift.tt/1BEJ9De;
BufferedReader in = null;
try {
myUrl = new URL(URL);
in = new BufferedReader(new InputStreamReader(myUrl.openStream()));

while ((line = in.readLine()) != null) {
System.out.println(line);
}
} finally {
if (in != null) {
in.close();
}
}




Creating a picture slider for a website

I am trying to create a picture slider on a website I'm building.


When searching for examples online, I've found very complex examples with great amounts of JavaScript code or suggestions to use Dreamweaver-type software.


Isn't there a simple, HTML5 integrated/built-in way to create a picture slider?





What are the alternative PageRank(no analogue PR)?

The question is what do you think is better algorithm PR? (As the main criterion for the formation of the results)


What are the alternatives? (As the main criterion for the formation of the results)


Non-standard algorithms? (As the main criterion for the formation of the results)


My options:


1.Analyze the number of bookmarks a page in the user's browser (the more the better results in search) PR-based on how many sites link to this site. The greater the higher the site results.


2.It is very hard to analyze the html. Up until the background color of the page.


Sorry for my bad English.





Where to start web devolping?

Right now I have a basic grasp of C++ (and by that I mean really basic!) and I want to learn web development.Where should I start?.What are the most used technologies today?





Make element position fixed while width = 100% stays valid

I'm currently having a problem with html and css(still learning both). I'm trying to make a standard layout with an image in a div fixed to top of page, under it a horizontal navigation bar, a footer, and a news module in between.


This is it how it looks like currently:


http://ift.tt/1F41BJ1


You can already see the problem(2 actually). I can't position the list over my navigation bar image, nor can I make the footer image as wide as the navigation image.


This is my html:



<!DOCTYPE html>
<html>

<head>
<meta charset="UTF-8">
<link rel = "stylesheet" href = "/servis/Stilovi/standardstyle.css">
<title>Granulo - RE d.o.o</title>
</head>

<body>
<!-- Element koji cini header -->
<div id = "headers">
<img id="aparat_slika" src="/servis/Resursi/Slike/aparat_slika.png" alt="Slika nije ucitana">
<img id="logo_slika" src="/servis/Resursi/Slike/granulo_logo.png" alt="Slika nije ucitana">
<p id="naziv_firme">GRANULO - RE d.o.o</p>
<p id="djelatnost_firme" class="djelatnost">Promet, inženjering i servis protivpožarnih uređaja<br>Bojnička 47, Sarajevo</p>
</div>
<!-- Element koji cini vertikalni meni -->
<nav id = "navbar">
<ul id="lista_meni">
<li ><a class="djelatnost" href="#">Link 1</a></li>
<li ><a class="djelatnost" href="#">Link 2</a></li>
<li ><a class="djelatnost" href="#">Link 3</a></li>
<li ><a class="djelatnost" href="#">Link 4</a></li>
<li ><a class="djelatnost" href="#">Link 5</a></li>
</ul>
<img id="navbar_bg" src="/servis/Resursi/Slike/horizontal_stripe.png" alt="Slika nije ucitana">
</nav>
<!-- Element u kojem se nalaze novosti -->
<div id = "news"></div>
<!-- Element koji cini footer -->
<div id = "footers">
<img id="footer_image" src="/servis/Resursi/slike/horizontal_stripe.png" alt="Slika nije ucitana">
</div>
</body>


</html>


And my css:



@import url(http://ift.tt/1rYOraV);
body{
margin-left: 10%;
margin-right: 10%;
background-color: white;
}

ul{
list-style-type: none;
}

/* images */
#aparat_slika{
float:right;
}

#logo_slika{
float:left;
}

#navbar_bg{
width: 100%;
margin: 0;
padding: 0;
}

#footer_image{
width: 100%;
}

/* div style */
#headers{
background-color: #e6e1e1;
width: 100%;
float: right;
border: 1px solid black;
}

#naziv_firme{
font-family: 'Roboto', bold;
font-size: 30pt;
float: top;
margin-top: 10px;
}

#navbar{
width: 100%;
border: solid 1px black;
float: right;
padding: 0;
text-align: center;
}

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

#navbar ul li{
margin: 0;
padding: 50px;
display: inline;
}
#navbar a:visited{
margin: 0;
padding: .3em .4em .3em .4em;
text-decoration: none;
font-weight: bold;
font-size: medium;
}

#navbar ul a:active{
margin: 0;
padding: .3em .4em .3em .4em;
text-decoration: none;
font-weight: bold;
font-size: medium;
}

#navbar ul a:hover{
margin: 0;
padding: .3em .4em .3em .4em;
text-decoration: none;
font-weight: bold;
font-size: medium;
background-color: #227755;
}

#footers{
position: fixed;
bottom: 0;
width: 100%;
border: solid 1px black;
}

#news{
border:solid 1px black;
}

/* Klasa za male natpise za firme */
.djelatnost{
font-family: 'Roboto', italic;
font-size: 10pt;
float:top;
margin-top: -40px;
color: black;
}

.linkSize{
height: 120px;
}




Why does safari keeps on auto refreshing the page?

I have developed a website foodinger.in. When i go to filteredRestaurant.php by selecting dine type in home page and clicking on search button, safari keeps on refreshing the page


Everything is working fine in other browsers, i have been searching for this since last 4 hours and unable to find my mistake, can anyone please suggest, what could be the possible reason for this only in safari.


Thanks in advance





Difference between location of MySQL Drivers between Java Application and Java Web Application?

I'm working with MySQL integration. I am using JDK 8 with Eclipse Luna EE, Tomcat 8.0 and MySQL 5.1.34


I have 2 projects, one is a Java Web Application, the other is a Dynamic Web Project.



public void connectToDB(String host, String dbName, int port, String username, String password){

try
{
String url = "jdbc:mysql://" + host + ":" + port + "/" + dbName;

Class.forName("com.mysql.jdbc.Driver");

dbConnection = DriverManager.getConnection(url, username, password);

System.out.println("Successfully connected to database!");
}
catch(Exception e){
System.out.println("Error accessing database!" + e.getMessage());
}
}


I have a few questions:



  1. The code doesn't work if I remove the "Class.forName(...)". Why is that so? I read I didn't need this for Java 5 and up (I am using Java 8), but it seems like my code won't work without it.

  2. For the JAVA APPLICATION project, the way I import the Driver is through Project Properties -> Java Build Path -> Libraries -> Add External JAR -> MySQL Driver ... For the DYNAMIC WEB APPLICATION project, if I import the same way (in the build path), it does not work! However, if I copy paste the MySQL Driver JAR file to the $CATALINA_HOME/lib, it works! Why is this the case?


Hoping someone can clear it up. Thanks!





HTML/CSS Image Rollover/Animation, specific case with existing code, how to change animation?

ok, I have don some web development in the past, but am fairly new to "css/webkit" animations.


I have an image on my website, that goes through an animation when a user "hovers" over the image, as so:


enter image description here


What I want to do is change this animation.


I want to remove the red "arrows" icon at the bottom-right. I think I want to keep the opacity transition, BUT, I want to display a DIFFERENT image, if the user is hovering over the image.


Here is the HTML code for the image:



<div class="col-md-4">

<div class="team" data-animation-name="fadeInRight">

<div class="team-photo">
<figure>
<img src="demo/team/dfds_seaways_ship.jpg" alt="">
<figcaption>
<a href="#">
<i class="gi gi-resize-full"></i>
</a>
</figcaption>
</figure>
</div>


I did not write this code, and so I am, unfortunately, quite lost.


I think I should show the "css-classes" used here.



/* ==========================================================================
Team
============================================================================= */
.team {
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
margin-bottom: 30px;
}
.team .team-photo {
position: relative;
margin-bottom: 15px;
overflow: hidden;
}
.team .team-photo figcaption {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-color: rgba(255, 255, 255, 0.5);
-webkit-transition: opacity 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
transition: opacity 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
opacity: 0;
}
.team .team-photo figcaption a {
display: block;
position: absolute;
z-index: 1;
width: 44px;
height: 44px;
overflow: hidden;
right: 0;
bottom: 0;
text-align: center;
text-decoration: none;
color: #fff;
background-color: #e35a55;
-webkit-transform-origin: 100%;
-moz-transform-origin: 100%;
-ms-transform-origin: 100%;
transform-origin: 100%;
-webkit-transform: rotate(-90deg);
-ms-transform: rotate(-90deg);
transform: rotate(-90deg);
-webkit-transition: -webkit-transform 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94), background-color 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
transition: -webkit-transform 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94), background-color 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.team .team-photo figcaption a .fa,
.team .team-photo figcaption a .gi {
width: 44px;
height: 44px;
line-height: 44px;
font-size: 16px;
}
.team .team-photo figcaption a:hover {
background-color: #000;
}
.team:hover .team-photo figcaption,
.team.touch .team-photo figcaption {
opacity: 1;
}
.team:hover .team-photo figcaption a,
.team.touch .team-photo figcaption a {
-webkit-transform: rotate(0);
-ms-transform: rotate(0);
transform: rotate(0);


.team .team-info {
text-align: center;
padding: 0 15px;
}
.team .team-name {
margin: 0;
}
.team .team-data {
display: none;
}


I tried "just" adding onMouseOver and OnMouseOutEvents, allthough I am unsure if that would be the right/best way to do this, like so:



<img src="demo/team/dfds_seaways_ship.jpg" alt="" onmouseover="this.src='demo/team/dfds_seaways_ship2.jpg'" onmouseout="this.src='demo/team/dfds_seaways_ship.jpg'">


But it isn't working. This was my naive approach, with my web dev knowledge from a while ago, but I would like to do this by conforming to the CSS approach taken here by the developers of this site.


To be honest, I am lost, so if anyone can help me, or explain to me how I can do this easily with the CSS code that is available, I would be extremely happy, so I can get this done.


If more information is needed, let me know. And I hope the gif above (of the ship) displays fine, on my machine it doesn´t display correctly on IE, but on chrome it displays fine.


Thanks for any and all help!


C





Is it technically possible to remove some parts of the page UI without owning it?

I am wondering if there is some page with too many advertisements, then is it possible to create my own simple UI and feed the input to that website ? Lets say this site to send sms: http://ift.tt/1GzWxOx


Now can I create an webpage with only Mobile number, SMS text input, display their verification code, and click send without having to see all other contents (Ads and stuffs).


Is it possible at all ?





Determine monitor/screen model in browser

I want to deliver video for 3D-Screens in the browser but most monitors need different Input formats (like sideBySide or Interlaced) to display the content correctly. As such I have to determine the monitor model as I can't think of any other way to determine the required format.


A simple Javascript or HTML5 solution would be perfect but it seems such information is not available to those environments. Are Flash, Silverlight or even ActiveX capable of such a thing?


Eventually I want to be able to do something like this:



if(monitorModel == 'someManufacturer GL1138THX)
{
//load corresponding video
}




Login Credetials: Why not drop the username?

I was just about to write my hundredth login form when a thought crossed my mind: Why do I need a username?


A while ago my dad had to change his e-mail-address, and he still didn't figure out, why he can't log into various websites with his new address. I'm also not a huge fan of individual per-site usernames. And wouldn't it be easier to remember only a password?


What are usernames good for? You obviously need some unique string to identify a user by. If you had just the password, that would work until a user picks a taken password and you would have to tell him “Sorry, 'GreatPassword123' already belongs to another user” — bad idea.


So part of the password needs to be unique. My idea: Predetermine the first three characters! You could choose from lower- and uppercase letters and digits, providing (26+26+10)^3 = 373,248 unique prefixes. At registration, the user would get a dialog, telling him that he only needs a password, and it starts with “N0i” for example, he has to pick the rest (“deaWhy” comes to mind). He can then log in with his password only, being “N0ideaWhy”, not knowing (or caring) that “N0i” actually is a unique username.


I see the following pros and cons:


Pros



  • independence from e-mail-addresses

  • user needs to remember just one string

  • might reduce password reuse

  • safe from leaked lists

  • faster login through fewer keystrokes


Cons



  • need to split the password-string and submit the first three characters unencrypted while hashing the rest

  • scalability comes to a dead stop at 373,248 users (or 26.8 million if you use four characters)

  • users might be skeptical / unexperienced / thrown off by not being able to reuse their standard password


I'm really wondering why nobody else did this so far? Are there any concerns that I missed?





(PHP) The include function only includes some parts of the file

I have a problem including a php file. I have searched on the web, and troubleshooted in different ways for three hours, But I can't figure it out on my own.


I have a file called "side9test.php" with this code:



<?php

include "styret/fil-liste.php";

?>


The file "fil-liste.php" contains:



<?php
echo "</br>";
echo file_get_contents("filsystem_navn/m_0.txt");

?>


The file "m_0.txt" contains this:



forste mappa


The problem though, When I run "side9test.php", all it gives me is:



</br>


I appreciate all feedback!





How to make a web browser to not load any external files for a local web page

I recently download w3school whole website with winHTTrack copier. I want to open w3school locally but when i am conected to the internet the local files load some ad also . I want to cut of internet supply for local web files, is there any way to do that.





How to check the website is responsive or not?

I want to learn more information about responsive designs.So please,tell me how to check or test the functionality of the website?





Fetch Image from Server in Xamarin Android

I am trying to fetch an image from server and to display on ImageView control in my Xamarin Android. I have tried to method for doing it but none of them is working. What may be the reason? Please help me


METHOD -I



public void testWCF()
{
WebClient web = new WebClient();
web.DownloadDataCompleted += new DownloadDataCompletedEventHandler(web_DownloadDataCompleted);
web.DownloadDataAsync(new Uri(@"http://ift.tt/191hiVP"));

}

void web_DownloadDataCompleted(object sender, DownloadDataCompletedEventArgs e)
{

if (e.Error != null)
{
RunOnUiThread(() =>
Toast.MakeText(this,"ritesh your error is "+ e.Error.Message, ToastLength.Long).Show());
}
else
{

Bitmap bm = BitmapFactory.DecodeByteArray(e.Result, 0, e.Result.Length);

RunOnUiThread(() =>
{
ImageView imgView = FindViewById<ImageView>(Resource.Id.imageView1);
imgView.SetImageBitmap(bm);
});
}
}


METHOD-II



public async void testWCF2()
{
var imgView = FindViewById<ImageView>(Resource.Id.imageView1);
using(var bm = await GetImageFromUrl(@"http://ift.tt/191hiVP"))
imgView.SetImageBitmap(bm);

}

private async Task<Bitmap> GetImageFromUrl(string url)
{
using(var client = new HttpClient())
{
var msg = await client.GetAsync(url);
if (msg.IsSuccessStatusCode)
{
using(var stream = await msg.Content.ReadAsStreamAsync())
{
var bitmap = await BitmapFactory.DecodeStreamAsync(stream);
return bitmap;
}
}
}
return null;
}




How to use themes from Themeforest with JSF/Primefaces?

I wonder whether it is possible to use themes like these from Themeforest with my JSF/Primefaces. Could someone please explain me?