Daily Archives

Articles indexed Friday May 7 2010

Page 7/110 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • Go programming: How to get from cgo to exe

    - by Kawili-wili
    From a basic test program. . . package main /* #include <stdio.h> static void test() { printf("hello world"); } */ import "C" func main() { C.test(); } I do "cgo hello_cgo.go" and get: _cgo_.o _cgo_defun.c _cgo_gotypes.go hello_cgo.cgo1.go hello_cgo.cgo2.c How do I go about compiling from here to an exe?

    Read the article

  • Ajax call with jQuery in ASP.NET MVC does not pass parameters

    - by desmati
    The Route is: routes.MapRoute( "Ajax", // Route name "BizTalk/Services/{action}", // URL with parameters new { // Parameter defaults controller = "BizTalk" } ); My Controller is: public JsonResult AjaxTest(string s, int i, bool b) { return Json("S: " + s + "," + "I: " + i + "," + "B: " + b); } My jQuery Code: $(document).ready(function() { $("#btn_test").click(function() { var s = "test"; var i = 8; var b = true; $.ajax({ type: "POST", cache: false, url: "/BizTalk/Services/AjaxTest", data: { i: i, s: s, b: b }, contentType: "application/json; charset=utf-8", dataType: "json", success: function(msg) { } }); }); });

    Read the article

  • javascript - Detect if Google Analytics is loaded yet?

    - by Geuis
    I'm working on a project here that will store some info in Google Analytics custom variables. The script I'm building out needs to detect if GA has loaded yet before I can push data to it. The project is being designed to work across any kind of site that uses GA. The problem is reliably detecting if GA has finished loading or not and is available. A couple of variabilities here: 1) There's multiple methods of loading GA. Older scripts from the Urchin days up to the latest asynchronous scripts. Some of these are inline, some are asynchronous. Also, some sites do custom methods of loading GA, like at my job. We use YUI getScript to load it. 2) Variable-variable names. In some scripts, the variable name assigned to GA is "pageTracker". In others, its "_gaq". Then there's the infinity of custom variable names that sites could be using for their implementation of GA. So does anyone have any thoughts on what might be a reliable way to check if Google Analytics is being used on the page, and if it's been loaded?

    Read the article

  • Getting really weird long Contact Group names

    - by Pentium10
    When looking at the Contact Groups on Google Contacts or in the People application of my HTC Legend phone, I get the groups names ok eg: Friends, Family, VIP, Favorite etc... But in my application I get really wrong names such as "Family" became "System Group: Family" "Friends" became "System Group: Friends" "Favorite" became "Favorite_5656100000000_3245664334564" I use the below code to read these values: public Cursor getFromSystem() { // Get the base URI for the People table in the Contacts content // provider. Uri contacts = ContactsContract.Groups.CONTENT_URI; // Make the query. ContentResolver cr = ctx.getContentResolver(); // Form an array specifying which columns to return. String[] projection = new String[] { ContactsContract.Groups._ID, ContactsContract.Groups.TITLE, ContactsContract.Groups.NOTES }; Cursor managedCursor = cr.query(contacts, projection, ContactsContract.Groups.DELETED + "=0", null, ContactsContract.Groups.TITLE + " COLLATE LOCALIZED ASC"); return managedCursor; } What I am missing?

    Read the article

  • Why do Lua arrays(tables) start at 1 instead of 0?

    - by AraK
    Hi, I don't understand the rational behind the decision of this part of Lua. Why does indexing start at 1? I have read(as many others did) this great paper. It seems to me a strange corner of a language that is very pleasant to learn and program. Don't get me wrong, Lua is just great but there has to be an explanation somewhere. Most of what I found(on the web) is just saying the index starts at 1. Full stop. It would be very interesting to read what its designers said about the subject. Note that I am "very" beginner in Lua, I hope I am not missing something obvious about tables.

    Read the article

  • python xml.dom.minidom.Attr question

    - by rudy
    Getting attributes using minidom in Python, one uses the "attributes" property. e.g. node.attributes["id"].value So if I have <a id="foo"></a>, that should give me "foo". node.attributes["id"] does not return the value of the named attribute, but an xml.dom.minidom.Attr instance. But looking at the help for Attr, by doing help('xml.dom.minidom.Attr'), nowhere is this magic "value" property mentioned. I like to learn APIs by looking at the type hierarchy, instance methods etc. Where did this "value" property come from?? Why is it not listed in the Attr class' page? The only data descriptors mentioned are isId, localName and schemaType. Its also not inherited from any superclasses. Since I'm new to Python, would some of the Python gurus enlighten?

    Read the article

  • Use Javascript RegEx to extract column names from SQLite Create Table SQL

    - by NimbusSoftware
    I'm trying to extract column names from a SQLite result set from sqlite_master's sql column. I get hosed up in the regular expressions in the match() and split() functions. t1.executeSql('SELECT name, sql FROM sqlite_master WHERE type="table" and name!="__WebKitDatabaseInfoTable__";', [], function(t1, result) { for(i = 0;i < result.rows.length; i++){ var tbl = result.rows.item(i).name; var dbSchema = result.rows.item(i).sql; // errors out on next line var columns = dbSchema.match(/.*CREATE\s+TABLE\s+(\S+)\s+\((.*)\).*/)[2].split(/\s+[^,]+,?\s*/); } }, function(){console.log('err1');} ); I want to parse SQL statements like these... CREATE TABLE sqlite_sequence(name,seq); CREATE TABLE tblConfig (Key TEXT NOT NULL,Value TEXT NOT NULL); CREATE TABLE tblIcon (IconID INTEGER NOT NULL PRIMARY KEY,png TEXT NOT NULL,img32 TEXT NOT NULL,img64 TEXT NOT NULL,Version TEXT NOT NULL) into a strings like theses... name,seq Key,Value IconID,png,img32,img64,Version Any help with a RegEx would be greatly appreciated.

    Read the article

  • Google Chrome Extension

    - by Jamie
    Is there a way to replace inside the DOM of a page using the replace() in javascript In the source code I want to replace: <div class="topbar">Bookmark Us</div> to <div class="topbar"><span class="larger-font">Bookmark Us</span></div> When a Google Chrome extenstion is on the matched website of a URL and it will do the above. Any page that matches: http://www.domain.com/support.php Thanks.

    Read the article

  • Refresh a Div that has a Google ad inside it

    - by Abs
    Hello all, I have a div that holds a google ad. My website is mostly AJAX and there is no need for a browser refresh. That means my ads will not refresh either, which isnt ideal, a user staring at one ad all day. So I wanted a way to refresh a particular div on a page. I found many solutions but they didnt work. For example, using JQuery's html function: $("#ads").html("google ad script here"); This managed to refresh the whole page no idea how. I can also make an AJAX request to a HTML page that contains the google ad but I am guessing it will have the same effect as the above attempt. I do not want to use iFrames. Is there any other option open to me? My pea brain can not think of anymore. :) Thanks you for any help. EDIT: It is allowed since I will be initiating the refresh only when a user clicks a link. A prime example is Yahoo Mail - their new AJAX mailbox uses this same method, when a user clicks a link then a new ad is shown.

    Read the article

  • 3D plotting in Matlab

    - by Jill
    I'm using the subplot and then surf functions to generate images in 3D in Matlab. How do I get rid of the axes and axis' gridlines and change the color to all yellow or all green or something like that? Thanks.

    Read the article

  • Change parent class of dom object via css selectors

    - by Le_Coeur
    Can i change parent class of some dom object on hover event via CSS selectors? For example I have such block: <span class="wBlock" > <span class="wText">Text</span> <span class="wLink"/> <\/span> and if i move mouse to span "wLink" span "wBlock" must be changed, and if i move out than it must be the same as at the begining .wLink{ padding-right:15px; background:url(/img/addlink.png) center right no-repeat; cursor:pointer; } .wText{ background-color: #1BE968; } It's something like this and if i move my cursor to plus text highlight must be changed to yellow

    Read the article

  • Cannot spawn an erlang supervisor from the shell.

    - by drfloob
    I've implemented a gen_server and supervisor: test_server and test_sup. I want to test them from the shell/CLI. I've written their start_link functions such that their names are registered locally. I've found that I can spawn the test_server from the command line just fine, but a spawned test_sup does nothing whatsoever. Why is this? For example, I can spawn a test_server by executing: 1> spawn(test_server, start_link, []). <0.39.0> 2> registered(). [...,test_server,...] I can interact with the server, and everything appears fine. However, if I try to do the same thing with test_sup, no new names/Pids are registered, and it looks like my test_server was not spawned at all. I'd assume I coded an error in my supervisor, but this method of starting my supervisor works perfectly fine: 1> {ok, Pid}= test_sup:start_link([]). {ok, <0.39.0>} 2> unlink(Pid). true 3> registered(). [...,test_server,test_sup,...] Why is it that I can spawn a gen_server but not a supervisor?

    Read the article

  • Is it possible to drag windows between workspaces when using Compiz?

    - by Mike Stone
    When I used Metacity, I could drag windows between workspaces using the small icon view of my workspaces. I recently started using Compiz for all the cool desktop effects, however this drag and drop feature isn't working. I use the cube effect for switching workspaces, but I noticed the wall effect doesn't allow it either. Is this just a missing feature from Compiz or is there a setting somewhere that I can enable it? I know that I can enable dragging windows across edges to the next workspace, and the expose feature to drag windows between workspaces. However, the drag and drop on the icon view is really powerful, and I would love to have it back along with all the great Compiz special effects.

    Read the article

  • Sharing Clipboard between non-networked PC's (KVM style)

    - by Glinkot
    Hi! My situation is this: I have a PC which is joined to a domain, and another computer 'outside' that network. I'd like to use a KVM style device to switch between them, but sharing the clipboard would be fantastic. When searching for such a thing I found various patents for this type of thing (eg http://www.freepatentsonline.com/6901455.html) but can't see one actually for sale anywhere! Anyone know of one? Or an alternative suggestion - eg a program that uses USB or another method to connect two PC's and share clipboard without ethernet? Thanks!

    Read the article

  • How to know the full path of a file using SSH?

    - by Roy
    Hi I am beginner for SSH stuff but i want to dump a big sql file and for that i need to be able to navigate to the appropriate path in my hosting account. I managed to login to SSH and i typed pwdbut it gave me a shared hosting pathway like /home/content/r/o/s/roshanjonah How Can i go to the path where i upload my files to...i use FTP but in FTP path it just shows / so i cannot go any further back than that...so using SSH how can i come to this path in ftp... Thanks Roshan

    Read the article

  • SQL string manipulation to return multiple rows

    - by Andy Jacobs
    I'm an experienced programmer, but relatively new to SQL. We're using Oracle 10 and 11. I have a system in place using SQL that combines actual rows with virtual rows (e.g. "SELECT 1 from DUAL") doing unions and intersects as needed, which all seems to work. My problem is that I need to combine this system which is expecting rows of data, with new data that will have the data in (let's say for simplification) comma delimited strings. So I think what I need is a way to convert a string like: "5,6,7,8" into 4 rows with one column each, with "5" in the first row, "6" in the second, etc. In other languages, I'd do a "Split" with comma as the delimiter. Of course, the data won't always have 4 entries. There's a second question, but I'll ask it separately. But I suspect it will simplify things, if possible, if the solution to the above could be used as a table in another SQL statement (i.e., to work with my existing system). Thanks for any help.

    Read the article

  • Parsing html for domain links

    - by Hallik
    I have a script that parses an html page for all the links within it. I am getting all of them fine, but I have a list of domains I want to compare it against. So a sample list contains list=['www.domain.com', 'sub.domain.com'] But I may have a list of links that look like http://domain.com http://sub.domain.com/some/other/page I can strip off the http:// just fine, but in the two example links I just posted, they both should match. The first I would like to match against the www.domain.com, and the second, I would like to match against the subdomain in the list. Right now I am using url2lib for parsing the html. What are my options in completely this task?

    Read the article

  • [C#] how do I get the height of a rich text content after word wrap?

    - by Led
    Question A. Given 1. A string in rich text format that may have paragraph, tabs, space, line break, indentation, (or even image?) 2. A width for the word wrapping rich text control/editor How do I know the height of the content after it have performed all the word wrapping? Is there something like int MeasureRichTextHeightAfterWordWrap(string aRichTextContent, int aWidth)? Otherwise how does those rich text control know how much to autosize? Do I have to actually place the content on a dummy rich text control and get its height afterwards? Question B. Similar to question A but in plain text onto a plain text memo/control/editor. And manually draw string with manually calculated indentations, breaks, word wrappings. Is it easier or harder?

    Read the article

  • Adsense in a ajax based application?

    - by prashant_sp
    How do I add adsense or other ads in a asp.net ajax/ajax based application ? (ex. ra-ajax samples page) or GWT Is creating an iframe a viable solution? As stated below, placing adsense script is easy. But the google bot wont be able to scan my ajax based page, as all of the content is javascript. There wont be contextual ads. So wont be able to monetize. It would be great for static ads. Any idea/inputs?

    Read the article

  • Javascript: achieving the Google Ad AJAX effect

    - by johnnietheblack
    I need to create a portable script to give to others to implement on their websites that will dynamically show content from my database (MySQL). I know AJAX has a cross-site problem, but it seems that Google's ad's somehow manage the effect in a cross-browser / cross-site fashion. Knowing that I have to give people a simple cut/paste snippet to put in their website...how can I achieve this? How did Google?

    Read the article

  • VSTS 2008 Load testing, Is it any good?

    - by anshu
    I have already spent couple of weeks trying to use this tool to generate some webtest and load test. But every day it throws a weird problem for which I do not find anything in document. examples: Hidden variables (_lastfocus) not found in the context error. Today, all of sudden it is now refusing to run some of the webtest which are part of the test mix in my load test run (is working fine with another load test). Are enterprise level, expensive tools are only good? (like loadrunner, silkperformer etc).

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >