Search Results

Search found 2474 results on 99 pages for 'patrick scott'.

Page 58/99 | < Previous Page | 54 55 56 57 58 59 60 61 62 63 64 65  | Next Page >

  • Drupal, Views, Exposed filter: custom default selected tags

    - by Patrick
    hi I'm using Drupal, Views with a exposed filter (using taxonomy). My customer wants to set from back-end the default selected tags (in order to pre-filter the views content). In the exposed filter settings, there is functionality. However, it doesn't work properly: when I click on "Select None" link (I'm using better_exposed_filter module) I expect none of the tags are selected, instead, the default configuration (default selected tags) are selected, so actually it doesn't work anymore. I hope it is clear. So, I was wondering if I can prepare a custom menu in which my user can check/uncheck the default selected tags in the view. thanks

    Read the article

  • Serialize Dictionary with a string key and List[] value to JSON

    - by Patrick
    How can I serialize a python Dictionary to JSON and pass back to javascript, which contains a string key, while the value is a List (i.e. []) if request.is_ajax() and request.method == 'GET': groupSet = GroupSet.objects.get(id=int(request.GET["groupSetId"])) groups = groupSet.groups.all() group_items = [] #list groups_and_items = {} #dictionary for group in groups: group_items.extend([group_item for group_item in group.group_items.all()]) #use group as Key name and group_items (LIST) as the value groups_and_items[group] = group_items data = serializers.serialize("json", groups_and_items) return HttpResponse(data, mimetype="application/json") the result: [{"pk": 5, "model": "myApp.group", "fields": {"name": "\u6fb4\u9584", "group_items": [13]}}] while the group_items should have many group_item and each group_item should have "name", rather than only the Id, in this case the Id is 13. I need to serialize the group name, as well as the group_item's Id and name as JSON and pass back to javascript. I am new to Python and Django, please advice me if you have a better way to do this, appreciate. Thank you so much. :)

    Read the article

  • MySQL to SQL Server ODBC Connector?

    - by Scott C.
    My boss wants to have data in MySQL DBs used for our website to be "linked and synced" with a Financial Server that has its DB in SQL Server. Sooooo...even though I have no idea how to accomplish this, this just sounds like an absolute nightmare especially since the MySQL DB is most likely going to be hosted in the cloud and not on a machine next to the Financial Server. Any ideas how to accomplish this? (within reason?) Also, his big thing is he wants to basically pull up the data from any record a user enters and using data pulled from that do all sorts of calculations using ANOTHER program that stores its data (apparently) in SQL Server. Thinking of all the data I might have to convert makes me very uneasy. Please tell a ODBC eliminates complicated junk like this. :/ I'm trying to talk him into just having MySQL do a nightly dump into a CSV file or something and using that (rather than connector) to update the SQL Server DBs. I guess I'm just not that comfortable with a server and/or programming I have no say over being connected DIRECTLY to my MySQL DB for the website. If there's no good answer for this, can anyone offer a suggestion as to what I can say to talk him out of this? (I'm a low-level IT guy w/ a decent grasp on programming...but I'm no expert - should I try to push this off to a seasoned IT pro?) Thanks in advance.

    Read the article

  • How do I anchor an expander to right side of a ListBox?

    - by Scott
    The XAML code below works fine except I want the expander button to be between the listbox and the grid. If I set the ExpandDirection="Left" the button is between the listbox and the grid but the direction indicator on the button is confusing to users - it point to the right when expanded and it points to the left when it is not expanded. I want the direction indicator to work the way it does when ExpandDirection="Right" but I want the functionality of ExpandDirection="Left". <DockPanel> <Expander ExpandDirection="Right"> <ListBox> <ListBoxItem>Item One</ListBoxItem> <ListBoxItem>Item Two</ListBoxItem> <ListBoxItem>Item Three</ListBoxItem> <ListBoxItem>Item Four</ListBoxItem> <ListBoxItem>Item Five</ListBoxItem> </ListBox> </Expander> <Grid Background="AliceBlue"> <TextBlock > Other Content </TextBlock> </Grid> </DockPanel>

    Read the article

  • How do I submit a form using jquery (ajaxForm plugin) to an external site but not reload to a differ

    - by Scott
    Hi, I'm trying to create a form that sends the customer's name and email address to icontact (an email list application). All the values are correct for icontact and if I submit the form as usual, icontact responds that it added the email address. The success message loads in a new page from icontact's website. What I'd like to accomplish is that ajax would send the form and returns a success message within the current page, without sending the customer to a new page. Here is the test page: http://www.skhot.com/test/js-test/forms/index.php

    Read the article

  • Nhibernate + Gridview + TargetInvocationException

    - by Scott
    For our grid views, we're setting the data sources as a list of results from an Nhibernate query. We're using lazy loading, so the objects are actually proxied... most of the time. In some instances the list will consist of types of Student and Composition_Aop_Proxy_jklasjdkl31231, which implements the same members as the Student class. We've still got the session open, so the lazy loading would resolve fine, if GridView didn't throw an error about the different types in the gridview. Our current workaround is to clone the object, which results in fetching all of the data that can be lazily loaded, even though most of it won't be accessed.. ever. This, however, converts the proxy into an actual object and the grid view is happy. The performance implications kind of scare me as we're getting closer to rolling the code out as is. I've tried evicting the object after a save, which should ensure that everything is a proxy, but this doesn't seem like a good idea either. Does anyone have any suggestions/workarounds?

    Read the article

  • "Detecting" and loading of "plugins" in GAE

    - by Patrick Cornelissen
    Hi! I have a "plugin like" architecture and I want to create one instance of each class that implements a dedicated interface and put these in a cache. (To have a singleton-ish effect). The plugins will be provided as jars and put into the app engine war file before the app is uploaded. I have tried to use the ClassPathScanningCandidateComponentProvider as I'm using spring anyway, but this didn't work. The provider complained that it was not able to find the HttpServletResponse class file while scanning the classpath. I can't get around this, when I add the servlet jar, then I'll get of course problems, because the same jar is also provided by the GAE. If I don't, I'm getting the error above... So I tried to add a static initialization code, but of course this doesn't work, because the class is initialized when it's instantiated for the first time. (Well I knew that but it was worth a try) The last chance I currently see is that I create a properties file with all plugin classes when the package is created, but this requires writing of a maven plugin etc. and I'd like to avoid that. Is there something that I am missing?

    Read the article

  • Python - network buffer handling question...

    - by Patrick Moriarty
    Hi, I want to design a game server in python. The game will mostly just be passing small packets filled with ints, strings, and bytes stuffed into one message. As I'm using a different language to write the game, a normal packet would be sent like so: Writebyte(buffer, 5); // Delimit type of message Writestring(buffer, "Hello"); Sendmessage(buffer, socket); As you can see, it writes the bytes to the buffer, and sends the buffer. Is there any way to read something like this in python? I am aware of the struct module, and I've used it to pack things, but I've never used it to actually read something with mixed types stuck into one message. Thanks for the help.

    Read the article

  • How to manage lifecycle in a ViewGroup-derived class?

    - by Scott Smith
    I had a bunch of code in an activity that displays a running graph of some external data. As the activity code was getting kind of cluttered, I decided to extract this code and create a GraphView class: public class GraphView extends LinearLayout { public GraphView(Context context, AttributeSet attrs) { super(context, attrs); LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); inflater.inflate(R.layout.graph_view, this, true); } public void start() { // Perform initialization (bindings, timers, etc) here } public void stop() { // Unbind, destroy timers, yadda yadda } . . . } Moving stuff into this new LinearLayout-derived class was simple. But there was some lifecycle management code associated with creating and destroying timers and event listeners used by this graph (I didn't want this thing polling in the background if the activity was paused, for example). Coming from a MS Windows background, I kind of expected to find overridable onCreate() and onDestroy() methods or something similar, but I haven't found anything of the sort in LinearLayout (or any of its inherited members). Having to leave all of this initialization code in the Activity, and then having to pass it into the view seemed like it defeated the original purpose of encapsulating all of this code into a reusable view. I ended up adding two additional public methods to my view: start() and stop(). I make these calls from the activity's onResume() and onPause() methods respectively. This seems to work, but it feels like I'm using duct tape here. Does anyone know how this is typically done? I feel like I'm missing something...

    Read the article

  • How to Add a Dynamic Layer to an Esri Map Control Programatically in WPF?

    - by Scott
    Just as the question asks. I have an Esri map control and want to add a Rastor image to the control in WPF and don't know how to do it. I see that I can add layers to the Map control, but is there a way to add a Raster image to a map control? I did find this code to turn the raster image into a Dynamic layer, but Im still lost on how to add a dynamic layer to the control it self. http://resources.esri.com/arcgisserver/apis/silverlight/index.cfm?fa=codeGalleryDetails&scriptID=16723 Thank you!

    Read the article

  • How to save an image in it's original format?

    - by Patrick Klug
    I am trying to figure out how I can get the original format of an image so that I can store it with the same encoding. It seems that the only way to save an Image is by using a BitmapEncoder but I don't know how I can get the correct format from the image. Example: Clipboard.GetImage() returns a InteropBitmap which doesn't seem to contain any information about the original format. I also tried using an Extension method: public static void Save(this BitmapImage image, System.IO.Stream stream) { var decoder = BitmapDecoder.Create(image.StreamSource, BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.Default); var encoder = BitmapEncoder.Create(decoder.CodecInfo.ContainerFormat); foreach (var frame in decoder.Frames) { encoder.Frames.Add(BitmapFrame.Create(decoder.Frames[0])); } encoder.Save(stream); } but the problem is that a) the ImageSource is not always a BitmapImage (Clipboard.GetImage()) for example and b) the image.StreamSource can be null in some cases (seems to be when the image is loaded via a relative Uri)

    Read the article

  • Help with this compile error

    - by Scott
    I just picked up an old project and I'm not sure what the following error could mean. g++ -o BufferedReader.o -c -g -Wall -std=c++0x -I/usr/include/xmms2 -Ijsoncpp/include/json/ -fopenmp -I/usr/include/ImageMagick -I/usr/include/xmms2 -I/usr/include/libvisual-0.4 -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/SDL -DQT_CORE_LIB -DQT_GUI_LIB -DQT_SCRIPT_LIB -DQT_SHARED -I/usr/include/QtCore -I/usr/include/QtGui -I/usr/include/QtScript BufferedReader.cpp In file included from BufferedReader.cpp:23: /usr/include/string.h:36:42: error: missing binary operator before token "(" In file included from /usr/lib/gcc/i686-redhat-linux/4.4.3/../../../../include/c++/4.4.3/cwchar:47, from /usr/lib/gcc/i686-redhat-linux/4.4.3/../../../../include/c++/4.4.3/bits/postypes.h:42, from /usr/lib/gcc/i686-redhat-linux/4.4.3/../../../../include/c++/4.4.3/iosfwd:42, from /usr/lib/gcc/i686-redhat-linux/4.4.3/../../../../include/c++/4.4.3/ios:39, from /usr/lib/gcc/i686-redhat-linux/4.4.3/../../../../include/c++/4.4.3/istream:40, from /usr/lib/gcc/i686-redhat-linux/4.4.3/../../../../include/c++/4.4.3/sstream:39, from BufferedReader.cpp:24: At line 24 of BufferedReader.cpp is #include <string.h>. I've tried it with just <string> but get the same thing. Any clue? Here's the snippet of code from string.h /* Tell the caller that we provide correct C++ prototypes. */ #if defined __cplusplus && __GNUC_PREREQ (4, 4) //line 36 # define __CORRECT_ISO_CPP_STRING_H_PROTO #endif Does that mean __GNUC_PREREQ isn't defined?

    Read the article

  • How to create Hash object/array using jquery?

    - by Patrick
    Hi folks I know there is a Hash() object in the Javascript prototype framework, but is there anything in Jquery like this? As I would like to stick with one javascript framework, rather than mixing the Prototype Frame work and the JQuery framework and use at the same time, as I worry there will be conflict and create side-effects. So my question is: how to create Hash object/array using jquery? Here is my function: /* prototype framework, I want to change this to jQuery! */ var starSaves = new Hash(); function myHover(id, pos) { var starStrip = $('star_strip_' + id); if (starSaves.keys().indexOf(id) == -1) { var starSave = new Array(); var imgs = starStrip.select("img") alert(imgs); for (var i = 0; i < imgs.length; i++) { starSave[starSave.length] = imgs[i].src; if (i < pos) imgs[i].src = "/images/star_1.gif"; else imgs[i].src = "/images/star_0.gif"; } starSaves.set(id, starSave); } }

    Read the article

  • How to get only a filename (not full path) into $1, using the PERL, regular expressions

    - by Scott
    I want to keep only the filenames (not full paths) and add the filename to some bbcode. Here is the HTML to be converted: <a href=/path/to/full/image.jpg rel=prettyPhoto><img rel=prettyPhoto src=/path/to/thumb/image.jpg /></a> Notice I cannot have rel="foo" (no double quotes).. Here is what I have in PERL, to perform the conversion: s/\<a href=(.+?)\ rel=prettyPhoto\>\<img rel=prettyPhoto src=(.+?) \/>\<\/a\>/\[box\]$1\[\/box\]/gi; This converts the HTML to: [box]/path/to/image.jpg[/box] But this is what I want as a result: [box]image.jpg[/box] The HTML must remain the same. So how do I change my PERL so that $1 contains only the filename?

    Read the article

  • php file_get_contents and &amp;

    - by Patrick
    Hello all, I'm trying to use php's file_get_content('a url'); The thing is if the url has '&' in it, for example file_get_contents('http://www.google.com/?var1=1&var2=2') it automatically make a requests to www.google.com/?var1=1&amp<no space here>;var2=2 How do I prevent that from happening?

    Read the article

  • Dealing with &rest-parameters in common lisp

    - by Patrick
    I want define a functions that accepts &rest - parameters and delegates them to another function. (html "blah" "foo" baz) = "blahfoobaz" I did not find a better way than this one: (defun html (&rest values) (concatenate 'string "" (reduce #'(lambda(a b) (concatenate 'string a b)) values :initial-value "") "")) But this looks somewhat glumbsy to me, since line 4 does no more than concatenating the &rest parameter "values". I tried (concatenate 'string "" (values-list values) "") but this does not seem to work (SBCL). Could someone give me an advice? Kind regards

    Read the article

  • Hacking "Contact Form 7" code to Add A "Referred By" field

    - by Scott B
    I've got about 6 subdomains that have a "contact us" link and I'm sending all these links to a single form that uses "Contact Form 7". I add ?from=site-name to each of the links so that I can set a $referredFrom variable in the contact form. The only two things I'm missing are (1) the ability to insert this referredFrom variable into the email that I get whenever someone submits the form and (2) The ability to redirect the user back to the site they came from (stored in $referredFrom) Any ideas? Here's a bit of code from includes/classes.php that I thought might be part of the email insert but its not doing much... function mail() { global $referrer; $refferedfrom = $referrer; //HERE IS MY CUSTOM CODE $fes = $this->form_scan_shortcode(); foreach ( $fes as $fe ) { $name = $fe['name']; $pipes = $fe['pipes']; if ( empty( $name ) ) continue; $value = $_POST[$name]; if ( WPCF7_USE_PIPE && is_a( $pipes, 'WPCF7_Pipes' ) && ! $pipes->zero() ) { if ( is_array( $value) ) { $new_value = array(); foreach ( $value as $v ) { $new_value[] = $pipes->do_pipe( $v ); } $value = $new_value; } else { $value = $pipes->do_pipe( $value ); } } $this->posted_data[$name] = $value; $this->posted_data[$refferedfrom] = $referrer; //HERE IS MY CUSTOM CODE } I'm also thinking that I could insert the referredFrom code somewhere in this function as well... function compose_and_send_mail( $mail_template ) { $regex = '/\[\s*([a-zA-Z][0-9a-zA-Z:._-]*)\s*\]/'; $callback = array( &$this, 'mail_callback' ); $mail_subject = preg_replace_callback( $regex, $callback, $mail_template['subject'] ); $mail_sender = preg_replace_callback( $regex, $callback, $mail_template['sender'] ); $mail_body = preg_replace_callback( $regex, $callback, $mail_template['body'] ); $mail_recipient = preg_replace_callback( $regex, $callback, $mail_template['recipient'] ); $mail_headers = "From: $mail_sender\n"; if ( $mail_template['use_html'] ) $mail_headers .= "Content-Type: text/html\n"; $mail_additional_headers = preg_replace_callback( $regex, $callback, $mail_template['additional_headers'] ); $mail_headers .= trim( $mail_additional_headers ) . "\n"; if ( $this->uploaded_files ) { $for_this_mail = array(); foreach ( $this->uploaded_files as $name => $path ) { if ( false === strpos( $mail_template['attachments'], "[${name}]" ) ) continue; $for_this_mail[] = $path; } return @wp_mail( $mail_recipient, $mail_subject, $mail_body, $mail_headers, $for_this_mail ); } else { return @wp_mail( $mail_recipient, $mail_subject, $mail_body, $mail_headers ); } }

    Read the article

  • How to perform a join with CodeIgniter's Active Record class on a multicolumn key?

    - by Scott Southworth
    I've been able to make this code work using CodeIgniter's db->query as follows: $sql = 'SELECT mapping_code,zone_name,installation_name FROM installations,appearances,zones WHERE installations.installation_id = zones.installation_fk_id AND appearances.installation_fk_id = installations.installation_id AND appearances.zone_fk_id = zones.zone_id AND appearances.barcode = ? '; return $this->db->query($sql,array($barcode)); The 'appearances' table throws a 'not unique table' error if I try this using the Active Record class. I need to join appearances on both the zone and installations tables. How can I do this?

    Read the article

  • Can I create ternary operators in C# ?

    - by Scott S
    I want to create a ternary operator for a < b < c which is a < b && b < c. or any other option you can think of that a < b c and so on... I am a fan of my own shortform and I have wanted to create that since I learned programming in high school. How?

    Read the article

< Previous Page | 54 55 56 57 58 59 60 61 62 63 64 65  | Next Page >