Search Results

Search found 12824 results on 513 pages for 'glen little'.

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

  • save data in the database to xml in c [closed]

    - by Jayanth N
    I have some data in the database. I want those data in database to be stored as an xml file. I'm using postgresql 9.1 for database, for xml processing I'm using libxml (http://xmlsoft.org/). I'm writing the code in C language. Please help me. Detailed explanation: I have a client, which sends me a xml file. Server receives the xml file, parses the xml file and stores it in the db. From db i want to send the details in the form of an xml to the client. client: <employee> <name>glen</name> <telephone>123456789</telephone> </employee> <employee> <name>gwen</name> <telephone>123456789</telephone> </employee> server parses this xml file as displayed below: name : glen telephone:123456789 name : gwen telephone: 123456789 and saves it in a database(postgresql9.1) if the client requests for details of the employees, i've to send it in xml form from database.I don't know how to do it can u help me out.

    Read the article

  • NetBeans PHP Community Council

    - by Tomas Mysik
    Hi all, today we would like to inform all of you that now you have a chance to improve NetBeans via NetBeans PHP Community Council. The author of this activity is Timur Poperecinii and he would like to tell you a few words about it. Hello passionate technical people, First of all let me introduce myself: my name is Timur, I’m a developer from Moldova (that little country between Romania and Ukraine), I develop mostly in .NET and JQuery, but I love to learn more, not being an expert I am familiar with Java (Struts2, Play), PHP (Symfony2), Ruby (Rails), Sencha Touch 2 and other technologies. I was “introduced” in PHP recently by a client of mine who requested to make the work specifically in PHP. Let me tell you a little story about my experience with open source and IDEs: when I was studying in university in 2007 I think, I did a simple little application in PHP and thought “Damn, if only there was a good IDE for PHP so I could relax and no having to remember all the function names”, then when I searched on internet pretty much everyone was using Vim or Emacs on Linux, but it had no autocomplete anyway, just syntax highlighting. I remember using some tool like Notepad++ I think. Nowadays everything changed, we have highlighting and autocomplete for about all standard things in PHP in many IDEs. I use NetBeans for PHP, and I really am happy with the experience I have there with standard PHP code, but for frameworks I still think there is lots of room for improvements. For example we have some Symfony 2 and Twig support. But I’d love to see more of that coming, for example I’m a big fan of file templates, where the main goal is to not waste time on writing over and over again something that can be generated, and it counts even more when you don’t have a lot of autocomplete. So what I thought, “Hey I know Java a little, and NetBeans has plugins, so may be it worth trying to do a file templates plugin”, and so I did, you can find details about my Unified Udevi Symfony2 Plugin for NetBeans 7.2 on my blog. It wasn’t hard, and it even was fun! Give back to open source Now think a little, NetBeans is an open source project and PHP support is just a part of it, so the resources are pretty limited in this area. But we as a community that uses this product, want to have the best possible experience with PHP and frameworks(!!!). So why don’t we GIVE BACK TO OPENSOURCE ? Imagine an IDE that can do all the things you wanted + it is free. Now how far is NetBeans from that point? I guess not so far – you might miss a little niche thing that you use on a daily basis, but then the question appears why don’t you make it happen on your own? NetBeans PHP Community Council What I proposed is to create a NetBeans PHP Community Council that will be formed of people willing to change something, willing to create plugins for their own needs and for the needs of the community, test the plugins created by them too, and basically evolve NetBeans in direction they want to reach. I already talked with the NetBeans PHP team. They are only happy to help this Council, with technical advises, opening some APIs we might need to have access to, and other things. One important thing to mention is that this Council is a Community project, so though we’ll have direct discussions with NetBeans PHP Dev team, NetBeans is not the leading force here, it is the community. You can see more details about the goals and structure I proposed at NetBeans PHP Community Council wiki page. We use this mail list: [email protected] for discussions and topics related to the Council. How can I join To join the NetBeans PHP Community Council please send an email to [email protected] with the subject of the mail starting with [Council New Member]. You can subscribe to this mail list here:http://netbeans.org/projects/php/lists. in your mail please indicate your location, age and experience both in Java and PHP. I need these data to assign you to a team. A response will be send to you with your next assignment and some people to contact. I really hope that you’ll make a step forward and try to make your everyday use of NetBeans even more fun.

    Read the article

  • Make the Time

    - by WonderOfItAll
    Took the little one to the pool tonight for swim lessons. Okay, Okay. They're not really lessons so much as they are "Hey, here's a few bucks, let me rent out a small section of your pool to swim around with my little one" Saw a dad at the pool. Bluetooth on, iPad in hand, and two year old somewhere around there. Saw a mom at the pool. Arguing with her five year old to NOT take a shower after swimming. Bluetooth on, iPad in hand, work laptop open on stadium seats. Her reasoning for not wanting the child to shower "Look, I have to get this stuff to the office by 6:30, we don't have time for you to shower. Let's go" Wait, isn't the whole point of this little experience called Mommy and Me (or, as in my case, Daddy and Me). Wherein Mommy/Daddy is supposed to spend time with little one. Not with the Bluetooth. Not with the work laptop. Dad (yeah, the same dad from earlier), in the pool. Bluetooth off (it's not waterproof or I'm sure he would've had it on), two year old in hand and iPad somewhere put away. Getting frustrated with kid because he won't 'perform' on command. Here's a little exchange Kid: "I don't wanna get in the water" Dad: "Well, we're here for 30 minutes, get in the water" Kid: "No, don't wanna" Dad: "Fine, I'm getting in" and, true to his word, in he goes, off to swim. Kid: Crying Dad: "Well, c'mon" Kid: Walking to stands Dad: Ignoring kid Kid: At stands Dad: Out of pool, drying off. Frustrated. Grabs bag, grabs kid, leaves How sad. It really seems like I am living in a generation of parents who view their children as one big scheduled distraction to another. It's almost like the dad was saying "Look, little 2 year old boy, I have a busy scheduled. Right now my Outlook Calendar tells me that I have 30 mins to spend with you, so, let's go kid: PERFORM because I have the time" Really? Can someone please tell me when the hell this happened? When did spending time with your kid, spending time with your family, spending time with your spouse, etc... become a distraction? I've seen people at work all day Tweeting throughout the day, checked in with Four Square, IM up and running constantly so they can 'stay in touch' only to see these same folks come home and be irritated because their kids or their spouse wants to connect with the. I've seen these very same people leave the house, go to the corner bar/store/you-name-the-place to be 'alone' only to find them there, plugged in, tweeting away, etc, etc, etc I LOVE technology. I love working with technology. But I also know that I am a human being. A person who, by very definition, is a social being. I needed social interactions and contact--and, no, I'm not talking about the Social Graph kind of connections, I'm talking about those interactions which, *GASP* involve eye to eye contact and human contact. A recent study found that the number one complaint of kids is that they feel they have to compete with technology for their parents time and attention. The number one wish from high school kids? That there parents would turn off the computer/tv/cell phone at dinner. This, coming from high school kids. Shouldn't that tell you a whole helluva lot? So, do yourself a favor tomorrow. Plug into technology all day. Throw yourself into it. Be passionate about what you do. When you walk through the door to your family, turn it all off for 30 mins and be there with your loved ones. If you can manage to play Angry Birds, I'm sure you can handle being disconnected for 30 minutes. Make the time

    Read the article

  • Large flags enumerations in C#

    - by LorenVS
    Hey everyone, got a quick question that I can't seem to find anything about... I'm working on a project that requires flag enumerations with a large number of flags (up to 40-ish), and I don't really feel like typing in the exact mask for each enumeration value: public enum MyEnumeration : ulong { Flag1 = 1, Flag2 = 2, Flag3 = 4, Flag4 = 8, Flag5 = 16, // ... Flag16 = 65536, Flag17 = 65536 * 2, Flag18 = 65536 * 4, Flag19 = 65536 * 8, // ... Flag32 = 65536 * 65536, Flag33 = 65536 * 65536 * 2 // right about here I start to get really pissed off } Moreover, I'm also hoping that there is an easy(ier) way for me to control the actual arrangement of bits on different endian machines, since these values will eventually be serialized over a network: public enum MyEnumeration : uint { Flag1 = 1, // BIG: 0x00000001, LITTLE:0x01000000 Flag2 = 2, // BIG: 0x00000002, LITTLE:0x02000000 Flag3 = 4, // BIG: 0x00000004, LITTLE:0x03000000 // ... Flag9 = 256, // BIG: 0x00000010, LITTLE:0x10000000 Flag10 = 512, // BIG: 0x00000011, LITTLE:0x11000000 Flag11 = 1024 // BIG: 0x00000012, LITTLE:0x12000000 } So, I'm kind of wondering if there is some cool way I can set my enumerations up like: public enum MyEnumeration : uint { Flag1 = flag(1), // BOTH: 0x80000000 Flag2 = flag(2), // BOTH: 0x40000000 Flag3 = flag(3), // BOTH: 0x20000000 // ... Flag9 = flag(9), // BOTH: 0x00800000 } What I've Tried: // this won't work because Math.Pow returns double // and because C# requires constants for enum values public enum MyEnumeration : uint { Flag1 = Math.Pow(2, 0), Flag2 = Math.Pow(2, 1) } // this won't work because C# requires constants for enum values public enum MyEnumeration : uint { Flag1 = Masks.MyCustomerBitmaskGeneratingFunction(0) } // this is my best solution so far, but is definitely // quite clunkie public struct EnumWrapper<TEnum> where TEnum { private BitVector32 vector; public bool this[TEnum index] { // returns whether the index-th bit is set in vector } // all sorts of overriding using TEnum as args } Just wondering if anyone has any cool ideas, thanks!

    Read the article

  • Android strange behavior with listview and custom cursor adapter

    - by Michael Little
    I have a problem with a list view and a custom cursor adapter and I just can't seem to figure out what is wrong with my code. Basically, in my activity I call initalize() that does a bunch of stuff to handle getting the proper data and initializing the listview. On first run of the activity you can see from the images that one of the items is missing from the list. If I go to another activity and go back to this activity the item that was missing shows up. I believe it has something to do with setContentView(R.layout.parent). If I move that to my initialize() then the item never shows up even when returning from another activity. So, for some reason, returning from another activity bypasses setContentView(R.layout.parent) and everything works fine. I know it's impossible for me to bypass setContentView(R.layout.parent) so I need to figure out what the problem is. Also, I did not include the layout because it is nothing more then two textviews. Also, the images I have attached do not show that the missing item is the last one on the list. Custom Cursor Adapter: public class CustomCursorAdapter extends SimpleCursorAdapter { private Context context; private int layout; public CustomCursorAdapter (Context context, int layout, Cursor c, String[] from, int[] to) { super(context, layout, c, from, to); this.context = context; this.layout = layout; } public View newView(Context context, Cursor cursor, ViewGroup parent) { LayoutInflater inflater = LayoutInflater.from(context); final View view = inflater.inflate(layout, parent, false); return view; } @Override public void bindView(View v, Context context, Cursor c) { if (c.getColumnName(0).matches("section")){ int nameCol = c.getColumnIndex("section"); String section = c.getString(nameCol); TextView section_text = (TextView) v.findViewById(R.id.text1); if ((section.length() > 0)) { section_text.setText(section); } else { //so we don't have an empty spot section_text.setText(""); section_text.setVisibility(2); section_text.setHeight(1); } } else if (c.getColumnName(0).matches("code")) { int nameCol = c.getColumnIndex("code"); String mCode = c.getString(nameCol); TextView code_text = (TextView) v.findViewById(R.id.text1); if (code_text != null) { int i = 167; byte[] data = {(byte) i}; String strSymbol = EncodingUtils.getString(data, "windows-1252"); mCode = strSymbol + " " + mCode; code_text.setText(mCode); code_text.setSingleLine(); } } if (c.getColumnName(1).matches("title")){ int nameCol = c.getColumnIndex("title"); String mTitle = c.getString(nameCol); TextView title_text = (TextView) v.findViewById(R.id.text2); if (title_text != null) { title_text.setText(mTitle); } } else if (c.getColumnName(1).matches("excerpt")) { int nameCol = c.getColumnIndex("excerpt"); String mExcerpt = c.getString(nameCol); TextView excerpt_text = (TextView) v.findViewById(R.id.text2); if (excerpt_text != null) { excerpt_text.setText(mExcerpt); excerpt_text.setSingleLine(); } } } The Activity: public class parent extends ListActivity { private static String[] TITLE_FROM = { SECTION, TITLE, _ID, }; private static String[] CODE_FROM = { CODE, EXCERPT, _ID, }; private static String ORDER_BY = _ID + " ASC"; private static int[] TO = { R.id.text1, R.id.text2, }; String breadcrumb = null; private MyData data; private SQLiteDatabase db; CharSequence parent_id = ""; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); data = new MyData(this); db = data.getReadableDatabase(); setContentView(R.layout.parent); initialize(); } public void initialize() { breadcrumb = null; Bundle bun = getIntent().getExtras(); TextView tvBreadCrumb; tvBreadCrumb = (TextView)findViewById(R.id.breadcrumb); if (bun == null) { //this is the first run tvBreadCrumb.setText(null); tvBreadCrumb.setHeight(0); parent_id = "0"; try { Cursor cursor = getData(parent_id); showSectionData(cursor); } finally { data.close(); } } else { CharSequence state = bun.getString("state"); breadcrumb = bun.getString("breadcrumb"); tvBreadCrumb.setText(breadcrumb); CharSequence code = bun.getString("code"); parent_id = code; if (state.equals("chapter")) { try { Cursor cursor = getData(parent_id); showSectionData(cursor); } finally { data.close(); } } else if (state.equals("code")) { try { Cursor cursor = getCodeData(parent_id); showCodeData(cursor); } finally { data.close(); } } } } @Override public void onStart() { //initialize(); super.onResume(); } @Override public void onResume() { initialize(); super.onResume(); } private Cursor getData(CharSequence parent_id) { Cursor cTitles = db.query(TITLES_TABLE_NAME, TITLE_FROM, "parent_id = " + parent_id, null, null, null, ORDER_BY); Cursor cCodes = db.query(CODES_TABLE_NAME, CODE_FROM, "parent_id = " + parent_id, null, null, null, ORDER_BY); Cursor[] c = {cTitles, cCodes}; Cursor cursor = new MergeCursor(c); startManagingCursor(cursor); return cursor; } private Cursor getCodeData(CharSequence parent_id2) { Bundle bun = getIntent().getExtras(); CharSequence intent = bun.getString("intent"); CharSequence searchtype = bun.getString("searchtype"); //SQLiteDatabase db = data.getReadableDatabase(); if (intent != null) { String sWhere = null; if(searchtype.equals("code")) { sWhere = "code LIKE '%"+parent_id2+"%'"; } else if(searchtype.equals("within")){ sWhere = "definition LIKE '%"+parent_id2+"%'"; } //This is a search request Cursor cursor = db.query(CODES_TABLE_NAME, CODE_FROM, sWhere, null, null, null, ORDER_BY); startManagingCursor(cursor); return cursor; } else { Cursor cursor = db.query(CODES_TABLE_NAME, CODE_FROM, "parent_id = "+ parent_id2, null, null, null, ORDER_BY); startManagingCursor(cursor); return cursor; } } private void showSectionData(Cursor cursor) { CustomCursorAdapter adapter= new CustomCursorAdapter(this, R.layout.item, cursor, TITLE_FROM, TO); setListAdapter(adapter); } private void showCodeData(Cursor cursor) { CustomCursorAdapter adapter = new CustomCursorAdapter(this, R.layout.item, cursor, CODE_FROM, TO); setListAdapter(adapter); Bundle bun = getIntent().getExtras(); CharSequence intent = bun.getString("intent"); if (intent != null) { Cursor cursor1 = ((CursorAdapter)getListAdapter()).getCursor(); startManagingCursor(cursor1); TextView tvBreadCrumb; tvBreadCrumb = (TextView)findViewById(R.id.breadcrumb); tvBreadCrumb.setText(cursor1.getCount() + " Records Found"); //cursor1.close(); //mdl } }

    Read the article

  • Wordpress 403/404 Errors: You don't have permission to access /wp-admin/themes.php on this server

    - by Glen
    Some background: I setup six blogs this week, all using Wordpress 2.92, installed with Fantastico on a baby croc plan with Hostgator. I used the same theme (heatmap 2.5.4) and plugins for each blog. They were all up and running, no issues at all. I go to create a new blog this morning, using the same setup, and when I try to change the theme settings, I get the following error: Forbidden You don't have permission to access /wp-admin/themes.php on this server. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. Apache/2.2.15 (Unix) mod_ssl/2.2.15 OpenSSL/0.9.8n DAV/2 mod_fcgid/2.3.5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 Server at http://www.mydomain.com Port 80 I tried uninstalling WP and doing a clean install, still the same issue with a clean installation. So I went back and checked the six other blogs that I had setup over the last week or so, and they are also now giving me 403 or 404 errors when trying to change theme settings, and everytime there's an error it points to either themes.php or functions.php At this point I'm at my wits end trying to figure out what the problem is. Hostgator support looked at it and thought maybe it was a permissions issue but they reset those and I'm still having the problem. At first I thought the problem might have been related to a plugin I recently installed on the previous six blogs that morning (ByREV Fix Missed Shedule Plugin) to deal with a missed schedule bug with WP 2.92, and that maybe that had mucked things up. But then I checked a blog I built months ago, also using the same theme and plugins, and now it too is also encountering the same problem. Any ideas? I tried deleting my htaccess, uploading a blank one, uploading one with this snippet I found on the hostgator forum: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress Nothing has worked. I still get 403 or 404 errors everytime. Everything was working perfectly yesterday so I know this setup DOES WORK, I've just mucked something up somewhere and I'm clueless what it is. I read a related thread here and tried chmoding the wp-content folder to 0755 and still having the issue. Any thoughts? Thanks!

    Read the article

  • boost::multi_array resize exception?

    - by Glen
    I'm trying to figure out if the boost::multi_array constructor or resize method can throw a bad_alloc exception (or some other exception indicating the allocation or resize failed). I can't find this information in the documentation anywhere.

    Read the article

  • Asp.Net Cache, modify an object from cache and it changes the cached value

    - by Glen
    Hi, I'm having an issue when using the Asp.Net Cache functionality. I add an object to the Cache then at another time I get that object from the Cache, modify one of it's properties then save the changes to the database. But, the next time I get the object from Cache it contains the changed values. So, when I modify the object it modifies the version which is contained in cache even though I haven't updated it in the Cache specifically. Does anyone know how I can get an object from the Cache which doesn't reference the cached version? i.e. Step 1: Item item = new Item(); item.Title = "Test"; Cache.Insert("Test", item, null, DateTime.Now.AddHours(1), System.Web.Caching.Cache.NoSlidingExpiration); Step 2: Item item = (Item)Cache.Get("test"); item.Title = "Test 1"; Step 3: Item item = (Item)Cache.Get("test"); if(item.Title == "Test 1"){ Response.Write("Object has been changed in the Cache."); } I realise that with the above example it would make sense that any changes to the item get reflected in cache but my situation is a bit more complicated and I definitely don't want this to happen.

    Read the article

  • create table based on a user defined type

    - by Glen
    Suppose I have a user defined type: CREATE OR REPLACE TYPE TEST_TYPE AS OBJECT ( f1 varchar2(10), f2 number(5) ); Now, I want to create a table to hold these types. I can do the following: create table test_type_table ( test_type_field test_type ); This gives me a table with one column, test_type_field. Is there an easy and automated way to instead create a table such that it has 2 columns, f1 and f2?. So that it's the equivilent to writing: create table test_type_table ( f1 varchar2(10), f2 number(5) );

    Read the article

  • How to install Visual Python in Ubuntu 10.04? [closed]

    - by Glen
    I am trying to do a Physics problem in python. I need to install visual python because I get the error that it can't find the visual library when I type import visual from * The documentation on the Visual Python site is totally useless. I have gone into synaptic package manger and installed python-visual. But I still get the same error. Can someone please help?

    Read the article

  • Better way to make a bash script self-tracing?

    - by Kevin Little
    I have certain critical bash scripts that are invoked by code I don't control, and where I can't see their console output. I want a complete trace of what these scripts did for later analysis. To do this I want to make each script self-tracing. Here is what I am currently doing: #!/bin/bash # if last arg is not '_worker_', relaunch with stdout and stderr # redirected to my log file... if [[ "$BASH_ARGV" != "_worker_" ]]; then $0 "$@" _worker_ >>/some_log_file 2>&1 # add tee if console output wanted exit $? fi # rest of script follows... Is there a better, cleaner way to do this?

    Read the article

  • Can a page opt out of IIS 7 compression?

    - by Glen Little
    My pages are automatically being compressed by IIS7 with GZIP. That is great... but, for one particular page, I need to stream it to the user, using Response.Flush() when needed. But when the output is being compressed, the IIS server seems to collect all my output until the page is done before compressing and sending it to the client. That nullifies my attempt to Flush the content out to the user. Is there a way that I can have this one page opt out of the compression? One possible option I've determined that if I manually set the content type to one that does not match the IIS configuration at c:\windows\system32\inetsrv\config\applicationhost.config, then IIS will not compress it. Eg. Response.ContentType = "x-text/html". This works okay with IE8, as it falls back to display the HTML. But Firefox will ask the user what to do with the unknown file type. This could work, if there was another Mime Type I could use that browsers would accept as HTML, that is not matched in the applicationhost.config. For reference, these are the mime types that will be compressed: <add mimeType="text/*" enabled="true" /> <add mimeType="message/*" enabled="true" /> <add mimeType="application/x-javascript" enabled="true" /> <add mimeType="application/atom+xml" enabled="true" /> <add mimeType="application/xaml+xml" enabled="true" /> Others options? Are there other options to opt out of compression?

    Read the article

  • Stop image from tiling

    - by Glen Morse
    I have a procedure: procedure DrawSolidHexImage(Target: TCanvas; { Canvas to draw hex on } Fillstyle : TBrushStyle; { How to fill the hex } Fillcolor : TColor; { Color to fill it } fillimage : Tbitmap; { Image to show} Linestyle : TPenStyle; { What kind of lines } LineColor : Tcolor; { What color for lines } x,y,radius: integer; { Position and size of Hex } button : boolean); { Make hexes look like buttons? } When I use this, the image is tiled to fill the area. Is there something I can add or must remove to make it not tile? Thus not repeating the image. Maybe make it center? The Code in which I use DrawSolidHexImage looks like: procedure THexMap.ImageAHex(ImageWanted : TBitmap; HexPatternWanted: TBrushStyle; MapLocation:TPoint); var p0:TPoint; begin if FHexMapOn and FDrawSolidMap and (not UseSavedMap) then begin with TempMap.canvas do p0 := ConvertCoords(Point(MapLocation.x,MapLocation.y),ptROWCOL); DrawSolidHexImage(TempMap.Canvas,HexPatternWanted,clGray, Imagewanted,psSolid,LineColor,p0.x,p0.y,hexradius,hex3d); Refresh; end; end;

    Read the article

  • Issue with Callback method and maintaining CultureInfo and ASP.Net HttpRuntime

    - by Little Larry Sellers
    Hi All, Here is my issue. I am working on an E-commerce solution that is deployed to multiple European countries. We persist all exceptions within the application to SQL Server and I have found that there are records in the DB that have a DateTime in the future! We define the culture in the web.config, for example pt-PT, and the format expected is DD-MM-YYYY. After debugging I found the issue with these 'future' records in the DB is because of Callback methods we use. For example, in our Caching architecture we use Callbacks, as such - CacheItemRemovedCallback ReloadCallBack = new CacheItemRemovedCallback(OnRefreshRequest); When I check the current threads CultureInfo, on these Callbacks it is en-US instead of pt-PT and also the HttpContext is null. If an exception occurs on the Callback our exception manager reports it as MM-DD-YYYY and thus it is persisted to SQL Server incorrectly. Unfortunately, in the exception manager code, we use DateTime.Now, which is fine if it is not a callback. I can't change this code to be culture specific due to it being shared across other verticals. So, why don't callbacks into ASP.Net maintain context? Is there any way to maintain it on this callback thread? What are the best practices here? Thanks.

    Read the article

  • Get Browser to send both If-None-Match and If-Modified-Since

    - by Glen
    My Browser isn't sending back an If-Modified-Since Header for PHP generated Content on the first request my script sends: (Status-Line) HTTP/1.1 200 OK Date Thu, 21 Jan 2010 08:55:25 GMT Server Apache/2.2.11 (Win32) PHP/5.2.9-1 X-Powered-By PHP/5.2.9-1 Pragma no-cache x-ua-compatible IE=8;FF=3;OtherUA=4 Last-Modfied Sat, 02 Jan 2010 02:02:20 GMT Content-Length 28453 Etag b98e0795b509be20146f58e06fbb624f Keep-Alive timeout=5, max=90 Connection Keep-Alive Content-Type image/png it on the second request it sends: (Request-Line) GET /kincumberunitingchurch/banner_image.php?id=1 HTTP/1.1 Host localhost User-Agent Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.0.17) Gecko/2009122116 Firefox/3.0.17 Accept image/png,image/*;q=0.8,*/*;q=0.5 Accept-Language en-us,en;q=0.5 Accept-Encoding gzip,deflate Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive 300 Connection keep-alive Referer http://localhost/kincumberunitingchurch/index.php?sid=tgl9jq3f71nau3cj9vps6pna03 Cookie sid=tgl9jq3f71nau3cj9vps6pna03; PHPSESSID=m0jvven6d7l65pl6odm9ecfnt4 If-None-Match b98e0795b509be20146f58e06fbb624f Cache-Control max-age=0 for other files the sever sends first: (Status-Line) HTTP/1.1 200 OK Date Thu, 21 Jan 2010 08:55:25 GMT Server Apache/2.2.11 (Win32) PHP/5.2.9-1 Last-Modified Wed, 30 Dec 2009 02:40:58 GMT Etag "1000000013d35-40d9-47be9117f6280" Accept-Ranges bytes Content-Length 16601 Keep-Alive timeout=5, max=84 Connection Keep-Alive Content-Type image/png and my browser send the following on the next request: (Request-Line) GET /kincumberunitingchurch/img/cbuttons.png HTTP/1.1 Host localhost User-Agent Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.0.17) Gecko/2009122116 Firefox/3.0.17 Accept image/png,image/*;q=0.8,*/*;q=0.5 Accept-Language en-us,en;q=0.5 Accept-Encoding gzip,deflate Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive 300 Connection keep-alive Referer http://localhost/kincumberunitingchurch/mystyle.css Cookie sid=tgl9jq3f71nau3cj9vps6pna03; PHPSESSID=m0jvven6d7l65pl6odm9ecfnt4 If-Modified-Since Wed, 30 Dec 2009 02:40:58 GMT If-None-Match "1000000013d35-40d9-47be9117f6280" Cache-Control max-age=0 why would it send the If-Modified-Since header

    Read the article

  • Saving an xml file without

    - by little
    Hi, How do I work with an xml file that when updating it, after saving the commented lines would still be present. Here's my code snippet for saving the file: public static void WriteSettings(Settings settings, string path) { XmlSerializer serializer = new XmlSerializer(typeof(Settings)); TextWriter writer = new StreamWriter(path); serializer.Serialize(writer, settings); writer.Close(); }

    Read the article

  • Processing an XML file removes comments

    - by little
    This snippet <!--Please don't delete this--> is part of my xml file. After running this method, the resulting xml file does not contain this snippet anymore <!--Please don't delete this-->. Why is this? Here's my method: XmlSerializer serializer = new XmlSerializer(typeof(Settings)); TextWriter writer = new StreamWriter(path); serializer.Serialize(writer, settings); writer.Close();

    Read the article

  • How can I reverse ruby's include function.

    - by Glen
    I'll explain what i'm looking for in code as thats probably the most succinct: module Mixin def method puts "Foo" end end class Whatever include Mixin end w = Whatever.new w.method => "Foo" # some magic here w2 = Whatever.new w.method => NoMethodError I had tried just undefining the Mixin module using remove_const, but this doesn't seem to make any difference to Whatever. I had assumed that #include just added a reference to the module into the class's method resolution chain - but this behaviour doesn't agree with that. Can anyone tell me what include actually does behind the scenes, and how to reverse this?

    Read the article

  • How to get Augmented Reality: A Practical Guide examples working?

    - by Glen
    I recently bought the book: Augmented Reality: A Practical Guide (http://pragprog.com/titles/cfar/augmented-reality). It has example code that it says runs on Windows, MacOS and Linux. But I can't get the binaries to run. Has anyone got this book and got the binaries to run on ubuntu? I also can't figure out how to compile the examples in Ubuntu. How would I do this? Here is what it says to do: Compiling for Linux Refreshingly, there are no changes required to get the programs in this chapter to compile for Linux, but as with Windows, you’ll first have to find your GL and GLUT files. This may mean you’ll have to download the correct version of GLUT for your machine. You need to link in the GL, GLU, and GLUT libraries and provide a path to the GLUT header file and the files it includes. See whether there is a glut.h file in the /usr/include/GL directory; otherwise, look elsewhere for it—you could use the command find / -name "glut.h" to search your entire machine, or you could use the locate command (locate glut.h). You may need to customize the paths, but here is an example of the compile command: gcc -o opengl_template opengl_template.cpp -I /usr/include/GL -I /usr/include -lGL -lGLU -lglut gcc is a C/C++ compiler that should be present on your Linux or Unix machine. The -I /usr/include/GL command-line argument tells gcc to look in /usr/include/GL for the include files. In this case, you’ll find glut.h and what it includes. When linking in libraries with gcc, you use the -lX switch—where X is the name of your library and there is a correspond- ing libX.a file somewhere in your path. For this example, you want to link in the library files libGL.a, libGLU.a, and libglut.a, so you will use the gcc arguments -lGL -lGLU -lglut. These three files are found in the default directory /usr/lib/, so you don’t need to specify their location as you did with glut.h. If you did need to specify the library path, you would add -L to the path. To run your compiled program, type ./opengl_template or, if the current directory is in your shell’s paths, just opengl_template. When working in Linux, it’s important to know that you may need to keep your texture files to a maximum of 256 by 256 pixels or find the settings in your system to raise this limit. Often an OpenGL program will work in Windows but produce a blank white texture in Linux until the texture size is reduced. The above instructions make no sense to me. Do I have to use gcc to compile or can I use eclipse? If I use either eclipse or gcc what do I need to do to compile and run the program?

    Read the article

  • SharePoint Designer for Mac?

    - by Glen Hunt
    I'm looking for some way of editing SharePoint ASPX pages on my Mac, using either a local text editor or some kind of remote-into-the-SP-server solution (like emacs with tramp). I know that Cyberduck has the ability to open WebDAV servers with NTLM authentication, but I've been unable to get that to work. So far, the only solution I've found is to use a remote desktop connection to a Windows Server, and run SharePoint Designer from there. Anyone know of either a better method, or a SharePoint Designer alternative?

    Read the article

  • ASP.NET MVC Inheriting from ProfileBase

    - by Glen
    I have 2 related issues. I inherited from ProfileBase and I have a couple of properites as such public SomeType PropertyName { get { return (SomeType)base["PropertyName"]; } set { base["PropertyName"] = value; Save(); } } I also have a User class (UserId, UserName, Profile, LastActivityDate) that has 2 additional properties out of the profile that I retrieve in my View to show a list of Users (i.e. @Model.Profile.PropertyName). However, everytime I access a property (from my View) it seems to update the LastActivityDate in the aspnet_Users table because when I show the LastActivityDate as well as the profile properties on my screen the LastActivtyDate is out of sync with the database. Also there is a LastActivityDate property available in my profile which unfortunately is not available and is in fact set to null and throws an exception when accessing it saying the property UserName is null. So the static Create method provided by ProfileBase seems to retrieve the correct profile properties but does not set the base's UserName property even though you pass in a UserName parameter to the Create method. Is this a internal bug? I was kind of hoping if by accessing the property because the LastActivityDate is updated then I could store that value to update my LastActivityDate in my User class before it is rendered to the page. The only way I can think of doing it is: public SomeType PropertyName { get { SomeType result = (SomeType)base["PropertyName"]; OnLastActivityDateChanged(); return result; } set { base["PropertyName"] = value; } } then in my User class: ... public MyProfile() { Profile.LastActivityDateChanged += Profile_LastActivityDateChanged(); } ~MyProfile() { Profile.LastActivityDateChanged -= Profile_LastActivityDateChanged(); } ... void Profile_LastActivityDateChanged(object sender, EventArgs e) { //Run a query to get the latest LastActivityDate this.LastActivityDate = ... } It seems I have to make 1 call to retrieve the full list to my aspnet_Users table then another call for each row just to get the latest activity date. ARGGGGHHH!!! Am I going about this the wrong way! I put an ajax refresh hyperlink next to each User row and when I click it, immediately after loading the page, the value changes. Therefore my suspision is valid that calling a property via the inherited profilebase class updates the value. Is there a workaround? It is a bit miss leading when my page says User Smith has no activity for 4 days then I click my ajax refresh link (or refresh the whole page for that matter) and now it says Smith was active but it was just me meally showing the page that indirectly caused an activity read event.

    Read the article

  • Generating all possible subsets of a given QuerySet in Django

    - by Glen
    This is just an example, but given the following model: class Foo(models.model): bar = models.IntegerField() def __str__(self): return str(self.bar) def __unicode__(self): return str(self.bar) And the following QuerySet object: foobar = Foo.objects.filter(bar__lt=20).distinct() (meaning, a set of unique Foo models with bar <= 20), how can I generate all possible subsets of foobar? Ideally, I'd like to further limit the subsets so that, for each subset x of foobar, the sum of all f.bar in x (where f is a model of type Foo) is between some maximum and minimum value. So, for example, given the following instance of foobar: >> print foobar [<Foo: 5>, <Foo: 10>, <Foo: 15>] And min=5, max=25, I'd like to build an object (preferably a QuerySet, but possibly a list) that looks like this: [[<Foo: 5>], [<Foo: 10>], [<Foo: 15>], [<Foo: 5>, <Foo: 10>], [<Foo: 5>, <Foo: 15>], [<Foo: 10>, <Foo: 15>]] I've experimented with itertools but it doesn't seem particularly well-suited to my needs. I think this could be accomplished with a complex QuerySet but I'm not sure how to start.

    Read the article

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