Search Results

Search found 1114 results on 45 pages for 'robert gould'.

Page 31/45 | < Previous Page | 27 28 29 30 31 32 33 34 35 36 37 38  | Next Page >

  • MySQL Select Statement - Two Tables, Sort One Table by Count of Other Table

    - by Robert Boka
    So I have built a voting system for a custom post system i wrote. I want to be able to sort by "most voted", "Most liked", etc. I have two tables. Entry: ID, Title, Post Vote: ID, EntryID, Result I want to be able to query the vote table for each entry and see how many vote's there are, and then sort the entry's by how many vote's each table had. I have messed around with joins, etc. and cannot seem to figure it out. Any suggestions?

    Read the article

  • Possible Performance Considerations using Linq to SQL Repositories

    - by Robert Harvey
    I have an ASP.NET MVC application that uses Linq to SQL repositories for all interactions with the database. To deal with data security, I do trimming to filter data to only those items to which the user has access. This occurs in several places: Data in list views Links in a menu bar A treeview on the left hand side containing links to content Role-based security A special security attribute, inheriting from AuthorizeAttribute, that implements content-based authorization on every controller method. Each of these places instantiates a repository, which opens a Linq to Sql DataContext and accesses the database. So, by my count, each request for a page access opens at least six separate Linq to SQL DataContexts. Should I be concerned about this from a performance perspective, and if so, what can be done to mitigate it?

    Read the article

  • Managing multiple customer databases in ASP.NET MVC application

    - by Robert Harvey
    I am building an application that requires separate SQL Server databases for each customer. To achieve this, I need to be able to create a new customer folder, put a copy of a prototype database in the folder, change the name of the database, and attach it as a new "database instance" to SQL Server. The prototype database contains all of the required table, field and index definitions, but no data records. I will be using SMO to manage attaching, detaching and renaming the databases. In the process of creating the prototype database, I tried attaching a copy of the database (companion .MDF, .LDF pair) to SQL Server, using Sql Server Management Studio, and discovered that SSMS expects the database to reside in c:\program files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\MyDatabaseName.MDF Is this a "feature" of SQL Server? Is there a way to manage individual databases in separate directories? Or am I going to have to put all of the customer databases in the same directory? (I was hoping for a little better control than this). NOTE: I am currently using SQL Server Express, but for testing purposes only. The production database will be SQL Server 2008, Enterprise version. So "User Instances" are not an option.

    Read the article

  • OmniCppComplete: Completing on Class Members which are STL containers

    - by Robert S. Barnes
    Completion on class members which are STL containers is failing. Completion on local objects which are STL containers works fine. For example, given the following files: // foo.h #include <string> class foo { public: void set_str(const std::string &); std::string get_str_reverse( void ); private: std::string str; }; // foo.cpp #include "foo.h" using std::string; string foo::get_str_reverse ( void ) { string temp; temp.assign(str); reverse(temp.begin(), temp.end()); return temp; } /* ----- end of method foo::get_str ----- */ void foo::set_str ( const string &s ) { str.assign(s); } /* ----- end of method foo::set_str ----- */ I've generated the tags for these two files using: ctags -R --c++-kinds=+pl --fields=+iaS --extra=+q . When I type temp. in the cpp I get a list of string member functions as expected. But if I type str. omnicppcomplete spits out "Pattern Not Found". I've noticed that the temp. completion only works if I have the using std::string; declaration. How do I get completion to work on my class members which are STL containers?

    Read the article

  • ASP.NET Performance, 100 "Memory Hard Faults" indiciate a memory swapping problem?

    - by Robert
    With a customer web site we currently experiences performance problems. While analyzing the problem we found an unexpected amount of of 112 "Memory Hard Faults" per minute. Does anybody can interpret the meaning of this value? Does this happen, when memory swapping is necessary - so the root cause is not sufficient memory? Even if the CPU value seems high, it is not the main problem for the slow web site. Do you agree?

    Read the article

  • What does Indy's HandleRedirect do?

    - by Robert Frank
    I'm having some trouble reading files with Indy from a site that has WordPress installed. It appears that the site is configured to redirect all hits to sitename/com/wordpress. Can I use HandleRedirect to turn that off so I can read files from the root folder? What is the normal setting for this property? Any downsides to using it for this purpose? (Edit: it appears that my problem may be caused by Windows cacheing of a file I've accessed before through Indy. I'm using fIDHTTP.Request.CacheControl := 'no-cache'; is that adequate?

    Read the article

  • How to bind to another event after ajax call in jquery

    - by robert
    Hi, I'm creating a graph using flot javascript library. I have enabled clickable event and the div is binded to plotclick event. So, when a datapoint is clicked, an ajax call is made and the result is used to replace the current div. After this i need to bind the div to a new event. I tried to call bind, but it is still bound to old callback. When i call unbind and bind, the new callback is not called. var handleTeacherClick = function( event, pos, item ) { if( typeof item != "undefined" && item ) { var user_id = jQuery( 'input[name="id' + item.datapoint[0] + '"]' ).val(); jQuery.ajax({ type: 'POST', url: BASEPATH + 'index.php/ajax/home/latest', data: { "user_id": user_id }, dataType: 'json', success: function ( result ) { jQuery.plot(jQuery('#stats_prog'), result.progress_data, result.progress_options); jQuery.plot(jQuery('#stats_perf'), result.performance_data, result.performance_options); jQuery('.stats_title'). html('<span class="stats_title">'+ ' >> Chapter '+Math.ceil(item.datapoint[0])+'</span>'); jQuery('#stats_prog')./*unbind("plotclick").*/ bind('plotclick', statClickHandler ); jQuery('#stats_perf')./*unbind("plotclick"). */ bind( 'plotclick', statClickHandler ); }, }); } }

    Read the article

  • iPhone OpenGL ES Texture2D Masking

    - by Robert Neagu
    What's the best choice when trying to mask a texture like ColorSplash or other apps like iSteam, etc? I started learning OPENGL ES like... 4 days ago (I'm a total rookie) and tried the following approach: 1) I created a colored texture2D, a grayscale version of the first texture and a third texture2D called mask 2) I also created a texture2D for the brush... which is grayscale and it's opaque (brush = black = 0,0,0,1 and surroundings = white = 1,1,1,1). My intention was to create an antialiased brush with smooth edges but i'm fine with a normal one right now 3) I searched for masking techniques on the internet and found this tutorial ZeusCMD - Design and Development Tutorials : OpenGL ES Programming Tutorials - Masking about masking. The tutorial tells me to use blending to achieve masking... first draw colored, then mask with glBlendFunc(GL_DST_COLOR, GL_ZERO) and then grayscale with glBlendFunc(GL_ONE, GL_ONE) ... and this gives me something close to what i want... but not exactly what i want. The result is masked but it's somehow overbright-ed 4) For drawing to the mask texture i used an extra frame buffer object (FBO) I'm not really happy with the resulting image (overbright-ed picture) nor with the speed achieved with this method. I think the normal way was to draw directly to the grayscale (overlay) texture2D affecting only it's alpha channel in the places where the brush hits. Is there a fast way to achieve this? I have searched a lot and never got an answer that's clear and understandable. Then, in the main draw loop I could only draw the colored texture and then blend the grayscale ontop with glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA). I just want to learn to use OPENGL ES and it's driving me nuts because i can't get it to work properly. An advice, a link to a tutorial would be much appreciated.

    Read the article

  • Android Extend BaseExpandableListAdapter

    - by Robert Mills
    I am trying to extend the BaseExpandableListAdapter, however when once I view the list and I select one of the elements to expand, the order of the list gets reversed. For example, if I have a list with 4 elements and select the 1st element, the order (from top to bottom) is now 4, 3, 2, 1 with the 4th element (now at the top) expanded. If I unexpand the 4th element the order reverts to 1, 2, 3, 4 with no expanded elements. Here is my implementation:`public class SensorExpandableAdapter extends BaseExpandableListAdapter { private static final int FILTER_POSITION = 0; private static final int FUNCTION_POSITION = 1; private static final int NUMBER_OF_CHILDREN = 2; ArrayList mParentGroups; private Context mContext; private LayoutInflater mInflater; public SensorExpandableAdapter(ArrayList<SensorType> parentGroup, Context context) { mParentGroups = parentGroup; mContext = context; mInflater = LayoutInflater.from(mContext); } @Override public Object getChild(int groupPosition, int childPosition) { // TODO Auto-generated method stub if(childPosition == FILTER_POSITION) return "filter"; else return "function"; } @Override public long getChildId(int groupPosition, int childPosition) { return childPosition; } @Override public View getChildView(int groupPosition, int childPosition, boolean isLastChild, View convertView, ViewGroup parent) { if(convertView == null) { //do something convertView = (RelativeLayout)mInflater.inflate(R.layout.sensor_row_list_item, parent, false); if(childPosition == FILTER_POSITION) { ((CheckBox)convertView.findViewById(R.id.chkTextAddFilter)).setText("Add Filter"); } else { ((CheckBox)convertView.findViewById(R.id.chkTextAddFilter)).setText("Add Function"); ((CheckBox)convertView.findViewById(R.id.chkTextAddFilter)).setEnabled(false); } } return convertView; } @Override public int getChildrenCount(int groupPosition) { // TODO Auto-generated method stub return NUMBER_OF_CHILDREN; } @Override public Object getGroup(int groupPosition) { return mParentGroups.get(groupPosition); } @Override public int getGroupCount() { // TODO Auto-generated method stub return mParentGroups.size(); } @Override public long getGroupId(int groupPosition) { // TODO Auto-generated method stub return groupPosition; } @Override public View getGroupView(int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) { if(convertView == null) { convertView = mInflater.inflate(android.R.layout.simple_expandable_list_item_1, parent, false); TextView tv = ((TextView)convertView.findViewById(android.R.id.text1)); tv.setText(mParentGroups.get(groupPosition).toString()); } return convertView; } @Override public boolean hasStableIds() { // TODO Auto-generated method stub return true; } @Override public boolean isChildSelectable(int groupPosition, int childPosition) { // TODO Auto-generated method stub return true; } } ` I just need to take a simple ArrayList of my own SensorType class. The children are the same for all classes, just two. Also, how do I go about making the parent in each group LongClickable? I have tried in my ExpandableListActivity with this getExpandableListView().setOnLongClickableListener() ... and on the parent TextView set its OnLongClickableListener but neither works. Any help on either of these is greatly appreciated!

    Read the article

  • Thread Locking CollectionViewSource

    - by Robert
    I added an event handler to my code and it broke all access to the CollectionViewSources in the SystemHTA class saying "The calling thread cannot access this object because a different thread owns it". My class was working when "this.systemHTA = new SystemHTA();" was placed outside of the DeviceManager_StateChanged() function. public partial class MainWindow : Window { private DeviceManager DeviceManager = DeviceManager.Instance; public SystemHTA systemHTA; public MainWindow() { InitializeComponent(); } private void Window_Loaded(object sender, RoutedEventArgs e) { DeviceManager.StateChanged += new EventHandler<DeviceManagerStateChangedEventArgs>(DeviceManager_StateChanged); DeviceManager.Initialize(); } void DeviceManager_StateChanged(object sender, DeviceManagerStateChangedEventArgs e) { if (e.State == DeviceManagerState.Operational) { this.systemHTA = new SystemHTA(); } } private void button1_Click(object sender, RoutedEventArgs e) { this.systemHTA.GetViewSourceTest(); } } public class SystemHTA { private CollectionViewSource _deviceTestSource; public SystemHTA() { _deviceTestSource = new CollectionViewSource(); _deviceTestSource.Source = CreateLoadData<HWController>.ControllerCollection; } public void GetViewSourceTest() { ListCollectionView view = (ListCollectionView)_deviceTestSource.View; //This creates an error saying a thread already owns _deviceTestSource } }

    Read the article

  • ASP.NET - Webservice not being called from javascript

    - by Robert
    Ok I'm stumped on this one. I've got a ASMX web service up and running. I can browse to it (~/Webservice.asmx) and see the .NET generated page and test it out.. and it works fine. I've got a page with a Script Manager with the webservice registered... and i can call it in javascript (Webservice.Method(...)) just fine. However, I want to use this Webservice as part of a jQuery Autocomplete box. So I have use the url...? and the Webservice is never being called. Here's the code. [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. [System.Web.Script.Services.ScriptService] public class User : System.Web.Services.WebService { public User () { //Uncomment the following line if using designed components //InitializeComponent(); } [WebMethod] public string Autocomplete(string q) { StringBuilder sb = new StringBuilder(); //doStuff return sb.ToString(); } web.config <system.web> <webServices> <protocols> <add name="HttpGet"/> <add name="HttpPost"/> </protocols> </webServices> And the HTML $(document).ready(function() { User.Autocomplete("rr", function(data) { alert(data); });//this works ("#<%=txtUserNbr.ClientID %>").autocomplete("/User.asmx/Autocomplete"); //doesn't work $.ajax({ url: "/User.asmx/Autocomplete", success: function() { alert(data); }, error: function(e) { alert(e); } }); //just to test... calls "error" function });

    Read the article

  • What's the best way to refactor this Rails controller?

    - by Robert DiNicolas
    I'd like some advice on how to best refactor this controller. The controller builds a page of zones and modules. Page has_many zones, zone has_many modules. So zones are just a cluster of modules wrapped in a container. The problem I'm having is that some modules may have some specific queries that I don't want executed on every page, so I've had to add conditions. The conditions just test if the module is on the page, if it is the query is executed. One of the problems with this is if I add a hundred special module queries, the controller has to iterate through each one. I think I would like to see these module condition moved out of the controller as well as all the additional custom actions. I can keep everything in this one controller, but I plan to have many apps using this controller so it could get messy. class PagesController < ApplicationController # GET /pages/1 # GET /pages/1.xml # Show is the main page rendering action, page routes are aliased in routes.rb def show #-+-+-+-+-Core Page Queries-+-+-+-+- @page = Page.find(params[:id]) @zones = @page.zones.find(:all, :order => 'zones.list_order ASC') @mods = @page.mods.find(:all) @columns = Page.columns # restful params to influence page rendering, see routes.rb @fragment = params[:fragment] # render single module @cluster = params[:cluster] # render single zone @head = params[:head] # render html, body and head #-+-+-+-+-Page Level Json Conversions-+-+-+-+- @metas = @page.metas ? ActiveSupport::JSON.decode(@page.metas) : nil @javascripts = @page.javascripts ? ActiveSupport::JSON.decode(@page.javascripts) : nil #-+-+-+-+-Module Specific Queries-+-+-+-+- # would like to refactor this process @mods.each do |mod| # Reps Module Custom Queries if mod.name == "reps" @reps = User.find(:all, :joins => :roles, :conditions => { :roles => { :name => 'rep' } }) end # Listing-poc Module Custom Queries if mod.name == "listing-poc" limit = params[:limit].to_i < 1 ? 10 : params[:limit] PropertyEntry.update_from_listing(mod.service_url) @properties = PropertyEntry.all(:limit => limit, :order => "city desc") end # Talents-index Module Custom Queries if mod.name == "talents-index" @talent = params[:type] @reps = User.find(:all, :joins => :talents, :conditions => { :talents => { :name => @talent } }) end end respond_to do |format| format.html # show.html.erb format.xml { render :xml => @page.to_xml( :include => { :zones => { :include => :mods } } ) } format.json { render :json => @page.to_json } format.css # show.css.erb, CSS dependency manager template end end # for property listing ajax request def update_properties limit = params[:limit].to_i < 1 ? 10 : params[:limit] offset = params[:offset] @properties = PropertyEntry.all(:limit => limit, :offset => offset, :order => "city desc") #render :nothing => true end end So imagine a site with a hundred modules and scores of additional controller actions. I think most would agree that it would be much cleaner if I could move that code out and refactor it to behave more like a configuration.

    Read the article

  • Load a bitmap from file in RGB format (without alpha)

    - by Robert
    Hi, i simply want to load a .BMP file and get the Bitmap object in 24bit RGB format (or 32bit in RGB format). All methods I tried return a Bitmap/Image object with PixelFormat = Format32bppArgb. Even if of course BMPs don't have alpha. new Bitmap(System.Drawing.Image.FromFile(fileName, true)); new Bitmap(fileName); I currently solve the problem by copying the first object to another in memory bitmap at 24bit RBG. Is there a single method to do it? Thanks

    Read the article

  • How to calculate the normal of points on a 3D cubic Bézier curve given normals for its start and end points?

    - by Robert
    I'm trying to render a "3D ribbon" using a single 3D cubic Bézier curve to describe it (the width of the ribbon is some constant). The first and last control points have a normal vector associated with them (which are always perpendicular to the tangents at those points, and describe the surface normal of the ribbon at those points), and I'm trying to smoothly interpolate the normal vector over the course of the curve. For example, given a curve which forms the letter 'C', with the first and last control points both having surface normals pointing upwards, the ribbon should start flat, parallel to the ground, slowly turn, and then end flat again, facing the same way as the first control point. To do this "smoothly", it would have to face outwards half-way through the curve. At the moment (for this case), I've only been able to get all the surfaces facing upwards (and not outwards in the middle), which creates an ugly transition in the middle. It's quite hard to explain, I've attached some images below of this example with what it currently looks like (all surfaces facing upwards, sharp flip in the middle) and what it should look like (smooth transition, surfaces slowly rotate round). Silver faces represent the front, black faces the back. Incorrect, what it currently looks like: Correct, what it should look like: All I really need is to be able to calculate this "hybrid normal vector" for any point on the 3D cubic bézier curve, and I can generate the polygons no problem, but I can't work out how to get them to smoothly rotate round as depicted. Completely stuck as to how to proceed!

    Read the article

  • customising asp.net fileupload control

    - by Robert
    Using the asp.net file upload control is very easy, i'm trying to squeeze it into my site and the dam thing is very ugly!. Can I not change the browse button to an image of my choosing ? So far i'm failing to achieve this seemingly simple goal. Any ideas on this one ? Thanks

    Read the article

  • Equivalent of Switch Statement in MySql 5

    - by Robert Gowland
    Using MySql 5, I have a task where I need to update one table based on the contents of another table. For example, I need to add 'A1' to table 'A' if table 'B' contains 'B1'. I need to add 'A2a' and 'A2b' to table 'A' if table 'B' contains 'B2', etc.. In our case, the value in table 'B' we're interested is an enum. Right now I have a stored procedure containing a series of statements like: INSERT INTO A SELECT 'A1' FROM B WHERE B.Value = 'B1'; --Repeat for 'B2' -> 'A2a', 'A2b'; 'B3' -> 'A3', etc... Is there a nicer more DRY way of accomplishing this?

    Read the article

  • a small question on GNUPlot

    - by Robert
    Dear Guys, I have used the following statement to get the GNUPlot plot a grah for me: plot "force.dat" using 1:2 title "Detroit" with lines, \ "force.dat" u 1:3 t "US Avergae" w linepoints and the "force.dat" looks like 2005 0 0 2006 104 51 2007 202 101 It draws nice graph for me.However,I don't like the X-axis,because it is labelled as 2005,2005.5,2006,2006.5,2007..etc. However,those are year identifiers,I only want the 2005,2006,2007 etc,how could I get rid of the 2005.5,2006.5 etc labels in my GNUPlot graph? Thank you very much for your ideas.

    Read the article

  • How significant are JPA lazy loading performance benefits?

    - by Robert
    I understand that this is highly specific to the concrete application, but I'm just wondering what's the general opinion, or at least some personal experiences on the issue. I have an aversion towards the 'open session in view' pattern, so to avoid it, I'm thinking about simply fetching everything small eagerly, and using queries in the service layer to fetch larger stuff. Has anyone used this and regretted it? And is there maybe some elegant solution to lazy loading in the view layer that I'm not aware of?

    Read the article

  • Send Keyboard Input to VMWare from C#

    - by Robert
    Hi. I want to send mouse clicks and keyboards keys to a window running a virtual machine such as VMware or VirtualBox. I want to pilotate it from the host OS, from an application written in C#. I can move and click the mouse. But I can't send keyboard input. I tried with SendKeys but it doesn't work. With every other "normal" window, it works. But I think it's related to how VMware or Virtual BOx intercept keyboard events. Any idea?

    Read the article

  • Constructor Type Coercion in C++

    - by Robert Mason
    Take the following class: class mytype { double num; public: mytype(int a) { num = sqrt(a); } void print() { cout << num; } } Say there is a method which takes a mytype: void foo(mytype a) { a.print(); } Is it legal c++ (or is there a way to implement this) to call foo(4), which would (in theory) output 2? From what I can glean you can overload type casts from a user defined class, but not to. Can constructor do this in a standards-compliant manner (assuming, of course, the constructor is not explicit). Hopefully there is a way to in the end have this legal: int a; cin >> a; foo(a); Note: this is quite obviously not the actual issue, but just an example for posting purposes. I can't just overload the function because of inheritance and other program-specific issues.

    Read the article

  • Maintaining a common set of Eclipse preferences

    - by Robert Munteanu
    Whenever I switch workspaces/Eclipse installs I need to copy/redo the preferences: compiler settings; font sizes/families; code formatter; java code templates; editor templates; code clean-ups; I would like to maintain these settings in an unitary way, preferrably under source control. How can I do that? I know about 'copy settings' when creating a new workspace, but it does not keep updated copies.

    Read the article

  • Windows 7 versus Windows XP multithreading - Delphi app not acting right

    - by Robert Oschler
    I'm having a problem with a Delphi Pro 6 application that I wrote on my Windows XP machine when it runs on Windows 7. I don't have Windows 7 to test yet and I'm trying to see if Windows 7 might be the source of the trouble. Is there a fundamental difference between the way Windows 7 handles threads compared to Windows XP? I am seeing things happen out of sequence in my error logs on Windows 7 and it's causing problems. For example, objects that should have been initialized are uninitialized when running on Windows 7, yet those objects are initialized on Windows XP by the time they are needed. Some questions: 1) Are there any core differences that could cause threads/processes to behave differently between the two operating system versions? 2) I know this next question may seem absurd, but does Windows 7 attempt to split/fork threads that aren't split/forked on Windows XP? 3) And lastly, are there any known issues with FPU handling that can cause XP programs trouble when run on Windows 7 due to operational differences in wait state handling or register storage, or perhaps something like Exception mask settings, etc? 4) Any 32-bit versus 64-bit issues that could be creating trouble here? -- roschler

    Read the article

  • Are .NET's regular expressions Turing complete?

    - by Robert
    Regular expressions are often pointed to as the classical example of a language that is not Turning complete. For example "regular expressions" is given in as the answer to this SO question looking for languages that are not Turing complete. In my, perhaps somewhat basic, understanding of the notion of Turning completeness, this means that regular expressions cannot be used check for patterns that are "balanced". Balanced meaning have an equal number of opening characters as closing characters. This is because to do this would require you to have some kind of state, to allow you to match the opening and closing characters. However the .NET implementation of regular expressions introduces the notion of a balanced group. This construct is designed to let you backtrack and see if a previous group was matched. This means that a .NET regular expressions: ^(?<p>a)*(?<-p>b)*(?(p)(?!))$ Could match a pattern that: ab aabb aaabbb aaaabbbb ... etc. ... Does this means .NET's regular expressions are Turing complete? Or are there other things that are missing that would be required for the language to be Turing complete?

    Read the article

< Previous Page | 27 28 29 30 31 32 33 34 35 36 37 38  | Next Page >