Daily Archives

Articles indexed Tuesday April 20 2010

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

  • Best resource for serious Commodore 64 programming.

    - by postfuturist
    What is the best resource for serious Commodore 64 programming? Assume that serious programming on the Commodore 64 is not done in BASIC V2 that ships with the Commodore 64. I feel like most of the knowledge is tied up in old books and not available on the internet. All that I have found online are either very beginner style introductions to Commodore 64 programming (Hello world), or arcane demo-coder hacks to take advantage of strange parts of the hardware. I haven't found a well-explained list of opcodes, memory locations for system calls, and general mid-level examples and tips. Main portals I have found: lemon64 C-64 Scene Database c64web Actually hosted on a Commodore 64! Tools I have found: cc65 A C compiler that can target Commodore 64.

    Read the article

  • Is this way the best solution to read and save images from Rss Feeds?

    - by Keyne
    Hi, I've build a "RSS Feed Reader" module to my application, and for every post with images in the content, I get the first that matches a specific size and then I save for future use as reference to the posts. When processing, everything works properly except when more then 10 images are saved at the same time (This value is variable). I got an 404 error after a while saving the images. Some images are saved, but not all of them. If I run the app in my local server, everything work as expected (using set_timeout(0) to avoid timeout errors). Currently my application is hosted at dreamhost and I'm using Zend Framework. I'm not sure if the problem is specif for Zend Framework applications, so I didn't put any tags about. I've had this problem another time with other projects hosted at dreamhost. They seems to limitate memory for operations like that. My question is: There is a better way to save images then this (maybe in background? a limited amount per operation?): require_once(APPLICATION_PATH . '/../library/simplehtmldom/simple_html_dom.php'); $TableFeeds = new Model_DbTable_Feeds(); $Feeds = $TableFeeds->fetchAll(); foreach($Feeds as $Feed) { $entries = Zend_Feed_Reader::import($Feed->link); $lastEntry = $this->getLastEntry($Feed->id); if($lastEntry) { $lastDate = new Zend_Date($lastEntry->created_at, Zend_Date::ISO_8601); } foreach ($entries as $entry) { if($lastDate) { if(strtotime($lastDate->get('y-M-d H:m:s')) >= strtotime($entry->getDateCreated()->get('y-M-d H:m:s'))) { break; } } $Category = new Model_DbTable_Categorias(); $availableCategories = $Category->getList('slug'); $categoria_id = false; foreach ($categories as $cat) { if(!empty($cat) && !$categoria_id) { $slug = Zf_Convert::slugfy($cat); if($availableCategories[$Feed->categoria_id] == $slug) { $categoria_id = $Feed->categoria_id; break; } if(in_array($slug,$availableCategories)) { $categoria_id = array_search($slug,$availableCategories); break; } } } if(!$categoria_id) { $categoria_id = $Feed->categoria_id; } // Cadastra a entrada $data = array( 'categoria_id' => $categoria_id, 'feed_id' => $Feed->id, 'titulo' => $entry->getTitle(), 'slug' => Zf_Convert::slugfy($entry->getTitle()), 'created_at' => $entry->getDateCreated()->get(Zend_Date::ISO_8601), 'link' => $entry->getLink(), 'html' => $entry->getContent(), 'tags' => $tags ); $entry_id = $this->insert($data); if($categoria_id == 2) { set_time_limit(0); $post_dom = str_get_dom($entry->getContent()); $img_tags = $post_dom->find('img'); $images = array(); foreach($img_tags as $image) { $images[] = $image->src; } if(count($images)) { $i = 0; $saved = false; while($images[$i] && !$saved) { $src = $images[$i]; $imagem = Zf_Image::create($src); $size = $imagem->getCurrentDimensions(); if($size['width'] >= 150 && $size['height'] >= 200) { $imagem->adaptiveResize(200,200); $imagem->save(PUBLIC_PATH . '/img/feeds/manchetes/' . $entry_id . '.jpg'); $saved = true; $this->update(array('imagemChamada' => 1),'id =' . $entry_id); } $i++; } } } } } }

    Read the article

  • Equivalent of Windows 7 Winkey+Left / Winkey+Right for Window Tiling in OSX

    - by Koobz
    Windows 7 has a neat feature where the Windows Key in conjunction with the arrow keys tiles the active window. Windows key + left arrow moves it to the left half, windows key + right arrow moves your window to the right half of your monitor. Is there an equivalent to this functionality in OS X? Can anyone suggest some alternative metaphors by which to manage my windows? I find that OSX windows tend to be a bit more scatterbrained than their windows counterparts.

    Read the article

  • 11g R2 on Windows???????!

    - by [email protected]
    Oracle Database?????????11g Release2(R2)?????????????Windows???????! ????Windows 7? Windows Server 2008 R2????????11g R2 for Windows????????OTN???????11gR2??????????????????????????????? ??????????????! OTN??????????????????????????????????????????????????????????????(?)????????????????????????????????????? http://www.oracle.com/technology/global/jp/software/products/database/index.html ? ???????????????????????????????????????????????????????????????? ??????????????????????? ???????! ??????????????????·??·??????????·??????·RAC????????????? GUI(Oracle Enterprise Manager)????????????···?????????????2??xx????? ??? http://download.oracle.com/docs/cd/E16338_01/index.htm????????????????????? ???????! ???PC?????????Oracle Direct Seminar?????????????????????????????11gR2?????????????????????? ???????????3???????? 2010?4?28?(?) 11:00~12:00 Windows 7 / Windows Server 2008 R2 ?????? Oracle ! 2010?5?26?(?) 11:00~12:00 ? ????DB??????????11g R2??? 2010?5?19?(?) 18:00~20:00 [Oracle Evening Seminar]Oracle Database 11g Release2?Windows Server 2008 R2/Windows7?????! 2010?5?22?(?) 13:00~17:00 [Oracle Weekend Seminar] ????????! Oracle Database ??? ????????????????????????????????! ????????????? ????????????????????? http://www.oracle.com/technology/global/jp/documentation/database.html OTN???????11gR2 ??????????????????????????????????????????????????????? ??? ????????????????????????????????????????????????????????????? ???????? ?????? ?????? FAQ ??????????????FAQ?????????? Coming Soon! 11gR2 on Windows ???????????????5???????????????????? ???????!???????????????????????????????????????··! ???????Oracle Database??????????????????OTN???????????????! ???????????????http://www.oracle.com/technology/global/jp/membership/index.html

    Read the article

  • Important Differences Between SEO and SEM

    Though both may be integral parts of the Search Engine cosmos, there still are huge differences between SEO and SEM in terms of features and the way in which they get implemented. Many have said that SEO India is a part or a division of SEM India. SEO envelopes factors such as meta tags, keywords and their density, titles and HTML coding where as SEM encompasses factors such as search engine submissions, directory submissions, paid inclusions and certain others.

    Read the article

  • SEO - The Powerful Linkwheel

    Perhaps, you heard the term linkwheel, but you just can't connect it with something useful to you. Linkwheel is an SEO technique use by expert SEO's to increase the quality of their site.

    Read the article

  • Keyword Research - The Foundation For Your Website!

    With the proliferation of the use of the Internet as a form of marketing, it is so important to be familiar with the common terms and practices used in this new marketing medium in order to be in the loop. Keyword research is the use of search engine optimization experts in finding out what keywords are popularly used by Internet users when they use search engines to obtain information.

    Read the article

  • How to apply jquery UI buttons to asp:Button

    - by Sash
    How do I apply jQueryUI styles to an asp:Button. Here is the problem: jqueryUI button requires you to have the following format <button>Test button</button> When I try to use an asp button server control, <asp:Button />, asp:Button renders as <input type=button>Test button </input> Thanks in advance, Sashidhar Kokku

    Read the article

  • Multi-level clones with Git?

    - by Chad Johnson
    So, I'm thinking of having the following centralized setup with Git (each of these are clones): stable development developer1 developer2 developer3 So, I created my stable repository git --bare init made the 'development' clone git clone ssh://host.name//path/to/stable/project.git development and made a 'developer' clone git clone ssh://host.name//path/to/development/project.git developer So, now, I make a change, commit, and then I push from my developer account git commit --all git push and the change goes to the development clone. But now, when I ssh to the server, go to the development clone directory, and run "git fetch" or "get pull", I don't see the changes. So what do I do? Am I totally misunderstanding things and doing things wrong? How can I see the changes in the 'development' clone that I pushed from my 'developer' clone? This worked fine in Mercurial.

    Read the article

  • Fast JSON serialization (and comparison with Pickle) for cluster computing in Python?

    - by user248237
    I have a set of data points, each described by a dictionary. The processing of each data point is independent and I submit each one as a separate job to a cluster. Each data point has a unique name, and my cluster submission wrapper simply calls a script that takes a data point's name and a file describing all the data points. That script then accesses the data point from the file and performs the computation. Since each job has to load the set of all points only to retrieve the point to be run, I wanted to optimize this step by serializing the file describing the set of points into an easily retrievable format. I tried using JSONpickle, using the following method, to serialize a dictionary describing all the data points to file: def json_serialize(obj, filename, use_jsonpickle=True): f = open(filename, 'w') if use_jsonpickle: import jsonpickle json_obj = jsonpickle.encode(obj) f.write(json_obj) else: simplejson.dump(obj, f, indent=1) f.close() The dictionary contains very simple objects (lists, strings, floats, etc.) and has a total of 54,000 keys. The json file is ~20 Megabytes in size. It takes ~20 seconds to load this file into memory, which seems very slow to me. I switched to using pickle with the same exact object, and found that it generates a file that's about 7.8 megabytes in size, and can be loaded in ~1-2 seconds. This is a significant improvement, but it still seems like loading of a small object (less than 100,000 entries) should be faster. Aside from that, pickle is not human readable, which was the big advantage of JSON for me. Is there a way to use JSON to get similar or better speed ups? If not, do you have other ideas on structuring this? (Is the right solution to simply "slice" the file describing each event into a separate file and pass that on to the script that runs a data point in a cluster job? It seems like that could lead to a proliferation of files). thanks.

    Read the article

  • TextBox.TextChanged & ICommandSource

    - by Brad Leach
    I am following the M-V-VM pattern for my WPF UI. I would like to hook up a command to the TextChanged event of a TextBox to a command that is in my ViewModel class. The only way I can conceive of completing this task is to inherit from the TextBox control, and implement ICommandSource. I can then instruct the command to be fired from the TextChanged event. This seems to be too much work for something which appears to be so simple. Is there an easier way (than subclassing the TextBox and implementing ICommandSource) to hook up the TextChanged event to my ViewModel class?

    Read the article

  • Hiding members in a C struct

    - by Marlon
    I've been reading about OOP in C but I never liked how you can't have private data members like you can in C++. But then it came to my mind that you could create 2 structures. One is defined in the header file and the other is defined in the source file. // ========================================= // in somestruct.h typedef struct { int _public_member; } SomeStruct; // ========================================= // in somestruct.cpp #include "somestruct.h" typedef struct { int _public_member; int _private_member; } SomeStructSource; SomeStruct *SomeStruct_Create() { SomeStructSource *p = (SomeStructSource *)malloc(sizeof(SomeStructSource)); p->_private_member = 0xWHATEVER; return (SomeStruct *)p; } From here you can just cast one structure to the other. Is this considered bad practice? Or is it done often? (I think this is done with a lot of the structures when using the Win32 API, but you guys are the experts let me know!)

    Read the article

  • Catching an error for a child resource in Ruby on Rails

    - by randombits
    What is the best way to add errors to render if a child resource is really what's having issues and not the parent resource? In english what I mean is the following.. imagine the following code: @foo = Foo.new foochild = Foochild.new // break foochild somehow @foo << foochild @foo.save now when I do: format.xml { render :xml => @foo.errors } I don't get anything about how foochild broke, meaning the error message is useless to the user. How does one go about fixing this?

    Read the article

  • How do I correctly install dulwich to get hg-git working on Cygwin?

    - by Erik Vold
    I have a similar issue as in this issue, but in my case I am trying to use cygwin. First I followed the instructions here, and I ran: $ easy_install hg-git The I created ~/.hgrc, with: [extensions] hgext.bookmarks = hggit = Then when I typed 'hg' at a command prompt, I'd see: "* failed to import extension hggit: No module named hggit" So I did a search for "hggit" and found /cygdrive/c/Python26/Lib/site-packages/hg_git-0.2.1-py2.6.egg/hggit, so I updated .hgrc: [extensions] hgext.bookmarks = hggit = /cygdrive/c/Python26/Lib/site-packages/hg_git-0.2.1-py2.6.egg/hggit Then when I type 'hg' I get "No module named dulwich.errors" If you read this question, it's the same problem. In python shell I cannot import dulwich: >>> import dulwich Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named dulwich I checked out my easy-install.pth and it does contain the dulwich egg: import sys; sys.__plen = len(sys.path) ./hg_git-0.2.1-py2.6.egg ./dulwich-0.5.0-py2.6-win32.egg import sys; new=sys.path[sys.__plen:]; del sys.path[sys.__plen:]; p=getattr(sys,'__egginsert',0); sys.path[p:p]=new; sys.__egginsert = p+len(new) So how can I fix this so that import dulwich works, which should fix my problem using hg-git I assume..

    Read the article

  • Reading string value from Excel with HSSF but it's double

    - by egaga
    Hi, I'm using HSSF-POI for reading excel data. The problem is I have values in a cell that look like a number but really are strings. If I look at the format cell in Excel, it says the type is "text". Still the HSSF Cell thinks it's numeric. How can I get the value as a string? If I try to use cell.getRichStringValue, I get exception; if cell.toString, it's not the exact same value as in Excel sheet. Thanks! edit: until this gets resolved, I'll use new BigDecimal(cell.getNumericCellValue()).toString()

    Read the article

  • Jquery: How do I select dynamic ids in this format?

    - by sjsc
    I'm trying to select dynamic ids when a user types something into the input fields. My app spits out the input fields in the following format: <input id="student_1_first_name" /> <input id="student_1_last_name" /> <input id="student_2_first_name" /> <input id="student_2_last_name" /> <input id="student_3_first_name" /> <input id="student_3_last_name" /> etc. For example, I tried doing this to select the end of the id string: <script type="text/javascript"> $(document).ready( function (){ $("input[id$=_first_name]").bind("keyup", run_some_function_here); run_some_function_here(); $("input[id$=_last_name]").bind("keyup", run_some_function_here); run_some_function_here(); } ); </script> When I do that, Jquery can't seem to select the input ids, so the functions don't run. Do you have any ideas on how I can select the ids correctly?

    Read the article

  • FileSystemWatcher does not fire when using C++ std::ofstream

    - by Adam Haile
    I'm trying to add a log monitor to an in-house test utility for a windows service I'm working on. The service is written in C++ (win32) and the utility is in .NET (C#) The log monitor works for many other C++ apps I've written, but not for my service. The only main difference I can see is that the other apps use the older ::WriteFile() to output to the log, whereas in the service I'm using std::ofstream like this: std::ofstream logFile; logFile.open("C:\\mylog.log"); logFile << "Hello World!" << std::endl; logFile.flush(); From my utility I use FileSystemWatcher like this: FileSystemWatcher fsw = new FileSystemWatcher(@"C:\", "mylog.log"); fsw.Changed += new FileSystemEventHandler(fsw_Handler); fsw.EnableRaisingEvents = true; But for the service, it never gets any change events as the log is updated. I've found that any example code using FileSystemWatcher I've come across online has the same exact issue as well... But, I know the events should be available because other log monitor apps (like BareTail) work fine with the service log file. I'd rather get the C# code for the utility to just work so it works with anything, but if I have to change the logging code for the service I will. Does anyone see what's going wrong here?

    Read the article

  • Game AI: Pattern for implementing Sense-Think-Act components?

    - by Rosarch
    I'm developing a game. Each entity in the game is a GameObject. Each GameObject is composed of a GameObjectController, GameObjectModel, and GameObjectView. (Or inheritants thereof.) For NPCs, the GameObjectController is split into: IThinkNPC: reads current state and makes a decision about what to do IActNPC: updates state based on what needs to be done ISenseNPC: reads current state to answer world queries (eg "am I being in the shadows?") My question: Is this ok for the ISenseNPC interface? public interface ISenseNPC { // ... /// <summary> /// True if `dest` is a safe point to which to retreat. /// </summary> /// <param name="dest"></param> /// <param name="angleToThreat"></param> /// <param name="range"></param> /// <returns></returns> bool IsSafeToRetreat(Vector2 dest, float angleToThreat, float range); /// <summary> /// Finds a new location to which to retreat. /// </summary> /// <param name="angleToThreat"></param> /// <returns></returns> Vector2 newRetreatDest(float angleToThreat); /// <summary> /// Returns the closest LightSource that illuminates the NPC. /// Null if the NPC is not illuminated. /// </summary> /// <returns></returns> ILightSource ClosestIlluminatingLight(); /// <summary> /// True if the NPC is sufficiently far away from target. /// Assumes that target is the only entity it could ever run from. /// </summary> /// <returns></returns> bool IsSafeFromTarget(); } None of the methods take any parameters. Instead, the implementation is expected to maintain a reference to the relevant GameObjectController and read that. However, I'm now trying to write unit tests for this. Obviously, it's necessary to use mocking, since I can't pass arguments directly. The way I'm doing it feels really brittle - what if another implementation comes along that uses the world query utilities in a different way? Really, I'm not testing the interface, I'm testing the implementation. Poor. The reason I used this pattern in the first place was to keep IThinkNPC implementation code clean: public BehaviorState RetreatTransition(BehaviorState currentBehavior) { if (sense.IsCollidingWithTarget()) { NPCUtils.TraceTransitionIfNeeded(ToString(), BehaviorState.ATTACK.ToString(), "is colliding with target"); return BehaviorState.ATTACK; } if (sense.IsSafeFromTarget() && sense.ClosestIlluminatingLight() == null) { return BehaviorState.WANDER; } if (sense.ClosestIlluminatingLight() != null && sense.SeesTarget()) { NPCUtils.TraceTransitionIfNeeded(ToString(), BehaviorState.ATTACK.ToString(), "collides with target"); return BehaviorState.CHASE; } return currentBehavior; } Perhaps the cleanliness isn't worth it, however. So, if ISenseNPC takes all the params it needs every time, I could make it static. Is there any problem with that?

    Read the article

  • WordPress Write Cache Problem with Multiple Sessions

    - by Volomike
    I'm working on a content dripper custom plugin in WordPress that my client asked me to build. He says he wants it to catch a page view event, and if it's the right time of day (24 hours since last post), to pull from a resource file and output another post. He needed it to also raise a flag and prevent other sessions from firing that same snippet of code. So, raise some kind of flag saying, "I'm posting that post, go away other process," and then it makes that post and releases the flag again. However, the strangest thing is occurring when placed under load with multiple sessions hitting the site with page views. It's firing instead of one post -- it's randomly doing like 1, 2, or 3 extra posts, with each one thinking that it was the right time to post because it was 24 hours past the time of the last post. Because it's somewhat random, I'm guessing that the problem is some kind of write caching where the other sessions don't see the raised flag just yet until a couple microseconds pass. The plugin was raising the "flag" by simply writing to the wp_options table with the update_option() API in WordPress. The other user sessions were supposed to read that value with get_option() and see the flag, and then not run that piece of code that creates the post because a given session was already doing it. Then, when done, I lower the flag and the other sessions continue as normal. But what it's doing is letting those other sessions in. To make this work, I was using add_action('loop_start','checkToAddContent'). The odd thing about that function though is that it's called more than once on a page, and in fact some plugins may call it. I don't know if there's a better event to hook. Even still, even if I find an event to hook that only runs once on a page view, I still have multiple sessions to contend with (different users who may view the page at the same time) and I want only one given session to trigger the content post when the post is due on the schedule. I'm wondering if there are any WordPress plugin devs out there who could suggest another event hook to latch on to, and to figure out another way to raise a flag that all sessions would see. I mean, I could use the shared memory API in PHP, but many hosting plans have that disabled. Can't use a cookie or session var because that's only one single session. About the only thing that might work across hosting plans would be to drop a file as a flag, instead. If the file is present, then one session has the flag. If the file is not present, then other sessions can attempt to get the flag. Sure, I could use the file route, but it's kind of immature in my opinion and I was wondering if there's something in WordPress I could do.

    Read the article

  • Script tag in XHTML

    - by Ben
    Hi, This might sound like a reaaaally dumb question but... why do browsers have a fit with this syntax: <script type='text/javascript' src="/path/to/my.js" /> and want this instead <script type='text/javascript' src="/path/to/my.js"></script> Seems the first construct should be valid since there's no inner content to the tag.. ?

    Read the article

  • How to collect user opinions about software

    - by alga
    I have written a small .net Windows Forms application. And now I decided to get opinions or comments from users. User will just write something in a input form and click a send button. I want to use the most easiest way. I don't want to host any webservices or another applications for gathering the information. Also I don't have a database. Nothing. I just want to know what people think about the application. How would you do it?

    Read the article

  • How do I fix incorrect inline Javascript indentation in Vim?

    - by Charles Roper
    I can't seem to get inline Javascript indenting properly in Vim. Consider the following: $(document).ready(function() { // Closing brace correctly indented $("input").focus(function() { $(this).closest("li").addClass("cur-focus"); }); // <-- I had to manually unindent this // Closing brace incorrectly indented $("input").blur(function() { $(this).closest("li").removeClass("cur-focus"); }); // <-- This is what it does by default. Argh! }); Vim seems to insist on automatically indenting the closing brace shown in the second case there. It does the same if I re-indent the whole file. How do I get it to automatically indent using the more standard JS indenting style seen in the first case?

    Read the article

  • Does anyone know why my WiFi connection suddenly keeps disconnecting, and will not re-connect withou

    - by Xavierjazz
    Does anyone know why my WiFi connection suddenly keeps disconnecting, and will not re-connect without a boot? I looked at other questions, but the OS is different and its not regular. Also the only answer there is not useful. I have had this connection for about 2 weeks with no problems, but suddenly, yesterday, it happened a few times and today it has happened at least 8 times so far. ISP: Bell Sympatico OS: XP SP3 Thanks all.

    Read the article

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