on-internet

Java application on web

I've made an application with Java which is a game. I'm wondering if it is possible to put this game on html page or similiar in order to play it with a webbrowser. The GUI has been built with JFrame, JPanel etc etc.

Join the discussion →

How can I auto-elevate my batch file, so that it requests from UAC administrator rights if required?

I want my batch file to only run elevated. If not elevated, provide an option for the user to relaunch batch as elevated. I'm writing a batch file to set a system variable, copy two files to a Program Files location, and start a driver installer. If a Windows user (UAC enabled *) and even if they are a local admin) runs it without right-clicking and selecting "Run as Administrator", they will get 'Access Denied' copying the two files and writing the system variable. I would like to use a command to automatically restart the batch as elevated if the user is in fact an administrator. Otherwise,

Join the discussion →

Windows/php pclose and popen issue

Here is my code: <?php require_once 'dbconnect.php'; function execInBackground($cmd) { if (substr(php_uname(), 0, 7) == "Windows"){ pclose(popen("start /B ". $cmd, "r")); } else { exec($cmd . " > /dev/null &"); } } if(isset($_GET['date'])){ //CHECK LOCK $checkLock = "Select IS_FREE_LOCK('overnight') as `lock`;"; $result = mysql_query($checkLock) or die(mysql_error()); while($information = mysql_fetch_array($result)){ if($information['lock'] == 0){ die('Overnight is already running, please try again later.'); } } execInBackground("php overnightQueries.php {$_GET['date']}"); //echo "<pre>".print

Join the discussion →

What does it mean to hydrate an object?

When someone talks about hydrating an object, what does that mean? I see a Java project called Hydrate on the web that transforms data between different representations (RDMS to OOPS to XML). Is this the general meaning of object hydration; to transform data between representations? Could it mean reconstructing an object hierarchy from a stored representation?

Join the discussion →

Sending Form Data Through XMLHTTP in VBA

I'm trying to send form data through the XMLHTTP object to get a webpage. I am using Excel 2010. The website is http://espn.go.com/mlb/players. I'm trying to search for a certain player through the searchbox (e.g. Fister). Here is the source code between the form tags. <form id="searchBox" name="searchBox" action="http://search.espn.go.com/results" method="get" accept-charset="utf-8" style="color: #999999;"> <div class="clearfix"> <input autocomplete="off" class="text" type="text" placeholder="Search" name="searchString" id="searchString" /> <input type="hidden" name="page" id="page" value="nu

Join the discussion →

Parsing vCard in php

Hi i want to parse vCard format to a array. User may upload vCard 2,1 or vCard 3.0 i should be able to parse it. I just want the email with names in the vCard in to a php array. i have tried vcardphp.sourceforge.net. <?php require("vcard.php"); $cards = parse_vcards(file('sample.txt')); print_r($cards); function parse_vcards($lines) { $cards = array(); $card = new VCard(); while ($card->parse($lines)) { $property = $card->getProperty('N'); if (!$property) { return ""; } $n = $property->getComponents(); $tmp = array(); if ($n[3]) $tmp[] = $n[3]; // Mr. if ($n[1]) $tmp[] = $n[1]; // John if ($n[

Join the discussion →

POST binary file using curl

I have a basic upload form which I would like to emulate using cURL. <?php $params = array( 'api_key' => $api_key, 'api_secret' => $api_secret, 'urls' => null, 'uids' => 'all', 'detector' => 'Aggressive', 'namespace' => 'face.auth'); $action = $url . '?' . http_build_query($params); ?> <form enctype="multipart/form-data" method="post" action="<?php echo $action; ?>"> <input type="file" name="upload" id="upload"> <input type="submit" /> </form> I know how to post using cURL, but I'm not sure how to post the image data (this data is stored as binary data in a database, lets call it $binary). Pas

Join the discussion →

What's the meaning of * (asterisk) in XAML ColumnDefinition?

What is the meaning of * (asterisk) in the XAML below? <ColumnDefinition Width="0.07*"/> <Grid Height="100" HorizontalAlignment="Left" Margin="102,134,0,0" Name="grid1" VerticalAlignment="Top" Width="354"> <Grid.ColumnDefinitions> <ColumnDefinition Width="40*" /> <ColumnDefinition Width="314*" /> </Grid.ColumnDefinitions> </Grid>

Join the discussion →

How To Create Reports Using Crystal Reports in Visual Studio 2010

I am new to Visual Studio 2010 C#. I'm creating an application which creates a report. The information that will be displayed in the report is from the MySQL Server. I already installed the Crystal Reports. However, I do have some problems with getting data from MySQL because I can't find the data from MySQL. The data shown in the Report Creation Wizard in not the database files in MySQL but the forms I created in C#. Please help. Screenshots:

Join the discussion →

How to use addView in ViewGroup?

I wanted to use a ViewGroup class and add views into it. So how can we accomplish this?? Something like this :: public class DrawView extends View { private static final String TAG = "DrawView"; List<Point> points = new ArrayList<Point>(); Paint paint = new Paint(); public DrawView(Context context) { //2 super(context); System.out.println("drawwwwwwwwwwwwwwwwwwwwwconnnnnnnnnnnnn"); setFocusable(true); setFocusableInTouchMode(true); paint.setColor(Color.MAGENTA); paint.setAntiAlias(true); } @Override public void onDraw(Canvas canvas) { System.out.println("drawwwwwwwwwwwwwwwwwwwww"); for (Point

Join the discussion →

How can I change Eclipse theme?

I want to change Eclipse theme like this Eclipse Dark Theme: I try to do all step in this page but eclipse theme not changed (but eclipse editor changed). I want to change all part of eclipse IDE change to black color, not only eclipse's editor.

Join the discussion →

Calling $this->library('libraryName', $config) in CodeIgniter does not load/instantiate the library

I'm using an older version of CodeIgniter when the application folder was still in system/application. I have pulled the application folder out of system such that the application folder is now at the same level as system. BEFORE: /system/application/ NOW: /application/ /system/ Question: How do I now load libraries? In one of my controllers, I tried this: $config['protocol'] = 'sendmail'; $config['mailpath'] = '/usr/sbin/sendmail'; $config['mailtype'] = 'html'; $config['charset'] = 'iso-8859-1'; $config['wordwrap'] = TRUE; $this->library('email', $config); The application dies when it tries t

Join the discussion →

How to install CakePHP in xampp?

I am very new to CakePHP and want to know how to install it. Also, can you tell me if the installation process is similar to Joomla! installation. Does CakePHP have an administration interface?

Join the discussion →

SharePoint 2010 SecurityTokenService error

We have SharePoint 2010 in our testing environment, working a with a custom STS (federation , and all sites are claimsbased). When we try to login to the site, we are redirected to the sts login page, we put in the credentials, we are directed to siteurl/_trust and it stays here for a long time and it times out. In the windows application error, this is what we see: Exception type: TimeoutException Exception message: The HTTP request to 'http://localhost:32843/SecurityTokenServiceApplication/securitytoken.svc' has exceeded the allotted timeout of 00:00:59.9840000. The time allotted to this ope

Join the discussion →

How to investigate " Attempt to free unreferenced scalar"

A Perl script (which uses a load of locally-written modules, and is under active development) has just started producing sporadic Attempt to free unreferenced scalar: SV 0xa6e685c, Perl interpreter: 0x96d9008 during global destruction. messages. This are always repeatable, in the sense that a particular sequence of commands always produces the message if it ever does, but I've not managed to isolate a simple or stand-alone case which elicits it. In particular, I haven't yet seen it when running the script from the Perl debugger (I can get it when debugging a script which uses IPC::Open3 to run

Join the discussion →

How to get DPI in C# .NET?

I'm trying to build a Windows Forms application using C#. How do I get the DPI in .NET? I've read before that there is DPIX and DPIY, which can be used in .NET to get the current DPI. Is that correct? Thanks all.

Join the discussion →

How can I specify a vector parameter so that values may change but the vector structure won't?

In defining a function in an interface : virtual void ModifyPreComputedCoeffs ( std::vector < IndexCoeffPair_t > & model_ ) = 0; we want to specify that the vector model_ should not be altered in the sense push_back etc operations should not be done on the vector, but the IndexCoeffPair_t struct objects in the model_ could be changed. How should we specify that ? Declaring the parameter as const, like so: virtual void ModifyPreComputedCoeffs ( const std::vector < IndexCoeffPair_t > & model_ ) = 0; does not work I think.

Join the discussion →

Validate an IP and CIDR combo

I have a user submitted IP address with netmask, and I need to make sure it is valid. For instance, if the user submits: 10.113.0.0/14, I need to flag it as invalid, because the /14 block for that IP range begins with 10.112.0.0. How can I do this in PHP?

Join the discussion →

Negative weights using Dijkstra's Algorithm

I am trying to understand why Dijkstra's algorithm will not work with negative weights. Reading an example on Shortest Paths, I am trying to figure out the following scenario: 2 A-------B \ / 3 \ / -2 \ / C From the website: Assuming the edges are all directed from left to right, If we start with A, Dijkstra's algorithm will choose the edge (A,x) minimizing d(A,A)+length(edge), namely (A,B). It then sets d(A,B)=2 and chooses another edge (y,C) minimizing d(A,y)+d(y,C); the only choice is (A,C) and it sets d(A,C)=3. But it never finds the shortest path from A to B, via C, with total length 1. I

Join the discussion →

Fixed position but relative to container

I am trying to fix a div so it always sticks to the top of the screen, using: position: fixed; top: 0px; right: 0px; However, the div is inside a centered container. When I use position:fixed it fixes the div relative to the browser window, such as it's up against the right side of the browser. Instead, it should be fixed relative to the container. I know that position:absolute can be used to fix an element relative to the div, but when you scroll down the page the element vanishes and doesn't stick to the top as with position:fixed. Is there a hack or workaround to achieve this?

Join the discussion →

Why is dereferencing a null pointer undefined behaviour?

According to ISO C++, dereferencing a null pointer is undefined behaviou. My curiosity is, why? Why has the standard decided to declare it undefined behavior? What is the rationale behind this decision? Compiler dependency? Doesn't seem, because according to C99 standard, as far as I know, it is well defined. Machine dependency? Any ideas?

Join the discussion →

Saving a picture from a webcam displayed video in a PictureBox in VB6

I have used a code from the internet to show my webcam in a certain form, however, i dont know how to capture an image and save it automatically to my local disk drive via command button click. would anyone help me ASAP :)) here is my code for the form. Option Explicit Const ws_visible = &H10000000 Const ws_child = &H40000000 Const WM_USER = 1024 Const WM_CAP_EDIT_COPY = WM_USER + 30 Const wm_cap_driver_connect = WM_USER + 10 Const wm_cap_set_preview = WM_USER + 50 Const wm_cap_set_overlay = WM_USER + 51 Const WM_CAP_SET_PREVIEWRATE = WM_USER + 52 Const WM_CAP_SEQUENCE = WM_USER + 62 Const WM_

Join the discussion →

send email without gmail

It seems many solutions involve using a server: smtp.gmail.com and System.Net.Mail.SmtpClient. one two Other's suggest using System.Web.Mail (which many say has been deprecated): here for example. In any case, when I tried it, I wasn't able to get either of the above examples to work. I don't think it's a firewall problem. I am able to use outlook express to send emails through gmail. The error in C# that I am given is that the target machine is actively refusing the connection. Should I attempt to use outlook from the code? Would the best way to do that be through AutoIt or through some dll/c

Join the discussion →

php nusoap return array

I am new to web services. I want to write a generic function in php nusoap server side which can query (fetch data from multiple tables) and return a dynamic array depending upon the results returned from mysql... Here is the server code... require_once ('../lib/nusoap.php'); $server = new soap_server; $server->register('getallbook'); function getallbook() { $conn = mysql_connect('localhost','root',''); mysql_select_db('apexinventry', $conn); $sql = "SELECT * FROM users"; $q = mysql_query($sql); while($r = mysql_fetch_array($q)){ $items[] = array('cd'=>$r['id'],'title'=>$r['userid'],'author'=>

Join the discussion →

Confused over memory mapping

I've recently started getting into low level stuff and looking into bootloaders and operating systems etc... As I understand it, for ARM processors at least, peripherals are initialized by the bootloader and then they are mapped into the physical memory space. From here, code can access the peripherals by simply writing values to the memory space mapped to the peripherals registers. Later if the chip has a MMU, it can be used to further remap into virtual memory spaces. Am I right? What I don't understand are (assuming what I have said above is correct): How does the bootloader initialize the

Join the discussion →

Encapsulate a dynamic number of OR LIKE conditions with parentheses using CodeIgniter's active record methods [duplicate]

I'm producing a query like the following using ActiveRecord SELECT * FROM (`foods`) WHERE `type` = 'fruits' AND `tags` LIKE '%green%' OR `tags` LIKE '%blue%' OR `tags` LIKE '%red%' The number of tags and values is unknown. Arrays are created dynamically. Below I added a possible array. $tags = array ( '0' => 'green'. '1' => 'blue', '2' => 'red' ); Having an array of tags, I use the following loop to create the query I posted on top. $this->db->where('type', $type); //var type is retrieved from input value foreach($tags as $tag): $this->db->or_like('tags', $tag); endforeach; The issue: I need t

Join the discussion →
Older stories