Daily Archives

Articles indexed Monday July 2 2012

Page 7/16 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • POSIX-compatible regex library for Visual Studio C

    - by user1397061
    I'm working on a C program which will be run in Linux and from inside Visual Studio 2010, and I'm looking for a regex library. GNU comes with a POSIX-compatible regex library, but Visual Studio, despite having C++ std::regex, doesn't have a C-compatible library. GNU has a Windows version of their library (http://gnuwin32.sourceforge.net/packages/regex.htm), but the DLLs are 32-bit only and the source code can't compile in Visual Studio (~500 errors!). My only requirement is that the end-user should not have to install anything extra, and should get the same behaviour on both platforms. I'm not picky about whether it's POSIX-style, Perl-style or something else. What should I do? Thanks in advance.

    Read the article

  • How to resize div element less than its content?

    - by andDaviD
    I have a table and there is a TreeView in a cell. Here is my code: <style> #leftPanel { width:60px; height:'100%'; border:1px solid red; background:yellow; } <style> <table> <tr> <td> <div id="leftPanel"> <asp:PlaceHolder runat="server" ID="TreeView" /> <%-- Here is a TreeView --%> </div> </td> </tr> <%-- other code --%> <table> $(function () { $('#leftPanel').resizable( { handles: 'e, w' }); }); I can't reduce the size of my div less then the size of my TreeView. What code need I write to allow leftPanel to be less than the size of TreeView ? It is necessary if TreeView node's text too long.

    Read the article

  • Can't INSERT INTO SELECT into a table with identity column

    - by Eran Goldin
    In SQL server, I'm using a table variable and when done manipulating it I want to insert its values into a real table that has an identity column which is also the PK. The table variable I'm making has two columns; the physical table has four, the first of which is the identity column, an integer IK. The data types for the columns I want to insert are the same as the target columns' data types. INSERT INTO [dbo].[Message] ([Name], [Type]) SELECT DISTINCT [Code],[MessageType] FROM @TempTableVariable END This fails with Cannot insert duplicate key row in object 'dbo.Message' with unique index 'IX_Message_Id'. The duplicate key value is (ApplicationSelection). But when trying to insert just Values (...) it works ok. How do I get it right?

    Read the article

  • sending javascript array to external php file using POST

    - by user1472224
    I am trying to send a javascript array to an external php page, but the only thing the php page is picking up is the fact that I am sending array, not the actual data within the array. javascript - var newArray = [1, 2, 3, 4, 5]; $.ajax({ type: 'POST', url: 'array.php', data: {'something': newArray}, success: function(){ alert("sent"); } }); External PHP Page - <?php echo($_POST['something'])); ?> I know this question has been asked before, but for some reason, this isn't working for me. I have spent the last couple days trying to figure this out as well. Can someone please point me in the right direction. current output (from php page) - Array (thats all the page outputs)

    Read the article

  • How to install older Android SDK in Eclipse

    - by John Brunner
    I'm working at the moment at a simple app in eclipse for android. Just receiving and sending data, and using the camera API. I've set the minSDKversion to 8, because I think that has the widest user base. But at the beginning of the project eclipse was asking me which target SDK version I would use, and because I had just one installed (the latest 4.0.3) I've took this. Now I'm asking me if it wouldn't be wiser to install a lower SDK, like Android 2.2, because it would be not that big (compared to the 4.0.3) and my app would not have included all the fancy new features, which are not used in any way?! Or is this complete nonsense I'm talking here, and just should take my 4.0.3 SDK? When not, how can I install a lower version? Help -> SDK Manager is not showing old SDKs...

    Read the article

  • Compass Rails 3.0 working with 'compass watch' but not without

    - by Mike Blyth
    I'm trying Compass with Rails 3.0.7, just trying to get started. Using gem compass-rails. If I put my sass file in app/assets/stylesheets and run 'compass watch', everything works ok: the compiled css is put into public/stylesheets. However, if I stop 'watch' and rely on Rails to do the compilation, it does not work. Instead, the program looks at the public/stylesheets/sass folder for the input. Furthermore, if a file in that folder has the '@include "compass"' directive, I get an error that the file is not found. How do I force Rails to look in the right place -- app/assets/stylesheets?

    Read the article

  • Modify code to change timestamp timezone in sitemap

    - by Aahan Krish
    Below is the code from a plugin I use for sitemaps. I would like to know if there's a way to "enforce" a different timezone on all date variable and functions in it. If not, how do I modify the code to change the timestamp to reflect a different timezone? Say for example, to America/New_York timezone. Please look for date to quickly get to the appropriate code blocks. Code on Pastebin. <?php /** * @package XML_Sitemaps */ class WPSEO_Sitemaps { ..... /** * Build the root sitemap -- example.com/sitemap_index.xml -- which lists sub-sitemaps * for other content types. * * @todo lastmod for sitemaps? */ function build_root_map() { global $wpdb; $options = get_wpseo_options(); $this->sitemap = '<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' . "\n"; $base = $GLOBALS['wp_rewrite']->using_index_permalinks() ? 'index.php/' : ''; // reference post type specific sitemaps foreach ( get_post_types( array( 'public' => true ) ) as $post_type ) { if ( $post_type == 'attachment' ) continue; if ( isset( $options['post_types-' . $post_type . '-not_in_sitemap'] ) && $options['post_types-' . $post_type . '-not_in_sitemap'] ) continue; $count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(ID) FROM $wpdb->posts WHERE post_type = %s AND post_status = 'publish' LIMIT 1", $post_type ) ); // don't include post types with no posts if ( !$count ) continue; $n = ( $count > 1000 ) ? (int) ceil( $count / 1000 ) : 1; for ( $i = 0; $i < $n; $i++ ) { $count = ( $n > 1 ) ? $i + 1 : ''; if ( empty( $count ) || $count == $n ) { $date = $this->get_last_modified( $post_type ); } else { $date = $wpdb->get_var( $wpdb->prepare( "SELECT post_modified_gmt FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = %s ORDER BY post_modified_gmt ASC LIMIT 1 OFFSET %d", $post_type, $i * 1000 + 999 ) ); $date = date( 'c', strtotime( $date ) ); } $this->sitemap .= '<sitemap>' . "\n"; $this->sitemap .= '<loc>' . home_url( $base . $post_type . '-sitemap' . $count . '.xml' ) . '</loc>' . "\n"; $this->sitemap .= '<lastmod>' . htmlspecialchars( $date ) . '</lastmod>' . "\n"; $this->sitemap .= '</sitemap>' . "\n"; } } // reference taxonomy specific sitemaps foreach ( get_taxonomies( array( 'public' => true ) ) as $tax ) { if ( in_array( $tax, array( 'link_category', 'nav_menu', 'post_format' ) ) ) continue; if ( isset( $options['taxonomies-' . $tax . '-not_in_sitemap'] ) && $options['taxonomies-' . $tax . '-not_in_sitemap'] ) continue; // don't include taxonomies with no terms if ( !$wpdb->get_var( $wpdb->prepare( "SELECT term_id FROM $wpdb->term_taxonomy WHERE taxonomy = %s AND count != 0 LIMIT 1", $tax ) ) ) continue; // Retrieve the post_types that are registered to this taxonomy and then retrieve last modified date for all of those combined. $taxobj = get_taxonomy( $tax ); $date = $this->get_last_modified( $taxobj->object_type ); $this->sitemap .= '<sitemap>' . "\n"; $this->sitemap .= '<loc>' . home_url( $base . $tax . '-sitemap.xml' ) . '</loc>' . "\n"; $this->sitemap .= '<lastmod>' . htmlspecialchars( $date ) . '</lastmod>' . "\n"; $this->sitemap .= '</sitemap>' . "\n"; } // allow other plugins to add their sitemaps to the index $this->sitemap .= apply_filters( 'wpseo_sitemap_index', '' ); $this->sitemap .= '</sitemapindex>'; } /** * Build a sub-sitemap for a specific post type -- example.com/post_type-sitemap.xml * * @param string $post_type Registered post type's slug */ function build_post_type_map( $post_type ) { $options = get_wpseo_options(); ............ // We grab post_date, post_name, post_author and post_status too so we can throw these objects into get_permalink, which saves a get_post call for each permalink. while ( $total > $offset ) { $join_filter = apply_filters( 'wpseo_posts_join', '', $post_type ); $where_filter = apply_filters( 'wpseo_posts_where', '', $post_type ); // Optimized query per this thread: http://wordpress.org/support/topic/plugin-wordpress-seo-by-yoast-performance-suggestion // Also see http://explainextended.com/2009/10/23/mysql-order-by-limit-performance-late-row-lookups/ $posts = $wpdb->get_results( "SELECT l.ID, post_content, post_name, post_author, post_parent, post_modified_gmt, post_date, post_date_gmt FROM ( SELECT ID FROM $wpdb->posts {$join_filter} WHERE post_status = 'publish' AND post_password = '' AND post_type = '$post_type' {$where_filter} ORDER BY post_modified ASC LIMIT $steps OFFSET $offset ) o JOIN $wpdb->posts l ON l.ID = o.ID ORDER BY l.ID" ); /* $posts = $wpdb->get_results("SELECT ID, post_content, post_name, post_author, post_parent, post_modified_gmt, post_date, post_date_gmt FROM $wpdb->posts {$join_filter} WHERE post_status = 'publish' AND post_password = '' AND post_type = '$post_type' {$where_filter} ORDER BY post_modified ASC LIMIT $steps OFFSET $offset"); */ $offset = $offset + $steps; foreach ( $posts as $p ) { $p->post_type = $post_type; $p->post_status = 'publish'; $p->filter = 'sample'; if ( wpseo_get_value( 'meta-robots-noindex', $p->ID ) && wpseo_get_value( 'sitemap-include', $p->ID ) != 'always' ) continue; if ( wpseo_get_value( 'sitemap-include', $p->ID ) == 'never' ) continue; if ( wpseo_get_value( 'redirect', $p->ID ) && strlen( wpseo_get_value( 'redirect', $p->ID ) ) > 0 ) continue; $url = array(); $url['mod'] = ( isset( $p->post_modified_gmt ) && $p->post_modified_gmt != '0000-00-00 00:00:00' ) ? $p->post_modified_gmt : $p->post_date_gmt; $url['chf'] = 'weekly'; $url['loc'] = get_permalink( $p ); ............. } /** * Build a sub-sitemap for a specific taxonomy -- example.com/tax-sitemap.xml * * @param string $taxonomy Registered taxonomy's slug */ function build_tax_map( $taxonomy ) { $options = get_wpseo_options(); .......... // Grab last modified date $sql = "SELECT MAX(p.post_date) AS lastmod FROM $wpdb->posts AS p INNER JOIN $wpdb->term_relationships AS term_rel ON term_rel.object_id = p.ID INNER JOIN $wpdb->term_taxonomy AS term_tax ON term_tax.term_taxonomy_id = term_rel.term_taxonomy_id AND term_tax.taxonomy = '$c->taxonomy' AND term_tax.term_id = $c->term_id WHERE p.post_status = 'publish' AND p.post_password = ''"; $url['mod'] = $wpdb->get_var( $sql ); $url['chf'] = 'weekly'; $output .= $this->sitemap_url( $url ); } } /** * Build the <url> tag for a given URL. * * @param array $url Array of parts that make up this entry * @return string */ function sitemap_url( $url ) { if ( isset( $url['mod'] ) ) $date = mysql2date( "Y-m-d\TH:i:s+00:00", $url['mod'] ); else $date = date( 'c' ); $output = "\t<url>\n"; $output .= "\t\t<loc>" . $url['loc'] . "</loc>\n"; $output .= "\t\t<lastmod>" . $date . "</lastmod>\n"; $output .= "\t\t<changefreq>" . $url['chf'] . "</changefreq>\n"; $output .= "\t\t<priority>" . str_replace( ',', '.', $url['pri'] ) . "</priority>\n"; if ( isset( $url['images'] ) && count( $url['images'] ) > 0 ) { foreach ( $url['images'] as $img ) { $output .= "\t\t<image:image>\n"; $output .= "\t\t\t<image:loc>" . esc_html( $img['src'] ) . "</image:loc>\n"; if ( isset( $img['title'] ) ) $output .= "\t\t\t<image:title>" . _wp_specialchars( html_entity_decode( $img['title'], ENT_QUOTES, get_bloginfo('charset') ) ) . "</image:title>\n"; if ( isset( $img['alt'] ) ) $output .= "\t\t\t<image:caption>" . _wp_specialchars( html_entity_decode( $img['alt'], ENT_QUOTES, get_bloginfo('charset') ) ) . "</image:caption>\n"; $output .= "\t\t</image:image>\n"; } } $output .= "\t</url>\n"; return $output; } /** * Get the modification date for the last modified post in the post type: * * @param array $post_types Post types to get the last modification date for * @return string */ function get_last_modified( $post_types ) { global $wpdb; if ( !is_array( $post_types ) ) $post_types = array( $post_types ); $result = 0; foreach ( $post_types as $post_type ) { $key = 'lastpostmodified:gmt:' . $post_type; $date = wp_cache_get( $key, 'timeinfo' ); if ( !$date ) { $date = $wpdb->get_var( $wpdb->prepare( "SELECT post_modified_gmt FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = %s ORDER BY post_modified_gmt DESC LIMIT 1", $post_type ) ); if ( $date ) wp_cache_set( $key, $date, 'timeinfo' ); } if ( strtotime( $date ) > $result ) $result = strtotime( $date ); } // Transform to W3C Date format. $result = date( 'c', $result ); return $result; } } global $wpseo_sitemaps; $wpseo_sitemaps = new WPSEO_Sitemaps();

    Read the article

  • Google Maps API v3 not working

    - by user1496322
    I've been banging my head on the wall after going through the documentation on this several times! I can't seem to get past the API error to get the map to appear on my site. I am getting the following error message from the web page where I want the map to be displayed: ~~~~~~~~~~~ Google has disabled use of the Maps API for this application. The provided key is not a valid Google API Key, or it is not authorized for the Google Maps Javascript API v3 on this site. If you are the owner of this application, you can learn about obtaining a valid key here: https://developers.google.com/maps/documentation/javascript/tutorial#Obtaining_Key ~~~~~~~~~~~ I have (several times now) gone into my account and 1) enabled the Maps v3 API service. 2) Generated a new API key. and 3) added my allowed referrers to the key. (both www.domain.com and domain.com URLs) I have the following added to the head of the web page: < script src="http://maps.googleapis.com/maps/api/js?sensor=false&key=MY_API_KEY_HERE" type="text/JavaScript" language="JavaScript" And... I have the following javascript function that executes when a link is clicked on the page: alert("viewMap()"); var map = new GMap3(document.getElementById("map_canvas")); var geocoder = new GClientGeocoder(); var address = "1600 Amphitheatre Parkway, Mountain View"; alert("Calling getLatLng ..."); geocoder.getLatLng(address, function(point) { var latitude = point.y; var longitude = point.x; // do something with the lat lng alert("Lat:"+latitude+" - Lng:"+longitude); }); The initial 'viewMap' alert is displayed and then is followed by the 'Google has disbled use...' error message. The error console is also showing 'GMap3 is not defined'. Can anyone please assist with showing me the errors of my ways?!?!? Thank you in advance for any help you can provide. -Dennis

    Read the article

  • How do I save my whole program?

    - by user1444829
    What argument should be in this missing part of formatter.Serliaze to get the program to save just the program as a .exe? Ignore the Openfiles. class FileOption { OpenFileDialog openDialog = new OpenFileDialog(); SaveFileDialog saveDialog = new SaveFileDialog(); BinaryFormatter formatter = new BinaryFormatter(); public void Open() { } public void Save() { if (saveDialog.ShowDialog() == DialogResult.OK) { FileStream file = new FileStream(saveDialog.FileName, FileMode.Create); formatter.Serialize(file, x); // x means that i havent set anything there yet// file.Close(); } } }

    Read the article

  • Can JMX operations take interfaces as parameters?

    - by Thor84no
    I'm having problems with an MBean that takes a Map<String, Object> as a parameter. If I try to execute it via JMX using a proxy object, I get an Exception: Caused by: javax.management.ReflectionException at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:231) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) Caused by: java.lang.IllegalArgumentException: Unable to find operation updateProperties(java.util.HashMap) It appears that it attempts to use the actual implementation class rather than the interface, and doesn't check if this is a child of the required interface. The same thing happens for extended classes (for example declare HashMap, pass in LinkedHashMap). Does this mean it's impossible to use an interface for such methods? At the moment I'm getting around it by changing the method signature to accept a HashMap, but it seems odd that I wouldn't be able to use interfaces (or extended classes) in my MBeans. Edit: The proxy object is being created by an in-house utility class called JmxInvocationHandler. The (hopefully) relevant parts of it are as follows: public class JmxInvocationHandler implements InvocationHandler { ... public static <T> T createMBean(final Class<T> iface, SFSTestProperties properties, String mbean, int shHostID) { T newProxyInstance = (T) Proxy.newProxyInstance(iface.getClassLoader(), new Class[] { iface }, (InvocationHandler) new JmxInvocationHandler(properties, mbean, shHostID)); return newProxyInstance; } ... private JmxInvocationHandler(SFSTestProperties properties, String mbean, int shHostID) { this.mbeanName = mbean + MBEAN_SUFFIX + shHostID; msConfig = new MsConfiguration(properties.getHost(0), properties.getMSAdminPort(), properties.getMSUser(), properties.getMSPassword()); } ... public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { if (management == null) { management = ManagementClientStore.getInstance().getManagementClient(msConfig.getHost(), msConfig.getAdminPort(), msConfig.getUser(), msConfig.getPassword(), false); } final Object result = management.methodCall(mbeanName, method.getName(), args == null? new Object[] {} : args); return result; } }

    Read the article

  • A Query to remove relationships that do not belong [closed]

    - by Segfault
    In a SQL Server 2008 R2 database, given this schema: AgentsAccounts _______________ AgentID int UNIQUE AccountID FinalAgents ___________ AgentID I need to create a query that does this: For each AgentID 'final' in FinalAgents remove all of the OTHER AgentID's from AgentsAccounts that have the same AccountID as 'final'. So if the tables have these rows before the query: AgentsAccounts AgentID AccountID 1 A 2 A 3 B 4 B FinalAgents 1 3 then after the query the AgentsAccounts table will look like this: AgentsAccounts AgentID AccountID 1 A 3 B What T-SQL query will delete the correct rows without using a curosr?

    Read the article

  • Chaining Many-To-Many Dimensional Relationships in SSAS

    - by Ray Saltrelli
    I'm developing a cube in SSAS and attempting to model the following relationships: Many Facts to 1 Customer Many Customers to Many Sales Reps Many Sales Reps (Subordinates) to Sales Reps (Managers) Each M2M relationship is facilitated by a bridge table which also acts as a fact table in the cube I have most of this working. I can slice Facts by Customer and by Sales Rep (Subordinate), but when I add Sales Rep (Manager) to the query it appears to return every subordinate/manager combination regardless of whether or not that relationship exists in the bridge table. Any ideas as to what I might be doing wrong?

    Read the article

  • How to check if a thread is busy in C#?

    - by Sam
    I have a Windows Forms UI running on a thread, Thread1. I have another thread, Thread2, that gets tons of data via external events that needs to update the Windows UI. (It actually updates multiple UI threads.) I have a third thread, Thread3, that I use as a buffer thread between Thread1 and Thread2 so that Thread2 can continue to update other threads (via the same method). My buffer thread, Thread3, looks like this: public class ThreadBuffer { public ThreadBuffer(frmUI form, CustomArgs e) { form.Invoke((MethodInvoker)delegate { form.UpdateUI(e); }); } } What I would like to do is for my ThreadBuffer to check whether my form is currently busy doing previous updates. If it is, I'd like for it to wait until it frees up and then invoke the UpdateUI(e). I was thinking about either: a) //PseudoCode while(form==busy) { // Do nothing; } form.Invoke((MethodInvoker)delegate { form.UpdateUI(e); }); How would I check the form==busy? Also, I am not sure that this is a good approach. b) Create an event in form1 that will notify the ThreadBuffer that it is ready to process. // psuedocode List<CustomArgs> elist = new List<CustomArgs>(); public ThreadBuffer(frmUI form, CustomArgs e) { from.OnFreedUp += from_OnFreedUp(); elist.Add(e); } private form_OnFreedUp() { if (elist.count == 0) return; form.Invoke((MethodInvoker)delegate { form.UpdateUI(elist[0]); }); elist.Remove(elist[0]); } In this case, how would I write an event that will notify that the form is free? and c) an other ideas?

    Read the article

  • print issue in safari

    - by designersvsoft
    I have used below css for select tag. select { vertical-align:middle; float:left; border:1px solid #cccccc; background-color:#F0F0F0; padding:2px; font-size:14px; height:35px ;} Here is the HTML version: <select> <option value="volvo">Volvo</option> <option value="saab">Saab</option> <option value="mercedes">Mercedes</option> <option value="audi">Audi</option> </select> If I see the print preview, it is not good on safari browser. Please help us.

    Read the article

  • Caching with AVPlayer and AVAssetExportSession

    - by tba
    I would like to cache progressive-download videos using AVPlayer. How can I save an AVPlayer's item to disk? I'm trying to use AVAssetExportSession on the player's currentItem (which is fully loaded). This code is giving me "AVAssetExportSessionStatusFailed (The operation could not be completed)" : AVAsset *mediaAsset = self.player.currentItem.asset; AVAssetExportSession *es = [[AVAssetExportSession alloc] initWithAsset:mediaAsset presetName:AVAssetExportPresetLowQuality]; NSString *outPath = [NSTemporaryDirectory() stringByAppendingPathComponent:@"out.mp4"]; NSFileManager *fileManager = [NSFileManager defaultManager]; [fileManager removeItemAtPath:outPath error:NULL]; es.outputFileType = @"com.apple.quicktime-movie"; es.outputURL = [[[NSURL alloc] initFileURLWithPath:outPath] autorelease]; NSLog(@"exporting to %@",outPath); [es exportAsynchronouslyWithCompletionHandler:^{ NSString *status = @""; if( es.status == AVAssetExportSessionStatusUnknown ) status = @"AVAssetExportSessionStatusUnknown"; else if( es.status == AVAssetExportSessionStatusWaiting ) status = @"AVAssetExportSessionStatusWaiting"; else if( es.status == AVAssetExportSessionStatusExporting ) status = @"AVAssetExportSessionStatusExporting"; else if( es.status == AVAssetExportSessionStatusCompleted ) status = @"AVAssetExportSessionStatusCompleted"; else if( es.status == AVAssetExportSessionStatusFailed ) status = @"AVAssetExportSessionStatusFailed"; else if( es.status == AVAssetExportSessionStatusCancelled ) status = @"AVAssetExportSessionStatusCancelled"; NSLog(@"done exporting to %@ status %d = %@ (%@)",outPath,es.status, status,[[es error] localizedDescription]); }]; How can I export successfully? I'm looking into copying mediaAsset into an AVMutableComposition, but haven't had much luck with that either. Thanks! PS: Here are some questions from people trying to accomplish the same thing (but with MPMoviePlayerController): Cache Progressive downloaded content in MPMoviePlayerController Simultaneously stream and save a video? Caching videos to disk after successful preload by MPMoviePlayerController

    Read the article

  • How do I plot a STOCK historical graph in android app?

    - by jer
    I wanted to plot a stock historical graph based on google finance in my android app . The problem is I can't find the api for just the stock chart alone and I must try to find another ways to do it. I thought of a way but don't know what whether it works the steps are as follows.. 1) get the details from csv file 2) read the csv file 3) plot the graph using the information of the csv file.(WHICH I DON'T KNOW HOW TO DO IT)! so if my steps above works , I would only want to know how to plot the graph.

    Read the article

  • Sometimes you have to brag on your employer

    - by Mickey Gousset
    A lot of you know me as an Application Lifecycle Management MVP, and a huge proponent of ALM, TFS, and Visual Studio.  For my day job, however, I work for Infront Consulting Group, a System Center consulting and training organization.  I love what I do there, and work closely with Operations Manager, Service Manager, and Orchestrator.  And believe it or not, use a lot of ALM best practices around all of those. Infront was just recognized as a 2012 Microsoft Corporate Account Virtualization Data Center Services Partner of the Year.  This award recognizes a solution partner that has demonstrated leadership and commitment in driving Microsoft virtualization solutions in the Microsoft Corporate Account segment.  I’m very proud of Infront, and all the hard work that everyone here has put into the incredible services we provide, which lead to us winning this award.

    Read the article

  • jQuery with SharePoint solutions

    - by KunaalKapoor
    For me jQuery is the 'Plan-B' for everything.And most of my projects include the use of jQuery for something or the other, so I decided to write a small note on what works best while using jQuery along with SharePoint.I prefer to use the jQuery JavaScript library, which is far more robust, easier to use, and allows for plugins. Follow the steps below to add jQuery to your master page. For office 365, the prefered location to add jQuery files is the "Site Asserts" library.Deployment Best PracticesThey are only as good as the context it’s being referenced.  In other words, take into account your world before applying it.Script your deployment options.  Folder in SPD. Use the file system.  Make external references.  The JQuery library is on the Microsoft Ajax Content Delivery Network. You may even choose to publish to and from the document library. (pros and cons to this approach)Reference options when referencing the script.ScriptLink will make sure it’s loaded at the top of the page and only loaded once. You need Visual Studio or SPDContent Editor Web Part (CEWP).  Drop it on the page and it’s there.  Easy but dangerousCustom Actions. Great for global deployments of JQuery.  Loads it on every page. It also works in Sandbox installations.Deployment Maintenance Dont’sDon’t add scripts directly to your Master Page. That’s way too much effort because the pages are hard to maintain.Don’t add scripts directly to the CEWP.  Use a content link instead. That will allow for reuse. If you or someone deletes the CEWP you won’t lose code in the web partSecurity.  Any scripts run with the same privileges of the current user.  In other words, you can’t get in trouble.Development Best PracticesDon’t abuse the DOM.  There are better options to load the DOM without hitting it 1,000 times.User other performance boosters.Try other libraries.  Try some custom codeAvoid String conversionMinify your filesUse CAML to reduce number of returns rowsOnly update your JQuery library AFTER RIGOROUS REGRESSION TESTINGCRUD operations can come with some funSP Services wraps SharePoint’s web services for executionThe Bing SDK is pretty easy to use.  You can add it to your page with a script,  put it into a content editor web part and connect it from the address parameters in a list.Steps:1. Go to jquery.com and download the latest jQuery library to your desktop. You want to get the compressed production version, not the development version.2. Open SharePoint Designer (SPD) and connect to the root level of your site's site collection.In SPD, open the "Style Library" folder. Create a folder named "Scripts" inside of the Style Library. Drag the jQuery library JavaScript file from your desktop into the Scripts folder.In the Scripts folder, create a new JavaScript file and name it (e.g. "actions.js").3. If you are using visual studio add a folder for js, you can create a new folder at the root level or if you prefer more cleaner solutions like me, you can use the layouts folder which cleans out on deactivation/uninstall.4. Within the <head> tag of the master page, add a script reference to the jQuery library just above the content place holder named "PlaceHolderAdditonalPageHead" (and above your custom CSS references, if applicable) as follows:<script src="/Style%20Library/Scripts/{jquery library file}.js" type="text/javascript"></script>Immediately after the jQuery library reference add a script reference to your custom scripts file as follows:<script src="/Style%20Library/Scripts/actions.js" type="text/javascript"></script>Inside your script tag, you can test if jQuery is already defined and if not, then add it to the page.<script type='text/javascript'>  if (typeof jQuery == 'undefined')    document.write('<scr'+'ipt type="text/javascript" src="http://code.jquery.com/jquery-1.6.1.min.js"></sc'+'ript>');</script>For the inquisitive few... Read on if you'd like :)Why jQuery on SharePoiny is AwesomeIt’s all about that visual wow factor.  You can get past that, “But it looks like SharePoint”  Take a long list view and put it into JQuery with pagination, etc and you are the hero.  It’s also about new controls you get with JQuery that you couldn’t do before.Why jQuery with SharePoint should be AwfulAlthough it’s fairly easy to get jQuery up and running. Copy/Paste can cause a problem.  If you don’t understand what it’s doing in the Client Object Model and the Document Object Model then it will do things on your site that were completely unexpected. Many blogs will note workarounds they employed on their sites. Why it’s not working: Debugging “sucks”.You need to develop small blocks of functionality, Test it by putting in some alerts  and console.log. Set breakpoints and monitor the DOM via Firebug and some IE development toolsPerformance - It happens all the time. But you should look at the tradeoffs. More time may give you more functionality.Consistency - ”But it works fine on my computer. So test on many browsers.  Take into account client resourcesHarm the Farm -  You need to code wisely and negatively test.  Don’t be the cause of a DoS attack that’s really JQuery asking for a resource over and over and over again.  So code wisely. Do negative testing. Monitor Server Resources.They also did a demo where JQuery did an endless loop to pull data from a list. It’s a poor decision but also an easy mistake.  They spiked their server resources within a couple seconds and had to shut down the call before it brought it down.ConclusionJQuery is now another tool in your tool kit. You don’t have to use it. Use it where it makes sense and where it helps you get your job done.Don’t abuse it, you will pay for it laterIt will add to page bloat so take that into accountIt can slow your performance

    Read the article

  • FREE Technical Training on Windows Server 2012 Virtualization / Hyper-V / Private Cloud

    - by KeithMayer
    Microsoft Learning partnered with the Microsoft Server and Tools team and Developer and Platform Evangelism (DPE) to deliver the “Windows Server 2012 Jump Start: Preparing for the Datacenter Evolution” on June 20-21, 2012. Thanks to an amazing product and a phenomenal team effort, this event shattered two Jump Start records with 2,064 attendees from 103 different countries and extremely positive event feedback! We are excited to announce the release of the HD-quality video recordings available on TechNet Videos now!For complete details: http://aka.ms/TrainWS12JSIf I can help with any other learning topics, please feel free to connect with me and let me know!HTH,Keith http://keithmayer.com | Twitter: @KeithMayer | LinkedIn: http://linkedin.com/in/KeithM

    Read the article

  • PowerShell Script To Find Where SharePoint 2010 Features Are Activated

    - by Brian Jackett
    The script on this post will find where features are activated within your SharePoint 2010 farm.   Problem    Over the past few months I’ve gotten literally dozens of emails, blog comments, or personal requests from people asking “how do I find where a SharePoint feature has been activated?”  I wrote a script to find which features are installed on your farm almost 3 years ago.  There is also the Get-SPFeature PowerShell commandlet in SharePoint 2010.  The problem is that these only tell you if a feature is installed not where they have been activated.  This is especially important to know if you have multiple web applications, site collections, and /or sites.   Solution    The default call (no parameters) for Get-SPFeature will return all features in the farm.  Many of the parameter sets accept filters for specific scopes such as web application, site collection, and site.  If those are supplied then only the enabled / activated features are returned for that filtered scope.  Taking the concept of recursively traversing a SharePoint farm and merging that with calls to Get-SPFeature at all levels of the farm you can find out what features are activated at that level.  Store the results into a variable and you end up with all features that are activated at every level.    Below is the script I came up with (slight edits for posting on blog).  With no parameters the function lists all features activated at all scopes.  If you provide an Identity parameter you will find where a specific feature is activated.  Note that the display name for a feature you see in the SharePoint UI rarely matches the “internal” display name.  I would recommend using the feature id instead.  You can download a full copy of the script by clicking on the link below.    Note: This script is not optimized for medium to large farms.  In my testing it took 1-3 minutes to recurse through my demo environment.  This script is provided as-is with no warranty.  Run this in a smaller dev / test environment first.   001 002 003 004 005 006 007 008 009 010 011 012 013 014 015 016 017 018 019 020 021 022 023 024 025 026 027 028 029 030 031 032 033 034 035 036 037 038 039 040 041 042 043 044 045 046 047 048 049 050 051 052 053 054 055 056 057 058 059 060 061 062 063 064 065 066 067 068 function Get-SPFeatureActivated { # see full script for help info, removed for formatting [CmdletBinding()] param(   [Parameter(position = 1, valueFromPipeline=$true)]   [Microsoft.SharePoint.PowerShell.SPFeatureDefinitionPipeBind]   $Identity )#end param   Begin   {     # declare empty array to hold results. Will add custom member `     # for Url to show where activated at on objects returned from Get-SPFeature.     $results = @()         $params = @{}   }   Process   {     if([string]::IsNullOrEmpty($Identity) -eq $false)     {       $params = @{Identity = $Identity             ErrorAction = "SilentlyContinue"       }     }       # check farm features     $results += (Get-SPFeature -Farm -Limit All @params |              % {Add-Member -InputObject $_ -MemberType noteproperty `                 -Name Url -Value ([string]::Empty) -PassThru} |              Select-Object -Property Scope, DisplayName, Id, Url)     # check web application features     foreach($webApp in (Get-SPWebApplication))     {       $results += (Get-SPFeature -WebApplication $webApp -Limit All @params |                % {Add-Member -InputObject $_ -MemberType noteproperty `                   -Name Url -Value $webApp.Url -PassThru} |                Select-Object -Property Scope, DisplayName, Id, Url)       # check site collection features in current web app       foreach($site in ($webApp.Sites))       {         $results += (Get-SPFeature -Site $site -Limit All @params |                  % {Add-Member -InputObject $_ -MemberType noteproperty `                     -Name Url -Value $site.Url -PassThru} |                  Select-Object -Property Scope, DisplayName, Id, Url)                          $site.Dispose()         # check site features in current site collection         foreach($web in ($site.AllWebs))         {           $results += (Get-SPFeature -Web $web -Limit All @params |                    % {Add-Member -InputObject $_ -MemberType noteproperty `                       -Name Url -Value $web.Url -PassThru} |                    Select-Object -Property Scope, DisplayName, Id, Url)           $web.Dispose()         }       }     }   }   End   {     $results   } } #end Get-SPFeatureActivated   Snippet of output from Get-SPFeatureActivated   Conclusion    This script has been requested for a long time and I’m glad to finally getting a working “clean” version.  If you find any bugs or issues with the script please let me know.  I’ll be posting this to the TechNet Script Center after some internal review.  Enjoy the script and I hope it helps with your admin / developer needs.         -Frog Out

    Read the article

  • Firewall GPO not applying despite being enumerated by gpresult

    - by jshin47
    I have a need to open up the admin$ share on all of my domain's client PC's and I am trying to do so using group policy. I defined computer policy for Windows Firewall with Advanced Security in a policy object linked to the appropriate container and added the appropriate rules. However, they are not being applied! I feel like I have tried all of the obvious steps: I've checked gpresult and the resulting set of policy is the way that I would expect it to look. I've gpupdate /force and gpupdate /sync on a few client computers, but no matter what I do they don't seem to respond to my changes. I know that other computer policies in the GPO are being applied so it is strange that these are not. I have also disabled exceptions on clients in the firewall GPO, but that doesn't seem to be applying either. Here is a screenshot of the firewall.cpl from a client: Basically, although other options in the same GPO ARE applied for computer policy, the firewall settings seem to be ignored.

    Read the article

  • Sharing files between multiple sites using only desktop software

    - by perlyking
    Our organisation has three sites; a head office, where the master copies of company files are stored, plus two branch offices using only workstations and a NAS or two. Currently we're talking about <10GB. At the main office, we have no admin access to the file server, as this is entirely controlled by the larger institution where we are located. For the same reason, we have no VPN remote access to this network. Instead, we simply have access to a network share using over a Novell LAN. Question: how can we share files between offices in way that minimises latency, i.e. that gives us a mirror of the main network share at each site? (There is little likelihood of concurrent editing, and we can live with the odd file conflict now and again). Up to now branch office staff have had to use GotoMyPC-type solutions to remotely access files held at the main office. Or email. I was hoping to use Google Drive on a dedicated workstation at each office to sync the contents of the network share (head office) or NAS (branch offices) via the cloud, but at my last attempt (29 Jun '12), the Google Drive installer would not allow me to designate the remote network share as the "target" folder. (I chose Google Drive over Drobbox et al. as we already use GMail for corporate mail) The next idea was to use a designated workstation at head office to mirror the network share to a local drive, then use Google Drive to push that to the cloud. This seems a step too far. Nor do I have any good ideas about how to achieve this network/local mirroring, as we can't, for example, install the rsync daemon on the server. I do not want to use Google Drive locally on each workstation as this will inconvenience users, and more importantly, move files off the backed-up, well-maintained (UPS, RAID etc) network share at head office. Our budget is only in the £100's. Should we perhaps just ditch the head office server and use something like JungleDisk? At least this presents the user with what appears to be a mapped drive.

    Read the article

  • Order files in Ubuntu server in alpha order?

    - by Josh Sherick
    I have a PHP script that is for personal use that goes through a folder and lists all the pictures in the folder. The pictures are pages from a book, so it is important that they be in order. They are named so that in alphabetical order, they are also in the correct page order. I had it running on my Mac OS server, and it worked fine, listing them in order because Mac OS apparently keeps files alphabetically. Now, since I've switched to Ubuntu, it is listing them in a seemingly random order. Is there any way to order files in Ubuntu server so that they are in alphabetical order?

    Read the article

  • rsync (or robocopy) from multiple computers - what happens?

    - by TheCleaner
    If a Linux server has two different rsync jobs nightly for the same folder to two different destinations, do both destinations end up with the same end set of files? Or does the first job run, and set something on the source folder/files that would cause the 2nd rsync job to not realize the daily changes/updates to the source? Same for a Windows environment using something like robocopy, or even a "differential" backup using BUE or similar. Does each "sync" compare the destination to the source and update the destination regardless of if it is synced multiple times to different destinations?

    Read the article

  • Cannot extend existing data disk over 2TB on windows 2008 with dynamic and gpt part

    - by DJYod
    As my D: disk is almost full (2TB) I extended the FC lun to 2.5TB. The new 500Go are seen by windows as "Unalloacted" as expected. I tried to extend the volume but windows says "The is not enough space available on the disk(s) to complete this operation" I read on the web that the disk should be configured as GPT and as a dynamic and it's already a dynamic gpt disk... How can I extend my disk without any data loss? My operating system is Windows 2008 R2 x64 SP1 and the SAN a 3PAR I hope someone can help me :) Thank you very much

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >