lundi 31 octobre 2016

Real time graph chart based on frequency calculated

I want to make a real time chart that does plotting to the frequencies calculated by capturing audios from microphone, currently. I am done with capturing audio and using frequencies to calculate the music notes (Thanks to stackoverflow community as well!).

How can I use the frequencies captured to plot into a real time chart?

Example http://ift.tt/2dXkV6F




A-Za-z vs. /i case insensitive

What is considered best practice, and what is the fastest to compute?

[A-Za-z]

vs.

[a-z]/i

Assuming that you don't care about the rest of the regex's case.




Tomcat 8.0 not starting if pom.xml add spring-boot-starter-data-jpa (spring)

hello can anyone help me, i'am new in spring, i was build web and run with no error with spring-web, but if i add this depedency to pom.xml

<dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>

then the console show this error :

Nov 01, 2016 8:36:27 AM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["ajp-nio-8009"]
Nov 01, 2016 8:36:27 AM org.apache.coyote.AbstractProtocol destroy
SEVERE: Failed to destroy end point associated with ProtocolHandler ["ajp-nio-8009"]
java.lang.NullPointerException
at org.apache.tomcat.util.net.NioEndpoint.releaseCaches(NioEndpoint.java:316)
at org.apache.tomcat.util.net.NioEndpoint.unbind(NioEndpoint.java:492)
at org.apache.tomcat.util.net.AbstractEndpoint.destroy(AbstractEndpoint.java:821)
at org.apache.coyote.AbstractProtocol.destroy(AbstractProtocol.java:551)
at org.apache.catalina.connector.Connector.destroyInternal(Connector.java:1023)
at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:292)
at org.apache.catalina.core.StandardService.destroyInternal(StandardService.java:589)
at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:292)
at org.apache.catalina.core.StandardServer.destroyInternal(StandardServer.java:877)
at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:292)
at org.apache.catalina.startup.Catalina.start(Catalina.java:633)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:351)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:485)

and this my all POM.xml

<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://ift.tt/IH78KX" xmlns:xsi="http://ift.tt/ra1lAU" xsi:schemaLocation="http://ift.tt/IH78KX http://ift.tt/VE5zRx"> <modelVersion>4.0.0</modelVersion> <groupId>be.beWed</groupId> <artifactId>beWed</artifactId> <version>0.0.1</version> <packaging>war</packaging> <name>beWed</name> <description>beWed</description> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.4.0.RELEASE</version> <relativePath /> </parent> <properties> <start-class>be.beWed.BeWedApplication</start-class> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <java.version>1.8</java.version> </properties> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-jdbc</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jpa</artifactId> </dependency> <dependency> <groupId>javax.persistence</groupId> <artifactId>persistence-api</artifactId> <version>1.0.2</version> </dependency> <dependency> <groupId>org.thymeleaf</groupId> <artifactId>thymeleaf-spring4</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId> <scope>provided</scope> </dependency> <dependency> <groupId>com.googlecode.json-simple</groupId> <artifactId>json-simple</artifactId> <version>1.1.1</version> </dependency> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <scope>runtime</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> </build> </project>

for IDE am using eclipse mars with JDK 8




Change the URL of a web project?

i'm using IntelliJ Idea for a web project and when I run it, the url is

http://localhost:8080/MyProjectName/

Is there a way to change it? like,

http://localhost:8080/OtherName

or just

http://localhost:8080/ 

thanks




Is it possible to create web app and deploy it on the app store?

Sorry for the question if it makes no sense, I'm pretty new to all this but I have been approached by a client to build a website and build an ios app for his product. The website and app is an ecommerce site. My question is, is it possible for me to go and create a web site using the likes of Ruby on rails, node.js or php which then can be deployed on the app store? if it ain't possible I am open to teaching myself ios10.

I haven't committed to this job yet as I informed him of my level of experience and I want to do my research before accepting.

Whats your suggestions? Kind Regards, Johnathan




Deleting stale google search results

I had hosted some pages on a google drive. Since google no longer allows that, I moved the pages elsewhere and resubmitted a request for google to crawl them.

Unfortunately google still includes the old pages in search results.

Is there anyway to tell google to forget the old results? Will they eventually disappear?




How to hide the toolbar when web view is swiped without a navigation controller?

Can't seem to find the answer. I have a webView with a toolbar at the bottom. hidesBarsOnSwipe only works if you have a navigation controller, which I am not using. toolBar.isHidden = true hides it but how do I unhide when user swipes up? Thank You so much for any help. Still learning swift :) OH! I am using Xcode 8 Swift 3




WebService over c#/https .net 4.6.1 fails on W7 but works in .net 3.5

I have an app connecting to an Azure AppServer thorugh WebServices (using SoapHttpClientProtocol).

It was working perfectly on .NET 3.5sp1, when i upgraded to .NET 4.6.1, it works ok on w10 boxes, but some w7 or w8 fail with:

The underlying connection was closed: An unexpected error occurred on a send

If I modify the constructor adding:

 System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Ssl3;

it does works. But i want to use Tls1.2, instead of Ssl3. if i use

System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;

(or the default) it gives the error on the w7 and w8 boxes.

This is the list of ciphers presented to the server on the w10 (it works):

CONNECT spac-test.cloudapp.net:443 HTTP/1.1 Host: spac-test.cloudapp.net Connection: Keep-Alive

A SSLv3-compatible ClientHello handshake was found. Fiddler extracted the parameters below.

Version: 3.3 (TLS/1.2) Random: 58 17 93 A5 5C 57 36 C2 97 69 48 B2 92 5C 93 44 86 1A 87 99 19 53 4D 04 C4 CB EE C0 87 70 30 67 "Time": 1/10/2058 1:26:48 AM SessionID: empty Extensions: server_name xxx.cloudapp.net
elliptic_curves unknown [0x1D), secp256r1 [0x17], secp384r1 [0x18] ec_point_formats uncompressed [0x0]
signature_algs sha256_rsa, sha384_rsa, sha1_rsa, sha256_ecdsa, sha384_ecdsa, sha1_ecdsa, sha1_dsa, sha512_rsa, sha512_ecdsa SessionTicket empty
extended_master_secret empty renegotiation_info 00

Ciphers:
[C02C] TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 [C02B] TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 [C030] TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 [C02F] TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 [009F] TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 [009E] TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 [C024] TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 [C023] TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 [C028] TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 [C027] TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 [C00A] TLS1_CK_ECDHE_ECDSA_WITH_AES_256_CBC_SHA [C009] TLS1_CK_ECDHE_ECDSA_WITH_AES_128_CBC_SHA [C014] TLS1_CK_ECDHE_RSA_WITH_AES_256_CBC_SHA [C013] TLS1_CK_ECDHE_RSA_WITH_AES_128_CBC_SHA [0039] TLS_DHE_RSA_WITH_AES_256_SHA [0033] TLS_DHE_RSA_WITH_AES_128_SHA [009D] TLS_RSA_WITH_AES_256_GCM_SHA384 [009C] TLS_RSA_WITH_AES_128_GCM_SHA256 [003D] TLS_RSA_WITH_AES_256_CBC_SHA256 [003C] TLS_RSA_WITH_AES_128_CBC_SHA256 [0035] TLS_RSA_AES_256_SHA [002F] TLS_RSA_AES_128_SHA [000A] SSL_RSA_WITH_3DES_EDE_SHA [006A] TLS_DHE_DSS_WITH_AES_256_CBC_SHA256 [0040] TLS_DHE_DSS_WITH_AES_128_CBC_SHA256 [0038] TLS_DHE_DSS_WITH_AES_256_SHA [0032] TLS_DHE_DSS_WITH_AES_128_SHA [0013] SSL_DHE_DSS_WITH_3DES_EDE_SHA

Compression: [00] NO_COMPRESSION

... and here is what is being presented on the PC which DOES NOT WORK:

A SSLv3-compatible ClientHello handshake was found. Fiddler extracted the parameters below.

Version: 3.3 (TLS/1.2) Random: 58 17 97 37 8C 71 81 A2 0F 25 5F BE 3F D1 37 8D B8 4C 4F D3 58 BF A5 C6 EB DE E7 C3 6B 74 5D 86 "Time":> Ciphers:

22/07/1999 9:06:32 SessionID: empty Extensions: renegotiation_info 00
server_name xxxx.cloudapp.net elliptic_curves secp256r1 [0x17], secp384r1 [0x18] ec_point_formats uncompressed [0x0]
signature_algs sha256_rsa, sha384_rsa, sha1_rsa, sha256_ecdsa, sha384_ecdsa, sha1_ecdsa, sha1_dsa [003C] TLS_RSA_WITH_AES_128_CBC_SHA256 [002F] TLS_RSA_AES_128_SHA [003D] TLS_RSA_WITH_AES_256_CBC_SHA256 [0035] TLS_RSA_AES_256_SHA [0005] SSL_RSA_WITH_RC4_128_SHA [000A] SSL_RSA_WITH_3DES_EDE_SHA [C027] TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 [C013] TLS1_CK_ECDHE_RSA_WITH_AES_128_CBC_SHA [C014] TLS1_CK_ECDHE_RSA_WITH_AES_256_CBC_SHA [C02B] TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 [C023] TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 [C02C] TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 [C024] TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 [C009] TLS1_CK_ECDHE_ECDSA_WITH_AES_128_CBC_SHA [C00A] TLS1_CK_ECDHE_ECDSA_WITH_AES_256_CBC_SHA [0040] TLS_DHE_DSS_WITH_AES_128_CBC_SHA256 [0032] TLS_DHE_DSS_WITH_AES_128_SHA [006A] TLS_DHE_DSS_WITH_AES_256_CBC_SHA256 [0038] TLS_DHE_DSS_WITH_AES_256_SHA [0013] SSL_DHE_DSS_WITH_3DES_EDE_SHA [0004] SSL_RSA_WITH_RC4_128_MD5

Compression: [00] NO_COMPRESSION

