Search Results

Search found 771 results on 31 pages for 'justin lawrence'.

Page 20/31 | < Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >

  • 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

  • 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

  • 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

  • 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

  • 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

  • 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

  • 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

  • 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

  • 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

  • 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

  • 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

  • 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

  • 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

  • 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

  • Using recursion to to trim a binary tree based on a given min and max value

    - by Justin
    As the title says, I have to trim a binary tree based on a given min and max value. Each node stores a value, and a left/right node. I may define private helper methods to solve this problem, but otherwise I may not call any other methods of the class nor create any data structures such as arrays, lists, etc. An example would look like this: overallRoot _____[50]____________________ / \ __________[38] _______________[90] / \ / _[14] [42] [54]_____ / \ \ [8] [20] [72] \ / \ [26] [61] [83] trim(52, 65); should return: overallRoot [54] \ [61] My attempted solution has three methods: public void trim(int min, int max) { rootFinder(overallRoot, min, max); } First recursive method finds the new root perfectly. private void rootFinder(IntTreeNode node, int min, int max) { if (node == null) return; if (overallRoot.data < min) { node = overallRoot = node.right; rootFinder(node, min, max); } else if (overallRoot.data > max) { node = overallRoot = node.left; rootFinder(node, min, max); } else cutter(overallRoot, min, max); } This second method should eliminate any further nodes not within the min/max, but it doesn't work as I would hope. private void cutter(IntTreeNode node, int min, int max) { if (node == null) return; if (node.data <= min) { node.left = null; } if (node.data >= max) { node.right = null; } if (node.data < min) { node = node.right; } if (node.data > max) { node = node.left; } cutter(node.left, min, max); cutter(node.right, min, max); } This returns: overallRoot [54]_____ \ [72] / [61] Any help is appreciated. Feel free to ask for further explanation as needed.

    Read the article

  • String Length Evaluating Incorrectly

    - by Justin R.
    My coworker and I are debugging an issue in a WCF service he's working on where a string's length isn't being evaluated correctly. He is running this method to unit test a method in his WCF service: // Unit test method public void RemoveAppGroupTest() { string addGroup = "TestGroup"; string status = string.Empty; string message = string.Empty; appActiveDirectoryServicesClient.RemoveAppGroup("AOD", addGroup, ref status, ref message); } // Inside the WCF service [OperationBehavior(Impersonation = ImpersonationOption.Required)] public void RemoveAppGroup(string AppName, string GroupName, ref string Status, ref string Message) { string accessOnDemandDomain = "MyDomain"; RemoveAppGroupFromDomain(AppName, accessOnDemandDomain, GroupName, ref Status, ref Message); } public AppActiveDirectoryDomain(string AppName, string DomainName) { if (string.IsNullOrEmpty(AppName)) { throw new ArgumentNullException("AppName", "You must specify an application name"); } } We tried to step into the .NET source code to see what value string.IsNullOrEmpty was receiving, but the IDE printed this message when we attempted to evaluate the variable: 'Cannot obtain value of local or argument 'value' as it is not available at this instruction pointer, possibly because it has been optimized away.' (None of the projects involved have optimizations enabled). So, we decided to try explicitly setting the value of the variable inside the method itself, immediately before the length check -- but that didn't help. // Lets try this again. public AppActiveDirectoryDomain(string AppName, string DomainName) { // Explicitly set the value for testing purposes. AppName = "AOD"; if (AppName == null) { throw new ArgumentNullException("AppName", "You must specify an application name"); } if (AppName.Length == 0) { // This exception gets thrown, even though it obviously isn't a zero length string. throw new ArgumentNullException("AppName", "You must specify an application name"); } } We're really pulling our hair out on this one. Has anyone else experienced behavior like this? Any tips on debugging it?

    Read the article

  • Prevent TEXTAREAs scroll by themselves on IE8

    - by Justin Grant
    IE8 has a known bug (per connect.microsoft.com) where typing or pasting text into a TEXTAREA element will cause the textarea to scroll by itself. This is hugely annoying and shows up in many community sites, including Wikipedia. The repro is this: open the HTML below with IE8 (or use any long page on wikipedia which will exhibit the same problem until they fix it) size the browser full-screen paste a few pages of text into the TEXTAREA move the scrollbar to the middle position now type one character into the textarea Expected: nothing happens Actual: scrossing happens on its own, and the insertion point ends up near the bottom of the textarea! Below is repro HTML (can also see this live on the web here: http://en.wikipedia.org/w/index.php?title=Text_box&action=edit) <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <body> <div style="width: 80%"> <textarea rows="20" cols="80" style="width:100%;" ></textarea> </div> </body> </html>

    Read the article

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