Daily Archives

Articles indexed Tuesday June 8 2010

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

  • Warning: implode() [function.implode]: on Wordpress page

    - by aWarner
    I just moved a wordpress site from one server to another, and I keep getting this error. Warning: implode() [function.implode]: Invalid arguments passed in /home/finer/public_html/wp-content/themes/barely-corporate/template_portfolio.php on line 41 I have been on the Wordpress support site but couldn't find a solution. Can someone please HELP!? Here is the link to the page where the error keeps coming up: http://finerthingsforher.com/?page_id=14

    Read the article

  • Rails paginate array items one-by-one instead of page-by-page

    - by hnovick
    Hi Guys, I have a group of assets, let's call them "practitioners". I'm displaying these practitioners in the header of a calendar interface. There are 7 columns to the calendar. 7 columns = 7 practitioners per view/page. Right now: if the first page shows you practitioners 1-7, when you go the next page you will see practitioners 8-15, next page 16-23, etc. etc. i am wondering how to page the practitioners so that if the first page shows you practitioners 1-7, the next page will show you practitioners 2-8, then 3-9, etc. etc. i would greatly appreciate any help you can offer. here is the rails code i am working with. best regards, harris novick # get the default sort order sort_order = RESOURCE_SORT_ORDER # if we've been given asset ids, start our list with them unless params[:asset_ids].blank? params[:asset_ids] = params[:asset_ids].values unless params[:asset_ids].is_a?(Array) sort_order = "#{params[:asset_ids].collect{|id| "service_provider_resources.id = #{id} DESC"}.join(",")}, #{sort_order}" end @asset_set = @provider.active_resources(:include => {:active_services => :latest_approved_version}).paginate( :per_page => RESOURCES_IN_DAY_VIEW, :page => params[:page], :order => sort_order )

    Read the article

  • Dynamic menu items in WPF

    - by mattdekrey
    Is there a way to create a section on a menu for a list of menu items to be populated by something like an ObservableCollection? I'd like to replicate the Window functionality in Visual Studio, where the open document tabs are listed in a numbered list, limited to the first 10.

    Read the article

  • Entity Framework connection metadata extraction

    - by James
    Hi, I am using the EntityFramework POCO adapter and since there are limitations to what microsoft gives access to with regards to the meta data, i am manually extracting the information i need out of the xml. The only problem is i want to get the ssdl, msl, csdl file names to load without having to directly check for the connection string node in app.config. In short where in the ObjectContext/EntityConnection can i get access to these file names? Worst case scenario i need to get the connection name from the EntityConnection object then load this from app.config and parse the string itself and extract the filenames myself. (But i obviously don't want to do that). Thanks

    Read the article

  • using LoadControl with object initializer to create properties

    - by lloydphillips
    In the past I've used UserControls to create email templates which I can fill properties on and then use LoadControl and then RenderControl to get the html for which to use for the body text of my email. This was within asp.net webforms. I'm in the throws of building an mvc website and wanted to do something similar. I've actually considered putting this functionality in a seperate class library and am looking into how I can do this so that in my web layer I can just call EmailTemplate.SubscriptionEmail() which will then generate the html from my template with properties in relevant places (obviously there needs to be parameters for email address etc in there). I wanted to create a single Render control method for which I can pass a string to the path of the UserControl which is my template. I've come across this on the web that kind of suits my needs: public static string RenderUserControl(string path, string propertyName, object propertyValue) { Page pageHolder = new Page(); UserControl viewControl = (UserControl)pageHolder.LoadControl(path); if (propertyValue != null) { Type viewControlType = viewControl.GetType(); PropertyInfo property = viewControlType.GetProperty(propertyName); if (property != null) property.SetValue(viewControl, propertyValue, null); else { throw new Exception(string.Format( "UserControl: {0} does not have a public {1} property.", path, propertyName)); } } pageHolder.Controls.Add(viewControl); StringWriter output = new StringWriter(); HttpContext.Current.Server.Execute(pageHolder, output, false); return output.ToString(); } My issue is that my UserControl(s) may have multiple and differing properties. So SubscribeEmail may require FirstName and EmailAddress where another email template UserControl (lets call it DummyEmail) would require FirstName, EmailAddress and DateOfBirth. The method above only appears to carry one parameter for propertyName and propertyValue. I considered an array of strings that I could put the varying properties into but then I thought it'd be cool to have an object intialiser so I could call the method like this: RenderUserControl("EmailTemplates/SubscribeEmail.ascs", new object() { Firstname="Lloyd", Email="[email protected]" }) Does that make sense? I was just wondering if this is at all possible in the first place and how I'd implement it? I'm not sure if it would be possible to map the properties set on 'object' to properties on the loaded user control and if it is possible where to start in doing this? Has anyone done something like this before? Can anyone help? Lloyd

    Read the article

  • Why isn't WH_MOUSE hook global anymore?

    - by Valentin Galea
    I have this global mouse hook setup in a DLL that watches for mouse gestures. Everything works perfectly but with a hook set for WH_MOUSE_LL which is a low-level hook and one that doesn't need to be in an external injectable DLL. Once I switch - to the more suitable one would say - WH_MOUSE mouse hook, everything falls apart. Once I click outside my main application (the one that installs the hook), the hook gets corrupted - ::UnhookWindowsHookEx will fail. I only found this guy saying at experts exchange: "No way, at least under Windows XP + SVP2 WH_MOUSE won't go global, you must use WH_MOUSE_LL instead." I setup the hooks correctly: in a DLL using a shared data section, posting and not sending messages from the hook proceduce. Why has this changed? And why is not documented? Anyone encountered this? Thanks! BTW: I've reverse engineered a bit the popular StrokeIt application and it uses a combination of WH_GETMESSAGE and WH_MOUSE hooks and still works on XP/Vista...

    Read the article

  • Codeigniter's URL Rewriting Problem

    - by Saiful
    I’ve using the following htaccess script so that i can hide index.php from the uri. RewriteEngine on RewriteCond $1 !^(index\.php|resources|robots\.txt) RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L,QSA] But i’ve facing a major problem :( I’ve a directory named assets beside my index.php file and it should be there. Now when i browse the directory by browser then the codeigniter’s not found page displays. I can’t browser the file /assets/image.jpg but it displays when i call it from an tag What can i do now? Note that it is working in my local server (localhost) but not in the live server. Signature $@!ful

    Read the article

  • Execute JavaScript function on a dynamic element (AJAX).

    - by jartaud
    Hello i have this following function: ... var model = $("#carModel"); .... model.change(validModel); function validModel(){ if(model.val() == undefined){ model.addClass("errorJS"); return false; }else{ model.removeClass("errorJS"); return true; } } I am getting carmodel id from a select box generated after an AJAX call. I can get its value in the Firebug console, but the function doest not execute. Even tough i use model.livequery(validModel); // The errorJS class put a red border in a element, if the function returns false

    Read the article

  • how to mysqldump remote db from local machine

    - by Mauritz Hansen
    Hi folks, I need to do a mysqldump of a database on a remote server, but the server does not have mysqldump installed. I would like to use the mysqldump on my machine to connect to the remote database and do the dump on my machine. I have tried to create an ssh tunnel and then do the dump, but this does not seem to work. I tried: ssh -f -L3310:remote.server:3306 [email protected] -N The tunnel is created with success. If I do telnet localhost 3310 I get some blurb which shows the correct server mysql version. However, doing the following seems to try to connect locally mysqldump -P 3310 -h localhost -u mysql_user -p database_name table_name Can someone assist me? Thanks, Mauritz

    Read the article

  • Better ways to print out column names when using cx_Oracle

    - by philipjkim
    Found an example using cx_Oracle, this example shows all the information of Cursor.description. import cx_Oracle from pprint import pprint connection = cx_Oracle.Connection("%s/%s@%s" % (dbuser, dbpasswd, oracle_sid)) cursor = cx_Oracle.Cursor(connection) sql = "SELECT * FROM your_table" cursor.execute(sql) data = cursor.fetchall() print "(name, type_code, display_size, internal_size, precision, scale, null_ok)" pprint(cursor.description) pprint(data) cursor.close() connection.close() What I wanted to see was the list of Cursor.description[0](name), so I changed the code: import cx_Oracle import pprint connection = cx_Oracle.Connection("%s/%s@%s" % (dbuser, dbpasswd, oracle_sid)) cursor = cx_Oracle.Cursor(connection) sql = "SELECT * FROM your_table" cursor.execute(sql) data = cursor.fetchall() col_names = [] for i in range(0, len(cursor.description)): col_names.append(cursor.description[i][0]) pp = pprint.PrettyPrinter(width=1024) pp.pprint(col_names) pp.pprint(data) cursor.close() connection.close() I think there will be better ways to print out the names of columns. Please get me alternatives to the Python beginner. :-)

    Read the article

  • php str_replace and \b word boundary

    - by Barry
    Hi, I am trying to use str_replace, but can't figure out how to use \b for word boundary: <?php $str = "East Northeast winds 20 knots"; $search = array("North", "North Northeast", "Northeast", "East Northeast", "East", "East Southeast", "SouthEast", "South Southeast", "South", "South Southwest", "Southwest", "West Southwest", "West", "West Northwest", "Northwest", "North Northwest"); $replace = array("N", "NNE", "NE", "ENE", "E", "ESE", "SE", "SSE", "S", "SSW", "SW", "WSW", "W", "WNW", "NW", "NNW"); $abbr = str_replace($search, $replace, $str); echo $abbr; // this example echoes "E Neast winds 20 knots" since \b word boundary is not used // how to apply word boundary so that is seeks the exact words to replace? // the text to replace could be anywhere (start, middle, end) of string // this example should output "ENE winds 20 knots" ?>

    Read the article

  • Best/Most Comprehensive API for Stocks/Financial Data

    - by Wilco
    What is the most recommended free/public API for accessing financial market stats and stock quotes (preferrably real-time quotes)? I'm not too picky about how it's exposed (SOAP, REST, some proprietary XML setup, etc.), as long as it's got some decent documentation. I'm planning to build a simple web dashboard in PHP with some basic data (basically a quick-n-dirty homepage), but may want to grow it into a full blown web app eventually. Any thoughts? As I find some, I'll post a list here (feel free to comment if you've used any of them before): Free opentick (soprano) Not Free XigniteRealTime

    Read the article

  • Vim: different key mapping for different window

    - by rahul
    My .vimrc file has filetype mappings for different filetypes such as : autocmd FileType sh map gf ... autocmd FileType ruby map gf ... While rewriting a program from one language to another, I have 2 splits, one with a shell script and one with ruby. I would assume that "gf" would take on its mapping based on filetype. However, it can only hold one mapping at a time. Is there any way to declare a mapping only for the existing file/window. I tried ":windo" and ":bufdo" but they work for all windows or buffers.

    Read the article

  • how can I cache a partial retrieved through link_to_remote in rails?

    - by Angela
    I use link_to_remote to pull the dynamic contents of a partial onto the page. It's basically a long row from a database of "todo's" for the day. So as the person goes through and checks them off, I want to show the updated list with a line through those that are finished. Currently, I end up needing to click on the link_to_remote again after an item is ticked off, but would like it to redirect back to the "cached" page of to-do's but with the one item lined through. How do I do that? Here is the main view: <% @campaigns.each do |campaign| %> <!--link_to_remote(name, options = {}, html_options = nil)--> <tr><td> <%= link_to_remote(campaign.name, :update => "campaign_todo", :url => {:action => "campaign_todo", :id => campaign.id } ) %> </td></tr> <% end %> </table> <div id="campaign_todo"> </div> I'd like when the New/Create actions are done to go back to the page that redirected it there.

    Read the article

  • Voice Recognition in iPhone app

    - by PRN
    Hello, Is it possible to access voice recognition in an iphone app,similar to voice dialing available in iphone 3gs...when the user says something that related information needs to be fetched... Is there any particular api for the same? I have seen apps on itunes..but how to go about it? Thanks in advance.

    Read the article

  • Setting directory security to allow user and deny all

    - by Rita
    I have winforms app, in which I need to access a secured directory. I'm using impersonation and create WindowsIdentity to access the folder. My problem is writing unit tests to test the directory security; I'd like to a write a code that creates a directory secured to only ONE user, which isn't the current user running the UT (or else the test would be worthless). I know how to add permissions to a certain user, but how can I deny the rest, including admins? (in case the user running the UT is an admin) (will this be a wise thing to do?) DirectoryInfo directoryInfo = new DirectoryInfo(path); DirectorySecurity directorySecurity = directoryInfo.GetAccessControl(); directorySecurity.AddAccessRule(new FileSystemAccessRule("Domain\SecuredUser", FileSystemRights.FullControl, InheritanceFlags.ContainerInherit | InheritanceFlags.ObjectInherit, PropagationFlags.InheritOnly, AccessControlType.Allow)); directorySecurity.RemoveAccessRule(new FileSystemAccessRule("??", FileSystemRights.FullControl, InheritanceFlags.ContainerInherit | InheritanceFlags.ObjectInherit, PropagationFlags.InheritOnly, AccessControlType.Deny)); directoryInfo.SetAccessControl(directorySecurity); This isn't working. I don't know who am I supposed to deny. Domain\Admins, Domain\Administrators, me... No one is being denied, and when I check folder's security - The SecuredUser has access to the folder, but the permissions are not checked, even though I specified FullControl. Basically I want to code this: <authorization> <allow users ="Domain\User" /> <deny users="*" /> </authorization> I was thinking about impersonating UT run with a weak user with no permissions, but this would result in: Impersonate - Run UT - Impersonate - Access folder, and I'm not sure if this is the right design. Help would be greatly appreciated, thank you.

    Read the article

  • Growing Talent

    The subtitle of Daniel Coyles intriguing book The Talent Code is Greatness Isnt Born. Its Grown. Heres How. The Talent Code proceeds to layout a theory of how expertise can be cultivated through specific practices that encourage the growth of myelin in the brain. Myelin is a material that is produced and wraps around heavily used circuits in the brain, making them more efficient. Coyle uses an analogy that geeks will appreciate. When a circuit in the brain is used a lot (i.e. a specific action is repeated), the myelin insulates that circuit, increasing its bandwidth from telephone over copper to high speed broadband. This leads to the funny phenomenon of effortless expertise. Although highly skilled, the best players make it look easy. Coyle provides some biological backing for the long held theory that it takes 10,000 hours of practice to achieve mastery over a given subject. 10,000 hours or 10 years, as in, Teach Yourself Programming in Ten Years and others. However, it is not just that more hours equals more mastery. The other factors that Coyle identifies includes deep practice, practice which crucially involves drills that are challenging without being impossible. Another way to put it is that every day you spend doing only tasks you find monotonous and automatic, you are literally stagnating your brains development! Perhaps Coyles subtitle, needs one more phrase, Greatness Isnt Born. Its Grown. Heres How. And oh yeah, its not easy. Challenging yourself, continuing to persist in the face of repeated failures, practicing every day is not easy. As consultants, we sell our expertise, so it makes sense that we plan projects so that people can play to their strengths. At the same time, an important part of our culture is constant improvement, challenging yourself to be better. And the balancing contest ensues. I just finished working on a proof of concept (POC) we did for a project we are bidding on. Completely time boxed, so our team naturally split responsibilities amongst ourselves according to who was better at what. I must have been pretty bad at the other components, as I found myself working on the user interface, not my usual strength. The POC had a website frontend, and one thing I do know is HTML. After starting out in pure ASP.NET WebForms, I got frustrated as time was ticking, I knew what I wanted in HTML, but I couldnt coax the right output out of the ASP.NET controls. I needed two or three elements on the screen that were identical in layout, with different content. With a backup plan in  of writing the HTML into the response by hand, I decided to challenge myself a bit and see what I could do in an hour or two using the Microsoft submitted jQuery micro-templating JavaScript library. This risk paid off. I was able to quickly get the user interface up and running, responsive to the JSON data we were working with. I felt energized by the double win of getting the POC ready and learning something new. Opportunities  specifically like this POC dont come around often, but the takeaway is that while it wont be easy, there are ways to generate your own opportunities to grow towards greatness.Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • Datagrid row height doesnot shrink back

    - by prince23
    Hi, I have a data grid, in each row I have one cell which needs to have a very lengthy text which is about 1000 characters long. So I decided to put the text in the expander control keeping the cell width fixed, when the user wants to read the text, he clicks on the expander to open and reads it. The row height automatically grows when the expander is expanded but when the expander is collapsed back, the row height doesnt shirk. Can anyone pls tell me how to set the row height back after the expander is collapsed? i tried the follwing link. http://forums.silverlight.net/forums/p/133177/299186.aspx#299186 but this did not work any help would be grealty appreciated, thanks

    Read the article

  • .NET 2.0 Framework in C# check if 64bit os if so do this? if not do this? better answer?

    - by NightsEVil
    hi i have this little snippet of code i wrote that checks to see if a folder is present (only exists in x64) if so it does "X" commands, if not (i.e x86) does "Z" commands (x,Z are just markers for code) but what i wanna know is there a better or more reliable way to do this using only the 2.0 .net Framework? string target = @"C:\Windows\SysWow64"; { if (Directory.Exists(target)) { //do x64 stuff } else { //do x86 stuff }

    Read the article

  • Publishing SWF using Adobe Flash

    - by Kim
    Hello everyone, I have a SWF file which contains of an image (1keyframe) and also, it contains an AS3 file with the following codes: var loader:Loader=new Loader(); var ur:URLRequest=new URLRequest("1.swf"); loader.load(ur); addChild(loader); so basically, i am trying to play the swf file (1.swf - an audio) while the image is being displayed. What I want to know is how will I be able to publish this project into an SWF file which can still play as expected even without the raw 1.swf file. I can publish SWF right now but when I delete the 1.swf file, my generated swf can only display the image. Help me please. Thanks in advance :)

    Read the article

  • "os x" + octave + Miscellaneous Package: install errors

    - by Mike Briggs
    Trying to install the Miscellaneous Package into Octave, I get this string of errors: octave-3.2.3:17 pkg install miscellaneous-1.0.9.tar.gz configure: error: in /var/folders/0o/0ox7a-rlFVGd8pZnuF96sE+++TM/-Tmp-/oct-zTlMUh/miscellaneous-1.0.9/src': configure: error: C compiler cannot create executables See config.log' for more details. the configure script returned the following error: checking for gcc... gcc checking for C compiler default output file name... error: called from `pkgconfigure_make' in file /Applications/Octave.app/Contents/Resources/share/octave/3.2.3/m/pkg/pkg.m near line 1240, column 2 error: called from: error: /Applications/Octave.app/Contents/Resources/share/octave/3.2.3/m/pkg/pkg.m at line 714, column 5 error: /Applications/Octave.app/Contents/Resources/share/octave/3.2.3/m/pkg/pkg.m at line 287, column 7 What is this trying to tell me? Where should I go? Mike Briggs

    Read the article

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