Daily Archives

Articles indexed Thursday February 3 2011

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

  • Network printer gets disabled occasionally

    - by Yossi Farjoun
    I'm running Ubuntu 10.04 and have a HP-Laserjet-3005P network printer. Occasionally (perhaps related to rebooting) the printer, which is setup as the default printer, becomes disabled. After realizing that I'm not getting anything printed, I must then open printing preferences and click on "enabled". Then it prints happily until the next time that it becomes disabled... Any ideas why this is happening and/or how I could fix it? I know I'm giving very little information, I can't think of anything else to give...if there's something I should be providing, please let me know.

    Read the article

  • Where is the Accessibility mouse click lock?

    - by user10133
    I've been a user of Linux on the desktop off and on again over the years. I very nearly switched my primary computer to Ubuntu prior to the release of Windows 7. There were a few, but significant issues at the time that prevented wholesale adoption, mostly tethering with my phone and lousy VPN Client. One key component I could count on was the Accessibility features. I have recently installed Ubuntu 10.10 and am considering giving it another try, but it appears Ubuntu has taken a leap backwards in that it no longer has a click lock feature for the mouse. Basically I need the ability to press and hold the left button to trigger a locking of the button so I can move the mouse by way of a trackpoint with my prosthesis. I absolutely require this feature and it is a deal breaker if it won't work. I've tried the Dwell keys but this is a chaotic control at best. I've never been able to manage a drag of any kind.

    Read the article

  • Only recognizes one partition from multi partitions SD card

    - by Jay Ngo
    Hello everybody, I split my sd card into 2 partitions. When i use usb-card-reader to read my sd card, only the one partition shows up on the screen, the other doesn't. I have run the command "sudo fdisk -l" and the result is the same, only one partition is recognized. But i do believe both partitions of my sd card work fine, because i still can boot my single-board computer with that sd card and run some programms, which are inside that unreadable partition. How can i access both partitions of my sd card? Does anyone know how to solve this kind of problem? I really appreciate your help.

    Read the article

  • How can I get Kindle for PC to work in Ubuntu using Wine?

    - by codeLes
    I've 'installed' Kindle using Wine but it doesn't work. The menu item is there but nothing seems to happen when I click it. I have set the application settings in Wine config to run Kindle as Windows 98 as I've seen suggested... still no luck. Any experience with this? EDIT I don't have a kindle, but I use kindle for android. I was wanting to be able to read my books on my pc without having to use windows.

    Read the article

  • Question about mod_rewrite rule for redirecting failing pages

    - by SimpleCoder
    I'm setting up a mod_rewrite rule that redirects failing pages to a custom Page Not Found page. This is with Wordpress. I'm using the guide here: http://httpd.apache.org/docs/2.2/rewrite/rewrite_guide_advanced.html#redirect404. My rule so far looks like this: RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.+) http://example.com/?page_id=254 [R] This works. It seems to be a combination of the first and second suggestion that worked, since the -U flag did nothing. My question is, out of curiosity why the following happens: When I change REQUEST_FILENAME to REQUEST_URI (as the second example suggests), the page loads, but none of the style sheets load. All of my formatting is gone, and this happens on every page. Can anyone think of why this might happen?

    Read the article

  • Simple project - make a 3D box tumble and fall to the ground [closed]

    - by Dominic Bou-Samra
    Possible Duplicate: Resources to learn programming rigid body simulation Hi guys, I want to try learning rigid-body dynamic simulation. I have done a fluid and cloth simulation before, but never anything rigid. My maths knowledge is limited in that I don't know the notation that well. Are there any good cliff-notes, tutorials, guides on how I would accomplish a simple task like this? I don't want a super complex pdf that's only a little relevant. Thanks.

    Read the article

  • XNA: How to make the Vaus Spacecraft move left and right on directional keys pressed?

    - by Will Marcouiller
    I'm currently learning XNA per suggestion from this question's accepted answer: Where to start writing games, any tutorials or the like? I have then installed everything to get ready to work with XNA Game Studio 4.0. General Objective Writing an Arkanoid-like game. I want to make my ship move when I press either left or right keys. Code Sample protected override void Update(GameTime gameTime) { // Allows the game to exit if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed) this.Exit(); // TODO: Add your update logic here #if WINDOWS if (Keyboard.GetState().IsKeyDown(Keys.Escape)) this.Exit(); else { if (Keyboard.GetState().IsKeyDown(Keys.Left)) MoveLeft(gameTime); } #endif // Move the sprite around. BounceEnergyBall(gameTime); base.Update(gameTime); } void MoveLeft(GameTime gameTime) { // I'm not sure how to play with the Vector2 object and its position here!... _vausSpacecraftPos /= _vausSpacecraftSpeed.X; // This line makes the spacecraft move diagnol-top-left. } Question What formula shall I use, or what algorithm shall I consider to make my spaceship move as expected left and right properly? Thanks for your thoughts! Any clue will be appreciated. I am on my learning curve though I have years of development behind me (already)!

    Read the article

  • Access is denied. Javascript error on request to secured page

    - by ihorko
    On SomePage.aspx page by javascript (XMLHttpRequest) I call SecuredPage.aspx used next code: var httpRequest = GetXmlHttp(); var url = "https://myhost.com/SecuredPage.aspx"; var params = "param1=" + document.getElementById('param1').value + "&param2=" + document.getElementById('param2').value; httpRequest.open("POST", url, true); httpRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); httpRequest.onreadystatechange = function() { //Call a function when the state changes. if (httpRequest.readyState == 4 && httpRequest.status == 200) { alert(httpRequest.responseText); } } httpRequest.send(params); // HERE ACCESS IS DENIED //--------------------------------------------- function GetXmlHttp() { var xmlhttp = false; if (window.XMLHttpRequest) { xmlhttp = new XMLHttpRequest(); } else if (window.ActiveXObject) // code for IE { try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) { xmlhttp = false; } } } return xmlhttp; } It throws Access is denied error. if send to http (http://myhost.com/SecuredPage.aspx), it works fine. How is it possible to resolve that problem. Thanks!

    Read the article

  • Executing commands on a Unix box from ASP .NET

    - by StefanE
    I'm in process to create a few utilities for my team to make life a bit easier working with our Unix boxes(most of them Solaris based). For example I'm creating a ASP .NET page to display the output of TOP. Also plan to be able to restart processes with the KILL -15 command. Now I wonder if there is any nice modules out the do the work for me or am I better off just going ahead with my own SSH communication? It would of course make sense building the app on the unix box directly but I'm not able to do this.

    Read the article

  • Append a parameter to a querystring with mod_rewrite

    - by Matt
    Hello, I would like to use mod_rewrite to append a parameter to the end of a querystring. I understand that I can do this using the [QSA] flag. However, I would like the parameter appended ONLY if it does not already exist in the querystring. So, if the querystring was: http://www.mysite.com/script.php?colour=red&size=large I would like the above URL to be re-directed to http://www.mysite.com/script.php?colour=red&size=large&weight=heavy Where weight=heavy is appended to the end of the querystring only if this specific parameter was not there in the first place! If the specific parameter is already in the URL then no redirect is required. Can anybody please suggest code to put in my .htacess file that can do this? Thanks.

    Read the article

  • Android preferencesActivity setDefaultValue() not working?

    - by Nick
    I'm extending PreferenceActivity for my settings screen. In this preference activity i have a couple of preferences one of which is custom made. The problem is as follows: in this custom preference (which extends from ListPreference) i want to be able to set the default value, so i override the setDefaultValue() method. In this method i do some parsing so it'll take the correct value. When i'm trying to read this value with the getValue() function it just returns null. So i figured, what happens when i just put some hardcoded value in there (you know, maybe i did something wrong, wouldn't be the first time). Well, i still get null back. Any ideas what i'm doing wrong? Edit: Setting the defaultValue in the xml file isn't really an option because the values aren't known until i retrieve them. I made a workaround: When app is started for the first time: get data Set the values in the preference. This way i set the default preference when i'm collection the data

    Read the article

  • method __getattr__ is not inherited from parent class

    - by ??????
    Trying to subclass mechanize.Browser class: from mechanize import Browser class LLManager(Browser, object): IS_AUTHORIZED = False def __init__(self, login = "", passw = "", *args, **kwargs): super(LLManager, self).__init__(*args, **kwargs) self.set_handle_robots(False) But when I make something like this: lm["Widget[LinksList]_link_1_title"] = anc then I get an error: Traceback (most recent call last): File "<pyshell#8>", line 1, in <module> lm["Widget[LinksList]_link_1_title"] = anc TypeError: 'LLManager' object does not support item assignment Browser class have overridden method __getattr__ as shown: def __getattr__(self, name): # pass through _form.HTMLForm methods and attributes form = self.__dict__.get("form") if form is None: raise AttributeError( "%s instance has no attribute %s (perhaps you forgot to " ".select_form()?)" % (self.__class__, name)) return getattr(form, name) Why my class or instance don't get this method as in parent class?

    Read the article

  • How do I call a function defined in a C++ DLL that has a parameter of type int *, from inside C# code ?

    - by Ashutosh
    I have a native regular C++ Dll which I want to call from C# code, so i created C++/CLI class (as described here and here) which will include managed C++ code and which can be called by any C# code directly and which can make calls inturn to native unmanaged C++. One of function in native C++ dll has parameter of type int *. How do I declare in wrapper function and how can i convert it into int *?

    Read the article

  • math syntax checker written in python

    - by neurino
    All I need is to check, using python, if a string is a valid math expression or not. For simplicity let's say I just need + - * / operators (+ - as unary too) with numbers and nested parenthesis. I add also simple variable names for completeness. So I can test this way: test("-3 * (2 + 1)") #valid test("-3 * ") #NOT valid test("v1 + v2") #valid test("v2 - 2v") #NOT valid ("2v" not a valid variable name) I tried pyparsing but just trying the example: "simple algebraic expression parser, that performs +,-,*,/ and ^ arithmetic operations" I get passed invalid code and also trying to fix it I always get wrong syntaxes being parsed without raising Exceptions just try: >>>test('9', 9) 9 qwerty = 9.0 ['9'] => ['9'] >>>test('9 qwerty', 9) 9 qwerty = 9.0 ['9'] => ['9'] both test pass... o_O Any advice?

    Read the article

  • Oracle DB on solaris utilizing swap memory when free RAM available

    - by Ara
    Hi, We have a weird instance where we noticed our oracle database server swap utilization was 100% and surprised to see that the system had free memory available during that period. To my knowledge, swap memory utilization starts once system runs out of free RAM (please correct me if i'm wrong). Not sure what could have caused this unusual activity. Had anyone else experienced such behaviour? Regs,

    Read the article

  • SQL Server GROUP BY troubles!

    - by Lucas311
    I'm getting a frustrating error in one of my SQL Server 2008 queries. It parses fine, but crashes when I try to execute. The error I get is the following: Msg 8120, Level 16, State 1, Line 4 Column 'customertraffic_return.company' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause. SELECT * FROM (SELECT ctr.sp_id AS spid, Substring(ctr.company, 1, 20) AS company, cci.email_address AS tech_email, CASE WHEN rating IS NULL THEN 'unknown' ELSE rating END AS rating FROM customer_contactinfo cci INNER JOIN customertraffic_return ctr ON ctr.sp_id = cci.sp_id WHERE cci.email_address <> '' AND cci.email_address NOT LIKE '%hotmail%' AND cci.email_address IS NOT NULL AND ( region LIKE 'Europe%' OR region LIKE 'Asia%' ) AND SERVICE IN ( '1', '2' ) AND ( rating IN ( 'Premiere', 'Standard', 'unknown' ) OR rating IS NULL ) AND msgcount >= 5000 GROUP BY ctr.sp_id, cci.email_address) AS a WHERE spid NOT IN (SELECT spid FROM customer_exclude) GROUP BY spid, tech_email

    Read the article

  • How do I implement configurations and settings?

    - by Malvolio
    I'm writing a system that is deployed in several places and each site needs its own configurations and settings. A "configuration" is a named value that is necessary to a particular site (e.g., the database URL, S3 bucket name); every configuration is necessary, there is not usually a default, and it's typically string-valued. A setting is a named value but it just tweaks the behavior of the system; it's often numeric or Boolean, and there's usually some default. So far, I've been using property files or thing like them, but it's a terrible solution. Several times, a developer has added a requirement for a configuration but not added the value to file for the live configuration, so the new release passed all the tests, then failed when released to live. Better, of course, for every file to be compiled — so if there's a missing configuration, or one of the wrong type, it won't get past the compiler — and inject the site-specific class into the build for each site. As a bones, a Scala file can easy model more complex values, especially lists, but also maps and tuples. The downside is, the files are sometimes maintained by people who aren't developers, so it has to be pretty self-explanatory, which was the advantage of property files. (Someone explain XML configurations to me: all the complexity of a compilable file but the run-time risk of a property file.) What I'm looking for is an easy pattern for defining a group required names and allowable values. Any suggestions?

    Read the article

  • ReadFile doesn't work asynchronously on Win7 and Win2k8

    - by f0b0s
    According to MSDN ReadFile can read data 2 different ways: synchronously and asynchronously. I need the second one. The folowing code demonstrates usage with OVERLAPPED struct: #include <windows.h> #include <stdio.h> #include <time.h> void Read() { HANDLE hFile = CreateFileA("c:\\1.avi", GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, NULL); if ( hFile == INVALID_HANDLE_VALUE ) { printf("Failed to open the file\n"); return; } int dataSize = 256 * 1024 * 1024; char* data = (char*)malloc(dataSize); memset(data, 0xFF, dataSize); OVERLAPPED overlapped; memset(&overlapped, 0, sizeof(overlapped)); printf("reading: %d\n", time(NULL)); BOOL result = ReadFile(hFile, data, dataSize, NULL, &overlapped); printf("sent: %d\n", time(NULL)); DWORD bytesRead; result = GetOverlappedResult(hFile, &overlapped, &bytesRead, TRUE); // wait until completion - returns immediately printf("done: %d\n", time(NULL)); CloseHandle(hFile); } int main() { Read(); } On Windows XP output is: reading: 1296651896 sent: 1296651896 done: 1296651899 It means that ReadFile didn't block and returned imediatly at the same second, whereas reading process continued for 3 seconds. It is normal async reading. But on windows 7 and windows 2008 I get following results: reading: 1296661205 sent: 1296661209 done: 1296661209. It is a behavior of sync reading. MSDN says that async ReadFile sometimes can behave as sync (when the file is compressed or encrypted for example). But the return value in this situation should be TRUE and GetLastError() == NO_ERROR. On Windows 7 I get FALSE and GetLastError() == ERROR_IO_PENDING. So WinApi tells me that it is an async call, but when I look at the test I see that it is not! I'm not the only one who found this "bug": read the comment on ReadFile MSDN page. So what's the solution? Does anybody know? It is been 14 months after Denis found this strange behavior.

    Read the article

  • tools for creating user-friendly command-line prompt?

    - by davka
    I notice that some programs (e.g. sqlite, mysql client) provide a command-line prompt that is very similar in capabilities to the bash's, including: line editing with left and right arrows, delete, insert, ^K, etc. history browsing with up and down arrows ^R for reverse i-search in command history which make me think that they are using the same toolset for this. I'd like to create a prompt with similar capabilities in my program, which tools can I use? I prefer it to have the same functionality as in bash, so that the users would be familiar with it.

    Read the article

  • nextgen gallery order issue

    - by mro
    Hi, wonder if anyone can help. I think what I'm after won't be solved by any exsiting code in nextgen plugin (in wordpress) due to the custom way I'm using it hence I come to stackoverflow for some opnions. Bascially - I am only really using the admin of nextgen to work with the gallerys etc. The actual meat of the functionality I'm querying the nextgen DB's direct from my code, I would have loved to use the inbuilt gallerys in nextgen, but my spec specifics were so custom I couldn't. My issue is, I need to pull the images from the DB's in the order it is in the admin (ie if a user pulls the sort order around in the drag and drop area). I have noticed however this doesn't affect the image id order in the DB, and wouldn't expect it to - that would be some complex shifting around just to reorder everytime surely. So obviously when I query the DB the order it's looking at is when it was created, by image id, with my filtering on top. I'm wondering though if there is a way I can query that sort order that's determined in the admin somehow, then at least I could sort the array somehow in the code ? does next gen store it's user custom sort order somewhere ? Hope this makes sense :) any thoughts appreciated. Thanks

    Read the article

  • Asynchronous Html.ImageGetter for setting multiple images in a TextView

    - by thedude19
    I'm writing an application that takes HTML pages and parses them to display on the screen. Specifically, this application pulls HTML from a message board and lists posts made by users. The problem is that a lot of the content in posts are pictures in <img> tags, so I need to write a Html.ImageGetter to handle the downloading of the images. My textView.setText() method will look like this: myTextView.setText(Html.fromHtml(myText, new ImageGetter() { @Override public Drawable getDrawable(String source) { Drawable d; // Need to async download image here return d; } }, null)); Doing this synchronously is trivial, but is there a suggested way to do this asynchronously so that it doesn't lock up my UI thread? I would also like to eventually build in caching of these images, but I imagine that would be pretty simple once the async downloading was there.

    Read the article

  • C#: The input stream is not a valid binary format.

    - by Mcoroklo
    I have a problem with deserializing in C#/ASP.NET, which gives the exact error: The input stream is not a valid binary format. The starting contents (in bytes) are: 41-41-45-41-41-41-44-2F-2F-2F-2F-2F-41-51-41-41-41 ... What I am trying to do I have a structure with 3 classes. I have a class A which is a base class, and then class B and C which are derived from A. I am trying to store random types of B and C in the database using LINQ to SQL, in a column with the type VARCHAR(MAX). I cannot use BINARY as the length is around 15.000. My code... Error is in the LAST codeblock C# Code in Business layer- Storing a record private void AddTraceToDatabase(FightTrace trace) { MemoryStream recieverStream = new MemoryStream(); MemoryStream firedStream = new MemoryStream(); MemoryStream moveStream = new MemoryStream(); BinaryFormatter binaryFormatter = new BinaryFormatter(); binaryFormatter.Serialize(recieverStream,trace.Reciever); binaryFormatter.Serialize(firedStream,trace.FiredBy); binaryFormatter.Serialize(moveStream,trace.Move); string reciever = Convert.ToBase64String(recieverStream.ToArray()); string fired = Convert.ToBase64String(firedStream.ToArray()); string move = Convert.ToBase64String(moveStream.ToArray()); this.dataAccess.AddFightTrace(trace.TraceType.ToString(),reciever,move,fired,trace.DateTime,this.FightId); } C# Code in Data access layer - Storing a record public void AddFightTrace(string type, string reciever, string Move, string firedBy, DateTime firedAt, int fightid) { GameDataContext db = new GameDataContext(); dbFightTrace trace = new dbFightTrace(); trace.TraceType = type; trace.Reciever = reciever; trace.Move = Move; trace.FiredBy = firedBy; trace.FiredAt = firedAt; trace.FightId = fightid; db.dbFightTraces.InsertOnSubmit(trace); db.SubmitChanges(); } C# Code getting the entry in the database public List<dbFightTrace> GetNewTraces(int fightid, DateTime lastUpdate) { GameDataContext db = new GameDataContext(); var data = from d in db.dbFightTraces where d.FightId==fightid && d.FiredAt > lastUpdate select d; return data.ToList(); } C# Factory, converting from LINQ to SQL class to my objects THIS IS HERE THE ERROR COMES public FightTrace CreateTrace(dbFightTrace trace) { TraceType traceType = (TraceType) Enum.Parse(typeof(TraceType), trace.TraceType); BinaryFormatter formatter = new BinaryFormatter(); System.Text.UTF8Encoding enc = new System.Text.UTF8Encoding(); MemoryStream recieverStream = new MemoryStream(enc.GetBytes(trace.Reciever)); recieverStream.Position = 0; MemoryStream firedStream = new MemoryStream(enc.GetBytes(trace.FiredBy)); firedStream.Position = 0; MemoryStream movedStream = new MemoryStream(enc.GetBytes(trace.Move)); movedStream.Position = 0; // THE NEXT LINE HERE CAUSES THE ERROR NPC reciever = formatter.Deserialize(recieverStream) as NPC; Player fired = formatter.Deserialize(firedStream) as Player; BaseAttack attack = formatter.Deserialize(movedStream) as BaseAttack; FightTrace t = new FightTrace(traceType,reciever,attack,fired); t.TraceId = trace.FightTraceId; t.DateTime = trace.FiredAt; return t; } So the error happends when the first Deserialize method is run, with the above error. I have tried several things but I am quite lost on this one.. Thanks! :-)

    Read the article

  • How to make a transparent NSScroller?

    - by aquaibm
    This is my application screenshot.There is only one NSScrollView on the window.I try to make all the scrollview elements transparent,and obviously parts of my code work, but the scroller doesn't. Here is my draw code for custom NSScroller subclass. - (void) drawRect: (NSRect)dirtyRect { [[NSColor clearColor] set]; NSRectFill(dirtyRect); [self drawKnob]; } Does anyone have a clue to make this work? Thanks a lot.

    Read the article

  • What if I made an explicit reference to 'this' for use inside an inner class?

    - by badp
    So far, I've used this approach to access this from the scope of an inner class: class FooManagementWindow extends JFrame { JButton rejectFoo; //... void getFooAcceptingPanel(){ //... final FooManagementWindow referenceToThis = this; rejectFoo = new JButton("Reject"); rejectFoo.addEventListener(new EventListener() { @Override public void actionPerformed(ActionEvent arg) { referenceToThis.setEnabled(false); //this requires a network call //... referenceToThis.setEnabled(true); //the user may resume his work } }); //... } } However, I just learned that instead of declaring referenceToThis, a direct reference is kept for me as: FooManagementWindow.this I have no reason to think my less standard approach may lead to errors or weird corner cases. Or are there?

    Read the article

  • Anchors within the document and their position.

    - by Jose Vega
    On the following website, www.josecvega.com, I have a navigation bar with years that link to sections on that same page. Unfortunately it is not working they way I hoped, when the user selects a year it moves to the section of the page, but puts that section on the top of the page. I have a fixed div on the top of the page that covers the sections and prevents it from properly displaying. What can I do for this to work? It hard to explain my situation, but it can be seen by going to www.josecvega.com and clicking one of the years.

    Read the article

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