w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
invalid conversion from void* to void (*) int error when compiling a simple signals code on Linux
The sa_handler member of struct sigaction is a function pointer of type void(*) (int). In contrast, the type of the expression (void *)ctx.eip is void * because of the cast. In C++, implicit conversion from void * to another pointer type does not happen, hence the error.

Categories : C++

Minimal files needed to deploy ASP.NET App to the Web Server
Yes, you can xcopy your web.config, global.asax and all .aspx files to the server, which is essentially what the Publish command in Visual Studio does. There is also the option to create a new Profile when doing a Publish via Visual Studio and have the files published to a directory so you can see what would have been pushed to an actual server before actually doing it. I use this as part of our deployment process to have a copy of the code that gets deployed to each of our testing environments.

Categories : C#

Error 500 on Apache/Linux server when accessing a git-cloned app
Just found this question because I had the same problem and i couldn't find an answer anywhere so this is for everyone in the future that'll find this question. You have to edit your bashrc file $ vim ~/.bashrc And add this to the bottom of the file umask 022 After this you have to logout and login before this will take effect (if you're logged in using ssh just connect again) or execute the file . ~/.bashrc Now you can git clone again and it'll work. You can find the documentation for umask here

Categories : GIT

minimal socket server written in python for openshift
It doesn't look like OpenShift lets you just run an application like that. You can see a howto guide here: https://github.com/giulivo/openshift-hellotornado

Categories : Python

Boxing conversion from bool to generic interface
Maybe this public static bool GetParsedValueOrDefault<T>(string val, out T result) where T : IParse<T> { result = default(T); result.TryParse(val, out result); return result } but is a little strange. Maybe you mean: public static T GetParsedValueOrDefault<T>(string val) where T : IParse<T> { var result = default(T); result.TryParse(val, out result); return result }

Categories : C#

codepage conversion support on linux
You seem to be using iconv. To get the list of all possible encodings, just run iconv -l If you do not have any file in a given encoding, you can create one: take any file in a known encoding and use iconv to convert it into the given encoding. If you are worried the conversion can exit in the middle, use iconv -c It omits invalid characters in the output, but encodes everything it can.

Categories : Linux

Microsoft® ODBC Driver 11 for SQL Server® on RedHat Linux with PHP - gives an error when bind parameter with PDO for stored procedures
Finally I found the solution for this, Microsoft driver has develop for C or C++ application and the PDO parameter binding does not work as expected. If you pass parameters without using PDO everything works as expected. Replace with @paravalue = N'".$v1."' Fore example - normal parameter binding - SQLBindParameter PDO parameter binding - $stmt->bindParam(1, $v1 = 5, PDO::PARAM_STR, 100); Corrected cod snippet: $stmt = $con->prepare( "SET NOCOUNT ON DECLARE @return_value int EXEC @return_value = [sp_insert_into_t_contact_test] @paravalue = N'".$v1."' SELECT 'returnV' = @return_value"); $stmt->execute(); $return =$stmt->fetch(); echo $return['returnV'];

Categories : PHP

Parse CSV file and perform conversion in Linux
Don't use a bash script but a Python script. At the very least, this will be much more readable/maintainable and probably more efficient. Example code could look like this (untested): # file: converter.py import datetime def convert_line(line): # split line on ';' line = line.split(';') # get the date part (second column) # parse date from string date = datetime.date.strptime(line[1], '%d%a%Y') # convert to desired format # replace item in line line[1] = date.strftime('%Y-%m-%d') # return converted line return ';'.join(line) while True: print convert_line(raw_input()) Now you'd just do: cat file.csv | python converter.py > file_converted.csv Alternative implementation: # file: converter_2.py import datetime def convert_line(line

Categories : Linux

'Interface not Registered' error on ATL out-of-process callback interface
In order for this to work out-of-proc you need the interfaces to be marshalled between processes. Most likely you will want to rely on Automation marshalling which uses a typelib generated from your IDL to find what and how to marshall. The problem is that will only work for interfaces that are marked [oleautomation], [dual] or both in the IDL. See this answer for more details. You best bet is marking the interfaces you want marshalled as [oleautomation] and adding a comment like "Marshalling magic goes away if you remove this".

Categories : C#

virtual to physical address conversion in linux kernel
It's not really "assembly" as there is no instruction in this macro per se. It's just a macro which inserts instr (an instruction passed to the macro) which has one input operand from, one immediate (constant) input operand type and a output operand to. There is also the part between pushsection and popsection which records in a specific binary section pv_table the address of this instruction. That allows the kernel to find these places in its code if it wishes to. The last part is the asm constraints and operands. It lists what the compiler will replace %0, %1 and %2 with. %0 is the first listed ("=r"(to)), it means that %0 will be any general purpose register, that is an output operand that will be stored in the macro argument to. The other 2 are similar except they're input opera

Categories : Linux

HTTP 400 - Hard to understand error code with minimal description
You can use a debugging proxy to view a client request and a server response to figure out what your client socket program needs to do. But first you need to create a simple web page that a browser displays, allows you to do a POST from the browser to the web server, and get a simple response back from the server.

Categories : Http

How to get notified by the Linux kernel if a new interface has been attached?
While you can use udev, the underlying mechanism is netlink. Interfaces themselves are not normally in /dev, but do show up under /sys/class/net as sub-directories. However, the hotplug.txt gives a good start to inspecting kernel events. Run the sample code and examine the netlink data when an interface is connected. The text is ASCII that any user space application can parse and use.

Categories : Linux

Linux input event interface numbering
If you mean by "mapping" specifying the name of the /dev/input/eventX 'file', you should use Udev. The kernel assigns the number of the event device, it is a bad idea and probably impossible to try and force this number since you never know which other device may have gotten this number first. My recommendation would be to let Udev create a symlink that points to your device; you can choose your own name and use that in your program (i.e. /dev/my_first_keypad). For example, my Wacom tablet is assigned /dev/wacom with the following udev rule: KERNEL=="event*", SUBSYSTEM=="input", SUBSYSTEMS=="input", ATTRS{name}=="Wacom Volito", SYMLINK+="wacom" The trick is to find the proper set of variables to exactly specify your keypad. If it is USB based, the vender/product ID are a good start. Ot

Categories : Linux

Linux network interface management by C code
Use a system call to execute a command like you would on the command line. #include <stdlib.h> int system(const char *command); man page

Categories : C

How to get more advanced network interface card type in Linux and Mac OSx
There is no direct equivalent. The Windows API mixes two properties: protocol and driver. To get interface protocol (Ethernet, ATM, Loopback, firewire) you can use SIOCGIFHWADDR ioctl which will return "Link Encapsulation". In most computers, it will be either loopback or Ethernet (most devices, including Wifi, tunnels, etc.. are Ethernet). This information is shown by 'ifconfig' tool: $ ifconfig | grep encap eth0 Link encap:Ethernet HWaddr 00:21:cc:xx:xx:xx lo Link encap:Local Loopback virbr0 Link encap:Ethernet HWaddr 00:00:00:00:00:00 wlan0 Link encap:Ethernet HWaddr 00:24:d7:xx:xx:xx To get interface driver, you can explore /sys/class/net/INTERFACE/device/ path. Then you can just use various heuristics: # get driver name $ readlink /sys/class/net/eth0/dev

Categories : C

Linux kernel: how to force TCP RST to be sent on incoming interface and not making routing decisions?
You do not need to modify kernel to achieve this, Use ip rule instead. first mark connection coming from different interface, and save the mark in conntrack table (I'm using eth2/4 as example): iptables -t mangle -A routemark -i eth2 -j MARK --set-mark 0x100 iptables -t mangle -A routemark -i eth4 -j MARK --set-mark 0x200 iptables -t mangle -A routemark -m mark ! --mark 0x0/0xff00 -j CONNMARK --save-mark --mask 0xff00 Then create rt_table for each interface in /etc/iproute2/rt_tables, insert default route into the table: ip route add default via gateway-ip-eth2 dev eth2 table rt-eth2 ip route add default via gateway-ip-eth4 dev eth4 table rt-eth4 For every outgoing packet, restore connection mark to packet mark, and lookup corresponding rt_table: iptables -t mangle -A PREROUTING -m

Categories : Linux

Building a minimal Qt Console Project fails with a cryptic Linker Error LNK2001: Unresolved external Symbol
#include "main.moc" just above the int main(...) is critical. If the file is not found, try cleaning the project / deleting the build directories, running qmake, restarting Qt Creator or even the whole system. This may have to do with paths in environment variables (maybe set previously by a different project). Another common reason seems to be a forgotten Q_OBJECT macro in the class declaration, or as above, run qmake after including it. Good luck!

Categories : C++

Why this Interface Instance give error when reference to an class Instance which implement that interface
You get this error because ClassA does not implement Interface B. Always remember that a parent type in java can refer to Subtype. Type IntefaceB is no way related to type ClassA here. And for below to work InterfaceB obj = new ClassA(); ClassA need to have its parent type to be InterfaceB(either directly or by anyother type which implements InterfaceB(a class) or extends InterfaceB(interface).

Categories : Java

Reading CSV files located on LINUX server and updating the tables in SQL Server Database
Since you know how to proceed once the csv file is on your Windows box, it seems this question amounts to how to get the file from a Linux server to a Windows server. I suggest rcp or rsync. There are Windows versions of both.

Categories : Linux

Issue when both apache2 server and apache tomcat server installed in my linux machine
Change the default port for Tomcat to something else, for example 8181 Current versions of web browsers recognize port 8080 like 80, so that's why it's forward you to 80 or cut the port option from URL. To change Tomcat port open server config file server.xml search for "8080", which is the current port in use, and replace it with something else (make sure the new port not in use), save and restart Tomcat.

Categories : Java

how to remove catalina.out from Linux server where Apache tomcat server installed
you don't have to remove catalina.out file. You can use logrotate, to rotate logs, and remove old files. Very useful description is here: http://www.swoops.co.uk/how-to-set-up-log-rotation-for-tomcat-catalina-out-log-file/ or here: http://java.dzone.com/articles/how-rotate-tomcat-catalinaout

Categories : Java

Linux server: Would a cache scheme help reduce hits to 3rd-party server?
I think memcached is a good choice. You can set timeout when you store content to memcached server, if key-value missed, retrieve data from 3rd-part server and store again. There is memcached extension for PHP, check doc here.

Categories : PHP

How to connect from a linux server with php to a database that is in a windows server?
Where the database is doesn't matter for connecting. As long as you use the correct credentials and functions, it will connect. If you see any connection method( PDO, mysqli etc ), it doesn't show the operating system anywhere. Database is running on top of the operating system. check for errors in each step. Example: $link = mysqli_connect("myhost","myuser","mypassw","mybd") or die("Error " . mysqli_error($link)); See http://www.php.net/manual/en/function.mysqli-connect.php.

Categories : PHP

float sql server conversion issue
Floats don't hold the precision correctly, if you need the exact precission then you have to with the decimal data Type . in the above case you can re-define the values as Decimal(38,20) to store the longitude and latitude values. If you are using SQL Server 2008 or later version, SQL Server supports SPATIAL data types, which has the functionality to hold the longitudes and latitudes and also does a lot of calculations on top of them. You can find more about the spatial data types from here http://msdn.microsoft.com/en-us/library/bb933790.aspx

Categories : Sql Server

Upper to Lowercase conversion in SQL Server
Just cast the appropriate side as a uniqueidentifier: select p.ProjectNodeName, i.IterationName from DimTeamProject p inner join DimIteration i on p.ProjectNodeGUID = CAST(i.ProjectGUID as uniqueidentifier) See the demo with a SQL Fiddle.

Categories : SQL

c++ float to sql server DECIMAL correct conversion
In the reference: SQLRETURN SQLBindParameter( SQLHSTMT StatementHandle, SQLUSMALLINT ParameterNumber, SQLSMALLINT InputOutputType, SQLSMALLINT ValueType, SQLSMALLINT ParameterType, SQLULEN ColumnSize, SQLSMALLINT DecimalDigits, SQLPOINTER ParameterValuePtr, SQLLEN BufferLength, SQLLEN * StrLen_or_IndPtr); ... BufferLength [Input/Output] Length of the ParameterValuePtr buffer in bytes. You have specified BufferLength as zero. Looking here, you can see the length of decimal for different precision values: Precision StorageBytes 1-9 5 10-19 9 20-28 13 29-38 17 Therefore, you need to call method SQLBindParameter as: SQLBindPa

Categories : C++

What column is SQL Server datatype conversion failing on?
There is no such an Addin for SQL Server. I suggest to look into Excel/CSV files and date columns inside those to make sure they are valid dates. Infact change to format of cells from general/text to Date. Then if any column has invalid dates you will see in Excel as ######

Categories : Sql Server

SQL Server Implicit Data Type Conversion Challenges
You could create views on the tables which would cast the smallint or tinyint to float and only publish these views to the users. This would keep the small memory usage. The conversion should be no overhead, compared to other database systems that must do that as well if they use a different data type for aggregation.

Categories : Sql Server

SQL Server- Table rows to data dictionary conversion
select t1.col1 as [Key] , t2.col1 as Value from dbo.Table1 t1 join dbo.Table2 t2 on t1.id = t2.id union all select t1.col2 , t2.col2 from dbo.Table1 t1 join dbo.Table2 t2 on t1.id = t2.id union all select t1.col3 , t2.col3 from dbo.Table1 t1 join dbo.Table2 t2 on t1.id = t2.id

Categories : Sql Server

IIS 7.5, ASP.NET MVC. HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfil
I assume you're using Chrome as your web browser? This is the default error page Chrome displays when it receives a 500 HTTP response from the server with no content. You need to find the cause of this error. Open the Event Viewer (Win+R, type "eventvwr.msc", click OK). Expand "Windows Logs" and click "Application". Look for an error or warning that relates to IIS, W3SVC or similar. It's likely an error that's occurring before the request reaches the .NET pipeline.

Categories : Asp Net

Datetime colum to float type conversion is getting issue in sql server
Without knowing your desired output, you could just: Add Float column, populate, drop date column. To my knowledge you cannot add a CONVERT to an ALTER statement, anyone know otherwise?

Categories : SQL

Oops! An Error Occurred The server returned a "500 Internal Server Error" on new actions crated
add route like this in your routing.yml for this action: route_name: url: /route-name-example param: { module: ModuleName, action: exportPostsToProject } and make sure to be on DEV environment

Categories : Symfony2

How to interface with the server to upload files (pictures) from my app
if you see the AFNetworking documentation of the methode multipartFormRequestWithMethod...you have a Dictionnary parameter where you can putt all the infos needed by the Web service. /** Creates an NSMutableURLRequest object with the specified HTTP method and path, and constructs a multipart/form-data HTTP body, using the specified parameters and multipart form data block. See http://www.w3.org/TR/html4/interact/forms.html#h-17.13.4.2 Multipart form requests are automatically streamed, reading files directly from disk along with in-memory data in a single HTTP body. The resulting NSMutableURLRequest object has an HTTPBodyStream property, so refrain from setting HTTPBodyStream or HTTPBody on this request object, as it will clear out the multipart form body stream.

Categories : IOS

solrnet server connection error. The remote server returned an error: (400) Bad Request
This error is probably related to a mismatch with your Solr schema.xml <fields> settings and your Article class. You should be able to debug your program and examine the Bad Request error for more details on what the issue is. Or you can examine the server logs for Solr (in your hosting container e.g. Jetty, Tomcat) for more details as well. Additionally, I would change your Tags property on the Article class to be the more generic ICollection like the multiValued examples on the SolrNet Mapping wiki.

Categories : C#

SQL Server linked server error locating server in sql server 2005
http://blog.sqlauthority.com/2009/05/21/sql-server-fix-error-provider-named-pipes-provider-error-40-could-not-open-a-connection-to-sql-server-microsoft-sql-server-error/ i think this will help you...

Categories : Mysql

C# Input string was not in a correct format. Conversion issue on server not in local machine
Your problem lies in the culture used to convert the decimal. Some cultures use 0,01 and some use 0.01. therein lies the problem. You could use the invariant culture (always 0.01 as input) for example: int www = Convert.ToInt32(Math.Round(Convert.ToDecimal(W.Value, System.Globalization.CultureInfo.InvariantCulture))); int hhh = Convert.ToInt32(Math.Round(Convert.ToDecimal(H.Value, System.Globalization.CultureInfo.InvariantCulture))); int xxx = Convert.ToInt32(Math.Round(Convert.ToDecimal(X.Value, System.Globalization.CultureInfo.InvariantCulture))); int yyy = Convert.ToInt32(Math.Round(Convert.ToDecimal(Y.Value, System.Globalization.CultureInfo.InvariantCulture))); Or you could use your culture, just replace System.Globalization.CultureInfo.InvariantCulture with CultureInfo.CreateSpec

Categories : C#

Get relevant local IP address/interface for sending to a specific server
Maybe it's no possible in your case, but nevertheless: the server gets to know the IP address when the connection is being established, it therefore is more like metadata than content. It should not be a big deal to get the sender IP address.

Categories : C++

.ashx - The remote server returned an error: (500) Internal Server Error
Try to use WebClient client = new WebClient(); client.Headers["Content-type"] = @"application/json"; Stream data = client.OpenRead(yoururl); ; StreamReader reader = new StreamReader(data); string responseFromServer = reader.ReadToEnd(); The above works fine for me.

Categories : C#

Handling The remote server returned an error: (500) Internal Server Error
It may not be wise to repeat the request. There are instances where a request fails to return but the receiving server may have processed it, as a result, a retry would result in duplication. It would be better if you raised an error response from this post method - By raising a specific exception - then it is the responsibility of the calling method on deciding what to do. It may choose to repeat the request or ignore it or try to validate it was received before attempting to send again.

Categories : C#

Best Linux server for Worklight?
For a list of supported Linux distributions, visit: Worklight 5.0.5 system requirements Worklight 5.0.6 system requirements Worklight 6.0.0 system requirements

Categories : Linux



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