w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
While Sending Html Mails from my web application Recieved Mails contains Symbols like &ldquo,&rdquo, ‘
Check with another constructor for htmlView: ContentType mimeType = new System.Net.Mime.ContentType("text/html"); var htmlView = AlternateView.CreateAlternateViewFromString(bodyMessage, mimeType);

Categories : Asp Net Mvc

nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
Skype uses port 80,443 by default, those are EXACTLY the http and https ports. Try shutting down skype and restarting nginx. If you are using the 'desktop version' of Skype you can change this setting by the way of tools>options>advanced>connections > untick use port 80 and 443 as alternatives. If you are using the win8 app, the only option seems to be shutting down skype completely or removing it completely. Someone has to confirm the win8 app though, I use linux.

Categories : PHP

(ubuntu) nginx: [emerg] bind() to failed (13: permission denied)
the socket API bind() to a port less than 1024, such as 80 as your title mentioned, need root access. here is "Bind to ports less than 1024 without root access" and another easier way is to run nginx as root.

Categories : Nginx

Unknown error nginx
You can only specify options for the listen directive once per combination of host:port (see the documentation). The error is being caused by this line in your second file: listen [::]:80 ipv6only=on; Because the first file has the ipv6only=on option, the second file does not need it. Changing the beginning of the second file to the following should fix the problem: server { listen 80; listen [::]:80; ... }

Categories : Nginx

Where is my nginx being configured? Changing nginx.conf still brings me to the 'Welcome to nginx' page
when you rewrited the nginx.conf in the folder of source code of nginx and installed it firstly, it will be copied to /usr/local/nginx/conf/nginx.conf (without specially modification of the configure in the folder of source code). But when you do this secondly, the nginx.conf in the folder of source code will be copied to /usr/local/nginx/conf/nginx.conf.defualt,and it usually don't work unless you use nginx -c /usr/local/nginx/conf/nginx.conf.defualt to assign its configure file evertime. There is a line NGINX_CONF_FILE="/usr/local/nginx/conf/nginx.conf" in your script above,which indicates the configure file clearly. To handle this, I suggest rewrite /usr/local/nginx/conf/nginx.conf (not the one in the folder of source code) instead.

Categories : Nginx

Logging a variable set by nginx's Lua module
You need to define the variable $foo before the Lua module can use it. Check the doc for an example defining the variable within the location directive before utilizing it.

Categories : Nginx

Rewrite rule with nginx replace get variable with slach
You're doing it backwards, try this. rewrite ^/auction/([^/]*)/([0-9]*) /auction.php?$1=$2 piece of advice, if this is a custom application you're writing without a framework, you could find a routing module that you could use and it would help you do every thing easily.

Categories : Nginx

