Search Results

Search found 504 results on 21 pages for 'charles lamb'.

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

  • Calling unmanaged code from within C#

    - by Charles Gargent
    I am trying to use a dll in my c# program but I just cant seem to get it to work. I have made a test app shown below. The return value is 0, however it does not actually do what it is supposed to do. Whereas the following command does work: rundll32 cmproxy.dll,SetProxy /source_filename proxy-1.txt /backup_filename roxy.bak /DialRasEntry NULL /TunnelRasEntry DSLVPN /Profile "C:\Documents and ettings\Administrator\Application Data\Microsoft\Network\Connections\Cm\dslvpn.cmp" Code: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; using System.Runtime.InteropServices; using System.Net; using WUApiLib; namespace nac { class Program { [DllImport("cmproxy.dll", CharSet = CharSet.Unicode)] static extern int SetProxy(string cmdLine); static void Main(string[] args) { string cmdLine = @"/source_filename proxy-1.txt /backup_filename proxy.bak /DialRasEntry NULL /TunnelRasEntry DSLVPN /Profile ""C:\Documents and Settings\Administrator\Application Data\Microsoft\Network\Connections\Cm\dslvpn.cmp"""; Console.WriteLine(SetProxy(cmdLine)); } } } Here is the contents of the dumpbin /exports command File Type: DLL Section contains the following exports for cmproxy.dll 00000000 characteristics 3E7FEF8C time date stamp Tue Mar 25 05:56:28 2003 0.00 version 1 ordinal base 1 number of functions 1 number of names ordinal hint RVA name 1 0 00001B68 SetProxy Summary 1000 .data 1000 .reloc 1000 .rsrc 2000 .text When this works it sets the proxy server for a VPN connection.

    Read the article

  • Facebook status.get API throws 500 HTTP status code

    - by Charles Prakash Dasari
    I have an APP that calls Facebook status.get method via the REST server - restserver.php using session key method. This app works fine for most of the users, but for one user I consistently receive HTTP 500 status code. Since this doesn't have any specific Facebook error message, it is almost impossible for me to debug this. Anyone faced a similar problem? What could be wrong with this user account? I checked the privacy options that I could think of and they look fine. Also, for the same user, I can use friends.get method without any problem. EDIT: I tried in Facebook forums as well, but it was of no use. Any pointers in the direction towards debugging/troubleshooting this problem are also appreciated.

    Read the article

  • Reverse engineering windows mobile live search CellID location awareness protocol (yikes)...

    - by Jean-Charles
    I wasn't sure of how to form the question so I apologize if the title is misleading. Additionally, you may want to get some coffee and take a seat for this one ... It's long. Basically, I'm trying to reverse engineer the protocol used by the Windows Mobile Live Search application to get location based on cellID. Before I go on, I am aware of other open source services (such as OpenCellID) but this is more for the sake of education and a bit for redundancy. According to the packets I captured, a POST request is made to ... mobile.search.live.com/positionlookupservice_1/service.aspx ... with a few specific headers (agent, content-length, etc) and no body. Once this goes through, the server sends back a 100-Continue response. At this point, the application submits this data (I chopped off the packet header): 00 00 00 01 00 00 00 05 55 54 ........UT 46 2d 38 05 65 6e 2d 55 53 05 65 6e 2d 55 53 01 F-8.en-US.en-US. 06 44 65 76 69 63 65 05 64 75 6d 6d 79 01 06 02 .Device.dummy... 50 4c 08 0e 52 65 76 65 72 73 65 47 65 6f 63 6f PL..ReverseGeoco 64 65 01 07 0b 47 50 53 43 68 69 70 49 6e 66 6f de...GPSChipInfo 01 20 06 09 43 65 6c 6c 54 6f 77 65 72 06 03 43 . ..CellTower..C 47 49 08 03 4d 43 43 b6 02 07 03 4d 4e 43 03 34 GI..MCC....MNC.4 31 30 08 03 4c 41 43 cf 36 08 02 43 49 fd 01 00 10..LAC.6..CI... 00 00 00 ... And receives this in response (packet and HTTP response headers chopped): 00 00 00 01 00 00 00 00 01 06 02 50 4c ...........PL 06 08 4c 6f 63 61 6c 69 74 79 06 08 4c 6f 63 61 ..Locality..Loca 74 69 6f 6e 07 03 4c 61 74 09 34 32 2e 33 37 35 tion..Lat.42.375 36 32 31 07 04 4c 6f 6e 67 0a 2d 37 31 2e 31 35 621..Long.-71.15 38 39 33 38 00 07 06 52 61 64 69 75 73 09 32 30 8938...Radius.20 30 30 2e 30 30 30 30 00 42 07 0c 4c 6f 63 61 6c 00.0000.B..Local 69 74 79 4e 61 6d 65 09 57 61 74 65 72 74 6f 77 ityName.Watertow 6e 07 16 41 64 6d 69 6e 69 73 74 72 61 74 69 76 n..Administrativ 65 41 72 65 61 4e 61 6d 65 0d 4d 61 73 73 61 63 eAreaName.Massac 68 75 73 65 74 74 73 07 10 50 6f 73 74 61 6c 43 husetts..PostalC 6f 64 65 4e 75 6d 62 65 72 05 30 32 34 37 32 07 odeNumber.02472. 0b 43 6f 75 6e 74 72 79 4e 61 6d 65 0d 55 6e 69 .CountryName.Uni 74 65 64 20 53 74 61 74 65 73 00 00 00 ted States... Now, here is what I've determined so far: All strings are prepended with one byte that is the decimal equivalent of their length. There seem to be three different casts that are used throughout the request and response. They show up as one byte before the length byte. I've concluded that the three types map out as follows: 0x06 - parent element (subsequent values are children, closed with 0x00) 0x07 - string 0x08 - int? Based on these determinations, here is what the request and response look like in a more readable manner (values surrounded by brackets denote length and values surrounded by parenthesis denote a cast): \0x00\0x00\0x00\0x01\0x00\0x00\0x00 [5]UTF-8 [5]en-US [5]en-US \0x01 [6]Device [5]dummy \0x01 (6)[2]PL (8)[14]ReverseGeocode\0x01 (7)[11]GPSChipInfo[1]\0x20 (6)[9]CellTower (6)[3]CGI (8)[3]MCC\0xB6\0x02 //310 (7)[3]MNC[3]410 //410 (8)[3]LAC\0xCF\0x36 //6991 (8)[2]CI\0xFD\0x01 //259 \0x00 \0x00 \0x00 \0x00 and.. \0x00\0x00\0x00\0x01\0x00\0x00\0x00 \0x00\0x01 (6)[2]PL (6)[8]Locality (6)[8]Location (7)[3]Lat[9]42.375621 (7)[4]Long[10]-71.158938 \0x00 (7)[6]Radius[9]2000.0000 \0x00 \0x42 //"B" ... Has to do with GSM (7)[12]LocalityName[9]Watertown (7)[22]AdministrativeAreaName[13]Massachusetts (7)[16]PostalCodeNumber[5]02472 (7)[11]CountryName[13]United States \0x00 \0x00\0x00 My analysis seems to work out pretty well except for a few things: The 0x01s throughout confuse me ... At first I thought they were some sort of base level element terminators but I'm not certain. I'm not sure the 7-byte header is, in fact, a seven byte header. I wonder if it's maybe 4 bytes and that the three remaining 0x00s are of some other significance. The trailing 0x00s. Why is it that there is only one on the request but two on the response? The type 8 cast mentioned above ... I can't seem to figure out how those values are being encoded. I added comments to those lines with what the values should correspond to. Any advice on these four points will be greatly appreciated. And yes, these packets were captured in Watertown, MA. :)

    Read the article

  • Managing multiple apps with one Google Analytics account?

    - by Charles S.
    I've just setup a Google Analytics for Mobile Apps account and I've implemented the SDK in my iPhone app with no trouble at all. However, I haven't figured out how to manage multiple apps with one account. It seems fairly easy to setup multiple subdomains when dealing with websites and I've noticed the javascript code has a setSubdomain function that doesn't seem to be present in the iPhone SDK. Is there any way I can have google analytics differentiate my different apps for the same account?

    Read the article

  • How to switch a view after i parse data?

    - by charles Graffeo
    OK my problem is this, i parse a document and after the document is parsed then i want to load to the next view sounds simple but ive been here for like 4 hours playing with code and id appreciete any help u can give me atm. k heres my parserDidEndDocumentCode - (void)parserDidEndDocument:(NSXMLParser *)parser{ IpadSlideShowViewController temp=(IpadSlideShowViewController)[[IpadSlideShowViewController alloc]init]; [temp performSelectorOnMainThread:@selector(switchViews) withObject:nil waitUntilDone:TRUE]; [temp release]; } now what i think should happen is my code will switch the view after it parses the documentation, n its not doing it idk why

    Read the article

  • What's the best general programming book to review basic development concepts?

    - by Charles S.
    I'm looking for for a programming book that reviews basic concepts like implementing linked lists, stacks, queues, hash tables, tree traversals, search algorithms, etc. etc. Basically, I'm looking for a review of everything I learned in college but have forgotten. I prefer something written in the last few years that includes at least a decent amount of code in object-oriented languages. This is to study for job interview questions but I already have the "solving interview questions" books. I'm looking for something with a little more depth and explanation. Any good recommendations?

    Read the article

  • Python socket error on UDP data receive. (10054)

    - by Charles
    I currently have a problem using UDP and Python socket module. We have a server and clients. The problem occurs when we send data to a user. It's possible that user may have closed their connection to the server through a client crash, disconnect by ISP, or some other improper method. As such, it is possible to send data to a closed socket. Of course with UDP you can't tell if the data really reached or if it's closed, as it doesn't care (atleast, it doesn't bring up an exception). However, if you send data and it is closed off, you get data back somehow (???), which ends up giving you a socket error on sock.recvfrom. [Errno 10054] An existing connection was forcibly closed by the remote host. Almost seems like an automatic response from the connection. Although this is fine, and can be handled by a try: except: block (even if it lowers performance of the server a little bit). The problem is, I can't tell who this is coming from or what socket is closed. Is there anyway to find out 'who' (ip, socket #) sent this? It would be great as I could instantly just disconnect them and remove them from the data. Any suggestions? Thanks.

    Read the article

  • Can I use the whatthetrend.com API to get daily and weekly twitter trends?

    - by Charles S.
    The twitter API allows me to receive daily trends and weekly trends (in addition to current trends, of course) as either JSON or XML. Is there an equivalent with the whatthetrend.com API? I don't see a method/parameter at first glance but I wanted to see if anyone out there knew a way... http://api.whatthetrend.com/api There's a method to lookup trend definition by keyword so I guess I could use that based off the Twitter API but I'd rather just load all the data at once rather than have to remotely access the API every time I want to look up a definition. Thanks

    Read the article

  • Why does Git.pm on cygwin complain about 'Out of memory during "large" request?

    - by Charles Ma
    Hi, I'm getting this error while doing a git svn rebase in cygwin Out of memory during "large" request for 268439552 bytes, total sbrk() is 140652544 bytes at /usr/lib/perl5/site_perl/Git.pm line 898, <GEN1> line 3. 268439552 is 256MB. Cygwin's maxium memory size is set to 1024MB so I'm guessing that it has a different maximum memory size for perl? How can I increase the maximum memory size that perl programs can use? update: This is where the error occurs (in Git.pm): while (1) { my $bytesLeft = $size - $bytesRead; last unless $bytesLeft; my $bytesToRead = $bytesLeft < 1024 ? $bytesLeft : 1024; my $read = read($in, $blob, $bytesToRead, $bytesRead); //line 898 unless (defined($read)) { $self->_close_cat_blob(); throw Error::Simple("in pipe went bad"); } $bytesRead += $read; } I've added a print before line 898 to print out $bytesToRead and $bytesRead and the result was 1024 for $bytesToRead, and 134220800 for $bytesRead, so it's reading 1024 bytes at a time and it has already read 128MB. Perl's 'read' function must be out of memory and is trying to request for double it's memory size...is there a way to specify how much memory to request? or is that implementation dependent? UPDATE2: While testing memory allocation in cygwin: This C program's output was 1536MB int main() { unsigned int bit=0x40000000, sum=0; char *x; while (bit > 4096) { x = malloc(bit); if (x) sum += bit; bit >>= 1; } printf("%08x bytes (%.1fMb)\n", sum, sum/1024.0/1024.0); return 0; } While this perl program crashed if the file size is greater than 384MB (but succeeded if the file size was less). open(F, "<400") or die("can't read\n"); $size = -s "400"; $read = read(F, $s, $size); The error is similar Out of memory during "large" request for 536875008 bytes, total sbrk() is 217088 bytes at mem.pl line 6.

    Read the article

  • Subversion: Ignore a Directory in the Repo on Commit

    - by Charles
    I have all the boost header files in this repository and when I do a check in it takes a really long time to scan all those files that will never change. Because I want users that checkout the project to be able to compile without installing boost I am in a pickle. I want to checkout everything, and then ignore updates (there will never be any) on a directory. Tortoise svn has a ignore-on-commit change list, but I cannot find anyway to add an entire directory to this list, and I do not fancy the idea of 'modifying' all the boost files so I can add them to this change list. Is there a simple solution?

    Read the article

  • How to automatically include generated source files into a C# project in Visual Studio?

    - by Charles Prakash Dasari
    I have a situation where I need to generate a bunch of C# code files in a prebuild step of a project and include the generated files into the current project for compilation. Is there a way to do this cleanly without having to muck with the project file every time the prebuild step is run? My solution should work for both IDE based build and a Team Build based on MSBuild. Since both are MSBuild based, I suspect there won't be much difference; but wanted to call it out. Any help is greatly appreciated, thanks!

    Read the article

  • Iphone UIButton not working in nested UIViews

    - by Charles Peterson
    This is so damn simple im sure! Im missing something and im exhausted from trying to fix it. hopefully someone can help. The Button in CharacterView.m works but the button nested down in CharacterMale.m does not. I'm not using IB everything is done progmatically. What would cause one button to work and other not? ///////////////////////////////////////////////////////////////////////////////// CharacterController.m ///////////////////////////////////////////////////////////////////////////////// #import "CharacterController.h" #import "CharacterView.h" @implementation CharacterController - (id)init { NSLog(@"CharacterController init"); self = [ super init ]; if (self != nil) { } return self; } - (void)loadView { [ super loadView ]; characterView = [ [ CharacterView alloc ] init]; self.view = characterView; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; } - (void)dealloc { [super dealloc]; } @end ///////////////////////////////////////////////////////////////////////////////// CharacterView.m ///////////////////////////////////////////////////////////////////////////////// #import "CharacterView.h" #import "CharacterMale.h" @implementation CharacterView - (id)initWithFrame:(CGRect)frame { if (self = [super initWithFrame:frame]) { characterMale = [ [ CharacterMale alloc ] init]; [self addSubview: characterMale]; UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; button.frame = CGRectMake(0, 200, 200, 100); [button setImage:[UIImage imageNamed:@"btnCharSelect.png"] forState:UIControlStateNormal]; [button addTarget:self action:@selector(ApplyImage:) forControlEvents:UIControlEventTouchUpInside]; [ self addSubview: button ]; } return self; } - (void)drawRect:(CGRect)rect { } -(void)ApplyImage:(id)sender { NSLog(@"CharacterView button works"); } - (void)dealloc { [super dealloc]; } @end ///////////////////////////////////////////////////////////////////////////////// CharacterMale.m ///////////////////////////////////////////////////////////////////////////////// #import "CharacterMale.h" #import "CharacterController.h" @implementation CharacterMale - (id)init { self = [ super init]; if (self != nil) { UIImage *image = [UIImage imageNamed:@"charMale.png"]; imageView = [[ UIImageView alloc] initWithImage:image]; [image release]; [ self addSubview: imageView ]; UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; button.frame = CGRectMake(0, 0, 200, 100); [button setImage:[UIImage imageNamed:@"btnCharSelect.png"] forState:UIControlStateNormal]; [button addTarget:self action:@selector(ApplyImage:) forControlEvents:UIControlEventTouchUpInside]; [ self addSubview: button ]; } return self; } -(void)ApplyImage:(id)sender { NSLog(@"CharacterMal button works"); } - (void)dealloc { [super dealloc]; } @end

    Read the article

  • Why won't this Jquery run on IE?

    - by Charles Marsh
    Hello All, I have this Jquery code (function($){ $.expr[':'].linkingToImage = function(elem, index, match){ // This will return true if the specified attribute contains a valid link to an image: return !! ($(elem).attr(match[3]) && $(elem).attr(match[3]).match(/\.(gif|jpe?g|png|bmp)$/i)); }; $.fn.imgPreview = function(userDefinedSettings){ var s = $.extend({ /* DEFAULTS */ // CSS to be applied to image: imgCSS: {}, // Distance between cursor and preview: distanceFromCursor: {top:2, left:2}, // Boolean, whether or not to preload images: preloadImages: true, // Callback: run when link is hovered: container is shown: onShow: function(){}, // Callback: container is hidden: onHide: function(){}, // Callback: Run when image within container has loaded: onLoad: function(){}, // ID to give to container (for CSS styling): containerID: 'imgPreviewContainer', // Class to be given to container while image is loading: containerLoadingClass: 'loading', // Prefix (if using thumbnails), e.g. 'thumb_' thumbPrefix: '', // Where to retrieve the image from: srcAttr: 'rel' }, userDefinedSettings), $container = $('<div/>').attr('id', s.containerID) .append('<img/>').hide() .css('position','absolute') .appendTo('body'), $img = $('img', $container).css(s.imgCSS), // Get all valid elements (linking to images / ATTR with image link): $collection = this.filter(':linkingToImage(' + s.srcAttr + ')'); // Re-usable means to add prefix (from setting): function addPrefix(src) { return src.replace(/(\/?)([^\/]+)$/,'$1' + s.thumbPrefix + '$2'); } if (s.preloadImages) { (function(i){ var tempIMG = new Image(), callee = arguments.callee; tempIMG.src = addPrefix($($collection[i]).attr(s.srcAttr)); tempIMG.onload = function(){ $collection[i + 1] && callee(i + 1); }; })(0); } $collection .mousemove(function(e){ $container.css({ top: e.pageY + s.distanceFromCursor.top + 'px', left: e.pageX + s.distanceFromCursor.left + 'px' }); }) .hover(function(){ var link = this; $container .addClass(s.containerLoadingClass) .show(); $img .load(function(){ $container.removeClass(s.containerLoadingClass); $img.show(); s.onLoad.call($img[0], link); }) .attr( 'src' , addPrefix($(link).attr(s.srcAttr)) ); s.onShow.call($container[0], link); }, function(){ $container.hide(); $img.unbind('load').attr('src','').hide(); s.onHide.call($container[0], this); }); // Return full selection, not $collection! return this; }; })(jQuery); It works perfectly in all browsers apart from IE, which it does nothing, no errors, no clues? I have a funny feeling IE doesn't support attr? Can anyone offer any advice?

    Read the article

  • How to exit grid with ctrl-TAB when grid is on a tabpage (onkeydown works when grid not on tabpage)

    - by Charles Hankey
    winforms .net 3.5 Ultrawingrid 9.2 In my subclass of Ultrawingrid.Ultragrid : Protected Overrides Sub OnKeyDown(ByVal e As System.Windows.Forms.KeyEventArgs) If e.KeyCode = Windows.Forms.Keys.Tab andalso e.control = True then SetFocusToNextControl(True) End if Mybase.OnKeyDown(e) End Sub This works fine. But when the grid is dropped on a TabControl tabpage, the ctrl-tab looks very different to the sub above. e.keycode is seen as controlkey {17} I realize that by default cntrl-Tab moves between tabpages. I need to override this behavior. My thought is I probably need a subclass of the tabControl which will pass the keycombo through just as the form does but I confess to being clueless as to how to accomplish that. I tried to override the onkeydown of a tabcontrol subclass and just issuing a return and not and base call to onkeydown if the ctrl-tab combo was pressed but it seemed to see the e.keycode as controlkey as well. FWIW I tried a different combination like ctrl-E and got pretty much the same result with focus disappearing from the grid but not going anywhere I could detect. The sub still saw the e.control as controlkey. Oddly, ctrl-X, ctrl-A etc all work in the grid and a ctrl-Delete combo I put in the subclass for deleting a row works fine. Once again - grid directly on form and it all works. I'm definitely over my head on this one. Guidance much appreciated. vb or c# fine. TIA

    Read the article

  • a4j:commandButton causes full page reload on IE7

    - by Greg Charles
    Our process allows users to activate their account, and then configure e-mail preferences. We're using the tag: <a4j:commandButton id="activate" action="#{controller.agreeAction}" image="/img/ok.png" styleClass="activate-button" reRender="mainContent, sideBar" oncomplete="showEmailDialog();" /> This works fine on Firefox, but on IE, the showEmaiDialog() fires off to display the new dialog, and then the full page reloads, which instantly hides it again. I put in numerous alert() calls to make sure of what was happening. I see the e-mail dialog until I clear the final alert box in in the showEmailDialog() script, and then I see the alerts that I put into jQuery(document).ready(). Why does IE do a full page reload instead of just refreshing the requested sections?

    Read the article

  • Create a new delegate class for each asynchronous image download?

    - by Charles S.
    First, I'm using an NSURLConnection to download JSON data from twitter. Then, I'm using a second NSURLConnection to download corresponding user avatar images (the urls to the images are parsed from the first data download). For the first data connection, I have my TwitterViewController set as the NSURLConnection delegate. I've created a separate class (ImageDownloadDelegate) to function as the delegate for a second NSURLConnection that handles the images. After the tweets are finished downloading, I'm using this code to get the avatars: for(int j=0; j<[self.tweets count]; j++){ ImageDownloadDelegate *imgDelegate = [[ImageDownloadDelegate alloc] init]; Tweet *myTweet = [self.tweets objectAtIndex:j]; imgDelegate.tweet = myTweet; imgDelegate.table = timeline; NSURLRequest* request = [NSURLRequest requestWithURL:[NSURL URLWithString:myTweet.imageURL] cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:60]; imgConnection = [[NSURLConnection alloc] initWithRequest:request delegate:imgDelegate]; [imgDelegate release]; } So basically a new instance of the delegate class is created for each image that needs to be downloaded. Is this the best way to go about this? But then there's no way to figure out which image is associate with which tweet, correct? The algorithm works fine... I'm just wondering if I'm going about it the most efficient way.

    Read the article

  • Problem with connection to MS SQL Server database using SSMS

    - by Charles
    I have a database on line with Godaddy (who uses SQL Server 2005). They provide basic management tools, but tell you that for more advanced tools you can connect directly using SSMS. I followed their instructions to ensure my online database will accept remote connections, and can apparently log in using SSMS with success (after giving my hostname and access data). However: When attempting to expand the "Databases" folder tree, I get the following error: Failed to retrieve data for this request. (Microsoft.SqlServer.Management.Sdk.Sfc) For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server& LinkId=20476 ADDITIONAL INFORMATION: An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo) The server principal "cmitchell" is not able to access the database "3pointdb" under the current security context. (Microsoft SQL Server, Error: 916) For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.4262&EvtSrc=MSSQLServer&EvtID=916&LinkId=20476

    Read the article

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