I suppose has something to do with the ciphers been negotiated, but will like to make w7 use tls1.2 (I check options in IE show "use Tls1.2", also instaled the registry settings to enable tls 1.2 in w7 :

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Client] "DisabledByDefault"=dword:00000000

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Server] "DisabledByDefault"=dword:00000000

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client] "DisabledByDefault"=dword:00000000

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server] "DisabledByDefault"=dword:00000000

any suggestions? thanks




Can I safely rev my Web App Manifest URL?

Static asset revisioning tools like the Rails Asset Pipeline, Laravel Elixir, or gulp-rev and gulp-rev-all put file hashes into URLs as a cache-busting strategy. Whenever the content of a file changes, it gets assigned a new URL the next time the website's static assets are compiled (changing from e.g. example.b5178d.jpg to example.aa349e.jpg) and references to it in other static assets rewritten to point to the new file.

Is it safe to use this strategy for a Web App Manifest (spec, MDN), or should the manifest for a given app always live at the same URL? I'm frightened that browsers or other software that uses the Web App Manifest might treat its URL as a unique identifier. One can imagine this causing bugs if the URL is in fact constantly changing due to static asset revisioning; for instance, a phone OS might fail to recognise that an app has already been added to the home screen because its manifest URL has changed.

Does the spec offer any guidance on whether changing the URL of a Web App Manifest is safe? And whatever the spec says, what is the current reality?




Do write requests to a web site all go to the same place, regardless of geography?

I've spent some time Googling for the answer but haven't been able to figure out how to ask the question.

With major websites like Google, Facebook, or Amazon, when a user makes some change (As opposed to just reading data), do all those requests go to the same place, regardless of where in the world the request is placed? Obviously read replication allows for local caching of data so that requests can happen faster, but I imagine changing data would have to all happen in the same datacenter, or else issues could happen when synchronizing the data between the datacenters (merge conflicts).

So, is it true that all requests which update data on a server have to go to the same datacenter, rather than having some sort of master/slave setup?




How to know all the websites hosted on that webserver?

For eg. I want to know all the google websites So, on this website I searched for google.com and I get 61 domains.

But in that I missed one website which is http://ift.tt/1cFc24N So, when I type this website, I got 62 domains.

Why is it so and how to get all the websites under single webserver.




Do modal window snapshots count as "dublicate content"

I have landing page that contains several modal windows. Each window has an anchor url (for example /home#!somewindow). Code is generated via script, so i implemented a spanshot scheme. Now i have multiple snapshots with similar code that differs only by modal windows code. Is this counting as dublicate content? If so, should i use just one snapshot with all modal windows code in it or it will be a cloaking?




How to call up the HTML of a specific website in an Android App and later display several parts in a WebView

How do I call up the HTML of a specific website in an Android App and later only display some several parts of the HTML in an WebView?

Thanks in advance




How to do this kind of epic website?

as title anyone know how to do this kind of website?

www.sirinlabs.com

  1. it using which kind of language?
  2. use what software to code it?
  3. and the cost to complete this kind website?

Thank you so much




Spring ResourceHandler mappings

I am working on a client/server application built using Angular/Spring respectively and recently changed the contextPath of the server (i.e. server.contextPath=/foo). The client and the server are packaged together into a jar and the client is then served at /. However, after changing the context path of the server the files of the client cannot be found - the index.html is properly served, but it links all the assets as /asset.js and since they are actually at /foo/asset.js they cannot be found. I tried solving this by adding resource handlers but it was to no avail. The code I used is something like:

        @Override
        public void addResourceHandlers(ResourceHandlerRegistry registry) {
            super.addResourceHandlers(registry);
            registry.addResourceHandler("/**").addResourceLocations("/foo/");
        }

I tried other variations but it didn't help either. Any ideas?




How does one prevent pinch zooming on iOS 10 devices in safari?

Is there a way to successfully prevent pinch zooming in safari on all iOS devices including those running on version 10?

Viewport meta tag is being ignored:

<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui" />

The above meta prevents pinch zooming on older iOS/Devices tested on iPhone 5 iOS 9.2 and this issue is not present. However when tested on an iPhone 6, 6+ version 10.0.1 and iPhone 7 10.0(14) this remains an issue.

From the iOS 10 beta 1 release notes:

To improve accessibility on websites in Safari, users can now pinch-to-zoom even when a website sets user-scalable=no in the viewport.

I have tried:

    document.documentElement.addEventListener('touchstart', function (event) 
    {
      if (event.touches.length > 1) 
      {
        event.preventDefault();
      }
    }, true);

Which seems to do the job ok if the user puts both fingers on the screen at the same time. But if you place one finger on the screen and then a second soon after you are able to pinch zoom. Note:event.preventDefault(); has been hit successfully as expected.

Side-note: Similar questions around e.g. How do you disable viewport zooming on Mobile Safari? but this question is aimed to directly tackle iOS 10 due to Apples change of specifications.




scrappy is not entering the parse function

I'm getting this error when run the spider and don't know why? please someone help me. thank you

`http://ift.tt/2f51dUl
 2016-10-31 10:29:02 [scrapy] INFO: Closing spider (finished)
 2016-10-31 10:29:02 [scrapy] INFO: Dumping Scrapy stats:
 {'downloader/request_bytes': 792,
 'downloader/request_count': 3,
 'downloader/request_method_count/GET': 3,
 'downloader/response_bytes': 106586,
 'downloader/response_count': 3,
 'downloader/response_status_count/200': 2,
 'downloader/response_status_count/302': 1,
 'finish_reason': 'finished',
 'finish_time': datetime.datetime(2016, 10, 31, 15, 29, 2, 699910),
 'item_scraped_count': 1,
 'log_count/INFO': 9,
 'log_count/WARNING': 2,
 'request_depth_count/0': 2,
 'request_depth_max': 0,
 'response_received_count': 2,
 'scheduler/dequeued': 3,
 'scheduler/dequeued/memory': 3,
 'scheduler/enqueued': 3,
 'scheduler/enqueued/memory': 3,
 'start_time': datetime.datetime(2016, 10, 31, 15, 28, 57, 811297)}
2016-10-31 10:29:02 [scrapy] INFO: Spider closed (finished)`




Redirect to last posts when click on image

I have problem with my slider, ive made slider and wrote something like this:

*def index
    @posts = Post.all
    @asd = Post.order("created_at").last
 end*


*<div class="container-fluid">
    <div class="row"> 
        <div class="col-md-8">  
            <ul class="bxslider">
                <script type="text/javascript">
                    $(document).ready(function(){
                    $('.bxslider').bxSlider({
                        auto: 'true'
                    });
                    });
                </script>
                <% @posts.limit(2).each do |post| %>
                <li>
                    <a href="<%= post_path(@asd)%>">
                        <%= image_tag ("kicius.jpg") %>
                    </a>        
                </li>
                <% end %>   
             </ul>
        </div>
        <div class="col-md-4">
            asd
        </div>  
    </div>  
</div>* 

I want moved me to the last post when opening the first positions in slider, while the second position in slider has already be the one before last post




Handle web app Javascript notifications better when screen is locked

In my web app I create desktop notifications on some page loads, depending on the state of things, and the page loads every two minutes. It's a simple notification, like this:

// if warning applies:
new Notification("Warning!", {body: "You must take some action"});

meaning that if you have the app open (and the warning applies) then you'll get a pop up every couple of minutes but each will disappear after about 20 seconds (whatever the browser behavior is).

So far, so good. My problem is what happens when the user's PC is locked. If the user comes back to their locked PC after a period where notifications should have popped up, then they will find they all try to pop up in series, meaning they have to either wait a long time for them to clear or close them all -- annoying!

The behavior I would really like is that the notifications should go through their normal lifecycle while the screen is locked, i.e. popup and disappear. Failing that, I would like them to simply not fire if the screen is locked.

Does anyone know how to achieve this?




Opening Links from Google Hangout Desktop app into Firefox instead of Chrome?

I am using the Google Hangout Desktop Application and would like to basically open the links I receive in these chats to open via Firefox instead of Chrome automatically.

How do I change this setting to use Firefox instead of Chrome?

Please help and thank you.




Multiple devices slider looping

I need to implement this section in my website http://ift.tt/2dUZDGG (Multiple devices section)

*Please scroll up then down to this section,you will find that the devices are looping

Can anyone do it? or give me ideas

Thanks




Directory listing as tree in website

I have a webserver storing html report files. It's running both Tomcat and Apache (for what it matters).

From time to time I copy to the WEBAPP folder a sub folder that contains another 3 folders in each there is a HTML report.

I currently have a directory listing in a frame that lets me link to the reports, and see them in either the frame or a different tab.

I would like to create a tree in the index page that shows the content of the folders in an expandable form that changes dynamically according to the contents of the folder.




how to make jquery not blur the edges

I have given this to blur an image but i also blurs the edges of the pictures which makes it weird for a website

$(function() {
    $({blurRadius: 0}).animate({blurRadius: 2}, {
        duration: 1500,
        easing: 'swing', // or "linear"
                         // use jQuery UI or Easing plugin for more options
        step: function() {
            console.log(this.blurRadius);
            $('.item').css({
                "-webkit-filter": "blur("+this.blurRadius+"px)",
                "filter": "blur("+this.blurRadius+"px)"
            });
        }
    });
});




Negiotiated media-range redirect with NancyFX

I've got a NancyFX module which serves both the view as well as json-based API results where as the response content is negotiated using media range filters. What I'm trying to achive is the following:

When deleting entity XXX...

  • for HTML -> redirect to module path
  • for JSON -> return status code OK

My current code:

return Negotiate
    .WithStatusCode(HttpStatusCode.OK)
    .ForHtml(new RedirectResponse(ModulePath))
    .ForJson(Nancy.Response.NoBody);

Where as ForHTML and ForJson are extension methods which look like this:

    public static Negotiator ForJson(this Negotiator negotiator, Func<object> resultFactory)
        => negotiator.WithMediaRangeModel(MediaRanges.Json, resultFactory);

    public static Negotiator ForHtml(this Negotiator negotiator, Func<object> resultFactory)
        => negotiator.WithMediaRangeModel(MediaRanges.Html, resultFactory);

The media ranges are text/html and application/json respectively.

However it doesn't really work. I always get just the status code back, no matter if I'm accessing the module from a browser or a REST client.




javascript. send to ctrl f (ctrl window value)

i have making web page. web page consist of one main page and links.

if one of link is clicked in main page, web browser(chrome) make new tap.

it already made. but i want to add function.

The function is that main page send value to ctrl f window in newly opened page after ctrl f is operated. so matching value will be highlighting.




dimanche 30 octobre 2016

Google text-text translation API

I intended to build a language translation system (Mobile/Web Platform).And i found out that Google translation API could be use/ apply in the system. But I'm not sure if the Google Translation API is free or i have to pay for it. and what will be language we need to use while using the google translation API. Overall my concern is

1)programming language. 2)platform(web/ mobile). 3)Google API Is free ?