Qt C++ function breaks deleting unknown variable
Here is my best guess at what is happening: An object that you are accessing is getting deleted somewhere where it shouldn't. That _Tidy function looks like it is doing some cleanup after string manipulation. Chances are the const-ness of your char * didn't make it down, and you are deleting a const pointer. To fix this I would make a deep copy of your variable and pass that into your updateDB that does the xstring LaTex stuff. Or you could create an xstring object right then and there and pass it down. I would also consider using strcpy or something similar, or maybe just the std::string. Also the crash code that comes out can be helpful, too. EDIT: Here is what your code should probably look like... void gui::on_go_clicked(){ std::string str(cb->currentText().toStdString

Categories : C++

SQL Store Unknown Column Name in Variable from a Given Input
There's no built-in way to do it, you need a UNION query like this: SELECT "col1" columname FROM Table WHERE primary_key = input1 AND col1 = input2 UNION SELECT "col2" FROM Table WHERE primary_key = input1 AND col2 = input2 UNION SELECT "col3" FROM Table WHERE primary_key = input1 AND col3 = input2 and so on You can create a dynamic query using INFORMATION_SCHEMA that checks all the columns.

Categories : Mysql

How to declare an iterator variable for unknown container
In C++03, you would need to get the iterator type from the container type explicitly: typename Container::iterator it; typename Container::const_iterator cit; In C++11, you can just use auto: auto my_iterator = c.begin(); // iterator in this case auto my_iterator = c.cbegin(); // const_iterator always Also note, as suggested my @Matthieu, that you can use a range based for loop in C++11, to simplify the code: template <class Container> void print(const Container& c) { for (const auto& elem : c) cout << c << endl; }

Categories : C++

Serving either a static or dynamic file based on a query variable using nginx
I think that you need something like this: location /thumbs/ { if ($arg_nocache) { rewrite ^(.*)$ /thumbs/index.php?r=$uri&$query_string break; } try_files $uri /thumbs/index.php?r=$uri&$query_string; }

Categories : PHP

Unknown property with class variable PHP in Yii encountered in unit testing
I don't know if this will be helpful to anyone, but I figured out a solution. First, the CDbCommand::bindParam follows the standard PHP PDOStatement::bindParam() syntax in which the placeholders on which variables are to be bound must have the prefix :. Without that prefix, the variables were not being bound to the SQL statement. Second, for some reason, private $insertQuestionSql was always found to be an unknown property when accessing within the class, despite usage of $this-> prefix when calling the variable. I worked around this by converting the property to static and calling via $command = $connection->createConnection(QuestionDAO::$insertQuestionSql);

Categories : PHP

R roxygen2 Error in preref.parsers[[tag]] %||% parse.unknown: attempt to use zero-length variable name
To track the problem down I systematically removed files and re-ran roxygenize() until it no longer failed to run through. Having identified the offending file, as suggested, it was a misplaced "@". This results in the aforementioned error: #' @ export So simply fix the misplaced space and problem solved: #' @export The difficult aspect is locating the typo.

Categories : R

Restarting nginx: nginx: [alert] Unable to start the Phusion Passenger watchdog because its executable
Passenger takes what you set in the file nginx.conf by passenger_ruby, for example: passenger_root /home/dev/.rvm/gems/ruby-1.9.3-p448/gems/passenger-4.0.5; passenger_ruby /home/dev/.rvm/wrappers/ruby-1.9.3-p448/ruby;

Categories : Ruby

Can a server run Nginx for some sites and Apache Nginx Reverse Proxy for others?
server { server_name example.com; location / { # assuming apache is on port 81 for example proxy_pass; # to make apache detect the host header proxy_set_header Host $host; } # if you have assets folders, you can let nginx serve them directly, # instead of passing them to apache location /images { # or /css or /js .. etc try_files $uri =404; } } Note: in the case of assets, sometimes some sites serve assets through rewrites, or even handled by the application it self, you can pass it to apache by adding that in the assets location as a fallback like this location /images { try_files $uri @apache; } location @apache { proxy_pass; } In apache you create a virtual host <Virtua

Categories : Apache

Error: Unknown symbols found":" Unknown property type filter, even when everything seems working
filter is non-standard property only for IE, so I guess NetBeans is picking on that wrong syntax and firing an error. Maybe you just need to update your NetBeans as it is a fixed bug: https://netbeans.org/bugzilla/show_bug.cgi?id=168406

Categories : CSS

Web App: Gathering unknown amount of data from user an unknown number of times
Do you mean something like this http://www.labs.mimmin.com/inlineedit/ http://dev.iceburg.net/jquery/tableEditor/example_new.php I found it on google by using 'jquery inline editable table' I know Yii has a nice admin interface specifically fast input, but I sense you wrote the code yourself, transferring to Yii might be a bigger challenge that solving this in a nice way. good luck

Categories : PHP

C# retrieve data from database - unknown datatype and unknown column name
You can use reader.GetSchemaTable() to get a table of the schema of the data reader or reader.GetType(n) or reader.GetProviderSpecificType(n) to get the datatype of a particular field. You can then use that information to decide which method to call: if (reader.GetType(n) == typeof(string)) { string value = reader.GetString(n); }

Categories : C#

Notice: Unknown: Skipping numeric key 1 in Unknown on line 0
The PHP session storage mechanism was originally built around "registering" variables, so the keys in $_SESSION must be names that could be treated as variables in their own right. This means that $_SESSION[42] is invalid, because $42 wouldn't be a valid variable name, and since $foo[42] and $foo['42'] refer to the same thing, $_SESSION['42'] is invalid as well. The solution is either to use a prefix on your session variables (e.g. $_SESSION['row_count_' . $x] = $row['Count'];) or make them into an array, which you can then loop over etc later (e.g. $_SESSION['row_counts'] = array(); ... $_SESSION['row_counts'][$x] = $row['Count'];) Note: this limitation is actually part of the "serialization handler" used when writing the session to disk, which is why the errors have no context (they'

Categories : PHP

Javascript audio not working in Firefox (x-unknown/unknown)
Hmm. Based upon my experience with the JS Audio elements, you're missing a line. var audio = new Audio('tune.wav'); audio.load(); audio.play(); I don't think that's causing the error though. Based upon the responses to this question: Firefox won't play .WAV files using the HTML5 <audio> tag? and the back-and-forth in this forum: https://bugzilla.mozilla.org/show_bug.cgi?id=524109 (comment 7) It looks like Firefox simply doesn't support 24-bit WAVE files. 16-bit is probably a safer option.

Categories : Javascript

unknown character / unknown token, json string
This smells like you've got a BOM in the front. Save PHP files without BOM and that should do it. :) See as well: UTF-8 BOM signature in PHP files

Categories : PHP

Exception: conversion from UNKNOWN to UNKNOWN is unsupported
The problem was that sql server is not happy to save a serialization (as done when implementing externalizable). .setObject() fails. The solution is to use setBinaryStream(). // Sql Server can't do an stmt.setObject(4,o) "Conversion from UNKNOWN to UNKNOWN not supported" // Serialize the object to an output stream and then read it in again into the stmt. Object o = ri.getReportModule(); ByteArrayOutputStream bos = new ByteArrayOutputStream(); ObjectOutputStream objectOutput = new ObjectOutputStream(bos); objectOutput.writeObject(o); objectOutput.flush(); InputStream objectInput = new ByteArrayInputStream(bos.toByteArray()); stmt.setBinaryStream(4, objectInput); Cheers Christian

Categories : Sql Server

OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=unknown state: unknown protocol
The problem appears to be that your target site, aristo4stu3.bgu.ac.il, is picky about SSL/TLS handshaking. I got two different results with the following OpenSSL command with different versions of OpenSSL: openssl s_client -connect aristo4stu3.bgu.ac.il:443 This does connect with the stock OpenSSL 0.9.8x on OS X 10.7.5. However, it does not connect using OpenSSL 1.0.1e - in that case the server just closes the connection (by sending a Close Notify alert) immediately after receiving the Client Hello. I captured packets with Wireshark, and the difference between what these two versions send is that 0.9.8x is sending an SSLv2 Client Hello advertising support through TLS 1.0, while 1.0.1e is sending a TLSv1 Client Hello advertising support through TLS 1.2. If I tell 1.0.1e not to use T

Categories : Ruby On Rails

Text Scanning to read in unknown number of variables and unknown number of runs
For any given file, are all the lines equal length? If they are, you could start by reading in the first line and use that to count the number of fields and then use textscan to read in the file. fID = fopen(strcat(pwd,'/',inputFile),'rt'); firstLine = fgetl(fID); numFields = length(strfind(firstLine,' ')) + 1; fclose(fID); formatString = repmat('%s',1,numFields); fID = fopen(strcat(pwd,'/',inputFile),'rt'); vars = textscan(fID, formatString,' '); fclose(fID); Now you will have a cell array where first entry are the var names and all the other entries are the observations. In this case I assumed the delimiter was space even though you said it was a csv file. If it is really commas, you can change the code accordingly.

Categories : Matlab

Record type reflection / populating a record variable of an unknown type (PL/SQL)
You can try to use table user_identifiers or all_identifiers if you have the access, as this other SO post shows. You may need to recompile your packages: alter package my_types compile plscope_settings='IDENTIFIERS:ALL' reuse settings; Unfortunately this is only available from 11gR1.

Categories : Oracle

nginx + passenger + rails: do I need to start the rails server or just start nginx?
Set nginx to forward to my rails server using this https://gist.github.com/jeffrafter/1229497 worker_processes 1; error_log /usr/local/var/log/nginx.error.log; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; upstream dev { server; } server { listen 80; # You could put a server_name directive here (or multiple) if # you have not setup wildcard DNS for *.dev domains # See http://jessedearing.com/nodes/9-setting-up-wildcard-subdomains-on-os-x-10-6 # If we choose a root, then we can't switch things around easily # Using /dev/null means that static assets are served through

Categories : Ruby On Rails

AS3 Advanced Variable Usage - Retrieve Value In Variable Selected Based On Value In Another Variable
Generally not a fan of having data-defining element names in XML, but - assuming event.dat is actually an XML object, and not an arbitrary object that you've manually parsed the XML into (can't tell from the question) - this is really a question about ECMAScript for XML (E4X) rather than variables in general. If so, this should work: for each (var menuField:XML in event.dat.child(mnVariable).element) { // Do something } Can't test at the moment, but this may also work (it's part of E4X standard, but not sure if Adobe implemented it): // Note, no dot before the indexer: for each (var menuField:XML in event.dat[mnVariable].element) { // Do something } The latter is also generally the way to access a property of an object using a string property name, so if event.dat is an arbitr

Categories : Actionscript

Jquery How to use .click() to update a variable and pass that variable to an array or add it to another variable
In this case the alert will show undefined since it is executed before the actual click happens. But the value of v1PackCharge is globally set, you can use it outside the click handler. Only thing is you need to modify the test case Demo: Fiddle

Categories : Jquery

How to copy local variable to global variable if both have the same names in C without using a third variable?
What you're doing is "shadowing" the global variable. In order to unshadow it in a local block, declare it in its own nested block with extern. void myFunction() { int myVariable { extern int myVarible; //modify myVariable global here; } //modify myVariable localhere }

Categories : C

How to use nginx proxy_pass
Try the nginx HttpRewriteModule you dont need a proxy for these(tho). it follows this format: rewrite regex replacement flag | | | | rewrite ^/ http://www.example.com/image/file.aspx?img=1 permanent; Then: location / { rewrite ^/ http://www.example.com/image/file.aspx?img=1 permanent; }

Categories : Node Js

Upgrading Nginx 1.1.9 to 1.4.x
This is what test environments or virtual machines are made for. Your question is quite general and hard to answer this way. Try it out in a test setup. If you don't have that option, read the Changelog. From my experience, I haven't encountered backwards compatibility issues with configurations since 1.0 (before that even, but that's when officially configuration syntax should be considered stable). That's not to say there aren't any.

Categories : Ubuntu

Nginx and Unicorn Set up Not sure what I am doing
I've never used knife... It might be worth checking out this this blog post about setting up Capistrano, Nginx, and Unicorn - I've always found Capistrano to be a good deployment app (and there's lots of support for it, especially on SO). On Heroku, you don't deploy as you would with Capistrano or any other deployment utility - you simply push to a branch on your Heroku server. See: https://devcenter.heroku.com/articles/git for how to deploy on Heroku using Git.

Categories : Ruby On Rails

htaccess to nginx (help)
Please try the following: server { listen 80; server_name www.website.com; return 301 $scheme://website.com; } server { listen 80; server_name website.com; root /path/to/root; location / { try_files $uri @rewrite; } location @rewrite { rewrite ^/([a-z]+)/?([0-9a-zA-Z]*)/?.*$ /index.php?a=$1&q=$2 last; } }

Categories : Apache

Git on server with nginx
You need a web frontend for git. Have a look at https://git.wiki.kernel.org/index.php/InterfacesFrontendsAndTools#Web_Interfaces for an overview

Categories : GIT

PHP htaccess to nginx
@Harinder: There must be some RewriteCond based on which you're applying this RewiteRule The reason why i am saying this is that, according to your RewriteRule RewriteRule ^(.*)$ /all_drivers.php?id=$1 [QSA] whatever that comes as a request, you are sending it to all_drivers.php. And if this is the desired rule, then all the request, no matter what will be send to this file only. Also it will be nice if you give us the complete .htaccess code segment that you want to be translated. And please check if you have configured php execution block correctly with all the required fastcgi directives as this blank php's output comes in the case if you have not passed SCRIPT_FILENAME fastcgi directive.

Categories : PHP

When do I need to restart nginx
Probably only when you change its configuration, if you are referring to when your django code changes you have to restart the uwsgi server, usually "touch"ing the wsgi.py file is enough to instruct the uwsgi server. Changes in static files don't require the uwsgi restart (because you usually serve them directly with nginx), and if you don't use cached template loaders, but only the default filesystem loader, you don't require the restart when changing a template either. Note that the cached template loader is usually suggested in production.

Categories : Django

Regex for Nginx
The way you written it means that the / is the one that could appear multiple times, ie /home///////share, to fix it write soemthing like location ~ /home/[^/]+/share { }

Categories : Regex

Redirecting to SSL using nginx
In order to use regular expressions for matching locations, you need to prefix the expression with either ~ or ~*: if ($server_port = 80) { location ~ (en|fr)/shop { rewrite ^ https://$host$request_uri permanent; } } From the documentation: To use regular expressions, you must use a prefix: "~" for case sensitive matching "~*" for case insensitive matching Since nginx does't allow location blocks to be nested inside of if blocks, try the following configuration: if ($server_port = 80) { rewrite ^/(en|fr)/shop https://$host$request_uri permanent; }

Categories : Nginx

Nginx add sites
well if you're going to use only 1 IP, then it's 1 server block ( 1 virtual host ) server { server_name [domain name or ip]; index index.html; # or php or whatever location /foo { root /var/www/foo/public_html; try_files $uri $uri/; } location /bar { root /srv/www/bar/public_html; try_files $uri $uri/; } } You haven't mentioned what kind of application this is, so it probably need some changes depending if its a php site or rails or any thing else, this would work for static content only like html and images.

Categories : Nginx

nginx and ssl certificate
This is the .cer file, the .key is the key you used to produce this .cer file, try to remember how you got this .cer file, you probably generated a key file on your device, then created a certificate signing request out of it .csr and then uploaded it to get this certificate correct ? you should already have the key file.

Categories : Ssl

© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.