Search Results

Search found 7793 results on 312 pages for 'sample'.

Page 15/312 | < Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >

  • String update in SQL Server

    - by Thiyaneshwaran S
    Currently I have varchar field. The delimiter is "$P$P$". The delimiter will appear at least once and at most twice in the varchar data. Eg. Sample Heading$P$P$Sample description$P$P$Sample conclusion Sample Heading$P$P$Sample Description If the delimiter appears twice, I need to insert a text before the second occurance of the delimiter. Eg: Sample Heading$P$P$Sample DescriptionINSERT TEXT HERE$P$P$Sample Conclusion If the delimiter occurs only once, then I need to insert a text at the end of the field. Eg: Sample Heading$P$P$Sample DescriptionAPPEND TEXT HERE How this can be done in SQL query?

    Read the article

  • string update in sqlserver

    - by Thiyaneshwaran S
    Currently i have varchar field. The delimiter is "$P$P$". The delimiter will appear atleast once and atmost twice in the varchar data. Eg. Sample Heading$P$P$Sample description$P$P$Sample conclusion Sample Heading$P$P$Sample Description If the delimiter appears twice, i need to insert a text before the second occurance of the delimiter. Eg: Sample Heading$P$P$Sample DescriptionINSERT TEXT HERE$P$P$Sample Conclusion If the delimiter occurs only once, then i need to insert a text at the end of the field. Eg: Sample Heading$P$P$Sample DescriptionAPPEND TEXT HERE How this can be done in sql query?

    Read the article

  • Can anyone provide sample source code for xml parsing using photoshop javascript?

    - by panofish
    Here is a sample of a simple xml file I want to parse using photoshop javascript: <Pgen> <renderSettings> <imageWidth>1000</imageWidth> <imageHeight>600</imageHeight> <SAA>16</SAA> <bgColor>E1E1E1</bgColor> <filePrefix></filePrefix> <suffix>.jpg</suffix> </renderSettings> <coverPage> <template>//TEMPLATE/Product.psd</template> <title>2010 Mazda</title> <subtitle>Exterior</subtitle> <date>March 26, 2010</date> </coverPage> <images> <template>/TEMPLATE/Product2.psd</template> <image file="file1.png" title="2010 Mazda" subtitle="LS" note="" exclude="yes"/> <image file="file2.png" title="2010 Mazda" subtitle="1LT" note="Shows SS trim" exclude="no"/> <image file="file3.png" title="2010 Mazda" subtitle="2LT" note="" /> <image file="file4.png" title="2010 Mazda" subtitle="2LT" note="" /> </images> </Pgen> I've found the toolkit documentation, but it doesn't have much sample code and I can't find any sample code by searching google.

    Read the article

  • How do I detect whether the sample supplied by VideoSink.OnSample() is right-side up?

    - by Ken Smith
    We're currently using the Silverlight VideoSink to capture video from users' local webcams, kinda like so: protected override void OnSample(long sampleTime, long frameDuration, byte[] sampleData) { if (FrameShouldBeSubmitted()) { byte[] resampledData = ResizeFrame(sampleData); mediaController.SetVideoFrame(resampledData); } } Now, on most of the machines that we've tested, the video sample provided in the byte[] sampleData parameter is upside-down, i.e., if you try to take the RGBA data and turn it into, say, a WriteableBitmap, the bitmap will be upside-down. That's odd, but fairly easy to correct, of course -- you just have to reverse the array as you encode it. The problem is that at least on some machines (e.g., the single Macintosh in our test environment), the video sample provided is no longer upside-down, but right-side up, and hence, flipping the image actually results in an image that's received upside-down on the far side. I reported this to MS as a bug, but their (terse) response was that it was "As Designed". Further attempts at clarification have so far been ignored. Now, I'll grant that it's kinda entertaining to imagine the discussions behind this design decision: "OK, just to make it interesting, let's play the video rightside up on a Mac, but let's turn it upside down for Windows!" "Great idea!" "Yeah, that'll keep those developers guessing!" But beyond that, I can't find this, umm, "feature" documented anywhere, nor can I find any documentation on how one is supposed to be able to tell that a given video sample is upside down or rightside up. Any thoughts on how to tell this?

    Read the article

  • Problem creating checklist (similar to TouchCells sample code) app for iPhone. Random cells get chec

    - by Jonah
    I've been having a problem creating a checklist in the style of the TouchCells example from the Apple sample code. Basically, it is a table that allows multiple selection of its items and gives each selected item a check mark. The problem I'm having is that when I select an item and then scroll down the screen, another item (off the screen) will randomly be selected. It seems that it is usually the next cell to be loaded on the screen. I couldn't figure out what I was doing wrong so I tested it with Apple's TouchCells code. In their program though, they only have 6 cells and there is no room to scroll. So, I duplicated some of the items from the plist file to make more cells and... the same problem pops up. If you select a cell and then scroll, another cell will randomly be selected. Update I recently tried the iPhone Dev Cookbook sample code named "Checks" and... you guessed it, the same problem. Here's the link: http://code.google.com/p/cookbooksamples/downloads/list This is driving me nuts. Is it a bug or am I doing something wrong? Does anyone know how to fix this? Thanks! Also, does anyone know of any sample code that shows how to do this?

    Read the article

  • Java Swing: How to add a CellRenderer for displaying a Date?

    - by HansDampf
    I have a Table: public class AppointmentTableModel extends AbstractTableModel { private int columns; private int rows; ArrayList<Appointment> appointments;... So each row of the table contains one Appointment. public class Appointment { private Date date; private Sample sample; private String comment; private ArrayList<Action> history; public Appointment(Date date, Sample sample, String comment) { this.date = date; this.sample = sample; this.comment = comment; this.history = new ArrayList<Action>(); } public Object getByColumn(int columnIndex) { switch (columnIndex) { case 0: return date;//Date: dd:mm:yyyy case 1: return date;//Time mm:hh case 2: return sample;//sample.getID() int (sampleID) case 3: return sample;//sample.getNumber string (telephone number) case 4: return sample;//sample.getName string (name of the person) case 5: return history;//newst element in history as a string case 6: return comment;//comment as string } return null; I added in comments what this one is going to mean. How would I create CellRenderers to display it like this. table.getColumnModel().getColumn(1).setCellRenderer(new DateRenderer()); I also want to add the whole row to be painted in red when the date is later then the current date. And then another column that holds a JButton to open up another screen with the corresponding Appointment as parameter.

    Read the article

  • Where is the sample applications in the lastest Spring release(Spring Framework 3.0.2)?

    - by Yousui
    Hi guys, On the Spring download page, It says that For all Spring Framework releases, the basic release contains only the binaries while the -with-dependencies release contains everything the basic release contains plus all third-party dependencies, buildable source trees, and sample applications. When I download the spring-framework-3.0.2.RELEASE-dependencies.zip, after extract it I get a list of folders: I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\com.bea.commonj I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\com.caucho I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\com.google.jarjar I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\com.h2database I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\com.ibm.websphere I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\com.jamonapi I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\com.lowagie.text I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\com.mchange.c3p0 I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\com.opensymphony.quartz I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\com.oracle.toplink.essentials I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\com.springsource.bundlor I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\com.springsource.util I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\com.sun.msv I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\com.sun.syndication I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\com.sun.xml I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\com.thoughtworks.xstream I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\edu.emory.mathcs.backport I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\edu.oswego.cs.concurrent I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\javax.activation I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\javax.annotation I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\javax.ejb I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\javax.el I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\javax.faces I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\javax.inject I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\javax.jdo I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\javax.jms I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\javax.mail I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\javax.persistence I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\javax.portlet I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\javax.resource I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\javax.servlet I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\javax.transaction I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\javax.validation I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\javax.xml.bind I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\javax.xml.rpc I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\javax.xml.soap I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\javax.xml.stream I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\javax.xml.ws I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\net.sourceforge.cglib I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\net.sourceforge.ehcache I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\net.sourceforge.iso-relax I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\net.sourceforge.jasperreports I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\net.sourceforge.jexcelapi I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\net.sourceforge.jibx I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\net.sourceforge.serp I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\net.sourceforge.xslthl I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\org.antlr I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\org.aopalliance I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\org.apache.axis I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\org.apache.bcel I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\org.apache.catalina I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\org.apache.commons I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\org.apache.coyote I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\org.apache.derby I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\org.apache.ibatis I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\org.apache.juli I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\org.apache.log4j I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\org.apache.openjpa I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\org.apache.poi I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\org.apache.regexp I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\org.apache.struts I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\org.apache.taglibs I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\org.apache.tiles I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\org.apache.velocity I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\org.apache.xerces I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\org.apache.xml I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\org.apache.xmlbeans I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\org.apache.xmlcommons I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\org.aspectj I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\org.beanshell I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\org.codehaus.castor I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\org.codehaus.groovy I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\org.codehaus.jackson I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\org.codehaus.jettison I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\org.codehaus.woodstox I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\org.custommonkey.xmlunit I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\org.dom4j I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\org.easymock I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\org.eclipse.jdt I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\org.eclipse.persistence I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\org.freemarker I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\org.hibernate I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\org.hsqldb I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\org.jaxen I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\org.jboss.javassist I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\org.jboss.logging I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\org.jboss.util I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\org.jboss.vfs I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\org.jdom I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\org.jgroups I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\org.joda I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\org.jruby I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\org.junit I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\org.jvnet.staxex I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\org.mortbay.jetty I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\org.mozilla.javascript I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\org.objectweb.asm I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\org.osgi I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\org.relaxng I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\org.slf4j I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\org.springframework I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\org.springframework.build I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\org.testng I:\soft\java\spring-framework-3.0.2.RELEASE-dependencies\org.xmlpull So where are the sample applications? I know one of the sample applications is called jpetstore in spring 2.0. I did search in these folders and can't find anything useful. By the way, I also download the basic release which is spring-framework-3.0.2.RELEASE.zip. In the readme.txt of the basic release I found the following text: GETTING STARTED Please consult the blog examples at http://blog.springsource.com as well as the sections of interest in the reference documentation. Sample applications and related material will be provided as separate downloads. But I still don't know where to download the sample applications. Anyone can help? Thanks in advance.

    Read the article

  • Converting from samplerate/cutoff frequency to pi-radians/sample in a discrete time sampled IIR filter system.

    - by Fake Name
    I am working on doing some digital filter work using Python and Numpy/Scipy. I'm using scipy.signal.iirdesign to generate my filter coefficents, but it requires the filter passband coefficents in a format I am not familiar with wp, ws : float Passband and stopband edge frequencies, normalized from 0 to 1 (1 corresponds to pi radians / sample). For example: Lowpass: wp = 0.2, ws = 0.3 Highpass: wp = 0.3, ws = 0.2 (from here) I'm not familiar with digital filters (I'm coming from a hardware design background). In an analog context, I would determine the desired slope and the 3db down point, and calculate component values from that. In this context, how do I take a known sample rate, a desired corner frequency, and a desired rolloff, and calculate the wp, ws values from that? (This might be more appropriate for math.stackexchange. I'm not sure)

    Read the article

  • Search results in wordpress, order by custom category order and time DESC

    - by Adiasz
    Hello I want to change default post search order to order: sample cat 1 sample post from cat 1 sample post from cat 1 sample cat 2 sample post from cat 2 sample post from cat 3 sample cat 3 etc.. So... I want to define category order and in search results will be sorted for this order and in category order will be date DESC. Only posts (no categories) will be visible. Anybody have any idea?

    Read the article

  • Wordpress: how to call a plugin function with an ajax call?

    - by Bee
    I'm writing a Wordpress MU plugin, it includes a link with each post and I want to use ajax to call one of the plugin functions when the user clicks on this link, and then dynamically update the link-text with output from that function. I'm stuck with the ajax query. I've got this complicated, clearly hack-ish, way to do it, but it is not quite working. What is the 'correct' or 'wordpress' way to include ajax functionality in a plugin? (My current hack code is below. When I click the generate link I don't get the same output I get in the wp page as when I go directly to sample-ajax.php in my browser.) I've got my code[1] set up as follows: mu-plugins/sample.php: <?php /* Plugin Name: Sample Plugin */ if (!class_exists("SamplePlugin")) { class SamplePlugin { function SamplePlugin() {} function addHeaderCode() { echo '<link type="text/css" rel="stylesheet" href="'.get_bloginfo('wpurl'). '/wp-content/mu-plugins/sample/sample.css" />\n'; wp_enqueue_script('sample-ajax', get_bloginfo('wpurl') . '/wp-content/mu-plugins/sample/sample-ajax.js.php', array('jquery'), '1.0'); } // adds the link to post content. function addLink($content = '') { $content .= "<span class='foobar clicked'><a href='#'>click</a></span>"; return $content; } function doAjax() { // echo "<a href='#'>AJAX!</a>"; } } } if (class_exists("SamplePlugin")) { $sample_plugin = new SamplePlugin(); } if (isset($sample_plugin)) { add_action('wp_head',array(&$sample_plugin,'addHeaderCode'),1); add_filter('the_content', array(&$sample_plugin, 'addLink')); } mu-plugins/sample/sample-ajax.js.php: <?php if (!function_exists('add_action')) { require_once("../../../wp-config.php"); } ?> jQuery(document).ready(function(){ jQuery(".foobar").bind("click", function() { var aref = this; jQuery(this).toggleClass('clicked'); jQuery.ajax({ url: "http://mysite/wp-content/mu-plugins/sample/sample-ajax.php", success: function(value) { jQuery(aref).html(value); } }); }); }); mu-plugins/sample/sample-ajax.php: <?php if (!function_exists('add_action')) { require_once("../../../wp-config.php"); } if (isset($sample_plugin)) { $sample_plugin->doAjax(); } else { echo "unset"; } ?> [1] Note: The following tutorial got me this far, but I'm stumped at this point. http://www.devlounge.net/articles/using-ajax-with-your-wordpress-plugin

    Read the article

  • Phonegap ( + rails ) basic sample app for profile listing, browsing?

    - by Rubytastic
    Im looking for a sample or tutorial to get started with phonegap. Im building a profile site and want the profiles to be listed in phonegap This is the functionality I look for: Basic login and with autentication in our rails app After login a listing of all profiles getting data from the rails app and display this inside phonegap Listing of profiles with basic search What would be the best and quickest way to get this functionality up and running? Is there some best practice on using rails and phonegap? If anyone knows a tutorial or sample app like described above please let know! Thanks!

    Read the article

  • How can I create a sample SQLLite DB for my iPhone app?

    - by Dr Dork
    I'm diving in to iPhone development and I'm building an iPhone app that uses the Core Data framework and my first task will be to get the model setup with a few that will display it. Thus far, I have the model defined and my Managed Object Files created, but I don't have a database with any sample data. What's a quick way to create a DB that conforms to my schema? Are there any tools that can generate a sample DB using my schemas? Is there a good tool I can use to directly manipulate the data in DB for testing purposes? Thanks in advance for your help! I'm going to continue researching this question right now.

    Read the article

  • Where can I find "canonical" sample programs that give quick refreshers for any given language? [on hold]

    - by acheong87
    Note to those close-voting this question: I understand this isn't a conventional programming question and I can agree with the reasoning that it's in the subjective domain (like best-of lists). In other ways though I think it's appropriate because, though it's not a "a specific programming problem," nor concerning "a software algorithm", nor (strictly) concerning "software tools commonly used by programmers", I think it is a "practical, answerable [problem that is] unique to the programming profession," and I think it is "based on an actual [problem I] face." I've been wanting this for some time now, because both approaches of (a) Googling for samples as I write every other line of code and (b) just winging it and seeing what errors crop up, distract me from coding efficiently. This note will be removed if the question gains popularity; this question will be deleted otherwise. I spend most of my time developing in C++, PHP, or Javascript, and every once in a while I have to do something in, say, VBA. In those times, it'd be convenient if I could just put up some sample code on a second monitor, something in between a cheat sheet (often too compact; and doesn't resemble anything that could actually compile/run), and a language reference (often too verbose, or segmented; requires extra steps to search or click through an index), so I can just glance at it and recall things, like how to loop through non-empty cells in a column. I think there's a hidden benefit to seeing formed code, that triggers the right spots in our brains to get back into a language we only need to brush up on. Similar in spirit is how http://ideone.com lets you click "Template" in any given language so you can get started without even doing a search. That template alone tells a lot, sometimes! Case-sensitivity, whitespace conventions, identifier conventions, the spelling of certain types, etc. I couldn't find a resource that pulled together such samples, so if there indeed doesn't exist such a repository, I was hoping this question would inspire professionals and experts to contribute links to the most useful sample code they've used for just this purpose: a keep-on-the-side, form-as-well-as-content, compilable/executable, reminder of a language's basic and oft-used features. Personally I am interested in seeing "samplers" for: VBA, Perl, Python, Java, C# (though for some of these autocompleters in Eclipse, Visual Studio, etc. help enough), awk, and sed. I'm tagging c++, php, and javascript because these are languages for which I'd best be able to evaluate whether proffered sample code matches what I had in mind.

    Read the article

  • Sandra reports my CPU as "Engineering Sample", how can I be sure this is correct?

    - by stevenvh
    I ran SiSoftware's Sandra on my new PC, and for my CPU it reports: Generation : G8 / T29 Name : TN0 (Trinity) FX/Opteron 32nm (ES) Revision/Stepping : 0 : 10 / 1 Stepping Mask : TN-A1 Microcode : MU6F10010F The (ES) is a well-known code in product development, meaning "Engineering Sample". Those are beta versions of the CPU, which still may contain some bugs, or even have features switches off. I contacted both the PC's manufacturer Medion as well as AMD about this. I had to downvote the Medion helpdesk here. The person I talked to boldly said Sandra was wrong (without knowing how Sandra got this information; he didn't even know the software), and used the word "impossible". His conclusion was "We’re not taking this in consideration for service”. Right. So, if you like Medion for their good prices, but like good support even better, you may consider buying your PC elsewhere. AMD was more helpful, but wanted to be sure before replacing the part (which I find reasonable). They suggested that I dismount the cooler from the CPU to check what was printed on it to be sure. I'm a bit reluctant here: I would have to wipe the thermal paste from the CPU, and won't know for sure my cooling will still be OK afterwards. Questions Has anybody actually found a confirmed ES CPU in her PC? Is anybody aware of Sandra erroneously reporting CPUs as Engineering Samples? How can you tell an ES, apart from the print on the package? Shouldn't Stepping Mask identify the CPU uniquely?

    Read the article

  • Is this a correct Interlocked synchronization design?

    - by Dan Bryant
    I have a system that takes Samples. I have multiple client threads in the application that are interested in these Samples, but the actual process of taking a Sample can only occur in one context. It's fast enough that it's okay for it to block the calling process until Sampling is done, but slow enough that I don't want multiple threads piling up requests. I came up with this design (stripped down to minimal details): public class Sample { private static Sample _lastSample; private static int _isSampling; public static Sample TakeSample(AutomationManager automation) { //Only start sampling if not already sampling in some other context if (Interlocked.CompareExchange(ref _isSampling, 0, 1) == 0) { try { Sample sample = new Sample(); sample.PerformSampling(automation); _lastSample = sample; } finally { //We're done sampling _isSampling = 0; } } return _lastSample; } private void PerformSampling(AutomationManager automation) { //Lots of stuff going on that shouldn't be run in more than one context at the same time } } Is this safe for use in the scenario I described?

    Read the article

  • How do i call bash script function using exec function by passing parameter in php?

    - by Stan
    I have created a bash script that install magento in a cpanel. but i have a problem regarding the exec function. $function_path = Mage::getBaseDir()."/media/installer/function.sh"; exec("$function_path $db_host $db_name $db_user $db_pass $url $ad_user $ad_pass $ad_email"); This the bash shell script function.sh #!/bin/bash magento_detail $dbhost $dbname $dbuser $dbpass $url $admin_username $admin_password $admin_email function magento_detail() { stty erase '^?' echo "To install Magento, you will need a blank database ready with a user assigned to it." echo -n "Do you have all of your database information" dbinfo = "y" echo $dbinfo if [ "$dbinfo" -eq 'y' ] then echo "Database Host (usually localhost) : $dbhost " echo "Database Name : $dbname " echo "Database User : $dbuser " echo "Database Password : $dbpass " echo "Store Url : $url " echo "Admin Username : $admin_username " echo "Admin Password : $admin_password " echo "Admin Email Address : $admin_email " echo -n "Include Sample Data? (y/n) " echo sample = "y" if [ "$sample" -eq "y" ]; then echo echo "Now installing Magento with sample data..." echo echo "Downloading packages..." echo wget http://www.magentocommerce.com/downloads/assets/1.5.1.0/magento-1.5.1.0.tar.gz wget http://www.magentocommerce.com/downloads/assets/1.2.0/magento-sample-data-1.2.0.tar.gz echo echo "Extracting data..." echo tar -zxvf magento-1.5.1.0.tar.gz tar -zxvf magento-sample-data-1.2.0.tar.gz echo echo "Moving files..." echo mv magento-sample-data-1.2.0/media/* magento/media/ mv magento-sample-data-1.2.0/magento_sample_data_for_1.2.0.sql magento/data.sql mv magento/index.php magento/.htaccess ./$test1 echo echo "Setting permissions..." echo chmod o+w var var/.htaccess app/etc chmod -R o+w media echo echo "Importing sample products..." echo mysql -h $dbhost -u $dbuser -p$dbpass $dbname < data.sql echo echo "Initializing PEAR registry..." echo chmod 550 mage ./mage mage-setup . echo echo "Downloading packages..." echo echo echo "Cleaning up files..." echo rm -rf downloader/pearlib/cache/* downloader/pearlib/download/* rm -rf magento/ magento-sample-data-1.2.0/ rm -rf magento-1.5.1.0.tar.gz magento-sample-data-1.2.0.tar.gz data.sql rm -rf index.php.sample .htaccess.sample php.ini.sample LICENSE.txt STATUS.txt data.sql echo echo "Installing Magento..." echo php -f install.php --license_agreement_accepted "yes" --locale "en_US" --timezone "America/Los_Angeles" --default_currency "USD" --db_host "$dbhost" --db_name "$dbname" --db_user "$dbuser" --db_pass "$dbpass" --url "$url" --use_rewrites "yes" --use_secure "no" --secure_base_url "" --use_secure_admin "no" --admin_email "$admin_email" --admin_username "$admin_username" --admin_password "$admin_password" echo echo "Finished installing Magento" echo exit else echo "Now installing Magento without sample data..." echo echo "Downloading packages..." echo wget http://www.magentocommerce.com/downloads/assets/1.5.1.0/magento-1.5.1.0.tar.gz echo echo "Extracting data..." echo tar -zxvf magento-1.5.1.0.tar.gz echo echo "Moving files..." echo mv magento/* magento/.htaccess . echo echo "Setting permissions..." echo chmod o+w var var/.htaccess app/etc chmod -R o+w media echo echo "Initializing PEAR registry..." echo chmod 550 mage ./mage mage-setup . echo echo "Downloading packages..." echo echo echo "Cleaning up files..." echo rm -rf downloader/pearlib/cache/* downloader/pearlib/download/* rm -rf magento/ magento-1.5.1.0.tar.gz rm -rf index.php.sample .htaccess.sample php.ini.sample LICENSE.txt STATUS.txt echo echo "Installing Magento..." echo php -f install.php --license_agreement_accepted "yes" --locale "en_US" --timezone "America/Los_Angeles" --default_currency "USD" --db_host "$dbhost" --db_name "$dbname" --db_user "$dbuser" --db_pass "$dbpass" --url "$url" --use_rewrites "yes" --use_secure "no" --secure_base_url "" --use_secure_admin "no" --admin_email "$admin_email" --admin_username "$admin_username" --admin_password "$admin_password" echo echo "Finished installing Magento else part" exit fi else echo "Please setup a database first. Don't forget to assign a database user!" exit fi }` when i run this exec command,at that time it calls bash script function magento_installer() which contains arguments $db_host $db_name $db_user $db_pass $url $ad_user $ad_pass $ad_email. above arguments i'll pass in exec command to call magento_installer() function of bash script. so, is it right way of calling a bash script function? It directly goes to the last step of if condition and prints "Please setup a database first. Don't forget to assign a database user!". It cant enter it in if condition and directly goes to else condition. so please help me?

    Read the article

  • How would i down-sample a .wav file then reconstruct it using nyquist? - in matlab [closed]

    - by martin
    Possible Duplicate: How would i down-sample a .wav file then reconstruct it using nyquist? - in matlab This is all done in MatLab 2010 My objective is to show the results of: undersampling, nyquist rate/ oversampling First i need to downsample the .wav file to get an incomplete/ or impartial data stream that i can then reconstuct. Heres the flow chart of what im going to be doing So the flow is analog signal - sampling analog filter - ADC - resample down - resample up - DAC - reconstruction analog filter what needs to be achieved: F= Frequency F(Hz=1/s) E.x. 100Hz = 1000 (Cyc/sec) F(s)= 1/(2f) Example problem: 1000 hz = Highest frequency 1/2(1000hz) = 1/2000 = 5x10(-3) sec/cyc or a sampling rate of 5ms This is my first signal processing project using matlab. what i have so far. % Fs = frequency sampled (44100hz or the sampling frequency of a cd) [test,fs]=wavread('test.wav'); % loads the .wav file left=test(:,1); % Plot of the .wav signal time vs. strength time=(1/44100)*length(left); t=linspace(0,time,length(left)); plot(t,left) xlabel('time (sec)'); ylabel('relative signal strength') **%this is were i would need to sample it at the different frequecys (both above and below and at) nyquist frequency.*I think.*** soundsc(left,fs) % shows the resaultant audio file , which is the same as original ( only at or above nyquist frequency however) Can anyone tell me how to make it better, and how to do the various sampling at different frequencies?

    Read the article

  • Why does this code sample produce a memory leak?

    - by citronas
    In the university we were given the following code sample and we were being told, that there is a memory leak when running this code. The sample should demonstrate that this is a situation where the garbage collector can't work. As far as my object oriented programming goes, the only codeline able to create a memory leak would be items=Arrays.copyOf(items,2 * size+1); The documentation says, that the elements are copied. Does that mean the reference is copied (and therefore another entry on the heap is created) or the object itself is being copied? As far as I know, Object and therefore Object[] are implemented as a reference type. So assigning a new value to 'items' would allow the garbage collector to find that the old 'item' is no longer referenced and can therefore be collected. In my eyes, this the codesample does not produce a memory leak. Could somebody prove me wrong? =) import java.util.Arrays; public class Foo { private Object[] items; private int size=0; private static final int ISIZE=10; public Foo() { items= new Object[ISIZE]; } public void push(final Object o){ checkSize(); items[size++]=o; } public Object pop(){ if (size==0) throw new ///... return items[--size]; } private void checkSize(){ if (items.length==size){ items=Arrays.copyOf(items,2 * size+1); } } }

    Read the article

  • Can anyone give me a sample java socket programming for doing a peer to peer for 3 systems?

    - by Sadesh Kumar N
    I am doing an university project. I need some sample programs on peer to peer programs in java socket programming. Every where people are telling to add a server socket in the client program. I am in a confusion. Can a single program having server socket and client socket will do or i have to create two programs of one initiating a system and another peer program running thrice to solve the problem. or i need to create three programs for three peer systems. I am not clear on the architecture of building peer to peer programs using java sockets. Can some one help me giving a simple program on how to create a peer to peer connection between three systems. I know how to do a socket program for client server model and clear on the concept. But creating a peer to peer architecture sounds complex for me to understand. I also referred this thread. developing peer to peer in java The person commented second says" To make peer2peer app each client opens server socket too. When client A wishes to connect to client B it just connects to its socket. " Need some more sample and an explanation on how peer to peer java socket program works I dont want any external api like jxta to do this task. I need a clear picture on how it works alone with an example.

    Read the article

< Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >