Search Results

Search found 4168 results on 167 pages for 'country codes'.

Page 12/167 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • How to avoid using the plld.exe utility in VS2008 (for linking C++ and Prolog codes)

    - by Joshua Green
    Here is my code in its entirety: Trying "listing." at the Prolog prompt that pops up when I run the program confirms that my Prolog source code has been loaded (consulted). #include <iostream> #include <fstream> #include <string> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <stdafx.h> using namespace std; #include "Windows.h" #include "ctype.h" #include "SWI-cpp.h" #include "SWI-Prolog.h" #include "SWI-Stream.h" int main(int argc, char** argv) { argc = 4; argv[0] = "libpl.dll"; argv[1] = "-G32m"; argv[2] = "-L32m"; argv[3] = "-T32m"; PL_initialise(argc, argv); if ( !PL_initialise(argc, argv) ) PL_halt(1); PlCall( "consult(swi('plwin.rc'))" ); PlCall( "consult('hello.pl')" ); PL_halt( PL_toplevel() ? 0 : 1 ); } So this is how to load a Prolog source code (hello.pl) at run time into VS2008 without having to use plld at the VS command prompt.

    Read the article

  • MIME/IMF error codes?

    - by hack.augusto
    I need to write php code to identify common e-mail errors, like "inbox full" or specially "invalid email name" from email messages, because we need to clear our databases from nonexistent emails. I'm looking the MIME and IMF formats but I didn't find any kind of standard error code, does it exist?

    Read the article

  • android actionbarsherlok demo codes

    - by Guillermo Varini
    I have being using this actionbarsherlok to give some nice style to my app. My doubt is that i can test ABS: fragment code, but i want to check out ABS: Demos code. Is it possible? i cant find it on .zip or web page, just the .apk em i missing something? in case we can not look that code, is there a good repository where they teach the way to implement the new tabs that android want us to use (3.0+++)?

    Read the article

  • mixed declarations and codes

    - by gcc
    When I compile function with "gcc -o dene -Wall -ansi -pedantic-errors dene.c",gcc emits no error.(can you look a line which starts with char ....,in if loop,) static void remove_negation(char *s,char *s1) { char **cmainp=malloc(sizeof(char*)*1); int len=0;int d=0; int i=0; cmainp[0]=malloc(sizeof(char)*300); len=strlen(s); for(i=0;i<len;++i) { if(s[i]=='-') if(i==0 || s[i-1]==',') /*look*/ {char *p=malloc(sizeof(char)*3); /*look*/ ++i; p[0]=s[i]; p[1]='\0'; strcat(s1,","); strcat(s1,p); free(p); continue; } cmainp[0][d]=s[i]; ++d; } cmainp[0][d+1]='\0'; strcpy(cmainp[0],s); free(cmainp[0]); } But,when compile above function being reformatted with gcc,gcc emits that error "dene.c:10: error: ISO C90 forbids mixed declarations and code" static void remove_negation(char *s,char *s1) { char **cmainp=malloc(sizeof(char*)*1); /*look*/ cmainp[0]=malloc(sizeof(char)*300); /*look*/ int len=0;int d=0; int i=0; len=strlen(s); for(i=0;i<len;++i) { if(s[i]=='-') if(i==0 || s[i-1]==',') {char *p=malloc(sizeof(char)*3); ++i; p[0]=s[i]; p[1]='\0'; strcat(s1,","); strcat(s1,p); free(p); continue; } cmainp[0][d]=s[i]; ++d; } cmainp[0][d+1]='\0'; strcpy(cmainp[0],s); free(cmainp[0]); } And last one,gcc emits following errors dene.c:16: error: expected expression before ‘char’ dene.c:20: error: ‘p1’ undeclared (first use in this function) dene.c:20: error: (Each undeclared identifier is reported only once dene.c:20: error: for each function it appears in.) static void remove_negation(char *s,char *s1) { char **cmainp=malloc(sizeof(char*)*1); /*look*/ cmainp[0]=malloc(sizeof(char)*300); /*look*/ int len=0;int d=0; int i=0; len=strlen(s); for(i=0;i<len;++i) { if(s[i]=='-') /*look*/ char *p=malloc(sizeof(char)*3); /*look*/ if(i==0 || s[i-1]==',') { ++i; p[0]=s[i]; p[1]='\0'; strcat(s1,","); strcat(s1,p); free(p); continue; } cmainp[0][d]=s[i]; ++d; } cmainp[0][d+1]='\0'; strcpy(cmainp[0],s); free(cmainp[0]); } question is why there are differences between them.

    Read the article

  • what is problem in the following matlab codes

    - by raju
    img=imread('img27.jpg'); %function rectangle=rect_test(img) % edge detection [gx,gy]=gradient(img); gx=abs(gx); gy=abs(gy); g=gx+gy; g=abs(g); % make it 300x300 img=zeros(300); s=size(g); img(1:s(1),1:s(2))=g; figure; imagesc((img)); colormap(gray); title('Edge detection') % take the dct of the image IM=abs(dct2(img)); figure; imagesc((IM)); colormap(gray); title('DCT') % normalize m=max(max(IM)); IM2=IM./m*100; % get rid of the peak size_IM2=size(IM2); IM2(1:round(.05*size_IM2(1)),1:round(.05*size_IM2(2))) = 0; % threshold L=length( find(IM2>20)) ; if( L > 60 ) ret = 1; else ret = 0; end

    Read the article

  • merging two small pieces of jquery codes

    - by Billa
    Following are two pieces of jquery code. First one prints a text message when clicked on a link, and the second slides down a div when click on a link. I want to merge second code into first one, so that when I click the link, it displays the message (as the first code does), and also slides down the #votebox (as done in second code, and show content in that. I will be very thankful for any help. $("a.vote_up").click(function(){ the_id = $(this).attr('id'); $("span#votes_count"+the_id).fadeOut("fast"); $.ajax({ type: "POST", data: "action=vote_up&id="+$(this).attr("id"), url: "votes.php", success: function(msg) { $("span#votes_up"+the_id).fadeOut(); $("span#votes_up"+the_id).html(msg); $("span#votes_up"+the_id).fadeIn(); //Here, I want to slide down the votebox and content div (from code below). } }); }); The following code slides down votebox div and displays content in it, I want to include that in the above code. $("a.vote_up").click(function(){ var id=$(this).attr("id"); var name=$(this).attr("name"); var dataString = 'id='+ id + '&name='+ name; //I want to include this votebox in above code. $("#votebox").slideDown("slow"); $("#flash").fadeIn("slow"); $.ajax({ type: "POST", url: "rating.php", data: dataString, cache: false, success: function(html){ $("#flash").fadeOut("slow"); //and want to use this div as well. $("#content").html(html); } }); }); Thanks for any help.

    Read the article

  • WPF/C#: How to simplify the use of codes when calling a function (Generating Images)

    - by eibhrum
    I created a function in one of my application that allows to generate an image (in WPF) by getting the 'source path' from the database that I am using: public void ShowImageThumb() { try { cn = new MySqlConnection(); cn.ConnectionString = ConfigurationManager.AppSettings["MyConnection"]; cn.Open(); MySqlCommand cmd = new MySqlCommand(); cmd.Connection = cn; cmd.CommandType = CommandType.Text; cmd.CommandText = "SELECT thumb FROM album WHERE thumbNo=1"; MySqlDataAdapter adp = new MySqlDataAdapter(); adp.SelectCommand = cmd; DataTable dt = new DataTable(); adp.Fill(dt); MySqlDataReader r = cmd.ExecuteReader(); while (r.Read()) { BitmapImage bmi1 = new BitmapImage(new Uri(r[0].ToString(), UriKind.Relative)); image1.Source = bmi1; } r.Close(); cn.Close(); } catch (Exception err){ System.Windows.MessageBox.Show(err.Message); } finally { } } Take a look on my SQL statement. I put a WHERE thumbNo=1 which allows the function to get 1 record. You see, I do have at least 10 records - file paths listed in that table. I just wanna ask if there's a possible way to make my SQL statement something like this: SELECT thumb FROM album; while having this piece of code inserted in my function: BitmapImage bmi2 = new BitmapImage(new Uri(r["second record?"].ToString(), UriKind.Relative)); image2.Source = bmi2; //something like this BitmapImage bmi3 = new BitmapImage(new Uri(r["third record?"].ToString(), UriKind.Relative)); image3.Source = bmi3; //something like this and so on and so forth, without ending up creating 10 different functions for 10 records. ShowImageThumb2(); . . // will not do this . ShowImageThumb10(); Sorry for the lengthy post. I hope somebody could answer back. Thanks!

    Read the article

  • BULK SMS, Long Codes (VMN MSIDN), T-mobile?

    - by John
    Does any US wireless carrier offer individuals or companies with a direct connection to the SMSC? The number is 747-772-3101 (repalce 7's with 6's) This number is registered to t-mobile, also verified by t-mobile to be a valid subscriber sending 160,000+ text messages monthly and that all they have is an unlimited text messaging plan on top of the cheapest voice plan. This company of the number verified to me that they don't use gsm modems as they are too slow. So I know it's possible but who would I contact, Sales or anyone else reachable through a 1-800 is ignorant to these services and developer.t-mobile is worthless and doesn't reply to emails. Any info??

    Read the article

  • What does ZIP stand for (the compression format, not the postal codes)

    - by codymanix
    Does anybody know for what the acronym ZIP stands for which was and is used in programs like PKZIP and GZIP? There is a compression algorithm named Lempel-Ziv-Welch-Algorithm (LZW) maybe the guy named Ziv invented together with other people ZIP? I cannot find anything about it, maybe its not an abbreviation but instead it just means "to zip files" but I think originally there was more about it..

    Read the article

  • Where can I find sample XHTML5 source codes?

    - by Bytecode Ninja
    Where can I find sample *X*HTML 5 pages? I mainly want to know if it is possible to mix and match XHTML 5 with other XML languages just like XHTML 1 or not. For example is something like this valid in XHTML 5? <!DOCTYPE html PUBLIC "WHAT SHOULD BE HERE?" "WHAT SHOULD BE HERE?"> <html xmlns="WHAT SHOULD BE HERE?" xmlns:ui="http://java.sun.com/jsf/facelets"> <head> <title><ui:insert name="title">Default title</ui:insert></title> <link rel="stylesheet" type="text/css" href="./css/main.css"/> </head> <body> <div id="header"> <ui:insert name="header"> <ui:include src="header.xhtml"/> </ui:insert> </div> <div id="left"> <ui:insert name="navigation" > <ui:include src="navigation.xhtml"/> </ui:insert> </div> <div id="center"> <br /> <span class="titleText"> <ui:insert name="title" /> </span> <hr /> <ui:insert name="content"> <div> <ui:include src="content.xhtml"/> </div> </ui:insert> </div> <div id="right"> <ui:insert name="news"> <ui:include src="news.xhtml"/> </ui:insert> </div> <div id="footer"> <ui:insert name="footer"> <ui:include src="footer.xhtml"/> </ui:insert> </div> </body> </html> Thanks in advance.

    Read the article

  • What is the difference between these codes?

    - by dhaliwaljee
    <input type='text' id='txt' name='txtName' size='20' value='testing'/> <script type="text/javascript" language='javascript'> var val = document.getElementsByName('txtName'); alert(val[0].value); alert(window.txtName.value); </script> In above code we are using alert(val[0].value); alert(window.txtName.value); these two ways for getting value from object. What is the difference between both ways and which way is best.

    Read the article

  • Grails remoteLink handling error codes

    - by soybie
    I'm on grails 1.3.6 and I see the following behavior. <g:javascript library="prototype" /> ... <g:remoteLink action="punch" id="${personInstance.id}" update="damage_${personInstance.id}" on401="alert('foo!');"> generates: <a on401="alert('foo!');" onclick="new Ajax.Updater('damage_5','/blah/person/punch/5',{asynchronous:true,evalScripts:true});return false;" href="/blah/person/punch/5"></a> "on401" isn't a supported event attribute for an anchor tag, so is this a bug in grails?

    Read the article

  • Sitecore E-Commerce Module - Discount/Promotional Codes

    - by Zachary Kniebel
    I am working on a project for which I must use Sitecore's E-Commerce Module (and Sitecore 6.5 rev. 120706 - aka 'Update 5') to create a web-store. One of the features that I am trying to implement is a generic promotional/discount code system - customer enters a code at checkout which grants a discount like 'free shipping', '20% off', etc. At the moment, I am looking for some guidance (a high-level solution, a few pseudo-ideas, some references to review, etc) as to how this can be accomplished. Summary: What I am looking for is a way to detect whether or not the user entered a promo code at a previous stage in the checkout line, and to determine what that promo code is, if they did. Progress Thus Far: I have thoroughly reviewed all of the Sitecore E-Commerce Services (SES) documentation, especially "SES Order Line Extension" documentation (which I believe will have to be modified/extended in order to accomplish this task). Additionally, I have thoroughly reviewed the Sitecore Community article Extending Sitecore E-Commerce - Pricing and believe that it may be a useful guide for applying a discount statically, but does not say much in the way of applying a discount dynamically. After reviewing these documents, I have come up with the following possible high-level solution to start from: I create a template to represent a promotional code, which holds all data relevant to the promotion (percent off, free shipping, code, etc). I then create another template (based on the Product Search Group template) that holds a link to an item within a global "Promotional Code" items folder. Next, I use the Product Search Group features of my new template to choose which products to apply the discount to. In the source code for the checkout I create a class that checks if a code has been entered and, if so, somehow carry it through the rest of the checkout process. This is where I get stuck. More Details: No using cookies No GET requests No changing/creating/deleting items in the Sitecore Database during the checkout process (e.g., no manipulation of fields of a discount item during checkout to signal that the discount has been applied) must stay within the scope of C# Last Notes: I will update this post with any more information that I find/progress that I make. I upgrade all answers that are relevant and detailed, thought-provoking, or otherwise useful to me and potentially useful to others, in addition to any high-level answers that serve as a feasible solution to this problem; even if your idea doesn't help me, if I think it will help someone else I will still upgrade it. Thanks, in advance, for all your help! :)

    Read the article

  • Java: Are these 2 codes the same?

    - by Kevin Duke
    for (Player p : players) { p.addCard(deck.dealCard()); p.addCard(deck.dealCard()); } and for (int i = 0; i < players.size() ; i++) { Player p = players.get(i); p.addCard(deck.dealCard()); p.addCard(deck.dealCard()); } The second code yeilds a null pointer exception, what can be done to make the bottom one equivalent ?

    Read the article

  • How does Facebook codes their Cropping tool?

    - by Trip
    I ask this because I am currently trying to work out my own technique, and there are huge strategic hangups for the entire site when your begin this. Of them are: Using jCrop and rMagick, it takes up a huge amount of processing ( to which I have backgrounded ). Because I have it backgrounded, I must by ajax develop a feature that auto-updates every five seconds to check when the backgrounding is done. Has anyone accomplished this with their sites? If so, what are some creative techniques you came across to keep the processing streamline, and the users happy?

    Read the article

  • Interpreting type codes in sys.objects in SQL Server

    - by fatcat1111
    On SQL Server, the sys.objects table includes "Type" and "Type_Desc" attributes. For example: SELECT DISTINCT [Type], Type_Desc FROM Sys.Objects ORDER BY [Type] Returns: C CHECK_CONSTRAINT D DEFAULT_CONSTRAINT F FOREIGN_KEY_CONSTRAINT FN SQL_SCALAR_FUNCTION FS CLR_SCALAR_FUNCTION IT INTERNAL_TABLE P SQL_STORED_PROCEDURE PK PRIMARY_KEY_CONSTRAINT S SYSTEM_TABLE SQ SERVICE_QUEUE TR SQL_TRIGGER U USER_TABLE UQ UNIQUE_CONSTRAINT V VIEW Is there a comprehensive list of these types somewhere? There isn't a constraint on sys.objects that points me to table of these, and sys.types contains data types. I've searched SQL BOL but haven't found it. Any help would be appreciated. EDIT: Some DBs use only a subset of these types. For example, if I have a database with no views, when I query Sys.Objects as above, there are no "V" rows in the results. I am looking for a list of all possible types and descriptions used by SQL Server.

    Read the article

  • JavaScript Key Codes

    - by Jonathan Wood
    I'm working with a JavaScript routine I didn't write. It is called from a text box's onkeydown attribute to prevent unwanted keystrokes. The first argument is apparently not used. The second argument is a list of characters that should be allowed. function RestrictChars(evt, chars) { var key; var keychar; if (window.event) key = window.event.keyCode; else if (e) key = e.which; else return true; keychar = String.fromCharCode(key); if ((key == null) || (key == 0) || (key == 8) || (key == 9) || (key == 13) || (key == 27)) // Control key return true; else if (((chars).indexOf(keychar) > -1)) return true; else return false; } This seems to work for alpha-numeric characters. However, characters such as . and / cause this function to return false, even when these characters are included in the chars parameter. For example, if the . key is pressed, key is set to 190, and keychar gets set to the "3/4" character. Can anyone see how this was meant to work and/or why it doesn't? I don't know enough about JavaScript to see what it's trying to do.

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >