Daily Archives

Articles indexed Saturday May 29 2010

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

  • Access MP3 audio data independently of ID3 tags?

    - by kyl191
    Hi, this is a 2 part question. First off, is it possible to access the audio data in an MP3 independently of the ID3 tags, and secondly, is there any way to do so using available libraries? I recently consolidated my music collection from 3 computers and ended up with songs which had changed ID3 tags, but the audio data itself was unmodified. Running a search for duplicate files failed because the file changed with the ID3 tag change, but I think it should be possible to identify duplicate files if I just run a deduplication using the audio data for comparison. I know that it's possible to seek to a particular position past the ID3 header in the file, and directly read the data, but was wondering if there's a library that would expose the audio data so I could just extract the data, run a checksum on it, and store the computed result somewhere, then look for identical checksums. (Also, I'd probably have to use some kind of library when you take into account variable length headers.)

    Read the article

  • A typical mysql query( how to use subquery column into main query)

    - by I Like PHP
    I HAVE TWO TABLES shown below table_joining id join_id(PK) transfer_id(FK) unit_id transfer_date joining_date 1 j_1 t_1 u_1 2010-06-05 2010-03-05 2 j_2 t_2 u_3 2010-05-10 2010-03-10 3 j_3 t_3 u_6 2010-04-10 2010-01-01 4 j_5 NULL u_3 NULL 2010-06-05 5 j_6 NULL u_4 NULL 2010-05-05 table_transfer id transfer_id(PK) pastUnitId futureUnitId effective_transfer_date 1 t_1 u_3 u_1 2010-06-05 2 t_2 u_6 u_1 2010-05-10 3 t_3 u_5 u_3 2010-04-10 now i want to know total employee detalis( using join_id) which are currently working on unit u_3 . means i want only join_id j_1 (has transfered but effective_transfer_date is future date, right now in u_3) j_2 ( tansfered and right now in `u_3` bcoz effective_transfer_date has been passed) j_6 ( right now in `u_3` and never transfered) what i need to take care of below steps( as far as i know ) <1> first need to check from table_joining whether transfer_id is NULL or not <2> if transfer_id= is NULL then see unit_id=u_3 where joining_date <=CURDATE() ( means that person already joined u_3) <3> if transfer_id is NOT NULL then go to table_transfer using transfer_id (foreign key reference) <4> now see the effective_transfer_date regrading that transfer_id whether effective_transfer_date<=CURDATE() <5> if transfer date has been passed(means transfer has been done) then return futureUnitID otherwise return pastUnitID i used two separate query but don't know how to join those query?? for step <1 ans <2 SELECT unit_id FROM table_joining WHERE joining_date<=CURDATE() AND transfer_id IS NULL AND unit_id='u_3' for step<5 SELECT IF(effective_transfer_date <= CURDATE(),futureUnitId,pastUnitId) AS currentUnitID FROM table_transfer // here how do we select only those rows which have currentUnitID='u_3' ?? please guide me the process?? i m just confused with JOINS. i think using LEFT JOIN can return the data i need, or if we use subquery value to main query? but i m not getting how to implement ...please help me. Thanks for helping me alwayz

    Read the article

  • More Maintenance Plan Weirdness

    - by AjarnMark
    I’m not a big fan of the built-in Maintenance Plan functionality in SQL Server.  I like the interface in SQL 2005 better than 2000 (it looks more like building an SSIS package) but it’s still a bit of a black box.  You don’t really know what commands are being run based on the selections you have made, and you can easily make some unwise choices without realizing it, such as shrinking your database on a regular basis.  I really prefer to know exactly what commands and with which options are being run on my servers. Recently I had another very strange thing happen with a Maintenance Plan, this time in SQL 2005, SP3.  I inherited this server and have done a bit of cleanup on it, but had not yet gotten around to replacing the Maintenance Plans with all my own scripts.  However, one of the maintenance plans which was just responsible for doing LOG backups was running more frequently than that system needed, and I thought I would just tweak the schedule a bit.  So I opened the Maintenance Plan and edited the properties of the Subplan, setting a new schedule, saved it and figured all was good to go.  But the next execution of the Scheduled Job that triggers the Maintenance Plan code failed with an error about the Owner of the job.  Specifically the error was, “Unable to determine if the owner (OldDomain\OldDBAUserID) of job MaintenancePlanName.Subplan has server access (reason: Could not obtain information about Windows NT group/user 'OldDomain\OldDBAUserID’..”  I was really confused because I had previously updated all of the jobs to have current accounts as the owners.  At first I thought it was just a fluke, but it happened on the next scheduled cycle so I investigated further and sure enough, that job had the old DBA’s account listed as the owner.  I fixed it and the job successfully ran to completion. Now, I don’t really like mysteries like that, so I did some more testing and verified that, sure enough, just editing the Subplan schedule and saving the Maintenance Job caused the Scheduled Job to be recreated with the old credentials.  I don’t know where it is getting those credentials, but I can only assume that it is the same as the original creator of the Maintenance Plan, and for some reason it insists on using that ID for the job owner.  I looked through the options in SSMA and could not find anything would let me easily set the value that I wanted it to use.  I suspect that if I did something like executing sp_changeobjectowner against the Maintenance Plan that it would use that new ID instead.  I’m sure that there is good reason that it works this way, but rather than mess around with it much more, I’m just going to spend my time rolling out my replacement scripts instead. Chalk this little hidden oddity up as yet one more reason I’m not a fan of Maintenance Plans.

    Read the article

  • Hiding the contents of your compiled Applications (.exe, .dll). C# code

    - by Tommy
    Well, as we all know, you can decompile C# (dll) assemblies to find what code lays inside of them. What I do not know, is how i can hide that code. The issue: I'd like to release some dll's that will add extra functionality to applications, but i thats all i want them to be used for. adding functionality to applications. I dont want others knowing the real source code behind it. Let me know if its possible to do that. Thanks!

    Read the article

  • Young people using Emacs?

    - by bigmonachus
    I am a college student that has fallen in love with Emacs. I have used IDEs in the past, and although features like Intellisense made the switch to Emacs very hard, I now think that Emacs is much more powerful, and features like Intellisense can be pretty closely matched by various modes depending on language (and I am not referring to M-/). I am happily writing Elisp code for everything that I need that isn't provided by modes or by Emacs itself and I love the way that it adapts and molds to my needs. However, I do think that its main disadvantage is the fact that it has a pretty steep learning curve and that most new programmers will not even begin to learn it out of many common misconceptions. So, I want to know the opinions of young people (or any person who didn't start using Emacs before there were IDEs) that are Emacs users. Just to get some reassurance that Emacs is not dead within our Eclipse-loving generation =). (Opinions of users of any other highly extensible editor like Jedit are also welcome)

    Read the article

  • Reading a MIDI file in Python

    - by Logan
    I want to be able to read events from a MIDI file in Python. I have looked for libraries, but can't find one that works with my MIDI file in windows. I do not need to do anything real time, and just want a simple library that gives me events and times. Would it be easier to write one for myself? Any help would be appreciated.

    Read the article

  • Does this variable need to be declared volatile?

    - by titaniumdecoy
    Does the out variable in the MyThread class need to be declared volatile in this code or will the "volatility" of the stdout variable in the ThreadTest class carry over? import java.io.PrintStream; class MyThread implements Runnable { int id; PrintStream out; // should this be declared volatile? MyThread(int id, PrintStream out) { this.id = id; this.out = out; } public void run() { try { Thread.currentThread().sleep((int)(1000 * Math.random())); out.println("Thread " + id); } catch (InterruptedException e) { e.printStackTrace(); } } } public class ThreadTest { static volatile PrintStream stdout = System.out; public static void main(String[] args) { for (int i = 0; i < 10; i++) { new Thread(new MyThread(i, stdout)).start(); } } }

    Read the article

  • web api programming with java

    - by radi
    hi , i am new to web programming in java , i want to know how to use web api such as google api , facebook api in my code so i need to know how to begin and what i need to do that . thanks

    Read the article

  • Trouble parsing some RSS feeds using Java and Sax

    - by brockoli
    I've written an RSS feed parser in Java (running on Android) and it parses some feeds perfectly, and others not at all. I get the following error when it tries to parse Slashdot (http://rss.slashdot.org/Slashdot/slashdot) org.apache.harmony.xml.ExpatParser$ParseException: At line 1, column 0: unbound prefix If I try to parse Wired (http://feeds.wired.com/wired/index) org.apache.harmony.xml.ExpatParser$ParseException: At line 1, column 0: syntax error If I try to parse AndroidGuys (http://feeds.feedburner.com/androidguyscom) org.apache.harmony.xml.ExpatParser$ParseException: At line 1, column 0: syntax error Here is some code for my parser. public void updateArticles(Context ctx, Feed feed, int numDaysToGet) { try { targetFlag = TARGET_ARTICLES; tweetDB = new TweetMonsterDBAdapter(ctx); tweetDB.open(); currentFeed = feed; TimeZone.setDefault(TimeZone.getTimeZone("UTC")); // or "Etc/GMT-1" Date currentDate = new Date(); long dateInMillis = currentDate.getTime(); oldestDate.setTime(dateInMillis-(dayInMillis*numDaysToGet)); SAXParserFactory spf = SAXParserFactory.newInstance(); SAXParser sp = spf.newSAXParser(); XMLReader xr = sp.getXMLReader(); xr.setContentHandler(this); xr.parse(new InputSource(currentFeed.url.openStream())); } catch (IOException e) { Log.e("TweetMonster", e.toString()); } catch (SAXException e) { tweetDB.close(); Log.e("TweetMonster", e.toString()); } catch (ParserConfigurationException e) { Log.e("TweetMonster", e.toString()); } tweetDB.close(); } It doesn't even get into my startElement method.

    Read the article

  • Converting PDF to images using ImageMagick.NET - how to set the DPI

    - by Avi Pinto
    Hi, I'm trying to convert pdf files to images. ImageMagick is a great tool, and using the command line tool gets me desired result. but i need to do this in my code, So added a reference to http://imagemagick.codeplex.com/ And the following code sample renders each page of the pdf as an image: MagickNet.InitializeMagick(); using (ImageList im = new ImageList()) { im.ReadImages(@"E:\Test\" + fileName + ".pdf"); int count = 0; foreach (Image image in im) { image.Quality = 100; image.CompressType = mageMagickNET.CompressionType.LosslessJPEGCompression; image.Write(@"E:\Test\" + fileName + "-" + count.ToString() + ".jpg"); ++count; } } The problem: IT LOOKS LIKE CRAP the rendered image is hardly readable. the problem i realized is it uses the default 72 DPI of ImageMagick. and i can't find a way to set it(96dpi or 120dpi gives good results) via the .Net wrapper. Am I missing something , or there is really no way to set it via this wrapper? Thanks

    Read the article

  • please suggest good variable names that represent theirself ( php)

    - by I Like PHP
    Hi all, it may be wrong place to ask this question, but i hope u all programmer must have the interesting naming convention of variables. i have seen many places that some variable names are very good n effective like common variable names $link $db $connect $query $stmt $sql $qry $output $result $list so please suggest me some good names for variable , bcoz all time i have to write $x, $y etc.. if i want to save something instantly on page...that are even not relevant, so please suggest me good variable names

    Read the article

  • About redirected stdout in System.Diagnostics.Process

    - by sforester
    I've been recently working on a program that convert flac files to mp3 in C# using flac.exe and lame.exe, here are the code that do the job: ProcessStartInfo piFlac = new ProcessStartInfo( "flac.exe" ); piFlac.CreateNoWindow = true; piFlac.UseShellExecute = false; piFlac.RedirectStandardOutput = true; piFlac.Arguments = string.Format( flacParam, SourceFile ); ProcessStartInfo piLame = new ProcessStartInfo( "lame.exe" ); piLame.CreateNoWindow = true; piLame.UseShellExecute = false; piLame.RedirectStandardInput = true; piLame.RedirectStandardOutput = true; piLame.Arguments = string.Format( lameParam, QualitySetting, ExtractTag( SourceFile ) ); Process flacp = null, lamep = null; byte[] buffer = BufferPool.RequestBuffer(); flacp = Process.Start( piFlac ); lamep = new Process(); lamep.StartInfo = piLame; lamep.OutputDataReceived += new DataReceivedEventHandler( this.ReadStdout ); lamep.Start(); lamep.BeginOutputReadLine(); int count = flacp.StandardOutput.BaseStream.Read( buffer, 0, buffer.Length ); while ( count != 0 ) { lamep.StandardInput.BaseStream.Write( buffer, 0, count ); count = flacp.StandardOutput.BaseStream.Read( buffer, 0, buffer.Length ); } Here I set the command line parameters to tell lame.exe to write its output to stdout, and make use of the Process.OutPutDataRecerved event to gather the output data, which is mostly binary data, but the DataReceivedEventArgs.Data is of type "string" and I have to convert it to byte[] before put it to cache, I think this is ugly and I tried this approach but the result is incorrect. Is there any way that I can read the raw redirected stdout stream, either synchronously or asynchronously, bypassing the OutputDataReceived event? PS: the reason why I don't use lame to write to disk directly is that I'm trying to convert several files in parallel, and direct writing to disk will cause severe fragmentation. Thanks a lot!

    Read the article

  • Recommend me a good JNI book

    - by Jose Figueroa
    Hello, I'm creating a software project in Java, is a remote administration tool. The thing is that I need to add some features with C++ and I read some about this process and I realized I need JNI, could you recommend me a good JNI Book or something related with ?

    Read the article

  • reduce image size in bytes without resize and quality lose in c#

    - by SR Dusad
    Hi I m using C#.NET 4.0 I have an jpeg image and i want to reduce its size in bytes .I don't want to change the image size in manner of height and width and not want to lose image quality.Some bit of reduce quality is not an issue. I try to make it a thumbnail image but it reduce the size according to height and width. I can't found any solution. Any type help will be appreciated..

    Read the article

  • Mac OS X file recovery

    - by Daniel
    I thought that all operating systems would merge folder content when being moved to the same location. Imagine my surprise when that didn't happen and I have hundreds, if not thousands of files that have gone missing and are nowhere to be found. Because they were not "deleted" they are not in the trash bin. I've tried to do some recovery using a program called stellarPheonix but after about a 24hour scan, it didn't recognize any of the raw files (.dng,.arw) as image files and so I couldn't see if they could be recovered. It also didn't show the directory structure, which would be handy. I tried a quick scan, but all it showed was files that were still on the HD, not sure what the point of that is. I've used recover 2000 on Win and it does a good job, does anyone know of anything that works quickly and reliably for this kind of file recovery. (I don't think I should have to do a sector-by=sector for this kind of file loss)

    Read the article

  • networking related problem

    - by abhay
    i have installed two LAN cards in my PC. one is used for local networking and other is for Wide area networking( both have a different gateways). But when i need to browse in WAN for that i have to disable my LAN and vice versa. so i don't know the technical / logical reason behind that. so could you please give me reason why this happens.

    Read the article

  • Where do I find nmake for Windows 7

    - by manyxcxi
    I'm trying to compile a Perl source and I can't seem to find a version of nmake that works with Windows 7 64 bit. I've searched all over Microsoft's website and my Googlefu seems to be failing me. Can I use a different compiler- if so suggestions/resources? I'm a native Linux user so pardon my ignorance

    Read the article

  • Real-time offline folder-to-folder backup application needed (Windows)

    - by niktech
    I recently started using Intel Matrix Storage RAID solution that allowed me to use my 5 1TB drives for two RAID volumes. First one a 1TB RAID 0 striped across all 5 drives and second one a RAID 5 across the rest of the free space on all drives (around 2.85TB usable space). The RAID 0 I use for OS, applications and games while the RAID 5 I use as a more-permanent type storage (photos, etc). Now I do realize that running the OS and applications on RAID 0 across 5 drives is very dangerous, which is what brings up the following question. Is there a reliable freeware realtime backup application that can backup a set of folders from one drive to another drive (no online backups needed)? I've already tried a few (Mozy, Yadis, Comodo Backup, GFI Backup, Idoo, Crash Plan) but none meet my requirements: Low CPU and RAM usage. Realtime Backups - as soon as a file is modified in the source folder, it is added to the backup queue which will be processed with the lowest priority when the CPU is idle. This backup queue should persist in cases of computer restarts (ie: the source and destination folders should always have the same set of files, except for the ones waiting in the backup queue). Incremental Backups - if only 10 bytes changed in a 1GB file, the app should only copy those 10 new bytes. Ability to back up locked and opened files (some apps, like Yadis, can't back up critical files like browser favorites). Ability to run as a service (no need for any user to log-in to have the app started). Optional requirements: Compression of the destination into a well-known format (RAR, Zip) that can be directly read without the use of the application. Preset source folders (such as Browser Favorites, Game Saves, Application Settings, etc). The idea is to use RAID 0 array as "semi-persistent RAM-like" storage which in case of a failure can be quickly rebuilt by reinstalling the OS, apps and games and copying over the settings, saves, favorites from the RAID 5. I'm also thinking of taking this RAID 0 as RAM idea to the extreme with SSDs (as soon as we get some nice 6Gb/s SATA III SSDs out there), where a couple of SSDs chained in RAID 0 will work as yet another semi-persistent cache layer sitting between the RAM and the HD. I'm just hoping there already exists an application that satisfies these requirements... otherwise I'll have to write one myself, which I would prefer not to do.

    Read the article

  • NHibernate correct way to reattach cached entity to different session

    - by Chris Marisic
    I'm using NHibernate to query a list of objects from my database. After I get the list of objects over them I iterate over the list of objects and apply a distance approximation algorithm to find the nearest object. I consider this function of getting the list of objects and apply the algorithm over them to be a heavy operation so I cache the object which I find from the algorithm in HttpRuntime.Cache. After this point whenever I'm given the supplied input again I can just directly pull the object from Cache instead of having to hit the database and traverse the list. My object is a complex object that has collections attached to it, inside the query where I return the full list of objects I don't bring back any of the sub collections eagerly so when I read my cached object I need lazy loading to work correctly to be able to display the object fully. Originally I tried using this to re-associate my cached object back to a new session _session.Lock(obj, LockMode.None); However when accessing the page concurrently from another instance I get the error Illegal attempt to associate a collection with two open sessions I then tried something different with _session.Merge(obj); However watching the output of this in NHProf shows that it is deleting and re-associating my object's contained collections with my object, which is not what I want although it seems to work fine. What is the correct way to do this? Neither of these seem to be right.

    Read the article

  • How to get a asp:radiobutton text in javascript?

    - by bala3569
    How to get a asp:radiobutton text in javascript? I use this RbDriver1.Text = dt.Rows[0].ItemArray[5].ToString(); RbDriver2.Text = dt.Rows[0].ItemArray[6].ToString() ; and my javascript function is function getDriverwireless() { alert(document.getElementById("ctl00_ContentPlaceHolder1_RbDriver1")); alert(document.getElementById("ctl00_ContentPlaceHolder1_RbDriver1").innerHTML); } innerHTML doesnt seems to take the text of my radiobutton...any suggestion When i inspect throgh firebug i found this <input type="radio" onclick="getDriverwireless();" value="RbDriver1" name="ctl00$ContentPlaceHolder1$drivername" id="ctl00_ContentPlaceHolder1_RbDriver1"> <label for="ctl00_ContentPlaceHolder1_RbDriver1">kamal,9566454564</label> I want to get the value kamal,9566454564 in javascript...

    Read the article

  • PHP: Find total number of images having same name in a folder.

    - by Muhammad Sajid
    Hi, I am creating code to upload images in a folder using PHP, & before upload an image I check that if any image with same name already exists in the folder by using below syntax: if (file_exists('profilephoto/' . 'frame.gif')) { } But actually I don't want to restrict the user to upload more images with same name & obviously it is impossible to save two images with same name , but there is a way to just find total number of images with same name & upload the next image with appending total number + 1 with image name. Now I just want to know that using PHP how could we find total number of images having same name in a folder? Thanks.

    Read the article

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