Daily Archives

Articles indexed Saturday March 20 2010

Page 23/89 | < Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >

  • Should I use Mutex OR Critical Section for Windows Mobile RIL

    - by afriza
    Hi, I am using a Radio Layer Interface (RIL) Native API in Windows Mobile application. In this API, the return values / results of most functions are not returned immediately but are passed through a callback function which is passed to the RIL API. Some usage examples are found at XDA Develompent Tools and Google Gears Geolocation API. My question is, in these two examples, a mutex is used to guard the data instead of other synchronization objects. Now, will Critical Section do fine here in the use cases described by both examples? Which thread or process will actually call the callback functions?

    Read the article

  • How to Learn Python

    - by Brett Veenstra
    For a beginner's perspective, can you answer the following: Best Tool(s) for Python development (e.g. NotePad, Vim) Best Book to get Started Best Website for Python beginner Best Problem Domain to do a sample project (what is Python-based solutions best suited for?)

    Read the article

  • Screen scraping over SSL with .NET

    - by Even Mien
    What solutions exist for screen scraping a site over SSL for use with .NET? My use case is that I need to login to a partner website (https), navigate through a dynamic hierarchy, and download a zipped file of reports. I certainly could use other screen scrapers if there are no good viable options in .NET, either though the framework or OSS.

    Read the article

  • JSON webservice response compression in IIS 7

    - by denisioru
    Hello! I have trouble with JSON response compression. I look to response headers after uploading website to production server (Windows 2008, IIS 7) and found uncompressed response. Turning on "Enabled static compression" and ""Enable dynamic compression" in IIS control panel does not effect. ASPX pages was responsed gzipped, but webservice response uncompressed. I looked to google, but no answer found about this trouble. Also, I try this http://stackoverflow.com/questions/2405595/json-ihttpmodule-compression way (and adding to web.config this module) - but this source is excellent working at development machine with ASP.NET development server (and have seven times response size reduced) and totally ignored at IIS7. How I can apply gzip compression to json responses from my webservice? Thanks. PS .NET 3.5

    Read the article

  • How to select a names from a column MS Excel 2007

    - by Alks
    Hey guys, I have an Excel document which has a list of students and their group names. I have another sheet within the the same excel document which is called comments. In this sheet, I would like to have a list of individual team names listed. There are 65 students and 14 defined groups. Is there a way to select the 14 group names, without repitition? Cell B3-B67 have the student names. Cell C3-C67 have the team names. The team names are entered against each student. I know in SQL I could use something like select distinct(team_name) but in Excel, how can I replicate this? Cheers, Alks.

    Read the article

  • overwrite blackberry's send sms/mail method

    - by Luis Armando
    I haven't been able to found this on Google, so I thought maybe somene here knew if this was possible and if so, how to implement it =) thanks in advance for any answers! What I am aiming for is overwriting this method so I can perform some actions before the sms/mail gets sent, then just allow it to perform its normal actions.

    Read the article

  • Problem calling Request using RequestBuilder

    - by Tushar Ahirrao
    Hi My Code is String url = "http: gd.geobytes.com/gd?after=-1&variables=GeobytesCountry,GeobytesCity"; RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, URL .encode(url)); try { Request request = builder.sendRequest(null, new RequestCallback() { public void onError(Request request, Throwable exception) { Couldn't connect to server (could be timeout, SOP violation, etc.) } public void onResponseReceived(Request request, Response response) { System.out.println(response.getText() + "Response"); if (200 == response.getStatusCode()) { Window.alert(response.getText()); } else { Window.alert(response.getText()); } } }); } catch (RequestException e) { e.printStackTrace(); } i receive following error com.google.gwt.http.client.RequestPermissionException: The URL http://gd.geobytes.com/gd?after=-1&variables=GeobytesCountry,GeobytesCity is invalid or violates the same-origin security restriction at com.google.gwt.http.client.RequestBuilder.doSend(RequestBuilder.java:378) at com.google.gwt.http.client.RequestBuilder.sendRequest(RequestBuilder.java:254) at com.ip.client.IpAddressTest.onModuleLoad(IpAddressTest.java:46) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:369) at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:185) at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:380) at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:222) at java.lang.Thread.run(Thread.java:619) Caused by: com.google.gwt.http.client.RequestException: (NS_ERROR_DOM_BAD_URI): Access to restricted URI denied

    Read the article

  • Obtaining C++ Code Coverage

    - by anon
    I'm on Linux. My code is written in C++. My program is non-interactive; it runs as "./prog input-file", processes the file, and exits. I have various unit tests "input-file0, input-file1, input-file2, ..." For designing new unit tests, I want to know what lines of code existing tests do not cover. Question: Given that I control how "prog" is compiled/run; how can I get list of the lines of code that "./prog input-file" does not hit? Thanks!

    Read the article

  • attaching linq to sql datacontext to httpcontext in business layer

    - by rap-uvic
    Hello all, I need my linq to sql datacontext to be available across my business/data layer for all my repository objects to access. However since this is a web app, I want to create and destroy it per request. I'm wondering if having a singleton class that can lazily create and attach the datacontext to current HttpContext would work. My question is: would the datacontext get disposed automatically when the request ends? Below is the code for what I'm thinking. Would this accomplish my purpose: have a thread-safe datacontext instance that is lazily available and is automatically disposed when the request ends? public class SingletonDC { public static NorthwindDataContext Default { get { NorthwindDataContext defaultInstance = (NorthwindDataContext)System.Web.HttpContext.Current.Items["datacontext"]; if (defaultInstance == null) { defaultInstance = new NorthwindDataContext(); System.Web.HttpContext.Current.Items.Add("datacontext", defaultInstance); } return defaultInstance; } } }

    Read the article

  • algorithm to find overlaps

    - by Gary
    Hey, Basically I've got some structs of type Ship which are going to go on a board which can have a variable width and height. The information about the ships is read in from a file, and I just need to know the best way to make sure that none of the ships overlap. Here is the structure of Ship: int x // x position of first part of ship int y // y position of first part of ship char dir // direction of the ship, either 'N','S','E' or 'W' int length // length of the ship Also, what would be a good way to handle the directions. Something cleaner than using a switch statement and using a different condition for each direction. Any help would be greatly appreciated!

    Read the article

  • MySQL slow queries

    - by jack
    The MySQL slow query log often shows a bunch of following entries in sequence. SET timestamp=1268999330; commit; # User@Host: username[username] @ localhost [] # Query_time: 4.172700 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 0 SET timestamp=1268999330; commit; # User@Host: username[username] @ localhost [] # Query_time: 3.628924 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 0 SET timestamp=1268999330; commit; # User@Host: username[username] @ localhost [] # Query_time: 3.116018 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 0 ... Usually 6-7 "commit" queries in sequence. Anyone what they are and what's the preceding query of each of them? Thanks in advance.

    Read the article

  • Update {node_counter} table programatically in drupal

    - by wiifm69
    I currently use the statistics module (core) on my Drupal 6 install. This increments a count in the {node_counter} table every time the node is viewed, and this works. My question is - can I programmatically increment this counter as well? I am looking to achieve this when users interact with content created from views (say click a lightbox), so being able to update the table with AJAX would be ideal. I have done a quick search on d.o and there doesn't appear to be any modules that stick out straight away. Does anyone have any experience with this?

    Read the article

  • Testing variable types in Python

    - by Jasper
    Hello, I'm creating an initialising function for the class 'Room', and found that the program wouldn't accept the tests I was doing on the input variables. Why is this? def __init__(self, code, name, type, size, description, objects, exits): self.code = code self.name = name self.type = type self.size = size self.description = description self.objects = objects self.exits = exits #Check for input errors: if type(self.code) != type(str()): print 'Error found in module rooms.py!' print 'Error number: 110' elif type(self.name) != type(str()): print 'Error found in module rooms.py!' print 'Error number: 111' elif type(self.type) != type(str()): print 'Error found in module rooms.py!' print 'Error number: 112' elif type(self.size) != type(int()): print 'Error found in module rooms.py!' print 'Error number: 113' elif type(self.description) != type(str()): print 'Error found in module rooms.py!' print 'Error number: 114' elif type(self.objects) != type(list()): print 'Error found in module rooms.py!' print 'Error number: 115' elif type(self.exits) != type(tuple()): print 'Error found in module rooms.py!' print 'Error number: 116' When I run this I get this error: Traceback (most recent call last): File "/Users/Jasper/Development/Programming/MyProjects/Game Making Challenge/Europa I/rooms.py", line 148, in <module> myRoom = Room(101, 'myRoom', 'Basic Room', 5, '<insert description>', myObjects, myExits) File "/Users/Jasper/Development/Programming/MyProjects/Game Making Challenge/Europa I/rooms.py", line 29, in __init__ if type(self.code) != type(str()): TypeError: 'str' object is not callable

    Read the article

  • Please recommend me intermediate-to-advanced Python books to buy.

    - by anonnoir
    I'm in the final year, final semester of my law degree, and will be graduating very soon. (April, to be specific.) But before I begin practice, I plan to take 2 two months off, purely for serious programming study. So I'm currently looking for some Python-related books, gauged intermediate to advanced, which are interesting (because of the subject matter itself) and possibly useful to my future line of work. I've identified 2 possible purchases at the moment: Natural Language Processing with Python. The law deals mostly with words, and I've quite a number of ideas as to where I might go with NLP. Data extraction, summaries, client management systems linked with document templates, etc. Programming Collective Intelligence. This book fascinates me, because I've always liked the idea of machine learning (and I'm currently studying it by the side too, for fun). I'd like to build/play around with Web 2.0 applications; and who knows if I can apply some of the things I learn to my legal work. (E.g. Playground experiments to determine how and under what circumstances judges might be biased, by forcing algorithms to pore through judgments and calculate similarities, etc.) Please feel free to criticize my current choices, but do at least offer or recommend other books that I should read in their place. My budget can deal with 4 books, max. These books will be used heavily throughout the 2 months; I will be reading them back to back, absorbing the explanations given, and hacking away at their code. Also, the books themselves should satisfy 2 main criteria: Application. The book must teach how to solve problems. I like reading theory, but I want to build things and solve problems first. Even playful applications are fine, because games and experiments always have real-world applications sooner or later. Readability. I like reading technical books, no matter how difficult they are. I enjoy the effort and the feeling that you're learning something. But the book shouldn't contain code or explanations that are too cryptic or erratic. Even if it's difficult, the book's content should be accessible with focused reading. Note: I realize that I am somewhat of a beginner to the whole programming thing, so please don't put me down. But from experience, I think it's better to aim up and leave my comfort zone when learning new things, rather than to just remain stagnant the way I am. (At least the difficulty gives me focus: i.e. if a programmer can be that good, perhaps if I sustain my own efforts I too can be as good as him someday.) If anything, I'm also a very determined person, so two months of day-to-night intensive programming study with nothing else on my mind should, I think, give me a bit of a fighting chance to push my programming skills to a much higher level.

    Read the article

  • Routing Users to single Models with Rails

    - by Eric Koslow
    I'm creating a Rails app for students and high schools and I'm having some trouble with my User.rb. I want to have a user model to be used for logging in, but having that user have many roles. The tricky part is that I want users that have a student role to have_one student page, and those that have a role of principal to have_one high_school page. The students and also nested in the high_school so the entire thing becomes a big mess. So my question(s): How do I limit a user to only creating one student / high school to represent them? Also how would I nest this student pages inside the highschool without screwing up the user system? My environment: Rails3 and Ruby 1.9.2dev Thank you!

    Read the article

  • Seeking enlightenment - global variables in AppEngine (aeoid.get_current_user())

    - by jerd
    Hello This may be a 'Python Web Programming 101' question, but I'm confused about some code in the aeoid project (http://github.com/Arachnid/aeoid). here's the code: _current_user = None def get_current_user(): """Returns the currently logged in user, or None if no user is logged in.""" global _current_user if not _current_user and 'aeoid.user' in os.environ: _current_user = User(None, _from_model_key=os.environ['aeoid.user']) return _current_user But my understanding was that global variables were, ehm, global! And so different requests from different users could (potentially) access and update the same value, hence the need for sessions, in order to store per-user, non-global variables. So, in the code above, what prevents one request from believing the current user is the user set by another request? Sorry if this is basic, it's just not how i thought things worked. Thanks

    Read the article

  • How to copy mailboxes from Exchange 2003 to Exchange 2007 across forests?

    - by Tor Ivar Larsen
    Hi. Were going through a quite difficult conversion from an old ASP-solution to an entirely new one. This includes moving mailboxes from Ex2003 to Ex2007. We want to do this without deleting the old mailboxes on the Ex2003 server, to have a "fall back" in case somehing goes wrong. I have investigated the "Move-Mailbox" cmdlet in the Ex2007 shell, and it seems to fit our needs quite well. The only problem being that we want to keep the old mailboxes. This could easily be accomplished with the -SourceMailboxCleanupOptions, but we can't use this when we have used the -AllowMerge switch. The reason we need -AllowMerge is because all the user accounts with connected mailboxes are already created on Ex2007(Some automatic user creation tool, no real relevance to the case in question) The twist is that the exchange servers are in two different forests... Windows 2003 SP1 on DC1, Windows 2003 SP2 on DC2 in forest 1. Windows 2003 R2 SP2 on DC1 in forest 2. Can we use the Move-Mailbox safely for this purpose? And if yes, how?

    Read the article

  • ReadyNAS issue with Google Apps?

    - by Jauder Ho
    The power went out (again) in my house today so I decided to set up some alerting. Since I have a ReadyNAS and the latest version of Raidinator seems to have SMTP TLS support, I figured I would try setting things up to email to a domain I have hosted on Google Apps. At this point, I have everything working IF I use a Gmail account but as soon as I switch to a Google Apps email address, it stops working and complains with smtpstatus=535 smtpmsg='535-5.7.1 Username and Password not accepted. Learn more at \n535 5.7.1 http://mail.google.com/support/bin/answer.py?answer=14257 30sm16076226wfd.23' errormsg='authentication failed (GNU SASL, method PLAIN)' exitcode=EX_NOPERM I'm wondering if anyone else has encountered this. Google's extremely aggressive captcha does not help but I am able to log in now without a captcha from a browser so I'm open to any ideas why the simple switch of a user/password combo that is supposed to work does not. I'm also attaching my config so that others can see how to set things up.

    Read the article

< Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >