Search Results

Search found 829 results on 34 pages for 'justin kelly'.

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

  • How can I speed up the rendering of my WPF ListBox?

    - by Justin Bozonier
    I have a WPF ListBox control (view code) and I am keeping maybe like 100-200 items in it. Every time the ObservableCollection it is bound to changes though it takes it a split second to update and it freezes the whole UI. Is there a way to add elements incrementally or something I can do to improve the performance of this control?

    Read the article

  • Access Violation

    - by Justin
    I've been learning how to NOP functions in C++ or even C but there are very few tutorials online about it. I've been googling for the past few hours now and I'm just stuck. Here is my code. #include <iostream> #include <windows.h> #include <tlhelp32.h> using namespace std; //#define NOP 0x90 byte NOP[] = {0x90}; void enableDebugPrivileges() { HANDLE hcurrent=GetCurrentProcess(); HANDLE hToken; BOOL bret=OpenProcessToken(hcurrent,40,&hToken); LUID luid; bret=LookupPrivilegeValue(NULL,"SeDebugPrivilege",&luid); TOKEN_PRIVILEGES NewState,PreviousState; DWORD ReturnLength; NewState.PrivilegeCount =1; NewState.Privileges[0].Luid =luid; NewState.Privileges[0].Attributes=2; AdjustTokenPrivileges(hToken,FALSE,&NewState,28,&PreviousState,&ReturnLength); } DWORD GetProcId(char* ProcName) { PROCESSENTRY32 pe32; HANDLE hSnapshot = NULL; pe32.dwSize = sizeof( PROCESSENTRY32 ); hSnapshot = CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0 ); if( Process32First( hSnapshot, &pe32 ) ) { do{ if( strcmp( pe32.szExeFile, ProcName ) == 0 ) break; }while( Process32Next( hSnapshot, &pe32 ) ); } if( hSnapshot != INVALID_HANDLE_VALUE ) CloseHandle( hSnapshot ); return pe32.th32ProcessID; } void WriteMem(DWORD Address, void* Value, size_t Size) { DWORD Protect = NULL; VirtualProtect((LPVOID)Address, 3, PAGE_READWRITE, &Protect); memcpy((void*)Address, Value, 3); VirtualProtect((LPVOID)Address, 3, Protect, &Protect); } void nop_(PVOID address, int bytes){ DWORD d, ds; VirtualProtect(address, bytes, PAGE_EXECUTE_READWRITE, &d); memset(address, 144, bytes); VirtualProtect(address,bytes,d,&ds); } void MemCopy(HANDLE pHandle, void* Dest, const void* Src, int Len) { DWORD OldProtect; DWORD OldProtect2; VirtualProtect(Dest, Len, PAGE_EXECUTE_READWRITE, &OldProtect); memcpy(Dest, Src, Len); VirtualProtect(Dest, Len, OldProtect, &OldProtect2); FlushInstructionCache(pHandle, Dest, Len); } int main() { enableDebugPrivileges(); DWORD pid; HANDLE phandle; // Obtain the process ID pid = GetProcId("gr.exe"); if(GetLastError()) { cout << "Error_PID_: " << GetLastError() << endl; system("pause"); return -1; } // Obtain the process handle phandle = OpenProcess(PROCESS_ALL_ACCESS,0,pid); if(GetLastError()) { cout << "Error_HANDLE_: " << GetLastError() << endl; system("pause"); return -1; } // Debug info, 0 = bad cout <<"pid : " << pid << endl; cout <<"HANDLE: " << phandle << endl << endl; system("pause"); // Change value to short iValue = -1; int choice = 0; BYTE * bGodMode = (BYTE *) (0x409A7E); // Lives Address bool hack = true; while(hack) { system("cls"); cout << "What hack?\n0. Exit\n1. Lives\n\n!> "; cin >> choice; switch(choice) { case 0: { hack=false; break; } case 1: // Modify Time cout << "God Mode On\n!> "; // cin >> iValue; // nop_((PVOID)(0x409A7E), 3); // MemCopy(phandle, (PVOID)0x409A7E, &NOP, 1); WriteMem((DWORD)(0x00409A7E), (void*)NOP, sizeof NOP); if(GetLastError()) { cout << "Error: " << GetLastError() << endl; system("pause"); } break; default: cout << "ERROR!\n"; break; } Sleep(100); } system("pause"); return 0; } This is suppose to NOP the DEC function that is 3 bytes long preventing me from losing lives. However each time I try it, it crashes the hack and says I had a access violation. I tried to look up the reasons and most of them dealt with with the size of the location I'm writing to and what I'm copying from. Otherwise, I have absolutely no idea. Any help would be nice. The game is GunRoar and the base address "0x409A7E" is where the DEC function is.

    Read the article

  • Polling versus socket servers for online Flash games

    - by justin
    Hi, I want to make an online flash game, it will have social features but the gameplay will be primarily single-player. For example, no two players will appear on the screen at once, the social interaction will be through asynchronous messages, there won't be real-time chat or anything. Much of the logic would happen in the client, the server would validate the client logic, but it wouldn't need to be totally synchronous, which is why I'm thinking polling might be satisfactory. I have read in many places that socket servers can be more efficient than using polling for online games, but is that mainly a consideration for games that are more multi-player with more mult-player interactions than the game I have descriebed? If many users are playing online at the same time, but each playing a relatively isolated game, and not interacting to in real-time with each players, could polling be okay, or would using sockets be advisable no matter what if you have an online game that you envision many people playing at the same time? Thanks!

    Read the article

  • MS Access 2003 - Is there a way to programmatically define the data for a chart?

    - by Justin
    So I have some VBA for taking charts built with the Form's Chart Wizard, and automatically inserting it into PowerPoint Presentation slides. I use those chart-forms as sub forms within a larger forms that has parameters the user can select to determine what is on the chart. The idea is that the user can determine the parameter, build the chart to his/her liking, and click a button and have it in a ppt slide with the company's background template, blah blah blah..... So it works, though it is very bulky in terms of the amount of objects I have to use to accomplish this. I use expressions such as the following: like forms!frmMain.Month&* to get the input values into the saved queries, which was fine when i first started, but it went over so well and they want so many options, that it is driving the number of saved queries/objects up. I need several saved forms with charts because of the number of different types of charts I need to have this be able to handle. SO FINALLY TO MY QUESTION: I would much rather do all this on the fly with some VBA. I know how to insert list boxes, and text boxes on a form, and I know how to use SQL in VBA to get the values I want from tables/queries using VBA, I just don't know if there is some vba I can use to set the data values of the charts from a resulting recordset: DIM rs AS DAO.Rescordset DIM db AS DAO.Database DIM sql AS String sql = "SELECT TOP 5 Count(tblMain.TransactionID) AS Total, tblMain.Location FROM tblMain WHERE (((tblMain.Month) = """ & me.txtMonth & """ )) ORDER BY Count (tblMain.TransactionID) DESC;" set db = currentDB set rs = db.OpenRecordSet(sql) rs.movefirst some kind of cool code in here to make this recordset the data of chart in frmChart ("Chart01") thanks for your help. apologies for the length of the explanation.

    Read the article

  • restrict script inside iframe to run only within pages of same top-level domain?

    - by Justin Grant
    I'd like to enforce a requirement that client script inside a page (which in turn is loaded inside an iframe of another page) will only run when the parent page is on the same top-level domain as the framed page (although it may be on another hostname in that domain). Is this do-able? I assume that the easy solution of looking at top.location.host won't be available due to cross-site scripting limitations, but I'm wondering if other javascript hackery could suffice. Constraints on any potential solution inculde: I need to be able to run XmlHttpRequest calls inside the child page, and I need to validate that the hostname is in the same domain before I make those calls. (this makes a document.domain solution challenging because AFAIK setting document.domain disables the ability to make XmlHttpRequest calls. I can control client-side script and HTML on both parent or child (and I can create new pages if needed), but I can't make any server-side code changes. I can't simulate the above via server-side calls or proxies, because the child page's hostname uses a forms auth system with hostname-scoped cookies that I can't get access to from the parent page since it's on a different hostname. I don't have enough control over the child-frame site to be able to put both sites behind the same reverse-proxy or load-balancer (which would enable me to put both sites on the same hostname). I don't actually need to access any UI inside the IFrame-- the iframe is invisible and I'm only using it to run javascript within the security context of a site on a different hostname from the parent page. So at this point I'm stumped. Got any ideas? I want to make sure I'm not overlooking an easy solution before giving up.

    Read the article

  • mediawiki markup equivalent of WMD editor?

    - by Justin Grant
    Anyone have a recommendation for an editor like the WMD editor, but using MediaWiki markup instead of Markdown? Our site is already using MediaWiki markup but we want a slicker editor without changing markup completely. Requirements include: live preview of formatted text underneath the markup you're typing a toolbar for common formatting (bold, italic, links, bullets, numbered-list, code, etc) keyboard shortcuts for each toolbar button (e.g. CTRL+B for bold) Undo/redo via keyboard shortcuts (CTRL+Z/CTRL+Y) or toolbar buttons works well in the usual set of popular browsers (including IE6!) open-source would be preferred

    Read the article

  • EF4 CTP5 Code First approach ignores Table attributes

    - by Justin
    I'm using EF4 CTP5 code first approach but am having trouble getting it to work. I have a class called "Company" and a database table called "CompanyTable". I want to map the Company class to the CompanyTable table, so have code like this: [Table(Name = "CompanyTable")] public class Company { [Key] [Column(Name = "CompanyIdNumber", DbType = "int")] public int CompanyNumber { get; set; } [Column(Name = "CompanyName", DbType = "varchar")] public string CompanyName { get; set; } } I then call it like so: var db = new Users(); var companies = (from c in db.Companies select c).ToList(); However it errors out: Invalid object name 'dbo.Companies'. It's obviously not respecting the Table attribute on the class, even though it says here that Table attribute is supported. Also it's pluralizing the name it's searching for (Companies instead of Company.) How do I map the class to the table name?

    Read the article

  • Is there a way to trace through only project source in Delphi?

    - by Justin
    I'm using Delphi 2010 and I'm wondering if there's a way to trace through code which is in the project without tracing through calls to included VCLs. For example - you put in a breakpoint and then use Shift+F7 to trace through line-by-line. Now you run into a call to some lengthy procedure in a VCL - in my case it's often a Measurement Studio or other component that draws the doodads for a bunch of I/O, OPC, or other bits. At any rate, what happens is that the debugger hops out of the active source file, opens the component source, and traces through that line by line. Often this is hundreds or thousands of lines of code I don't care about - I just want to have it execute and return to the next source line in MY project. Obviously you can do this by setting breakpoints around every instance of an external call, but often there are too many to make this practical - I'd be spending an hour setting a hundred breakpoints every time I wanted to step through a section of code. Is there a setting or a tool somewhere that can do this? Allow one to trace through code within the project while silently executing code which is external to the project? Thanks in advance, Stack Overflow!

    Read the article

  • mediawiki markup equivalent of WMD live-previewing editor? (not WYSIWYG)

    - by Justin Grant
    Anyone have a recommendation for an editor like the WMD editor, but using MediaWiki markup instead of Markdown? Our site is already using MediaWiki markup but we want a slicker editor without changing markup completely. Requirements include: live preview of formatted text underneath the markup you're typing a toolbar for common formatting (bold, italic, links, bullets, numbered-list, code, etc) keyboard shortcuts for each toolbar button (e.g. CTRL+B for bold) Undo/redo via keyboard shortcuts (CTRL+Z/CTRL+Y) or toolbar buttons works well in the usual set of popular browsers (including IE6!) open-source would be preferred I've found a few options at http://www.mediawiki.org/wiki/WYSIWYG_editor, but all of these seem to be WYSIWYG editors which is not exactly what I want since full-on WYSIWYG editors tend to be bug-prone and complicate working at the markup level. Instead we want a plain-text markup editor with a client-side previewer, plus some UI niceties (toolbar, undo, keyboard shortcuts) to make editing markup easier.

    Read the article

  • prevent javascript in the WMD editor's preview box

    - by Justin Grant
    There are many SO questions (e.g. here and here) about how to do server-side scrubbing of Markdown produced by the WMD editor to ensure the HTML generated doesn't contain malicious script, like this: <img onload="alert('haha');" src="http://www.google.com/intl/en_ALL/images/srpr/logo1w.png" /> Unfortunately, this still allows script to show up in the WMD client's preview box. I doubt this is a big deal since if you're scrubbing the HTML on the server, an attacker can't save the bad HTML so no one else will be able to see it later and have their cookies stolen or sessions hijacked by the bad script. But it's still kinda odd to allow an attacker to run any script in the context of your site, and it's probably a bad idea to allow the client preview window to allow different HTML than your server will allow. StackOverflow has clearly plugged this hole. How did they do it? [NOTE: I already figured this out but it required some tricky javascript debugging, so I'm answering my own question here to help others who may want to do ths same thing]

    Read the article

  • Jetty RewriteHandler and RewriteRegexRule

    - by Justin
    I'm trying to rewrite a URL for a servlet. The URL gets rewritten correctly, but the context doesn't match after that. Any idea how to get this to work? RewriteHandler rewriteHandler = new RewriteHandler(); rewriteHandler.setRewriteRequestURI(true); rewriteHandler.setRewritePathInfo(true); rewriteHandler.setOriginalPathAttribute("requestedPath"); RewriteRegexRule rewriteRegexRule = new RewriteRegexRule(); rewriteRegexRule.setRegex("/r/([^/]*).*"); rewriteRegexRule.setReplacement("/r?z=$1"); rewriteHandler.addRule(rewriteRegexRule); ContextHandlerCollection contextHandlerCollection = new ContextHandlerCollection(); Context servletContext = new Context(contextHandlerCollection, "/"); servletContext.addServlet(new ServletHolder(new RedirectServlet()), "/r"); So basically /r/asdf gets rewritten to /r?z=asdf. However, the rewritten /r?z=asdf is now not processed by the servlet. Also, /r?z=asdf does work if called directly.

    Read the article

  • find_or_create_by_facebook_id method not found

    - by Justin
    Hi guys, I'm trying to find out where this function comes from. Any one have any clue? It's used by this: http://github.com/fluidtickets/facebooker-authlogic-bridge with a working example here: http://facebooker-authlogic-bridge.heroku.com Downloading the code, it throws: undefined method 'find_or_create_by_facebook_id' for #<Class:0xb04dd1c> I have no clue where this function comes from. Thanks all!

    Read the article

  • Windows equalivalent to eth0

    - by Justin Fuller
    Is there a generic IP device name for windows similar to "eth0" used by Linux and Solaris? I am attempting to monitor SCTP traffic, which appears to be successful passing the ip address, but this means for every machine to use this application would changing to use the host address. Thanks

    Read the article

  • How do I call a basic YUI3 function from within a normal JavaScript function?

    - by Justin Tanner
    I'd like to call a simple YUI3 function from within a JavaScript function. Here is some code that does what I want in a very verbose way: function changeContent (message) { YUI().use("node", function(Y) { Y.all('#content-div').setContent(message); }); } Is there a better way to do this? NOTE: I don't want to attach this function to any event, I just want a global changeContent() function available.

    Read the article

  • tastypie posting and full example

    - by Justin M
    Is there a full tastypie django example site and setup available for download? I have been wrestling with wrapping my head around it all day. I have the following code. Basically, I have a POST form that is handled with ajax. When I click "submit" on my form and the ajax request runs, the call returns "POST http://192.168.1.110:8000/api/private/client_basic_info/ 404 (NOT FOUND)" I have the URL configured alright, I think. I can access http://192.168.1.110:8000/api/private/client_basic_info/?format=json just fine. Am I missing some settings or making some fundamental errors in my methods? My intent is that each user can fill out/modify one and only one "client basic information" form/model. a page: {% extends "layout-column-100.html" %} {% load uni_form_tags sekizai_tags %} {% block title %}Basic Information{% endblock %} {% block main_content %} {% addtoblock "js" %} <script language="JavaScript"> $(document).ready( function() { $('#client_basic_info_form').submit(function (e) { form = $(this) form.find('span.error-message, span.success-message').remove() form.find('.invalid').removeClass('invalid') form.find('input[type="submit"]').attr('disabled', 'disabled') e.preventDefault(); var values = {} $.each($(this).serializeArray(), function(i, field) { values[field.name] = field.value; }) $.ajax({ type: 'POST', contentType: 'application/json', data: JSON.stringify(values), dataType: 'json', processData: false, url: '/api/private/client_basic_info/', success: function(data, status, jqXHR) { form.find('input[type="submit"]') .after('<span class="success-message">Saved successfully!</span>') .removeAttr('disabled') }, error: function(jqXHR, textStatus, errorThrown) { console.log(jqXHR) console.log(textStatus) console.log(errorThrown) var errors = JSON.parse(jqXHR.responseText) for (field in errors) { var field_error = errors[field][0] $('#id_' + field).addClass('invalid') .after('<span class="error-message">'+ field_error +'</span>') } form.find('input[type="submit"]').removeAttr('disabled') } }) // end $.ajax() }) // end $('#client_basic_info_form').submit() }) // end $(document).ready() </script> {% endaddtoblock %} {% uni_form form form.helper %} {% endblock %} resources from residence.models import ClientBasicInfo from residence.forms.profiler import ClientBasicInfoForm from tastypie import fields from tastypie.resources import ModelResource from tastypie.authentication import BasicAuthentication from tastypie.authorization import DjangoAuthorization, Authorization from tastypie.validation import FormValidation from tastypie.resources import ModelResource, ALL, ALL_WITH_RELATIONS from django.core.urlresolvers import reverse from django.contrib.auth.models import User class UserResource(ModelResource): class Meta: queryset = User.objects.all() resource_name = 'user' fields = ['username'] filtering = { 'username': ALL, } include_resource_uri = False authentication = BasicAuthentication() authorization = DjangoAuthorization() def dehydrate(self, bundle): forms_incomplete = [] if ClientBasicInfo.objects.filter(user=bundle.request.user).count() < 1: forms_incomplete.append({'name': 'Basic Information', 'url': reverse('client_basic_info')}) bundle.data['forms_incomplete'] = forms_incomplete return bundle class ClientBasicInfoResource(ModelResource): user = fields.ForeignKey(UserResource, 'user') class Meta: authentication = BasicAuthentication() authorization = DjangoAuthorization() include_resource_uri = False queryset = ClientBasicInfo.objects.all() resource_name = 'client_basic_info' validation = FormValidation(form_class=ClientBasicInfoForm) list_allowed_methods = ['get', 'post', ] detail_allowed_methods = ['get', 'post', 'put', 'delete'] Edit: My resources file is now: from residence.models import ClientBasicInfo from residence.forms.profiler import ClientBasicInfoForm from tastypie import fields from tastypie.resources import ModelResource from tastypie.authentication import BasicAuthentication from tastypie.authorization import DjangoAuthorization, Authorization from tastypie.validation import FormValidation from tastypie.resources import ModelResource, ALL, ALL_WITH_RELATIONS from django.core.urlresolvers import reverse from django.contrib.auth.models import User class UserResource(ModelResource): class Meta: queryset = User.objects.all() resource_name = 'user' fields = ['username'] filtering = { 'username': ALL, } include_resource_uri = False authentication = BasicAuthentication() authorization = DjangoAuthorization() #def apply_authorization_limits(self, request, object_list): # return object_list.filter(username=request.user) def dehydrate(self, bundle): forms_incomplete = [] if ClientBasicInfo.objects.filter(user=bundle.request.user).count() < 1: forms_incomplete.append({'name': 'Basic Information', 'url': reverse('client_basic_info')}) bundle.data['forms_incomplete'] = forms_incomplete return bundle class ClientBasicInfoResource(ModelResource): # user = fields.ForeignKey(UserResource, 'user') class Meta: authentication = BasicAuthentication() authorization = DjangoAuthorization() include_resource_uri = False queryset = ClientBasicInfo.objects.all() resource_name = 'client_basic_info' validation = FormValidation(form_class=ClientBasicInfoForm) #list_allowed_methods = ['get', 'post', ] #detail_allowed_methods = ['get', 'post', 'put', 'delete'] def apply_authorization_limits(self, request, object_list): return object_list.filter(user=request.user) I made the user field of the ClientBasicInfo nullable and the POST seems to work. I want to try updating the entry now. Would that just be appending the pk to the ajax url? For example /api/private/client_basic_info/21/? When I submit that form I get a 501 NOT IMPLEMENTED message. What exactly haven't I implemented? I am subclassing ModelResource, which should have all the ORM-related functions implemented according to the docs.

    Read the article

  • What features would you like to see removed from C++?

    - by Justin Ethier
    This question was inspired by what-features-would-you-like-to-see-added-to-c. anBasically, C++ is a great general-purpose language. But perhaps too general and feature-rich... multiple inheritance, operator overloading, manual memory management, templates, smart pointers, virtual destructors, legacy frameworks (think MFC), and I could just go on. Is there any one feature / aspect of C++ that you would like taken away, to make our lives easier as C++ developers? One feature per answer, please.

    Read the article

  • ACCESS 2003 Excel 2003 : VBA for opening Excel file from Access and copying a pictre from excel the

    - by Justin
    So I have an excel workbook that has a nice global map of shaperange objects. With some very simple code I can change the colors, group and ungroup collections of countries into arrays, etc...and it works pretty well. However, I would like to bring this into Access. So I could copy and paste all the shapes into an access form manually, but then they become pictures and I cannot change the colors of the countries (shaperange objects) to have the map act interactively as I can in excel. So I am thinking that I know how to use excel functions from access, and how to open excel from access. Is there a way to copy an object from excel (I know the file name and the shape name that i mean to copy everytime), and bringing it back to access to paste on a form? Atypical, I know, all my Access questions are. Thanks!

    Read the article

  • MS Access 2003 - Is there a way to run access (mde) without the access shell around the forms/report

    - by Justin
    So I am not sure if I am asking this correctly; let me explain: IS there a way I can run my MDE without the access shell around the forms/reports? The part that provides the menu, and the little application title. I think it is the overall presentation layer form that all my access stuff sits on, but I am not sure. I am just wondering if you can get rid of it. Thanks

    Read the article

  • Converting IPv4 or IPv6 address to a long for comparisons

    - by Justin Akehurst
    In order to check if an IPv4 or IPv6 address is within a certain range, I've got code that takes an IPv4 address, turns that into a long, then does that same conversion on the upper/lower bound of the subnet, then checks to see if the long is between those values. I'd like to be able to do the same thing for IPv6, but saw nothing in the Python 2.6 standard libraries to allow me to do this, so I wrote this up: import socket, struct from array import array def ip_address_to_long(address): ip_as_long = None try: ip_as_long = socket.ntohl(struct.unpack('L', socket.inet_pton(socket.AF_INET, address))[0]) except socket.error: # try IPv6 try: addr = array('L', struct.unpack('!4L', socket.inet_pton(socket.AF_INET6, address))) addr.reverse() ip_as_long = sum(addr[i] << (i * 32) for i in range(len(addr))) except socket.error as se: raise ValueError('Invalid address') except Exception as e: print str(e) return ip_as_long My question is: Is there a simpler way to do this that I am missing? Is there a standard library call that can do this for me?

    Read the article

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