Pronunciation Correction for Arabic Language

I have seen a lot of software available that are able to do the pronunciation correction for English language.

Out of personal interest in this domain, I would like to have some pointers / approach / algorithms that can used for the pronunciation correction in Arabic Language.

I have read about the signal processing techniques and also about Phonetic comparison approach. Want to know which approach shall be the best suited for Arabic language.

Looking forward to inputs




CSS @media query doesn't work with meta tag

I am having some issues changing the layout of my content with the use of @media queries. I have the following meta in the head, <meta name="viewport" content="width=device-width, initial-scale=1">. And one of my queries looks like this:

    `@media all and (min-width: 768px) {

    .navbar-default .navbar-nav > li > a {
        background-color: #f06449;
        color: #fff;
    }

    .centerIcon .fa-arrow-down {
        display: none;
    }
}`

I have tried changing the query to use "screen" instead of the current, "all", but it has no affect. The actual color of the code starting with @media is white (ofc this depends on what text editor you have), but I suspect that the code is overwritten by something else, could this be accurate?

Many thanks in advance!




Body text render first

It is my code:

<html>text<head></head><body></body></html>

But my firefox browser render that code:

<html><head></head><body>text</body></html>

Why? Someone know?




Bug in my php code which reads data from file and keeps log

I'm writing some php code and I want to compare an ip address with the ip address the user is coming from. This is the code:

<!DOCTYPE html>

<html>
<?php
// set date and hour
$date=date('H:i:s d-m-Y');
// set ip user
$ip=$_SERVER['REMOTE_ADDR'];
// log text
$ipLog="User entered at " . $date . " from ip address: " . $ip . ".\n";
// write log
$firstLogFile="../../logs/firstLogIP.txt";
// ipcheck
$myfile=fopen("../../logs/ownip.txt", "r") or die("Unable to read ownip file!");
$ownip=fgets($myfile);
fclose($myfile);
if($ip!=$ownip) {
    $handleFirstLog=fopen($firstLogFile, 'a') or die("<br><br>Can't open logfile!<br><br>"); 
    fwrite($handleFirstLog, $ipLog);
    fclose($handleFirstLog);
}
?>

<head>
</head>

<body>
    <div class="container">
        <div class="inner-container">
        <div>
            <?php           
            if($ip!=$ownip) {
                print "ips not equal: " . $ip . " " . $ownip;
            } else {
                print "ips equal";
            }
            ?>
        </div>
        </div>
    </div>
<body>

</html>

If the ip address of the user don't equals that of the ip address that's stored in my file (../../logs/ownip.txt) then this should be written to logfile (firstLogIP.txt) and you should see "ips not equal" on the screen.

So if the ip's equal, no log should be written and you should see "ips equal" on the screen.

Althoug the ip address of the user and that of $_SERVER['REMOTE_ADDR'] ARE equal, the script still say's "ips not equal" and the ip address is logged!

Any help with this bug? Thx!!




Basic Webdesign Account Storage Files

I am trying to create a website that allows users to create an account. I would like to be able to (as an admin) upload a media file, automatically process it (perform fairly resource intensive processes), and distribute unique variations of that file to each user account.

I am fairly new to web and database design so I was hoping for a little direction. I registered a domain name using NameCheap.com and am using Bluehost.com webhosting to host the website.

I am not really sure where the "process it" step should take place or how to link media to a user account. I would assume I set up some sort of relational database through mysql to link user account emails, passwords, etc. But how do I link and store media files to an account? Is there a name for this type of service? Would this service be able to execute my server-side code to modify my media files?

I apologize if this is in the wrong section and/or a very basic question as this is my first post.

Thanks for any help.




How can I create a carousel in javascript with writing attached to every picture?

I am trying to create a carousel in javascript for my website .. however I am not having much success .. I want my carousel to have buttons on each side and have writing attached to every picture ..




how to render a response to a specific place on a gsp grails

I am new to grails and groovy. I am trying to find out how to render a response from an action in a grails controller IN THE SAME gsp - but in a DIFFERENT SECTION OF THE gsp - as the gsp that takes the request (in this case a web form gsp page)?

any links or turorials or just straight to the point "do this" kind of replies are welcomed.

I tried to google search for it, but I was not sure what to use as a search term and I could not find a concise answer.

thanks.

ironmantis7x




redirect to another page

hello guys i have this problem that i couldn't solve the thing is i have two buttons one for delete and the other for edit, the delete is working flawlessly, but edit button doesn't seems to work to make it redirect to a php file + how i can get the meeting name with edit button when it's redirect to another page don't know how here's my code

 <table class="table table-striped custab" >
  <thead>
    <tr>
      <th>Title</th>
      <th>Chairman</th>
      <th>Summary</th>
      <th> Date &   Time</th>
    </tr>
    <?php

        $findMeetings = "SELECT * FROM `meeting` WHERE chairman='".$name."'";

        $result = mysqli_query($db, $findMeetings);

        $numRows = mysqli_num_rows($result);

        if($numRows == 0){

            $empty = "<div class='alert alert-danger'>You are currently managing no meetings!</div>";

        }
        else{

            $x = 0;

            while($rows = mysqli_fetch_array($result)){

                $title = $rows['title'];
                $chairman = $rows['chairman'];
                $date = $rows['time'];
                $summary = $rows['summary'];

                $meeting = "
                <tr>
                <th>".$title."</th>
                <th>".$chairman."</th>
                <th>".$summary."</th>
                <th>".$date."</th>
                <th><form method='post'>
                    <input type='submit' class='btn btn-success' name='edit".$x."' value='Edit'/>
                    <input type='submit' class='btn btn-danger' name='delete".$x."' value='Delete'/>
                </form></th>
                </tr>
                ";

                echo $meeting;

                if(isset($_POST['delete'.$x.''])){

                    $query = "DELETE FROM meeting WHERE title='".$title."' LIMIT 1";

                    if($result = mysqli_query($db, $query)){

                        header("Location:managemeeting.php");

                    }

                }



            }

        }

    ?>

  </thead>
  <tbody>

  </tbody>
</table>

so how to get the meeting name and the passed it to editmeeting.php cause there's multiple data.




Uploading model from 3ds max on web by three.js

I am working on a project and want to upload my own model made in 3ds max on web. I have looked upon the OBJLoader example from three.js website but it doesn't work for me. Can someone please guide me through. Thanks in advance.




Save body text on csv file | Python 3

I am trying to create a database with several articles for Text mining purposes. I am extracting the body via web scraping and then save the body of these articles on a csv file. However, I couldn't manage to save all the body texts. The code that I came up with saves only the text the last URL (article) while if I print what I am scraping (and what I am supposed to save) I obtain the body of all the articles.

I just included some of the URL from the list (which contains a larger number of URLs) just to give you an idea:

import requests
from bs4 import BeautifulSoup
import csv

r=["http://ift.tt/2e2rbee",
"http://ift.tt/2f2NI78    attack.html",
"http://ift.tt/2dSBZrd",
"http://ift.tt/2bcB32V",
"http://ift.tt/2fkgZOA",
]

for url in r:
    t= requests.get(url)
    t.encoding = "ISO-8859-1"
    soup = BeautifulSoup(t.content, 'lxml')
    text = soup.find_all(("p",{"class": "story-body-text story-content"}))
    print(text)
with open('newdb30.csv', 'w', newline='') as csvfile:
    spamwriter = csv.writer(csvfile, delimiter=' ',quotechar='|', quoting=csv.QUOTE_MINIMAL)
    spamwriter.writerow(text)




Scaling my Web Application

I have a web application which I want to open on the web i.e. host on the internet instead of localhost.

I think all the setup has to be moved (MySQL database, PHP stack) to AWS i.e. the cloud.

I don't understand how it can be done. Please give a high-level understanding.

Thanks a lot. :)




Define parent URL-Path of an Web-Application

This is mightbe a basic question, but I wasn´t able to find an answere anywhere on google (maybe I was to stupide to know what to Google for). Thanks in addvanced for even trying to understand my problem.

Scenario:

Dir: C:/xampp/htdocs/MY_PROGRAMM
URL: localhost/MY_PROGRAMM

Style File:

Dir: C:/xampp/htdocs/MY_PROGRAMM/inc/style.css
URL: localhost/MY_PROGRAMM/inc/style.css

Page:

Dir: C:/xampp/htdocs/MY_PROGRAMM/categorie/(or more folders)/page.php
URL: localhost/MY_PROGRAMM/(or more folders)/page.php

And I want any page to be able to set the style on any page, I would have to know that the Programm Url is "localhost/MY_PROGRAMM/"

So I know how to get the "server" dir of my programm

define('SERVER_ROOT', dirname(__FILE__)); or getcwd()

SERVER_ROOT = /mnt/web/a/server/htdocs/maybefolder/ormore/"MY_PROGRAMM"

But this woulnd´t be useable in html code like

so my idea was to get the root dir as normal url like this

CLIENT_ROOT = http://ift.tt/2eRsd8P"MY_PROGRAMM"

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

But how could I achive this, even when I switch to an online server? Is there an universal solution?




Ruby on Rails - showing all instances in a view, with specific column value, returned by other table column

First, my schema looks like this:

create_table "categories", force: :cascade do |t|
t.text     "name"
t.text     "slug"
end

create_table "fields", force: :cascade do |t|
t.integer  "order"
t.string   "title"
t.text     "tipo"
t.text     "values"
t.integer  "sub_category_id"
end
add_index "fields", ["sub_category_id"], name: "index_fields_on_sub_category_id"

create_table "sub_categories", force: :cascade do |t|
t.integer  "category_id"
t.text     "name"
t.text     "slug"
end
add_index "sub_categories", ["category_id"], name: "index_sub_categories_on_category_id"

This is my schema, a category has many sub_categories, and a sub_category has many fields. Im trying to generate a view which contains all fields of a specific sub_category, i've already passed the sub_category.id to this view, but thats all i could do.

Its not that difficult i imagine, but im a begginer on rails. How can i do it? The routes are also a problem, since i have to create a new controller function. But the route generated by my application already looks like this: "/sub_categories/mysubcategory56/visualizeform?sub_category=56"




Why clientside oauth is bad?

I've heard that making oauth requests right from client is bad. And there should be server proxy for that purpose. But could you explain in details why?

P.S. as I can see in network tab, site https://tweetdeck.twitter.com/ sends requests to api.twitter.com right from client.

Thanks for advance.




Making a subdirectory redirect to another file

I am working on an instant messaging application for android. I want to create a webpage which redirects the user to a profile inside the application. So if the user opens "http://ift.tt/2enOs5G", it will redirect him to another page sending the "Name" as an argument. The application handles opening the profile and showing it. I have got the application working but am unsure how to make the redirecting to work. The Name changes according to the user. What is the best to way to redirect without making multiple directories for each user? Thanks in advanced, Aditya




How to remove a word from the URL with .htaccess?

I want to redirect http://ift.tt/2e0QBTM to http://ift.tt/2fsZg6E. The blog is built on Anchor CMS and has the following .htaccess file:

Options -indexes

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

# Allow any files or directories that exist to be displayed directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# Rewrite all other URLs to index.php/URL
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>
ErrorDocument 404 index.php
</IfModule>




How Can i paginate a list of object of my models (Play Framework)?

I'm New in this framework! I want to generate a paginator of my models to show my lits in the templates.

I'm Using Play-java, Ebean, scala.html templates.

Thanks!

I have this!

Model:

public static Finder<String,User> find = new Finder(
    String.class, User.class
);


public static  List<User> all(){
    return find.all();
}

Controller:

public class UserController extends Controller {

   public Result index() {
      return ok(list_users.render(User.all()));
   }
}

View (list_user.scala.html)

      <table>
             <thead>
                  <tr>
                    <th>Email</th>
                    <th>Name</th>
                    <th>Last Name</th>  
                 </tr>
             </thead>           
              <tbody>                
                @for(user<- users){               
                   <tr>
                       <td>@user.getEmail()</td>
                       <td>@user.getName()</td>
                       <td>@user.getLastName()</td>
                  </tr>       
               }
            </tbody>
    </table>         




Darknet crawler python

Im trying to write a simple web crawler to "Darknet" web. my first step is to get with python script to to darknet. I tried many answers but non of them worked.

what I did: I installed Tor docker as root.
I succeeded to get to this site with regular browser after the right configurations.
I succeeded to get check.torproject.org with my script
I am running with ubuntu 16.04 on VM

my code now is:

import socks
import ssl
import requests.cert

s = socks.socksocket()
s.setproxy(socks.PROXY_TYPE_SOCKS5, "127.0.0.1", port=9050)
s.connect(('http://ift.tt/2f1FwnC', 443))
ss = ssl.wrap_socket(s, cert_reqs=ssl.CERT_REQUIRED, ca_certs="requests.cert.where()")

print "Peer cert: ", ss.getpeercert()

ss.write("""GET / HTTP/1.0\r\nHost:http://ift.tt/2fj1aaC""")

content = []
while True:
    data = ss.read()
    if not data: break
         content.append(data)


ss.close()
content = "".join(content)
assert "This browser is configured to use Tor" in content

I think that my problem now is because of https instead of http (should I change port??)

any better solution? any explnation how to do it? Thanks

I checked all this questions and non of them worked - Python urllib over TOR? , How to route urllib requests through the TOR network? , Using SocksiPy with SSL .
(I saw in theit comments that I am not the only one it did not worked for him..)



all I need is to get this "discussion" pastes..




samedi 29 octobre 2016

Is it possible to add to a JSON by typing it in the URL?

I am sure my question my might make much sense right away. But I short I am making in Ethereum smart contract, and for reasons too long to explain, I need to be able to make a get call to a URL and append my own data to the JSON file that will load from that URL.

This is probably not possible, but in the case that it is please let me know how to do it.

To give a concrete example, say I make a get call to "http://ift.tt/2eHi3Kg" this returns something like this:

{
  USD: 10.32
}

Can I add something to the URL so that when it loads I get:

{
  USD: 10.32,
  userId: 53
 }




Add file to HDFS from Hadoop Web UI

Is there any way to add files inside the HDFS using the Web UI.

On http://localhost:50070/ or at some else url . Does something like that exists?




What are the differences between Custom Elements v0 and v1?

The title is self explanatory. If I get multiple short answers, I will compile them at the end.

See caniuse.com before using v1 or even v0.




Page Index on Wed Page

What is this technically called so I can figure out how to reference it? itd a page indexc on a web page. My assumption is that javascript is the language i would use to reference it's values? Or would it be a combination of html and javascript?

Sorry for the dumb question, bored and trying to learn new stuff.

enter image description here




Web Based product designer App

Following is the link of web based glove designer

http://ift.tt/2f3t6KF

can any one please tell me how to make such designer what language or API to use for making such designer. as you can see on the left column you select the properties and on right side design changes automatically. please help me




How my Web server can send Web requests to my IoT thing?

CAUTION: A newbie about IoT concepts here!

I'll try to be short and explain what I want to do:

  • Suppose that I already have connected my development board (be whatever you want; arduino, rpi, esp8266. The only requirement is to have a WiFi module on it) to my electric water heater.
  • I return from my work and I want the water to be ready for my bath.
  • The only thing I do is to visit (via my amazing smartphone) http://ift.tt/2eTEWuq and just press the button named activate!
  • Bang! The development board has received a Web request from a User-agent, it activates the relay and my water heater is now turned on.

Can this be accomplished?

I suspect that I have to turn my dev board to a router in order to listen for Web requests (GET, POST, PUT). Is the WoT trying to solve this kind of things?

It is assumed that any authentication/authorization and security issues have been taken care of.




Web Programming in Chrome - File was not found error

I've just started programming a website, and I wrote some code in Notepad++, saved the file, and opened it in Google Chrome to test it out. However, I got this error:

Your file was not found

It may have been moved or deleted.
ERR_FILE_NOT_FOUND

However, I opened the file in Internet Explorer and Firefox and it worked perfectly fine. So why won't it work with Chrome?




Hosting dynamic website using AWS and also implementing php, as well as mySQL

So I need to host a site that is partially reliant on being updated by a database, web development isnt really my strong point (I prefer programming) but I have to do it anyway. If someone could advice me on how to go about this using amazon web servers, itd be appreciated.

PHP and SQL are compulsory in this project.




BACKGROUND IMAGE SIZES - What resolution should they be?

as you all know having that huge big image background in your home screen is the latest fad with web design. As you can see on http://www.apple.com/ (Except some images fill the whole home page).

But I have a few questions in regards to this.

1) What resolution should the image be?

2) What file size should the background image be?

3) How do I format it so that the images don't stretch on my website? - Should I be setting a width and height as default for my webpage? - Should I be using background-size image?

4) Any other tips would be greatly appreciated.

Thanks Team :)




C# Web Server IO bytesarray data gets lost

I'm sending POST data through C# to a web server to create Accounts in a database, which itself works, but some chars get replaced with spaces.

I'm sending the data this way:

Webrequest request = Webrequest.Create(Url);    
request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded";
request.ContentLength = bytesarr.Length;

System.IO.Stream streamwriter = request.GetRequestStream();
streamwriter.Write(bytesarr, 0, bytesarr.Length);
Console.WriteLine(Encoding.UTF8.GetString(bytesarr,0,bytesarr.Length));
streamwriter.Close();

The output of the bytesarray in my program is still fine, when I get the echo from the server then some things are missing like "+". I'm not escaping the string in the php form(although I tried that as well).




Script to add to a web design to give access even if Cpanel password is changed

I developed a website for someone who is a middleman between I (the developer) and the owner. But he is presenting himself to the owner as the web developer/designer.

He has gotten the hosting and domain already and now he said the owner wants him to upload to the hosting he has already bought before he pays him. And it is from whatever is paid that he will also pay me.

My issue now is I don't know him before as this is our first project together. If I go ahead to give him the design, I am afraid I may start hearing another story. And he said the owner who is a novice does not want to check the design on any other sub-domain but his own.

Is there a script like a backdoor that I can secretly include in my design (before giving it to them) and later use the backdoor to get access back to my design and hack it or wipe it off without knowing their cpanel password, in-case they refuse to pay me later.

Please help on this.




Polymer app best practices

I have best practices questions to respect while developing Polymer Web App.

Let's say I have a Todo app. The main element my-main-task is responsible for switching between those elements: list all tasks, view a single task, create a new task, edit a task and delete a task.

My question is: the new element must save data using firebase-document or iron-ajax by itself or delegate it to the my-main-task?

Thanks for your help.




Meaning of this two jquery expression?

HTML CODE

<tr class="roti">

    <td class="ts" rowspan="2">
        <input type="text" class="form-control totalSale" id="totalSaleAmountForRoti" name='totalSaleAmountForRoti' value="0" readonly>
    </td>

</tr>

<tr class="roti">
    column related class="form-control totalSale"
</tr>

What is the difference between them and their meaning?

var $class = $(this).parent().parent().attr('class');

1)

totalSale = $(this).parents('.' + $class).find('.totalSale');

2)

totalSale = $(this).parents('.' + $class).siblings('.' + $class + ':last').find('.totalSale');

And what meanings of this below code?

if ($(this).parent().siblings().children().hasClass('.totalSale')) { ... }




Tomcat Web Application: Allow Access to a URL only for a specified IP Address

I have deployed a Java web application in Tomcat 7 server. I need to allow Access to a URL only for a specified IP Address. For this I added below code in application's WEB-INF/web.xml. But it is not working. It is allowing access to "registration.do" for all IP Address. How to achieve this in web.xml? Any other option to implement this? Please advice.

     <filter>
      <filter-name>Remote Address Filter</filter-name>
      <filter-class>org.apache.catalina.filters.RemoteAddrFilter</filter-class>
      <init-param>
        <param-name>allow</param-name>
        <param-value>192\.168\.2\.39</param-value>
      </init-param>
    </filter>
    <filter-mapping>
      <filter-name>Remote Address Filter</filter-name>
      <url-pattern>/registration.do</url-pattern>
    </filter-mapping>




Tool to optimize website (opensource)

Is there any opensource project to optimize/check website before launch.

I mean tests for source code, meta tags, headings, image/js/css sizes, 404 page, cache headers etc. like Nibbler has.

Looking for tool to check, that page is well done for search engines. Tool i can extend (contribute to) with new tests.

Backlinks counter, search engine positions, Social metrics are not so important.




Creating Asynchronous XML Web Service Methods with .Net 1.1

I am working with Visual Studio 2003 and .NET 1.1. I created one web service method. After it works, I am trying to change it to Asynchronous XML Web Service Methods explicity. But I have no idea how to write and it is stuck. Please help me how to develop Asynchronous Web Service Methods for the following Web Service:

public class Service1 : System.Web.Services.WebService
{

    public DepositAuthenticationHeaders myHeaderVariable ;

    [WebMethod]
    [SoapHeader("myHeaderVariable")]
    public DepositAuthenticationResponse RedirectDeposit(string TransactionId, Amount amount, AccountInfo accountInfo)
    {
        string apiVersion = "";
        string sessionToken = "";
        string merchantId = "";
        string merchantPassword = "";

        string transactionId = "";
        string tranAmount = "";
        string tranCurrency = "";

        string accountId = "";
        string userName = ""; 

        apiVersion = myHeaderVariable.ApiVersion;
        sessionToken = myHeaderVariable.SessionToken;
        merchantId = myHeaderVariable.Credential.MerchantId;
        merchantPassword = myHeaderVariable.Credential.MerchantPassword;

        transactionId = TransactionId;
        tranAmount = amount.amount;
        tranCurrency = amount.currency;

        accountId = accountInfo.field1.Value;  //123456
        userName = accountInfo.field2.Value;    //TEST1

        DepositAuthenticationResponse resp = new DepositAuthenticationResponse();
        resp.RedirectUrl = Server.UrlEncode("http://www.aspmemo.net");
        resp.Status = "APPROVED";
        resp.ErrorDetail.Code = ""; 
        resp.ErrorDetail.Description = "";

        return resp;
    }
}

[Serializable]
public class DepositAuthenticationHeaders : SoapHeader 
{
    private string _ApiVersion;
    private string _SessionToken;
    private Credentials _Credential;

    public DepositAuthenticationHeaders()
    {
        _Credential = new Credentials();
    }

    public string ApiVersion
    {
        get 
        {
            return _ApiVersion;
        }
        set 
        {
            _ApiVersion = value;
        }
    }

    public string SessionToken
    {
        get 
        {
            return _SessionToken;
        }
        set 
        {
            _SessionToken = value;
        }
    }

    public Credentials Credential
    {
        get 
        {
            return _Credential;
        }
        set 
        {
            _Credential = value;
        }
    }

}

[Serializable]
public class Credentials
{
    private string _MerchantId;
    private string _MerchantPassword;
    private string _Credential1;
    private string _Credential2;

    public Credentials()
    {

    }


    public string MerchantId
    {
        get 
        {
            return _MerchantId;
        }
        set 
        {
            _MerchantId = value;
        }
    }

    public string MerchantPassword
    {
        get 
        {
            return _MerchantPassword;
        }
        set 
        {
            _MerchantPassword = value;
        }
    }

    public string Credential1
    {
        get 
        {
            return _Credential1;
        }
        set 
        {
            _Credential1 = value;
        }
    }

    public string Credential2
    {
        get 
        {
            return _Credential2;
        }
        set 
        {
            _Credential2 = value;
        }
    }
}

[Serializable]
public class Amount
{
    private string _amount;
    private string _currency;

    public Amount()
    {
    }

    public Amount(string strAmount,string strCurrency, string strAmt)
    {
        amount = strAmount;
        currency = strCurrency;
    }

    public string amount
    {           
        get 
        {
            return _amount;
        }
        set 
        {
            _amount = value;
        }
    }

    public string currency
    {           
        get 
        {
            return _currency;
        }
        set 
        {
            _currency = value;
        }
    }

}

[Serializable]
public class AccountInfo
{
    private Field1 _field1;
    private Field2 _field2;

    public Field1 field1
    {
        get 
        {
            return _field1;
        }
        set 
        {
            _field1 = value;
        }
    }

    public Field2 field2
    {
        get 
        {
            return _field2;
        }
        set 
        {
            _field2 = value;
        }
    }

    public AccountInfo()
    {
        field1 = new Field1();
        field2 = new Field2(); 
    }

    public AccountInfo(string name1, string value1, string name2, string value2)
    {
        field1 = new Field1(name1, value1);
        field2 = new Field2(name2, value2); 
    }

}

[Serializable]
public class Field1
{
    public string Name;
    public string Value;

    public Field1()
    {

    }

    public Field1(string name, string strValue)
    {
        Name = name;
        Value = strValue;
    }
}

[Serializable]
public class Field2
{
    public string Name;
    public string Value;
    public Field2()
    {

    }

    public Field2(string name, string strValue)
    {
        Name = name;
        Value = strValue;
    }
}

[Serializable]
public class DepositHeaders : SoapHeader 
{
    public string ApiVersion;
    public string SessionToken;
}

[Serializable]
public class DepositAuthenticationResponse
{
    public string RedirectUrl;
    public string Status;
    public ErrorDetails ErrorDetail = new ErrorDetails();
}

[Serializable]
public class ErrorDetails
{
    public string Code;
    public string Description;
}

I just created web service below and it is stuck.

[WebMethod]
public IAsyncResult BeginRedirectDeposit(string TransactionId, Amount amount, AccountInfo accountInfo, AsyncCallback callback, object asyncState) 
{

}

[WebMethod]
public DepositAuthenticationResponse EndRedirectDeposit(IAsyncResult asyncResult)
{

}

Thanks in advance!




Undefined property: core::#$_news

Hello i'm trying to fix my website but i am receiving

Notice: Undefined property: core::$_news in C:\xampp\htdocs\library\class\core.oraios.class.php on line 79

This is the code at line 79: $this->_news.="";




vendredi 28 octobre 2016

How to control Directshow graph in ASP.NET application across user requests?

I'm developing an ASP.NET application that's required to stream video file hosted on the server to client. Now I use DirectShow.NET to process the video file requested by users such as adding a subtitle before it is sent out into Internet. Following this article, I can successfully transfer video stream over network through WMAsfWriter after it's processed by DirectShow and paly it in my web page. To be specific, when I click the play button on my web page, the browser sends a request to the server and the server constructs a DirectShow graph and runs it. Then the server gets the URL of video stream from the AsfWriter filter and put it in the response. On the client side the browser parses the URL from the response and calls the vlc player embedded in an ActiveX object on that page to play that it.

This all works fine until I want to have more control of the played video stream such as pausing or stopping it. Since web server is stateless, the DirectShow filter object I used to stream video will be destroyed every time it returns the response to the client. Although it seems that the DirectShow graph is still running after that because I can see the video stream is being played on my web page, I can't control it through the DirectShow filter object I used in my program as they are destroyed by the server on the end of the request. I know I can set those object as static variables to keep them alive across user requests, it's the last thing I want to do because static variables can be accessed by all requests from every user. So I want to ask that is there a better solution to achieve my goal?




How to fix Content-Length of * bytes exceeds the limit of * bytes

My problem is when I upload a file exceeds the limits I set in the script (5 MB) it shows this warning in the top of the website:

Warning: POST Content-Length of 32485176 bytes exceeds the limit of 20971520 bytes in Unknown on line 0

For example here I uploaded a file more than (30 MB) but when I upload a file more than (5 MB) and less than 30 (or not that large) it doesn't show that warning and shows only the error I wanted from the code :

if($file_size > 5000000) { echo
    "<div>
        You Can't Upload More than 5MB of the file
    </div>";
}

I am working on localhost and this error is appearing every time, I know how to fix it in localhost by modifying php.ini, but the website is online too and this error isn't showing in the website. Is there a way to limit the uploaded files sizes to (5 MB) and not modifying the php.ini file because I don't think I have the permission from the hosting company to change the apache config for the limits.

I hope my question's clear.

Thanks for helping.




App crashes, WebView

the app doesn't work I don't know what am I doing wrong please help me, there is code MainActivity.java:

import android.app.Activity;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.Window;
import android.webkit.WebView;
import android.webkit.WebViewClient;

public class MainActivity extends Activity {
final WebView mWebView = (WebView) findViewById(R.id.webView);
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    this.requestWindowFeature(Window.FEATURE_NO_TITLE);
    setContentView(R.layout.activity_main);
    String url = "http://ift.tt/2e6aUCI";
    mWebView.getSettings().setJavaScriptEnabled(true);
    mWebView.loadUrl(url);
    mWebView.setWebViewClient (new WebViewClient() {
        public void onPageFinished(WebView view, String url) {
            String user="u";
            String pwd="p";
            view.loadUrl("javascript:document.getElementById('UID0').value = '"+user+"';document.getElementById('PASS0').value='"+pwd+"';");
        }
    });
}

}

Thanks for your respond guys!




How to document URLs and interaction between pages

We're developing a web application that is now growing to quite a few pages, all dealing with complex data and rather complex interactions between pages.

For instance, the login flow encompasses the following different possible requests to our controllers:

  • Login -> Forgot Password -> Send email [POST only] -> Password reset token -> New password submit -> Back to Login
  • Login -> Create New User -> Signup [POST only] -> Send activation email
  • Login -> Process new invite requests -> Main page

...a couple of more different variations, all including sending emails, asking for verification/activation tokens; and that's not even starting to touch upon the multiple wizard-like pages for connecting to external applications and so on.

Is there a good way of documenting all of these different URLs, their parameters, and the ways that these interact with each other? For complex web applications, having a way to refer to all these different requests must be a rather good resource... And especially in terms of security, being able to visually inspect the flow of requests and spotting potential glitches. (Hey, why is this page a GET? It should be a POST with CSRF protection!)

I just don't feel like a Word document is enough... UML? xmldoc?

Not that it matters at all, but it's written in C#.




how to implement additional pages

I am working on a project in which I need to design the additional pages such as google does in this picture here.

help me.




In Angular, Is it possible to have one trigger for a tooltip to appear, and another for it to disappear?

So I have a button on my template, with a tooltip that gives some extra information about the button. I would like the tooltip to appear when the mouse hovers over the button, and then disappear when the button is clicked. Clicking the button loads a separate view.

Currently I have it so the tooltip appears on hover, but then the problem is that the tooltip sticks around after the button has been clicked. Since the button is no longer part of the current view, the tooltip jumps to the top corner of the screen for a few seconds before disappearing. I'd like it to disappear the moment the button is clicked.

So far I've tried two things to solve the problem, neither of which have worked:

  1. I tried wrapping the JS function which opens a new view in $timeout, hoping that the tooltip would disappear before the new view loads.

  2. I tried changing the tooltip-trigger to 'click', but now the tooltip won't appear when the mouse is hovering over it. It will appear once the button is clicked, and stay there until the view is re-loaded.

Here is my code, which includes the two failed attempts mentioned above:

Test.html:

<a class="the-button" ng-click="loadNewView($event)"
                             uib-tooltip-html="getToolTipInfo($event)"
                             tooltip-trigger="'click'"
                >
                 Click Me!
             </a>

Test.js:

ctrl.loadNewView = function($event) {
      $timeout(function($event) {      //timeout
          SystemViews.openNewView(ctrl.newView);
      });
    };

Is it possible to have separate triggers for a tooltip like this? If not, what is another way that I can make sure the tooltip disappears before the new view is loaded?

Thank you very much in advance for any wisdom you'd be willing to impart.




How to create a download distribution web server

I have an application idea in which part of the app includes downloadable features from a website. You go to my website and download (say, audio files), which will be imported into the application. I know how to send http requests in my application's code. My question is what is required on the web end to handle the received HTTP requests. If I have a website running, do I just set up a php file on my webserver, which the program would send HTTP requests to, to "react" to the http requests? I'm trying to make sense of how to handle http requests on my own end.

Basically, I have experience in SENDING http requests to a web service, but I have no experience on the web side for handling the SENT http requests.




Jquery contenteditable for all cells not rows

i create a table by adding rows and columns with JS and Jquery. This is my code:

 function AddColumnToDataTable(){
      $('#tableHeader').append("<th> Header </th>").attr("contenteditable", true); 
// Add a new ColumnHeader and set the property "editable"
    }

    function AddRowToDataTable(){
      var count = $('#tableHeader').find("th").length; 
// Get the count of Columns in the table

      var newRow = $('#tableBody').append("<tr></tr>"); 
// Add a new Row

      for(var i = 0; i < count ; i++){
          newRow.find('tr').last().append("<td> Content </td>").attr("contenteditable", true); 
// Fill the cells with a default text and set the property "editable"
      }
    }

So my question is, how can i write the code, that each cell is editable? At the moment, when i click, the whole row goes editable? Each cell should have that property.

I found a code that could help

//$('table th:nth-child(4)').attr("contenteditable", true)

This makes the 4th header/cell editable. But how can i use it, each new created header/cell is the nth-child ?




Export to excel in SAP WebGui using ALV

I have a problem with SAP WEBGUI when I try to export my ALV in Excel file. So I used the button Local File. When I choose

enter image description here

and I press confirm button, nothing happens. After this operation, any other button doesn't work.

Can you help me? I'm using WEBGUI on Google Chrome




What is the best way to interact with another website

I want to interact with a website. I have looked at macros but they seem limited. Preferably I would like to use Java.

I am interested in the general application for this project but the specific website I want to use is howthestockmarketworks.com




The best django course

Can you tell me the best course teaching django?




How to read image from json data transfer

Today i'm working with drag and drop in HTML5. I want to do something like:

  • grab image file from your computer,
  • drop it in input="file" div in web browser
  • then i need to take this picture and display it in #livePreview div

I know i cannot get absolute path for this file from user location - security stuff.

I do something like this:

HTML

  var livePreview = document.getElementById('livePreviewId');
    var imageInput = document.getElementById("inputFileId");
    
    imageInput.addEventListener("dragover", function( e ){
        e.preventDefault();
        e.stopPropagation();
    });
    imageInput.addEventListener("dragenter", function( e ){
       e.preventDefault();
        e.stopPropagation();
    });
    
    imageInput.addEventListener("drop", function( e ){
        if(e.dataTransfer){
            console.log(e.dataTransfer);
            if(e.dataTransfer.files.length) {
                console.log("e files length ", e.dataTransfer.files.length);
                e.preventDefault();
                e.stopPropagation();
                /*UPLOAD FILES HERE*/
                console.log("e files ", e.dataTransfer.getData("image/gif"));
                upload(e.dataTransfer.files);
            }   
        }
    });
    
    function upload(files){
        console.log(files[0]);
    }
 <div id="livePreviewId" style="border:1px solid #d3d3d3;width:150px;height:300px;"></div>
            
            <div class="pull-right">
                <p>Drop it here:</p>
                <input id="inputFileId" type="file" class="column" style="border:1px solid #d3d3d3;width:350px;height:50px;"/>  
            </div>

Okay, i got the file in JSON, what next? How can I display it in browser? How can i send it to server? How to store in local storage?

Maybe one possible way is to send it to server (local storage?) and then put in the browser? But this is not a live preview?

Any ideas how to solve this problem?

BR




How to update page with react-router-component

I'm using react-router-component (not react-router) to handle routing in my single page application. Refreshing the page or typing route manually in address bar results in page not found. How to handle the refresh and navigation by address in react-router-component?




Automatically arrange several images to fit a whole web page

Given a bunch a images of different size and ratio, but all rectangular, is there a easy way in javascript/css to assemble them so they fit the whole web page. Such as :

Given the following constraints :

  • Images could be, in the process, be resized down, but not up.
  • The resizing down should have a size limit (so image could still be visible).
  • Ratio must be preserved.

Is there generic/formal terms to describe this process so I can better search for solutions ?

I guess there is no easy, ready-to-use way to do this, like a js library. But does it exist an algorithm that would handle this operation, like form a geometrical point of view of assembling rectangle to fit a bigger rectangle ?




Creation of a specific chart in php

hello i want to create a chart that looks like the one attached in php, is there a way to do that. Thank youThe ones with multiple colors. It should have the flexibility to start from anywhere in the bar and stop anywhere.




Urllib : Page not found if http/https is not present in the webpage link

I have the code:

     def download_page(url):
                import urllib
                try:
                    headers = {}
                    headers['User-Agent'] = "Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.27 Safari/537.17"
                    req = urllib2.Request(url, headers = headers)
                    response = urllib2.urlopen(req)
                    page = response.read()
                    return page    
                except:
                    return"Page Not found"

I have passed the url as www.quora.com but it returns page not found. Only working if I pass the url as http://www.quora.com or other link with http before. Secondly, webpage also doesn't download if I pass the url without www like quora.com. Is there any problem in my code or it is a bug in urllib? How to solve this issue?




web scrapping in python 3.5 mac os

im trying to perform jsDriver = webdriver.PhantomJS() i have installed everything im using mac os python 3.5 and it still gives me this error Traceback (most recent call last): File "", line 1, in jsDriver = webdriver.PhantomJS('phantomjs') File "//anaconda/lib/python3.5/site-packages/selenium/webdriver/phantomjs/webdriver.py", line 51, in init log_path=service_log_path) File "//anaconda/lib/python3.5/site-packages/selenium/webdriver/phantomjs/service.py", line 50, in init service.Service.init(self, executable_path, port=port, log_file=open(log_path, 'w')) PermissionError: [Errno 13] Permission denied: 'ghostdriver.log'Traceback (most recent call last): File "", line 1, in jsDriver = webdriver.PhantomJS('phantomjs') File "//anaconda/lib/python3.5/site-packages/selenium/webdriver/phantomjs/webdriver.py", line 51, in init log_path=service_log_path) File "//anaconda/lib/python3.5/site-packages/selenium/webdriver/phantomjs/service.py", line 50, in init service.Service.init(self, executable_path, port=port, log_file=open(log_path, 'w')) PermissionError: [Errno 13] Permission denied: 'ghostdriver.log'




Javascript with ASP.NET MVC

I am new with javascript and want to learn how to use javascript in ASP.NET MVC. Until now I use bootstrap but I realize javascript is neccessary for web programming. So what do you think about where can I start with it ? Do you recommend a resource or a study plan ?




jeudi 27 octobre 2016

Does my web application require SSL for Firebase Cloud Messaging for Web to work?

With Firebase Cloud Messaging for Web,
1. Does my web application domain still require SSL?
2. Or only the service worker.js needs to be on an SSL site? if so, can I host the service worker on an SSL site but keep my web application on a non-SSL site?

Any feedback is much appreciated.

Thank you, Christina




The appendTo() function in js didn't work

I met a problem with js. The js function appendTo() is not work! my js code is like this: enter image description here

my browser console shows that everythings is as planed: enter image description here

here is the problem , my html element tbody doesn't contain any things as followed: enter image description here

why? how can i fix this?




ASMX Service Multipart Formdata

I have a legacy ASMX service that needs a new method which allows posting multipart/form-data.

The post will look something like this

enter image description here

I am a little stuck on how to achieve this, any help would be much appreciated.




Downloading a mp3 with requests module?

im having a trouble understanding the module requests, i understand that http have post,get, put, delete methods, but i think i need to know more about how requests works, i have read the documentation but still i have a lot of questions about how to do something, this is the first time i try to make a script for web without selenium or mechanize

im trying to interact with vubey.yt, but i cant make my vubey url change at what i want(or what i see when i manually use the pag) i can send my data, and it changes the url, but if i copy that url and navigate manually, it does nothing... so i dont understand whats happening, because i dont have any visual clue

here is my code (python 3.5):

def Descarga(youtubeid):
       # also i have tried only sending videoURL without quality and sub, but is the same
        r = requests.get('https://vubey.yt/', params={'videoURL': youtubeid, 'quality': '320', 'submit': 'Convert+To+MP3'})

        print(r.url, r.status_code)

Descarga("https://www.youtube.com/watch?v=dQw4w9WgXcQ")    

if someone could link me a tutorial for really understand how to use this module or tell me what im doing wrong or misunderstanding about this module i ll thank so much




Creating a website that tunnels to other sites?

I would like to create a webpage that basically just tunnels into whatever other site you enter.

So if I go to http://ift.tt/2fcdv0m it will go to Reddit and display it on my page. Basically it's like a proxy except I'm somewhere I can't change my browser's proxy settings, but would like to view blocked pages.

Mysite.example.com is unrestricted but Reddit.com is.




Returning POST message is not appearing where it should

I followed this great tutorial on how to build a contact form. Everything works great except the success/error messages, instead of appearing above the fields like they should they appears in a 'separate page' i.e http://ift.tt/2eKO4P9

I copy paste the contact.php and just updated $from & $to values and removed the last name and phone fields from the fields array, tocontact.jsi didn't made any changes. the file that is a bit different is the index.php here is the code index.php:

<!-- contact -->
       <div class="contact wowload fadeIn">
       <div class="container">
       <h2 class="text-center">Contact us</h2>
       <div class="row">
        <div class="col-sm-6 col-sm-offset-3">
          <form id="contact-form" method="post" action="contact.php" role="form">
            <div class="messages"></div>
                <div class="form-group">
                    <input id="name" name="name" type="text" class="form-control" placeholder="name" required="required" data-error="enter your name"> 
                    <div class="help-block with-errors"></div>
                </div>
                <div class="form-group">
                    <input id="email" name="email" type="email" class="form-control" placeholder="email*" required="required">
                    <div class="help-block with-errors"></div>
                </div>
                <div class="form-group">
                    <textarea id="message" name="message" class="form-control" placeholder="message" rows="5" required="required"></textarea>
                    <div class="help-block with-errors"></div>
                </div>   
               <div>
                   <p class="text-muted"><strong>*</strong> These fields are required.</p>
               </div>                
                <button type="submit" class="btn btn-success"><i class="fa fa-send-o"></i> Submit</button>

            </form>

          </div>
        </div>
       </div>
       </div>
       <!-- contact -->

Why the message not appear where it should, Thanks.




How to find source code for events that trigger features on web apps

I am just getting my beak wet with web development. I found a site navigation bar on http://ift.tt/2apZI39 that I really liked and wanted to emulate it's interactivity, but I cannot find the code that triggers. It is triggers by scrolling on the page and I've managed to do it in my own way, but I am still curious as to whether there is a way to find the javaScript code that catches the scroll event. Again, I very new to web development and was curious as to whether there are tools that will allow me to catch the JS code on foreign web app.




Selenium/Python: Javascript throws error on website, if special characters in url (...I suspect)

I have some pretty weird behaviour in one of my scripts, and I hope someone here can help me. What am I trying to do (cannot really provide code snippets, maybe tomorrow): I try to scrape a website with a python (2.7) script and selenium via chrome (everything besides Chrome and Python itself just installed; why Selenium: Some ugly javascript, and I need to log in there).

  • If I open the website in my browser (Firefox), everything loads fine, including the javascript (a table).
  • If I open the website via Selenium browser.get(url) (Chrome), the javascript on the website fails, the table doesn't get loaded
  • If I copy the url (which I opened normally in the browser, and which fails via Selenium) from the Selenium instance of the browser into a new browser window (from Selenium/Chrome into Firefox), it also fails.

Via Firebug I see that the website now suddenly throws a "SyntaxError: missing ; before statement" in the javascript.

I suspect this is because the URL has parts which have some special characters like ? and & in it (e.g. aspx?replaceCurrent=1&url etc), and the & is in html & amp; and that the ; in there throws off the Javascript. But I cannot really confirm that. I've already tried to convert the URL via urllib.urlencode , to convert the special characters into this format 5E%26%2A (...sorry, web stuff is not my strong side), but then the browser just fails to open the site (because the : is replaced, therefore it doesn't recognize it as a valid URL).

...so...um...what am I potentially doing wrong here/what could be going wrong here? I really don't have a clue right now what I could try. Any pointers would be appreciated :).




Import JS and CSS in htmls

I'm new to web development and can't seem to understand this. My Node.js project has the following structure -

public - 
       |-js-
           |-a.js

       |-css-
            |-a.css

       |-htmls-
            |-a.html

I have set up the static middleware to the public folder.

webServer.use(express.static('public'))

Why do I have to do something like this to include a.js in a.html

<script src="../js/a.js"></script>

instead of

<script src="js/a.js"></script> ?

since I have set up routes that the static content be served from the public folder? How does the request for a.js goes to my server?

If I do something like this -

public - 
       |-js-
           |-a.js

       |-css-
            |-a.css

       |-htmls-
            |-a.html
src - 
    |-views-
           |-b.html

In my b.html i am able to use the a.js by just using

<script src="js/todo.js"></script>   

Why is this?




nginx Redirect non-www to www and https

Here is my code for my nginx configuration:

server {
    listen 80;
    server_name example.com www.example.com;
    return 301 http://ift.tt/V2T1rx;
}

server {
    listen 443 ssl;
    server_name example.com;
    ssl_certificate /etc/ssl/example.com.crt;
    ssl_certificate_key /etc/ssl/example.com.key;
    return 301 http://ift.tt/V2T1rx;
}


server {
    listen 443 ssl;
    server_name www.example.com;
    ssl_certificate /etc/ssl/example.com.crt;
    ssl_certificate_key /etc/ssl/example.com.key;

    root /usr/share/nginx/html;
    index index.php index.html index.htm;

    location / {
        # First attempt to serve request as file, then
        # as directory, then fall back to displaying a 404.
        try_files $uri $uri/ =404;
        # Uncomment to enable naxsi on this location
        # include /etc/nginx/naxsi.rules
    }

    error_page 404 /404.html;
    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
        root /usr/share/nginx/html;
    }

    location ~ \.php$ {
        try_files $uri =404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }

    # Only for nginx-naxsi used with nginx-naxsi-ui : process denied requests
    #location /RequestDenied {
    #   proxy_pass http://127.0.0.1:8080;    
    #}

    #error_page 404 /404.html;

    # redirect server error pages to the static page /50x.html
    #
    #error_page 500 502 503 504 /50x.html;
    #location = /50x.html {
    #   root /usr/share/nginx/html;
    #}

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    #
    #location ~ \.php$ {
    #   fastcgi_split_path_info ^(.+\.php)(/.+)$;
    #   # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
    #
    #   # With php5-cgi alone:
    #   fastcgi_pass 127.0.0.1:9000;
    #   # With php5-fpm:
    #   fastcgi_pass unix:/var/run/php5-fpm.sock;
    #   fastcgi_index index.php;
    #   include fastcgi_params;
    #}

    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one
    #
    #location ~ /\.ht {
    #   deny all;
    #}
}

here is what im trying to do:

i put it in my default file for configuration and it does not work. the error I get is that the redirect is not redirecting properly. can someone please help? thanks!!!




Multilanguage web app using MEAN stack

I would like to create a multilenguague system for my website using MEAN. I don't know what is the best option to create it, because the application have one part using Node.js and the other using Angular.js.

Thanks !

PD: It's my first question at stackoverflow ;)




Saving repsonse from Restful web service

So Im doing a GET request to my REST web service from java client. Im not sure how to receive response from server. Response is a json with two attributes, nickname and password. Could you help me with that? Thanks




Raise HTTP Application Sender Object from Button Click in C#

I have a button. I want it to submit a http request.

And then redirect it to string + request.absolute.uri.

  signInUrl +=  "?Invitation=" + m_invitation;
  Response.Redirect(signInUrl, true);

The issue is that now I can't use the request.absolute.uri since it is just a click event even though I have put a runat server tag.

<ASP:BUTTON id="SignIn" TabIndex="1" runat="server" OnClick="SignIn_Click"></ASP:BUTTON>

How can I do that?

Please help. Thanks.




C# Webservice Proxy Windows Authentication

I have a c# application which consumes a webservice through a client proxy. The webservice is setup on windows authentication (HTTP 401 challange through Active Directory).My user account is authorized to access the webservice.

When I call the webservice throug the browser it work well. The browser is able to do the 401 challange and does not ask for any user id password (as internally the server and client do it through AD controller).

The problem is that when I try to consume the service through the C# application, it throws HTTP request unauthorized error.

I have tried all the below options for the webservice proxy to do windows authentication. ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation ClientCredentials.Windows.ClientCredential = System.Net.CredentialCache.DefaultCredentials as System.Net.NetworkCredential ClientCredentials.Windows.AllowedImpersonationLevel =System.Security.Principal.TokenImpersonationLevel.Impersonation

