Daily Archives

Articles indexed Sunday June 24 2012

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

  • when including a file using php function not work?

    - by John Smiith
    MY PHP FUNCTION IS function functionName() { include($_SERVER['DOCUMENT_ROOT']."/path/file.php"); } Content of File.php is $foo = 'bar'; Calling function (content of file test.php) functionName(); When call function and variable not work echo $foo; <- not works But when adding code below its works (content of file test.php) include($_SERVER['DOCUMENT_ROOT']."/path/file.php"); echo $foo; <- its works

    Read the article

  • How to use Google Analytics as an affiliate to track sales data

    - by lalex
    As an affiliate, how can we get more information on sales? It looks like the goals feature in GA is for those who have control over the receipt page. But we are sending users away using an affiliate link. With event tracking, we've been able to count the clicks and see which links are being clicked the most, but not which ones actually convert. We want to find out the following on each sale: Did the converted user come from search or internal traffic? If it was search, which keyword brought the user to our site (and clicked away and converted)? Is it possible?

    Read the article

  • Do search engines crawl PDFs and if so are there any rules to follow when making them

    - by RandomBen
    The website I am working on has a few hundred PDFs in it. I don't think I have ever seen any of them come back in a search but there are linked to directly from out site. They are also full of keywords because they are product documents. Is there anything special we need to do to get Google or other search engines to crawl them? Is there any hard and fast rules for making PDFs to help Google like them more? For instance should I run them through ghostscript to clean up broken PDF tags that Adobe creates during generation?

    Read the article

  • Using elapsed time for SlowMo in XNA

    - by Dave Voyles
    I'm trying to create a slow-mo effect in my pong game so that when a player is a button the paddles and ball will suddenly move at a far slower speed. I believe my understanding of the concepts of adjusting the timing in XNA are done, but I'm not sure of how to incorporate it into my design exactly. The updates for my bats (paddles) are done in my Bat.cs class: /// Controls the bat moving up the screen /// </summary> public void MoveUp() { SetPosition(Position + new Vector2(0, -moveSpeed)); } /// <summary> /// Controls the bat moving down the screen /// </summary> public void MoveDown() { SetPosition(Position + new Vector2(0, moveSpeed)); } /// <summary> /// Updates the position of the AI bat, in order to track the ball /// </summary> /// <param name="ball"></param> public virtual void UpdatePosition(Ball ball) { size.X = (int)Position.X; size.Y = (int)Position.Y; } While the rest of my game updates are done in my GameplayScreen.cs class (I'm using the XNA game state management sample) Class GameplayScreen { ........... bool slow; .......... public override void Update(GameTime gameTime, bool otherScreenHasFocus, bool coveredByOtherScreen) base.Update(gameTime, otherScreenHasFocus, false); if (IsActive) { // SlowMo Stuff Elapsed = (float)gameTime.ElapsedGameTime.TotalSeconds; if (Slowmo) Elapsed *= .8f; MoveTimer += Elapsed; double elapsedTime = gameTime.ElapsedGameTime.TotalMilliseconds; if (Keyboard.GetState().IsKeyDown(Keys.Up)) slow = true; else if (Keyboard.GetState().IsKeyDown(Keys.Down)) slow = false; if (slow == true) elapsedTime *= .1f; // Updating bat position leftBat.UpdatePosition(ball); rightBat.UpdatePosition(ball); // Updating the ball position ball.UpdatePosition(); and finally my fixed time step is declared in the constructor of my Game1.cs Class: /// <summary> /// The main game constructor. /// </summary> public Game1() { IsFixedTimeStep = slow = false; } So my question is: Where do I place the MoveTimer or elapsedTime, so that my bat will slow down accordingly?

    Read the article

  • Undeclared Scope in Rock Paper Scissors Simple Game

    - by Rianelle
    #include <iostream> #include <string> #include <cstdlib> #include <ctime> using namespace std; bool win; int winnings; int draws; int loses; string comChoice; string playerChoice; void winGame () { cout << "You won! Play again?" <<endl; cout << "Type y/n" <<endl; char x; cin >> x; if (x == 'y') { beginGame(); } else if ('n'){ cout << "Game Stopped." <<endl; cout << "Number of Draws: " <<draws << endl; cout << "Number of Loses: " <<loses << endl; cout << "Number of Wins: " << winnings << endl; win = true; } } void drawGame (){ ++draws; cout << "Draw! Try again" << endl; return; } void lose () { cout << "You lose! Try again?" <<endl; cout << "Type y/n" <<endl; char feedback; cin >> feedback; if (feedback == 'y') { beginGame(); } else if ('n'){ cout << "Game Stopped." <<endl; cout << "Number of Draws: " <<draws << endl; cout << "Number of Loses: " <<loses << endl; cout << "Number of Wins: " << winnings << endl; } } void beginGame() { cout << "Welcome to the Rock, Paper and Scissors Game!" <<endl; cout << "Let's begin. Type <rock, paper, scissors> for your choice!" <<endl; cin >> playerChoice; srand(time(0)); int randomizer = 1+(rand()%3); if (randomizer == 1) comChoice = "rock"; if (randomizer == 2) comChoice = "paper"; if (randomizer == 3) comChoice = "scissors"; do { if (playerChoice == comChoice) { drawGame(); } if (playerChoice == "rock" && comChoice == "paper") ++loses; lose(); if (playerChoice == "rock" && comChoice == "scissors") ++winnings; winGame(); if (playerChoice == "paper" && comChoice == "rock") ++winnings; winGame(); if (playerChoice == "paper" && comChoice == "scissors") ++loses; lose(); if (playerChoice == "scissors" && comChoice == "rock") ++loses; lose(); if (playerChoice == "scissors" && comChoice == "paper") ++winnings; winGame(); }while (win != true); } int main () { beginGame(); return 0; }

    Read the article

  • How to port animation from one skeleton to another?

    - by shawn
    While I need to do this in a Blender3D modeler script, the math should be similar for other modelers or realtime engines. Blender3D specific terminology: Armature = skeleton EditBone = rest pose bone (stores the rest pose matrix) PoseBone = can store a different pose (animation matrix) for each frame of your animation I need to share animations (Blender Actions) between Armatures which have EditBones with same names and which have the same positions, but can have different (rest pose) angles and scales. Plus the Armatures might have different bone hierarchy (bone parenting/ no bone parenting). Why I need this: I've made an importer/exporter for a 3d format for a game. The format doesn't store enough info to connect/parent the bones, which makes posing/animating character models in a 3d modeller nearly impossible (original model files for the 3d modeler don't exist, this is for modding). As there are only 2 character skeleton types in the game, I decided to optionally allow to generate the bone from a hardcoded data in the model importer and undo that in the exporter. This allows to easily pose the model for checking weights, easily create weights, makes it easier for Blender to generate automatic weights and of course makes animating possible. This worked perfectly: the importer optionally generated the Armature itself and the exporter removed those changes, so the exported model works with existing animations in the game. But now I'm writing an importer and exporter for the game's animation format and here come the problems of: Trying to make original animations work in Blender with my "custom" (modified) Armature Trying to make animations created by using the "custom" (modified) Armature work with the original models in the game (and Blender). Constraints or bone snapping inside Blender won't work as they don't care that the bones have different angles in the rest pose, they will still face the same direction. It seems I just need to get the "difference" between the EditBone matrices of all EditBones for the two Armatures somehow and apply that difference to PoseBone matrices of all PoseBones, for all frames of my animation. I need to know how to get that difference and how to apply it. BTW, PoseBone matrices are relative to rest pose, they are by default [1.000000, 0.000000, 0.000000, 0.000000](matrix [row 0]) [0.000000, 1.000000, 0.000000, 0.000000](matrix [row 1]) [0.000000, 0.000000, 1.000000, 0.000000](matrix [row 2]) [0.000000, 0.000000, 0.000000, 1.000000](matrix [row 3]) So the question is: How to get the difference between two bone (EditBone) matrices to apply that difference to the animation matrices (PoseBone matrices)? Please be easy on the matrix math.

    Read the article

  • Encoding/Decoding hex packet

    - by Roberto Pulvirenti
    I want to send this hex packet: 00 38 60 dc 00 00 04 33 30 3c 00 00 00 20 63 62 39 62 33 61 36 37 34 64 31 36 66 32 31 39 30 64 30 34 30 63 30 39 32 66 34 66 38 38 32 62 00 06 35 2e 31 33 2e 31 00 00 02 3c so i build the string: string packet = "003860dc0000" + textbox1.text+ "00000020" + textbox2.text+ "0006" + textbox3.text; then "convert" it to ascii: conn_str = HexString2Ascii(packet); then i send the packet... but i have this: 00 38 60 **c3 9c** 00 00 04 33 30 3c 00 00 00 20 63 62 39 62 33 61 36 37 34 64 31 36 66 32 31 39 30 64 30 34 30 63 30 39 32 66 34 66 38 38 32 62 00 06 35 2e 31 33 2e 31 00 00 02 3c **0a** why?? Thank you! P.S. the function is: private string HexString2Ascii(string hexString) { byte[] tmp; int j = 0; int lenght; lenght=hexString.Length-2; tmp = new byte[(hexString.Length)/2]; for (int i = 0; i <= lenght; i += 2) { tmp[j] =(byte)Convert.ToChar(Int32.Parse(hexString.Substring(i, 2), System.Globalization.NumberStyles.HexNumber)); j++; } return Encoding.GetEncoding(1252).GetString(tmp); }

    Read the article

  • linux's fork and system resources

    - by Dmitry Bespalov
    Suppose I have following code in linux: int main() { FILE* f = fopen("file.txt", "w"); fork(); fwrite("A", 1, 1, f); fclose(f); return 0; } What I know about fork from documentation, is that it makes the copy of current process. It copies state of the memory as well, so *f should be equal in both instances. But what happens with system resources, such as a file handle? In this example I open the file with write intentions, so only one instance can write into file, right? Which of the instances will actually write into file? Who should care further about the file handle, and call fclose() ?

    Read the article

  • MySQL Select problems

    - by John Nuñez
    Table #1: qa_returns_items Table #2: qa_returns_residues I have a long time trying to get this Result: item_code - item_quantity 2 - 1 3 - 2 IF qa_returns_items.item_code = qa_returns_residues.item_code AND status_code = 11 THEN item_quantity = qa_returns_items.item_quantity - qa_returns_residues.item_quantity ELSEIF qa_returns_items.item_code = qa_returns_residues.item_code AND status_code = 12 THEN item_quantity = qa_returns_items.item_quantity + qa_returns_residues.item_quantity ELSE show diferendes END IF I tried this Query: select SubQueryAlias.item_code, total_ecuation, SubQueryAlias.item_unitprice, SubQueryAlias.item_unitprice * total_ecuation as item_subtotal, item_discount, (SubQueryAlias.item_unitprice * total_ecuation) - item_discount as item_total from ( select ri.item_code , case status_code when 11 then ri.item_quantity - rr.item_quantity when 12 then ri.item_quantity + rr.item_quantity end as total_ecuation , rr.item_unitprice , rr.item_quantity , rr.item_discount * rr.item_quantity as item_discount from qa_returns_residues rr left join qa_returns_items ri on ri.item_code = rr.item_code WHERE ri.returnlog_code = 1 ) as SubQueryAlias where total_ecuation > 0 GROUP BY (item_code); The query returns this result: item_code - item_quantity 1 - 2 2 - 2

    Read the article

  • MYSQL get the name from another table that is associated with the first table

    - by Juan Gonzales
    I can't figure out why this statement is not working SELECT myChurches.id AS id, myChurches.church_name AS church_name FROM myChurches INNER JOIN church_staff ON church_staff.church_id=myChurches.id WHERE church_staff.mem_id='$logOptions_id' ORDER BY myChurches.church_name ASC Basically I need to find the person's that are staff members of a church from one table and want to get the 'name' of that church FROM the 'myChurches' table. Hopefully that makes sense. Thanks in advance

    Read the article

  • Lucene raise document score if sibling entity matches query

    - by Pitagoras
    I have the following design situation. I use hibernate search (lucene in the back). Tha application manages ITEMs which have title, description and tags. These are full text indexed. On the other hand, we have COLLECTION of ITEMs. The user can create a COLLECTION and add as many ITEMs as she wants. ITEMs can also belong to many COLLECTIONs. I have a boosted query so that search terms that appear in the tags are more important than in the title, and lastly in the description. But I need an additional matching criteria: for a given ITEM, it whould rank better if other documents in some COLLECTION where the ITEM belongs, also match the query. This is like to say: the title/tags/description of "fellow" items (i.e. items in some shared collection) make the item rank better. I was thinking that adding an ITEM to a COLLECTION would add something like "extra tags" to every other ITEM in the collection, being these extra tags the elements to match in the added ITEM. I feel a more clever solution lucene-wise should exists. Any ideas/pointers are welcome. Thanks.

    Read the article

  • javascript - how to call a function newly added from ajax

    - by strike_noir
    I have a coding difficulty which have been asked in this forum before: Calling a JavaScript function returned from a Ajax response But I didn't find the answers quite satisfying. To be more precise of the problem I'm dealing, here is the details: I dynamically load a document (HTML and javascript) using jquery var url = 'document.php'; $('#container').load(url); And then I want to call the functions from that document.php. Due to my requirement, I don't want to call the function after the documents' loaded, but rather to call it later when I need it. Because it was dynamically loaded, the DOM doesn't recognize the functions. How to properly call this function? Thank you

    Read the article

  • Where should I declare a list of 5,000+ words?

    - by user647362
    I am writing a game in python in which I must periodically pull a random word from a list of words. When I prototyped my game I declared a word_list = ['cat','dog','rat','house'] of ten words at the top of one of my modules. I then use choice(word_list) to get a random word. However, I must must change this temporary hack into something more elegant because I need to increase the size of the word list to 5,000+ words. If I do this in my current module it will look ridiculous. Should I put all of these words in a flat txt file, and then read from that file as I need words? If so, how would I best do that? Put each word an a separate line and then read one random line? I'm not sure what the most efficient way is.

    Read the article

  • How can unit testing make parameter validation redundant?

    - by Johann Gerell
    We have a convention to validate all parameters of constructors and public functions/methods. For mandatory parameters of reference type, we mainly check for non-null and that's the chief validation in constructors, where we set up mandatory dependencies of the type. The number one reason why we do this is to catch that error early and not get a null reference exception a few hours down the line without knowing where or when the faulty parameter was introduced. As we start transitioning to more and more TDD, some team members feel the validation is redundant. Uncle Bob, who is a vocal advocate of TDD, strongly advices against doing parameter validation. His main argument seems to be "I have a suite of unit tests that makes sure everything works". But I can for the life of it just not see in what way unit tests can prevent our developers from calling these methods with bad parameters in production code. Please, unit testers out there, if you could explain this to me in a rational way with concrete examples, I'd be more than happy to seize this parameter validation!

    Read the article

  • Using the mpz_powm functions from the GMP/MPIR libraries with negative exponents

    - by Mihai Todor
    Please consider the following code: mpz_t x, n, out; mpz_init_set_ui(x, 2UL); mpz_init_set_ui(n, 7UL); mpz_init(out); mpz_invert(out, x, n); gmp_printf ("%Zd\n", out);//prints 4. 2 * 4 (mod 7) = 1. OK mpz_powm_ui(out, x, -1UL, n);//prints 1. 2 * 1 (mod 7) = 2. How come? gmp_printf ("%Zd\n", out); mpz_clear(x); mpz_clear(n); mpz_clear(out); I am unable to understand how the mpz_powm functions handle negative exponents, although, according to the documentation, it is supposed to support them. I would expect that raising a number to -1 modulo n is equivalent to inverting it modulo n. What am I missing here?

    Read the article

  • Allocate from buffer in C

    - by Grimless
    I am building a simple particle system and want to use a single array buffer of structs to manage my particles. That said, I can't find a C function that allows me to malloc() and free() from an arbitrary buffer. Here is some pseudocode to show my intent: Particle* particles = (Particle*) malloc( sizeof(Particle) * numParticles ); Particle* firstParticle = <buffer_alloc>( particles ); initialize_particle( firstParticle ); // ... Some more stuff if (firstParticle->life < 0) <buffer_free>( firstParticle ); // @ program's end free(particles); Where <buffer_alloc> and <buffer_free> are functions that allocate and free memory chunks from arbitrary pointers (possibly with additional metadata such as buffer length, etc.). Do such functions exist and/or is there a better way to do this? Thank you!

    Read the article

  • efficient video format/codec for sparse & binary blob tracking

    - by user391339
    I am working on a blob tracking project and have many high-definition videos that I would like to reduce in size for storage and downstream tracking/shape-analysis. I want to use a lossless method that takes advantage of the black and white nature of the video as well as the fact that not much is moving between individual frames. The videos are quite sparse, with 5 to 10 b&w blobs per frame occupying <30% of the space in total, with each blob moving <5-10% of the field of view between frames and not changing shape too much between 2-3 frames. I will work in Python, Matlab, or LabView for this project, and could use a batch utility if available. It may be worthwhile to export the files as compressed image stacks if a proper video format can't be found. What are the pros and cons of this? A video codec uses correlations between neighboring frames, so it should be more efficient, but not if the wrong one is chosen or if it is improperly configured.

    Read the article

  • Shortcodes and Custom Fields

    - by user1429400
    How do I get shortcodes to process properly in custom fields? I've tried using the code below, but I cannot figure out where to place it ("button" is the name of the field): <?php if ( get_post_meta($post->ID, 'button', true) ) echo do_shortcode(get_post_meta($post->ID, 'button', $single = true)); ?> As of now, the shortcode is working in the sense that the button is displaying, but the shortcode text is displaying where the "buy now" button is supposed to be. See screenshot: http://i.imgur.com/41vsr.png

    Read the article

  • copy entire row (without knowing field names)

    - by Todd Webb
    Using SQL Server 2008, I would like to duplicate one row of a table, without knowing the field names. My key issue: as the table grows and mutates over time, I would like this copy-script to keep working, without me having to write out 30+ ever-changing fields, ugh. Also at issue, of course, is IDENTITY fields cannot be copied. My code below does work, but I wonder if there's a more appropriate method than my thrown-together text string SQL statement? So thank you in advance. Here's my (yes, working) code - I welcome suggestions on improving it. Todd alter procedure spEventCopy @EventID int as begin -- VARS... declare @SQL varchar(8000) -- LIST ALL FIELDS (*EXCLUDE* IDENTITY FIELDS). -- USE [BRACKETS] FOR ANY SILLY FIELD-NAMES WITH SPACES, OR RESERVED WORDS... select @SQL = coalesce(@SQL + ', ', '') + '[' + column_name + ']' from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME = 'EventsTable' and COLUMNPROPERTY(OBJECT_ID('EventsTable'), COLUMN_NAME, 'IsIdentity') = 0 -- FINISH SQL COPY STATEMENT... set @SQL = 'insert into EventsTable ' + ' select ' + @SQL + ' from EventsTable ' + ' where EventID = ' + ltrim(str(@EventID)) -- COPY ROW... exec(@SQL) -- REMEMBER NEW ID... set @EventID = @@IDENTITY -- (do other stuff here) -- DONE... -- JUST FOR KICKS, RETURN THE SQL STATEMENT SO I CAN REVIEW IT IF I WISH... select EventID = @EventID, SQL = @SQL end

    Read the article

  • Is this a SEO SAFE anchor link

    - by Mayhem
    so... Is this a safe way to use internal links on your site.. By doing this i have the index page generating the usual php content section and handing it to the div element. THE MAIN QUESTION: Will google still index the pages using this method? Common sense tells me it does.. But just double checking and leaving this here as a base example as well if it is. As in. EXAMPLE ONLY PEOPLE The Server Side if (isset($_REQUEST['page'])) {$pageID=$_REQUEST['page'];} else {$pageID="home";} if (isset($_REQUEST['pageMode']) && $_REQUEST['pageMode']=="js") { require "content/".$pageID.".php"; exit; } // ELSE - REST OF WEBSITE WILL BE GENERATED USING THE page VARIABLE The Links <a class='btnMenu' href='?page=home'>Home Page</a> <a class='btnMenu' href='?page=about'>About</a> <a class='btnMenu' href='?page=Services'>Services</a> <a class='btnMenu' href='?page=contact'>Contact</a> The Javascript $(function() { $(".btnMenu").click(function(){return doNav(this);}); }); function doNav(objCaller) { var sPage = $(objCaller).attr("href").substring(6,255); $.get("index.php", { page: sPage, pageMode: 'js'}, function(data) { ("#siteContent").html(data).scrollTop(0); }); return false; } Forgive me if there are any errors, as just copied and pasted from my script then removed a bunch of junk to simplify it as still prototyping/white boarding the project its in. So yes it does look a little nasty at the moment. REASONS WHY: The main reason is bandwidth and speed, This will allow other scripts to run and control the site/application a little better and yes it will need to be locked down with some coding. -- FURTHER EXAMPLE-- INSERT PHP AT TOP <?php // PHP CODE HERE ?> <html> <head> <link rel="stylesheet" type="text/css" href="style.css" /> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="scripts.js"></script> </head> <body> <div class='siteBody'> <div class='siteHeader'> <?php foreach ($pageList as $key => $value) { if ($pageID == $key) {$btnClass="btnMenuSel";} else {$btnClass="btnMenu";} echo "<a class='$btnClass' href='?page=".$key."'>".$pageList[$key]."</a>"; } ?> </div><div id="siteContent" style='margin-top:10px;'> <?php require "content/".$pageID.".php"; ?> </div><div class='siteFooter'> </div> </div> </body> </html>

    Read the article

  • What is going on with the "return fibonacci( number-1 ) + fibonacci( number-2 )"?

    - by user1478598
    I have problem understanding what the return fibonacci( number-1 ) + fibonacci( number-2 ) does in the following program: import sys def fibonacci( number ): if( number <= 2 ): return 1 else: return fibonacci( number-1 ) + fibonacci( number-2 ) The problem is that I can't imagine how this line works: return fibonacci( number-1 ) + fibonacci( number-2 ) Does the both of the "fibonacci( number-1 )" and "fibonacci( number-2 )" being processed at the same time? or the "fibonacci( number-1 )" is the first to be processed and then the second one? I only see that processing both of them would eventually return '1' so the last result I expect to see it is a '1 + 1' = '2' I would appreciate a lot, If someone can elaborately explain the process of its calculation. I think this is a very newb question but I can't really get a picture of its process.

    Read the article

  • localStorage not working in IE9 and Firefox

    - by maha
    I am working with localStorage. My code is perfectly working in Chrome, but not in IE9 and Firefox. Here is the code: document.addEventListener("DOMContentLoaded", restoreContents, false); document.getElementsByTagName("body")[0].onclick=function(){saveContents('myList','contentMain', event, this);}; function amIclicked(e, eleObject) { alert("amIClicked"); e = e || event; var target = e.target || e.srcElement; alert("target = " + target.id); if(target.id=='pageBody' || target.id=='Save') return true; else return false; } function saveContents(e, d, eveObj, eleObject) { //alert("saveContents"); if (amIclicked(eveObj, eleObject)) { var cacheValue = document.getElementById(e).innerHTML; var cacheKey = "key_" + selectedKey; var storage = window.localStorage; //alert ("cacheKey = " + cacheKey + " ,cacheValue = " + cacheValue); if(typeof(Storage)!=="undifined"){ localStorage.setItem("cacheKey","cacheValue"); } //alert ("Saved!!"); var dd = document.getElementById(d); //document.getElementById("contentMain").style.display == "none"; dd.style.display = "none"; } } function restoreContents(e,k) { //alert("test"); if(k.length < 1) { return; } var mySavedList = localStorage["key_" + k]; if (mySavedList != undefined) { document.getElementById(e).innerHTML = mySavedList; } } <a onclick="ShowContent('contentMain','myList','Sample_1'); return true;" href="#" >Sample 1</a><br/><br/> <a onclick="ShowContent('contentMain','myList','Sample_2'); return true;" href="#" >Sample 2</a><br/><br/> <div style="display:none;display:none;position:absolute;border-style: solid;background-color: white;padding: 5px;"id="contentMain"> <ol id="myList" contenteditable="true"> <li>Enter Content here</li> </ol> <!--<input id="editToggleButton" type="button" value="Edit"/>--> </div> When I debugging in Iexplore Iam getting the error as SCRIPT5007: Unable to get value of the property 'length': object is null or undefined sample_1.html, line 157 character 3 Thanks

    Read the article

  • change a value xml in php but false with a node name id-7

    - by Nataly Nguyen
    I want to change a xml, but fails with this code. I think mistake with name of variable (ID-1) in php. chang.php <?php include 'example.php'; $xml = new SimpleXMLElement($xmlstr); $xml->ID-1 = '8'; $xml->name = 'Big Cliff'; $xml->asXML('test2.xml'); echo $xml->asXML(); ?> example.php <?php $xmlstr = <<<XML <?xml version="1.0" encoding="utf-8"?> <film> <ID-1>29</ID-1> <name>adf</name> </film> XML; ?>

    Read the article

  • How can I create an http response from scratch?

    - by ispiro
    I have code that returns an http response, but it also includes the content of the page. How can I create a response from scratch so it won't include anything except what I put in it? My code now: GCheckout.AutoGen.NotificationAcknowledgment response = new GCheckout.AutoGen.NotificationAcknowledgment(); response.serialnumber = serialNumber; HttpContext.Current.Response.Clear(); HttpContext.Current.Response.BinaryWrite(GCheckout.Util.EncodeHelper.Serialize(response)); HttpContext.Current.Response.StatusCode = 200;

    Read the article

  • Python/Tkinter make a custom window

    - by user1435947
    I want to make a window without the top taskbar (that is movable), so there is only thin outline around the GUI box. I also want to add my own 'X' to the box. import Tkinter class Application(Frame): def __init__(self, master=None): Frame.__init__(self, master) self.parent = master ............ def main(): root = Tk() root.attributes('-fullscreen', True) root.geometry('500x250+500+200') app = Application(root) app.parent.configure(background = 'gray32') root.resizable(width=FALSE, height=FALSE) app.mainloop() main() I tried forcing the box to resize after going into fullscreen to remove the taskbar, though box is no longer movable. Any suggestions? [I have seen this thread: Python/Tkinter: Removing/disabling a resizable window's maximize button under Windows The -toolwindow attribute didn't work for me, maybe because I use linux...]

    Read the article

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