on-internet

Best high-level language to call Fortran subroutines from?

I was wondering which high-level langunage allows the easiest manner in which to call Fortran subroutines? I currently use MATLAB and calling MEX files seems to be relatively complicated compared to other languages. I'm particularly interested in how the following compares in terms of getting "up and running" quickly: *Python via f2py *R via ? *MATLAB via MEX files Another way of asking this would be "If you were to start over and learn a new language, which one would you choose if your objective was calling Fortran subroutines?" I'm trying to getbthe "best of both worlds" i.e. having good dat

Join the discussion →

How to map two virtual adresses on the same physical memory on linux?

I'm facing a quite tricky problem. I'm trying to get 2 virtual memory areas pointing to the same physical memory. The point is to have different page protection parameters on different memory areas. On this forum, the user seems to have a solution, but it seems kinda hacky and it's pretty clear that something better can be done performance-wise : http://www.linuxforums.org/forum/programming-scripting/19491-map-two-virtual-memory-addres-same-physical-page.html As I'm facing the same problem, I want to give a shot here to know if somebody has a better idea. Don't be afraid to mention the dirty d

Join the discussion →

C# extend indexer?

Is it possible to use extension methods to extend an indexer? I want to be able to get cell's value from DataGridViewCell of given DataGridViewRow using header text like this: object o = row["HeaderText"]; I have this code public static class Ext { public static object Cells(this DataGridViewRow r, string header) { foreach (DataGridViewCell c in r.Cells) { if (c.OwningColumn.HeaderText == header) { return c.Value; } } return null; } } and I want similar indexer. Thanks.

Join the discussion →

Today's Date in an Adobe Form

I'm using Acrobat X Pro and would like my form to open with today's date. I am having a hard time finding a script that works in Acrobat X. Appreciate any help. I found this response by Paque in July 2010: Remove your script and replace it with the following document javascript: var f = this.getField("wells_datefield"); if (!f.value) f.value = util.printd ("m/d/yyyy", new Date()); Save your form and open it, and the date should pop right in there. When making the document javascript, remember to not put it inside a function. One way of doing that is the following. In the Acrobat menu: Advanced

Join the discussion →

Delphi: sliding (animated) panel

Is there a sliding (animated) panel component for Delphi? For instance it can be found in Raize Components (a left panel with a "Hot Spot" or hide/show button). I need not a resizeable panel but a panel that can slide horizontally and smoothly from the left to the right + that has a hide/show button (it's not a big deal if without that button). Thanks!

Join the discussion →

Problem with JW Player Embed Code - Flash with HTML5 Fallback

I'm trying to setup my page to play a video with the following specs: Use licensed JW player Flash player to be used, HTML5 fall back I'd also like to provide alternative file formats for the HTML5 fallback (ogg, webm) Use the RTMP streaming method to deliver the videos via cloudfront Here is a link to my test page: http://coachesmarketingcenter.com/test_new_ppts/index3.html Here is the embed code I'm currently using: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta

Join the discussion →

How to performance analyse GNU Make files

We have a lot of GNU Make-files. I´d like to time each target used during build to identify any performance bottlenecks. Is there a tool or technique to do this in a convenient and automatic way? I might like to parse these results to keep tabs on the performance factor as the build changes and grows (but it´s already quite large and complex).

Join the discussion →

Give background color to excel sheet in asp.net

I am performing export to excel in asp.net without using any third party controls. How can i give background color to my exported excel sheet? The background color may (not sure) be different according to some cells range. Say from Cell 0- 5 (Cell A-E in excel) is red color, 6-12 is green and so on and so forth. How can i achieve the same? public static void DataSetToExcel(System.Data.DataSet dtExport, System.Web.HttpResponse response, string strFileName) { //Clean up the response Object response.Clear(); response.Charset = ""; //Set the respomse MIME type to excel response.ContentType = "appl

Join the discussion →

debugging in netbeans not working

I've a java project configured in netbeans 7.0.1 with tomcat 6.0. When I try to debug it , the project starts but i'm not able to connect to tomcat. The browser shows the busy icon and there is no errors in tomcat console. When I click on the stop debug button it gives the login page immediately. In short debugging is not working.

Join the discussion →

git add only modified changes and ignore untracked files

I ran "git status" and listed below are some files that were modified/or under the heading "changes not staged for commit". It also listed some untracked files that I want to ignore (I have a ".gitignore" file in these directories). I want to put the modified files in staging so I can commit them. When I ran "git add .", it added the modified files AND the files I want to ignore to staging. How do I add only the modified files and ignore the untracked files if presented with the git status below. Also, are my ".gitignore" files working properly? $ git status # On branch addLocation # Changes n

Join the discussion →

Why are references to const necessary to avoid copying parameters

According to Wikipedia, function calls don't copy parameters which are are references to a const type: void f_slow(BigObject x); void f_fast(const BigObject& x); f_slow(y); // slow, copies y to parameter x f_fast(y); // fast, gives direct read-only access to y Why does the reference need to be const? Wouldn't a non-const reference accomplish the same: void f_should_be_fast(BigObject& x);

Join the discussion →

What is __future__ in Python used for and how/when to use it, and how it works

The __future__ module frequently appears in Python modules. I do not understand what __future__ is for and how/when to use it even after reading the Python's __future__ doc. Can anyone explain with examples? A few answers regarding the basic usage of __future__ I've received seemed correct. However, I need to understand one more thing regarding how __future__ works: The most confusing concept for me is how a current python release includes features for future releases, and how a program using a feature from a future release can be compiled successfully in the current version of Python. I am gu

Join the discussion →

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 →

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 →

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 →
Older stories