Search Results

Search found 3286 results on 132 pages for 'piece'.

Page 80/132 | < Previous Page | 76 77 78 79 80 81 82 83 84 85 86 87  | Next Page >

  • Parent-child table layout

    - by cyberzed
    I'm currently planning a piece of software for dogbreeders and I'm in doubt about my datadesign...whether I'm doing something smart or stupid :) The plan at the moment is one holistic "dog" table sorta like this... Id | Name | FatherId | MotherId ------------------------------- 1 | A | 0 | 0 2 | B | 1 | 0 3 | C | 0 | 0 4 | D | 0 | 3 5 | E | 1 | 3 6 | F | 5 | 2 7 | G | 4 | 3 My questions is, is it common to make it like this or is it really sloppy. I can see a quick lookup reason to have it but I'm really in doubt whether it's good or bad in the end. I thinking it would be better designed if I had a rel-table on the side with Id coupling, but I'm really in doubt how well any of the cases are. A side note is that it'll only be me personally looking at the data this way (or someone adopting the project from me)

    Read the article

  • How to compare 2 pdf files using command line or any tool

    - by Darzen
    I have to compare 2 pdf files and check if they are same or different. I have tried my luck with WinMerge and Beyond compare. however they dont solve my issue. The issue is that there are 2 files which are exactly same except for the time in which they were saved. I have a piece of code that embeds the time of saving into the file. but i am not supposed to do any modifications to the code I have. Hence the above mentioned tools will say that the files dont match and There is just one difference, that is timestamp. Can anyone suggest me a way to handle this. Please. Thanks

    Read the article

  • Gradient boosting predictions in low-latency production environments?

    - by lockedoff
    Can anyone recommend a strategy for making predictions using a gradient boosting model in the <10-15ms range (the faster the better)? I have been using R's gbm package, but the first prediction takes ~50ms (subsequent vectorized predictions average to 1ms, so there appears to be overhead, perhaps in the call to the C++ library). As a guideline, there will be ~10-50 inputs and ~50-500 trees. The task is classification and I need access to predicted probabilities. I know there are a lot of libraries out there, but I've had little luck finding information even on rough prediction times for them. The training will happen offline, so only predictions need to be fast -- also, predictions may come from a piece of code / library that is completely separate from whatever does the training (as long as there is a common format for representing the trees).

    Read the article

  • Pulling .live() functionality out of jQuery

    - by Daniel
    I am writing a Firefox Add-On that currently is depending on jQuery for the following things: Selectors Animations A special .live("focus") hail-mary event-catching maneuver that happens to work with jQuery 1.4.2 (but not 1.4.4) jQuery isn't well suited for functioning inside XUL, and it's a miracle we've gotten this far with it. We're trying to remove the jQuery requirements, the first two are easy (animations are simple, and we can use .querySelector() instead of jQuery), but the .live has proven impossible to do on our own. I've tried reading the source code, but I haven't been able to piece it apart. What is the jQuery .live function doing? There's clearly a lot more going on than document.addEventListener("focus"/"focusin",function_to_pick_apart_events). What else is going on here?

    Read the article

  • Adding my own items to Long Click on Text Box menu on android

    - by Boardy
    Hi all, I am currently developing an application for android. I'm not sure if this is possible but here it goes. When the user clicks and holds on a text box whether it is a website or a piece of software a menu is displayed which shows paste and input method. What I want to be able to do is add my own items to this menu and when the user clicks on my item it will load my app, they can select an item from a list view. It will then copy the contents and automatically paste it into the text field the user selected. Thanks for your help in this matter

    Read the article

  • Throwing special type of exception to terminate unit test

    - by trendl
    Assume I want to write a unit test to test a particular piece of functionality that is implemented within a method. If I wanted to execute the method completely, I would have to do some extra set up work (mock objects expectations etc.). Instead of doing that I use the following approach: - I set up the expectations I'm interested in verifying and then make the tested method throw a special type of exception (e.g. TerminateTestException). - Further down in the unit test I catch the exception and verify the mock object expectations. It works fine but I'm not sure it is good practice. I do not do this regularly, only in cases where it saves me time and effort. One thing that comes to mind as an argument against using this is that throwing exceptions takes long time so the tests execute slower than if I used a different approach.

    Read the article

  • Make a loop that draws lines in processing

    - by theolc
    I have this piece of code, and i am wondering how to make a loop that will draw these lines... Every 50 pixels on the x-axis... I am curious as to how this can be done and would like to use a loop rather than manually drawing each line! The following is the code for the lines... Please any help would be much appreciated! //set sidewalk fill(255,255,255); rect(0,490,500,10); line(50,490,50,500); line(100,490,100,500); line(150,490,150,500); line(200,490,200,500); line(250,490,250,500); line(300,490,300,500); line(350,490,350,500); line(400,490,400,500); line(450,490,450,500);

    Read the article

  • Comapring pitches with digital audio

    - by user2250569
    I work on application which will compare musical notes with digital audio. My first idea was analyzes wav file (or sound in real-time) with some polyphonic pitch algorithms and gets notes and chords from this file and subsequently compared with notes in dataset. I went through a lot of pages and it seems to be a lot of hard work because existing implementations and algorithms are mainly/only focus on monophonic sound. Now, I got the idea to do this in the opposite way. In dataset I have for example note: A4 or better example chord: A4 B4 H4. And my idea is make some wave (or whatever I don't know what) from this note or chord and then compared with piece of digital audio. Is this good idea? Is it better/harder solution? If yes can you recommend me how to do it?

    Read the article

  • How To Securly Store Data In MySQL Using AES_ENCRYPT

    - by Justin
    We are storing sensitive data in MySQL, and I want to use AES_ENCRYPT(data, 'my-secret-key-here') which works great. My biggest question is how do I secure the key? Previously I just wast storing the key in a web PHP file, so something like: define("ENCRYPTION_KEY", 'my-secret-key-here'); This really doesn't work though, as our MySQL server and web server are the same physical machine, so if somebody gains access to the server, they can get both the encrypted data stored in MySQL and the key. Any ideas? I am thinking I need to move the key to a separate server, and read it in remotely. Or, what about generating the encryption key dynamically for each piece of data. For example taking the customer_id and running md5 on it, and then using that as the key.

    Read the article

  • Review of a locked part of an function in C#.NET

    - by Lieven Cardoen
    Is this piece of code where I lock a part of the function correct? Or can it have use drawbacks when multiple sessions ask concurrently for the same Exam? Purpose is that client that first asks for the Exam will assemble it, all next clients will get the cached version. public Exam GetExamByExamDto(ExamDTO examDto, int languageId) { Log.Warn("GetExamByExamDto"); lock (LockString) { if (!ContainsExam(examDto.id, languageId)) { Log.Warn("Assembling ExamDto"); var examAssembler = new ExamAssembler(); var exam = examAssembler.createExam(examDto); if (AddToCache(exam)) { _examDictionary.Add(examDto.id + "_" + languageId, exam); } Log.Warn("Returning non cached ExamDto"); return exam; } } Log.Warn("Returning cached ExamDto"); return _examDictionary[examDto.id + "_" + languageId]; } I have a feeling that this isn't the way to do it.

    Read the article

  • No class def find error

    - by John Smith
    I have the following piece of code which helps me to read the paths of all the files in a directory and its subdirectories : File dir = new File("directory path"); try { System.out.println("Getting all files in " + dir.getCanonicalPath() + " including those in subdirectories"); } catch (IOException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } List<File> files = (List<File>) FileUtils.listFiles(dir, TrueFileFilter.INSTANCE, TrueFileFilter.INSTANCE); for (File file : files) { try { System.out.println("file: " + file.getCanonicalPath()); } catch (IOException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } } The problem is that I get a java.lang.NoClassDefFoundError: org/apache/commons/io/filefilter/TrueFileFilter error. I've imported the necessary libraries. I mention that I work on a plugin project. This code runs in a class with main function. I don't understand why it gave me this error. Thank you !

    Read the article

  • Java- GregorianCalander

    - by namitjain23
    Hey guys, i know this is a very simple question but i am new to Java so please bare with me. I have create a program that can calculate the time a book is due to come back after being issed! So please help me out Here is the piece of code that i have: public void loan(int numOfDays) { if( onLoan == true) { System.out.println("Already on Loan, Return Date : "+Calendar.DATE ); } else { due.set( numOfDays, Calendar.DATE ); System.out.println("Available"); onLoan = true; } } // Mark the book as having been returned Basically i need to replace that Calendar.DATE to get me calculations right. I need to calculate the date passed by the TEST file and calulate the date it will be returned. This project needs to be submitted TOMORROW, so please please help me out!

    Read the article

  • Where can I find the project templates for ASP.NET MVC 1.0?

    - by Jason
    I would like to edit the ASP.NET MVC templates for Visual Studio so that any new action or controller created has a specific piece of code within it by default. For instance, I'd like to replace the generated: public ActionResult MyAction() { return View(); } with a specific coding standard we prefer to use within in my team. eg: public ActionResult About() { try { DoStuff(); return View(); } catch(Exception) { HandleException(); } } I've looked through the filesystem, but I cannot find anything specific that relates to the ASP.NET mvc templates. Anyone know where they are?

    Read the article

  • Obtaining Index value of dictionary

    - by Maudise
    I have a piece of code which looks at the following public Test As Dictionary(Of String, String()) Which is brought in tester = New Dictionary(Of String, String()) tester.add("Key_EN", {"Option 1_EN", "Option 2_EN", "Option 3_EN"}) tester.add("Key_FR", {"Option 1_FR", "Option 2_FR", "Option 3_FR"}) tester.add("Key_DE", {"Option 1_DE", "Option 2_DE", "Option 3_DE"}) There's then a combo box which looks at the following dim Language as string Language = "_EN" ' note this is done by a drop down combo box to select _EN or _FR etc. cboTestBox.items.AddRange(tester("Key" & Language)) What I need to be able to do is to see what index position the answer is in and convert it back to the Key_EN. So, for example _DE is selected, then the options of "Option 1_DE", "Option 2_DE", "Option 3_DE" would be displayed. If they chose Option 3_DE then I need to be able to convert this to Option 3_EN. Many thanks Maudise

    Read the article

  • Accessing Node of an XML object

    - by Lizard
    I am trying to access certain pieces of data from an xml file, here is the problem. ###XML FILE <products> <product> .... .... </product> <product> .... .... </product> etc... </products> I know that the piece of data I need is in ($products->product->myProdNode) I have this mapping (and many others) stored in my database as a string e.g.'product->prodCode' or 'product->dedscriptions->short_desc' How can I access this data by using the strings stored in my database. Thanks for you help in advance!

    Read the article

  • How to find out how namespace got polluted?

    - by dehmann
    Consider the following little piece of code: // all of these include other headers, lots of code: #include "myheader1.h" #include "myheader2.h" #include <string> void foo() { string s("hello world"); // oh no, why does this compile?? } This compiles, so obviously some of the recursively included header files has a using namespace std; somewhere. How would you go about finding out where that offending line of code is? Just using grep on all header files won't really work because that statement is often used inside a function, where it is safe and won't pollute the rest of the code.

    Read the article

  • [VC++ 2010] Stack around the variable 'xyz' was corrupted.

    - by tirolerhut
    hi, I'm trying to get some simple piece of code I found on a website to work in VC++ 2010 on windows vista 64: #include "stdafx.h" #include <windows.h> int _tmain(int argc, _TCHAR* argv[]) { DWORD dResult; BOOL result; char oldWallPaper[MAX_PATH]; result = SystemParametersInfo(SPI_GETDESKWALLPAPER, sizeof(oldWallPaper)-1, oldWallPaper, 0); fprintf(stderr, "Current desktop background is %s\n", oldWallPaper); return 0; } it does compile, but when I run it, I always get this error: Run-Time Check Failure #2 - Stack around the variable 'oldWallPaper' was corrupted. I'm not sure what is going wrong, but I noticed, that the value of oldWallPaper looks something like "C\0\:\0\0U\0s\0e\0r\0s[...]" -- I'm wondering where all the \0s come from. A friend of mine compiled it on windows xp 32 (also VC++ 2010) and is able to run it without problems any clues/hints/opinions? thanks

    Read the article

  • Writing lambda functions in Scala

    - by user2433237
    I'm aware that you can write anonymous functions in Scala but I'm having trouble trying to convert a piece of code from Scheme. Could anyone help me convert this to Scala? (define apply-env (lambda (env search-sym) (cases environment env (empty-env () (eopl:error 'apply-env "No binding for ~s" search-sym)) (extend-env (var val saved-env) (if (eqv? search-sym var) val (apply-env saved-env search-sym))) (extend-env-rec (p-name b-var p-body saved-env) (if (eqv? search-sym p-name) (proc-val (procedure b-var p-body env)) (apply-env saved-env search-sym)))))) Thanks in advance

    Read the article

  • How to write a list to a text file in the correct format

    - by lia1000
    I've got this piece of code that I want to write the output to a text file but with the correct format i.e. no brackets, single quotes so it appears as a formatted list. This is the code: file = open("env5.txt", "w"); for key in os.environ.keys(): env = os.environ[key]; key1 = key; list = str([key, env]).replace("'","").replace('[]', ''); list2 = list[1:-1]; print(list2); file.writelines(list2); file.close(); This is the original code: for key in os.environ.keys(): print(key, os.environ[key]); Many thanks

    Read the article

  • GregorianCalander

    - by namitjain23
    Hey guys, i know this is a very simple question but i am new to Java so please bare with me. I have create a program that can calculate the time a book is due to come back after being issed! So please help me out Here is the piece of code that i have: public void loan(int numOfDays) { if( onLoan == true) { System.out.println("Already on Loan, Return Date : "+Calendar.DATE ); } else { due.set( numOfDays, Calendar.DATE ); System.out.println("Available"); onLoan = true; } } // Mark the book as having been returned Basically i need to replace that Calendar.DATE to get me calculations right. I need to calculate the date passed by the TEST file and calulate the date it will be returned. This project needs to be submitted TOMORROW, so please please help me out!

    Read the article

  • Does .live() binding work for jQuery in IE7?

    - by Steve
    Hi everyone, I have a piece of javascript which is supposed to latch onto a form which gets introduced via XHR. It looks something like: $(document).ready(function() { $('#myform').live('submit', function() { $(foo).appendTo('#myform'); $(this).ajaxSubmit(function() { alert("HelloWorld"); }); return false; }); }); This happens to work in FF3, but not in IE7. Any idea what the problem is?

    Read the article

  • How can I convert my Stream (image data) back into a file

    - by James Hay
    I have a WCF restful service that I'm trying to upload an image to. I have a very basic metod that accepts a stream as it's only parameter and is defined in the contract as: [OperationContract] [WebInvoke(UriTemplate = "ReviewImage", BodyStyle = WebMessageBodyStyle.Bare, Method = "POST")] ReviewImage UploadImage(Stream data); I'm actually consuming this service from flash (which is fairly inconsequntial) which selects a file from the file system and uploads it through the service url. It all works seems to work, adding a breakpoint to the UploadImage method breaks as expected. If I wanted to save this file back to disk, is it just a case of reading this Stream object into a FileStream object that creates the file somewhere? A bit like the this? When i do actually do this the file can not be opened as an image. I'm sure i'm missing a key piece of knowledge here. Does my stream actually contain just the image bytes or does it contain more than that?

    Read the article

  • how to format (css) data loaded with $.load or $.get or $.ajax?

    - by user356981
    I need to load a piece of content html when an link in a menu is clicked; once loaded, the css format is not working properly, how do I re-format (re-styling via css) the loaded code? My code is: $('a', mainMenu).click(function() { ref = this.href; $('#content').load(ref + ' #content' function() { url = '../css/jquery-ui-1.8.2.custom.css'; //styling here if (document.createStyleSheet) document.createStyleSheet(url); else $('<link rel="stylesheet" type="text/css" href="'+url+'"/>').appendTo('head'); }); }) is it another way to load and re-style html (plugins perhaps)? thanks in adv'n.

    Read the article

  • Java Thread wait() => blocked?

    - by Chris
    According to http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Thread.State.html calling wait() will result a thread to go in BLOCKED state. However this piece of code will result (after being called) in a Thread in WAITING State. class bThread extends Thread { public synchronized void run() { try { wait(); } catch (InterruptedException e) { e.printStackTrace(); } } } Have I got something wrong? Can anybody explain this behaviour to me? Any help would be appreciated!

    Read the article

  • UITable View Issue,

    - by abc
    hello i am having same issue, i tried your solution but it didnt help me in my case.. i am not getting exception but view is not getting changed.. my piece of code is as below printf("hi"); //Get the selected country NSString *selectedCountry = [listOfItems objectAtIndex:indexPath.row]; //Initialize the detail view controller and display it. DetailViewController *aSecondView = [[DetailViewController alloc] initWithNibName:@"DetailView" bundle:nil]; // aSecondView.selectedCountry = selectedCountry; [self.navigationController pushViewController:aSecondView]; [aSecondView release]; aSecondView = nil; printf("bye.."); both hi and bye gets printed but view doesnt change.. i have wasted 2 days around it .. plz help me out..

    Read the article

< Previous Page | 76 77 78 79 80 81 82 83 84 85 86 87  | Next Page >