Can someone please help on how I can make the webservice call just like how the browser does. I cannot pass user id and password while calling the service.




Script For Facebook Web App

Is there any script or templates that I can use for Facebook web app quiz or horoscope? Just like these two site, which makes use of Facebook connect to get information from the visitor Facebook profile used in the quiz or horoscope.

http://en.nametests.com
http://en.quiezz.com




Custom 404 page running 3 times

I have a custom 404 page , and on it I run a script to insert a record into a db with the page name. I am noticing that each page gets written to my db 3 times, like it's hitting the page 3 times. Any idea why?




How can I embed JavaFX on a web without NPAPI?

I have working some time on JavaFX, I have a proyect that depends of other proyects and libraries.

Searching has emerged me a doubt about the future of JavaFX to leave Firefox to support NPAPI, I have sought alternatives but I have not found anything.

Oracle has not been informed of anything at the moment.

Any ideas?

Thanks.




Python flask url variable from another route as endpoint parameter

Hello guys i am new to flask and i have 1 question. I have a route /tweeter where i show some data for the tweets which I take from twitter api with the help of tweepy. How i can pass a variable from the /twitter route to create a new route with an atribute of the variable as endpoint. for example:

@app.route('/twitter', methods=('GET', 'POST'))
  def twitter():
    tweets = api.user_timeline(screen_name = 'example', count=100, include_rts = True)

and in a new route i would like to pass tweets.text as endpoint parameter.

@app.route('/twitter/{twitter.text}')
  def newfunction(twitter.text):
.......

and some values from the tweets variable from above.




What's Wrong With W3Schools and Why Should They Be Avoided?

The Issue

From time to time, in various searches throughout the last few months, I have seen references denigrating W3Schools by various commenters on posts on the Stack Exchange networks. The comments left often are one-liners advising

"stay away from W3Schools"
"You shouldn't be using W3Schools"
"Avoid W3Schools", etc.

I researched it and found a website W3Fools.com. It appears that up until about 3 years ago, W3Schools was riddled with "documentation errors". According to W3Fools, W3Schools have improved their documentation and the quality of their code.

MyExperience

I've been using W3Schools for the past 3 years, despite the "warnings", and have not had any inaccuracy problems. All the code usually works in the Try-It editor, and if it doesn't, it is because of something I did.

I believe at one time there may have been severe inaccuracy issues with W3Schools, and I am not trying to downplay the annoying experiences some may have had. But, I personally, have never had this experience.

My Question

My question then is this:

I there any valid, demonstrable reason ANYMORE to be afraid of W3Schools?

NOTE: This is NOT an opinion piece. Please post anecdotes, quotes, or links to online documentation that supports your reply or comment. Thanks.

Any help is appreciated!




how rewrite to http://ift.tt/2ezb5qU when url just type "domian.com/test_site"

normal condition
redirect to "http://www.domain.com" when just type "domain.com"

we can use like below on .htaccess file

RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www\.)?domain\.com$
RewriteRule ^$ http://ift.tt/wAZaPt [L,R=301]

================================================================= if anyone know when use append folder to be a website ? how to set rule on .htaccess?

if i want to just type "domain.com/uat_01" hope redirect to "http://ift.tt/2ezdhi7" or "http://ift.tt/2eJsTND"




Dictionary task. Choose needed ones and order them

stackoverfollowers!

There is a task that i am trying to resolve now. here it is:

'' Write a function samewords(u1, u2, enc, k) that:

  1. Take 2 urls and enc = ‘utf8’:
    u1 = 'http://ift.tt/2fiYYz5'
    u2 = 'http://ift.tt/2ePQugb'
  2. On this web pages u1 and u2 find words of the length k that occur on both pages
  3. Count how many times that words occur on each page
  4. Return a list that contain groups of 3 parameters: word (found in paragraph 2), occur1 (how many times a word occurs on the page u1), occur2 (how many times a word occurs on the page u2)
  5. A returned list should be in decreasing ordered in accordance with total number of occurs on the both pages ''

So returned list should look like this if k=10 (the length of serching words):

[(u'fondamenti', 4, 4), (u'istruzioni', 4, 3), (u'operazioni', 2, 3), (u'stylesheet', 2, 2), (u'permettono', 2, 1), (u'googlecode', 1, 1), (u'inlinemath', 1, 1), (u'javascript', 1, 1), (u'parentnode', 1, 1), (u'tantissime', 1, 1)]

using this code to delete all notalphabetic characters

def mywords(s):              # delet nonalphabetic characters
    for c in '''!?/-,():;--'.\_[]"{}''':
        s = s.replace(c, ' ')
    return s.split()            # return a list of all words from page with my url

import urllib.request as ul

def myurl(u, enc):      #open my url
    p = ul.urlopen(u)
    t = p.read()
    p.close()

    return mywords(t.lower())

And then i meet difficultes with points 3-5 and stuck (mainly because if something doesn't go i check the code online with pythontutor.com but in this case i can't do that because it doesn't support urllib library)

Thank you!!!




Combine if-query with allocation

Is it possible to combine the allocation into the if-query and should that be done?

$textxPos = $xPos + $fieldData["coordinates"]["x"] / $divisor;
if ($textxPos < 0) {
  ..
}

like so:

if ($link['value'] = trim($link['value'])) {
  ..
}




Installing mysql through terminal

I am having some issues getting sql to work when trying to set my rails project. I have the latest version of both ruby and rails, the issue I believe lies within my terminal PATH. When typing gem install mysql, I get the following error:

ERROR: While executing gem ... (Errno::EACCES) Permission denied @ rb_sysopen - /Users/myName/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/mysql-2.9.1/COPYING.

And when echoing my PATH I get the following description: /Users/myName/.rbenv/shims:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin This is a messed up path, and yes I have specified the PATH I want in the .bash_profile. My desired path looks like this: export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH" It just doesn't seem to work. Any ideas of what I am doing wrong? Running Sierra on a Macbook Pro 2015.

Thanks in advance for the help!




How to add a new module dynamically?

Image that I have the following .js code:

 $.ajax({
     url: 'some/url',
     success: function(result) {
        $activeTabContainer.html(result);
    }
 });

The $activeTabContainer is jQuery selected div.

The result object contains html (with script tag), maybe something like:

<div ng-app="mySpa">
    <div ng-controller="myController"></div>
</div>

And later in the same .html file a script tag, which contains:

(function () {
    "use strict";
    var app = angular.module("mySpa", []);
    app.controller("myController", [function () {
        debugger;
    }]);
})();

It perfectly executes the .js part in the script tag, but I guess that angular must be somehow notified about the dynamically added module and its controllers, something like dynamically bootstrapping.

Do anyone have an idea?




How to know where the file you are downloading comes from

I am trying to make a script that downloads files from a site. But i have encountered an problem: I can't find the location of the file (the site automatically starts the download and redirects you back to the previous page) which is a problem, because i'd need the adress of the file , rather than the download link. (and I cant view the page source because it redirects me straightaway)




Which one is the best browser to web development?

I know the questions looks like is subjective, but

  • which one is more like to not fix code mistakes, broken tags or misspelling
  • which one has the better developer tools, i mean, network recording, storage access, DOM element access, console and debugger, and responsive design?
  • which one you recommends?



Connections to Kubernetes Service lost at Interval (23-24hours)

We are currently experiencing a problem with our Kubernetes Deployment where Client applications through web services are unable to connect to Pods via Kubernetes Services at a set interval (About 24 hours). The rest of the time our Applications are working as expected. we suspect something on the Kube-Proxy that routes traffic from the service to the pods are the culprit, but we are unable to find the root cause. Also simply deleting the Kube-proxies on the nodes to re-start the proxy pods seems not to be restarting or fixing the Issue.

We please need help\ideas on the following:

  1. Troubleshooting (we have tried the obvious documented routes) in finding the root-cause
  2. How do we restart Kubernetes without any service interruption
  3. What to check in our configuration, is there any updates etc scheduled every 24 hours that could cause this and we might have missed it.

Summary of our Deployment: Client Version: version.Info{Major:"1", Minor:"2", GitVersion:"v1.2.4", GitCommit:"3eed1e3be6848b877ff80a93da3785d9034d0a4f", GitTreeState:"clean"} Server Version: version.Info{Major:"1", Minor:"3", GitVersion:"v1.3.3+coreos.0", GitCommit:"d8dcde95b396ecd9a74b779cda9bc4d5b71e8550", GitTreeState:"clean"} CoreOS stable (1068.8.0)

We have a Micro services Architecture model that allows third party application to request Telemetry data (We are streaming 1200ms/s via a service that uses 0MQ http://zeromq.org/ as the underlying transport layer, this data is then written to a Cassandra Cluster). The stream is also "Published" which allows literally thousands of clients listening to their data stream - Potentially creating thousands of connections and creating the above problem. We also expose a REST web service to request data in the case a client lost connection and want to "download" the missing data.

What we are seeing is that all services will run perfectly (Multiple replicas - Pods exposed via Kubernetes services) for up to 24 Hours, then all connections to the services are dropped. What we could see by digging through the logs, (I am sure we have not covered all the logs, we are still new to Kubernetes) The problem is mainly seen from the Client Applications getting a "Connection Time-out" when trying to retrieve data from the REST web services. From http://ift.tt/2bU1yqp and if I understand the above correct then the default conntrack-tcp-timeout-established duration is set at 24 Hours (Is this just a coincidence with the failures we are experiencing?) or is our failure due to the above posts? If we leave Kubernetes, we are not trying any restarts of services, then it Any pointers in how and where to look to help if it can solve the above and our problem will gladly be appreciated.

If we need to provide specific logs, files etc we can.




How to stress memory on web server?

I have created web cluster with several web sites and I would like to perform stress test of a memory but I have no clue how to.... I have used Jmeter but I always get CPU load not memory (cant used more then 1GB). Is there anyway to stress test it by Jmeter?

p.s. I would like to avoid custom scripts because I want my test to be repeatable by anyone. For websites I am using generic WP installations.