Daily Archives

Articles indexed Tuesday June 25 2013

Page 12/20 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • How to Implement Complex Form Data?

    - by SoulBeaver
    I'm supposed to implement a relatively complex form that looks like follows, but has at least four more pages requiring the user to fill in all necessary information for the tracks: This data will need to be sent to the server, which is implemented using Dropwizard. I'm looking for best practices on how to upload and send such a complex form with potentially dozens of songs to the server. The simplest available solution I have seen is a simple multipart/form-data request with the following form schema (Source): Client <html> <body> <h1>File Upload with Jersey</h1> <form action="rest/file/upload" method="post" enctype="multipart/form-data"> <p> Select a file : <input type="file" name="file" size="45" /> </p> <input type="submit" value="Upload It" /> </form> </body> </html> Server @POST @Path("/upload") @Consumes(MediaType.MULTIPART_FORM_DATA) public Response uploadTrack(final FormDataMultiPart multiPart) { List<FormDataBodyPart> artists = multiPart.getFields("artist"); StringBuffer output = new StringBuffer(); for (FormDataBodyPart artist : artists) output.append(artist.getValueAs(String.class)); List<FormDataBodyPart> tracks = multiPart.getFields("track"); for (FormDataBodyPart track : tracks) writeToFile(track.getValueAs(InputStream.class), "Foo"); return Response.status(200).entity(output.toString()).build(); } Then I have also read about file uploads via Ajax or Formdata (Mozilla HttpRequest) which allows for Posts in the formats application/x-www-form-urlencoded, multipart/form-data, or text/plain. I don't know which approach, if any, is best. An ideal solution would be to utilize Jackson to convert a json string into my data objects, but I don't get the impression that this is possible with binary data.

    Read the article

  • Decorator not calling the decorated instance - alternative design needed

    - by Daniel Hilgarth
    Assume I have a simple interface for translating text (sample code in C#): public interface ITranslationService { string GetTranslation(string key, CultureInfo targetLanguage); // some other methods... } A first simple implementation of this interface already exists and simply goes to the database for every method call. Assuming a UI that is being translated at start up this results in one database call per control. To improve this, I want to add the following behavior: As soon as a request for one language comes in, fetch all translations from this language and cache them. All translation requests are served from the cache. I thought about implementing this new behavior as a decorator, because all other methods of that interface implemented by the decorater would simple delegate to the decorated instance. However, the implementation of GetTranslation wouldn't use GetTranslation of the decorated instance at all to get all translations of a certain language. It would fire its own query against the database. This breaks the decorator pattern, because every functionality provided by the decorated instance is simply skipped. This becomes a real problem if there are other decorators involved. My understanding is that a Decorator should be additive. In this case however, the decorator is replacing the behavior of the decorated instance. I can't really think of a nice solution for this - how would you solve it? Everything is allowed, even a complete re-design of ITranslationService itself.

    Read the article

  • How to convert a Bazaar repository to GIT repository?

    - by Naruto Uzumaki
    We have a large bazaar repository and we want to convert it to a git repository. The bazaar repository contains the folders of each of the interns. Any documentation/code prepared by interns is committed in their directory so there are a huge number of commits. What steps should be performed to securely convert the bazaar repository to a git repository so that we do not lose any commit information. We firstly need to create a backup of the existing bazaar repository and then convert it. Edit: I followed this link: http://librelist.com/browser//cville/2010/2/9/migrate-repository-bzr-to-git/ It's working fine on my system with Ubuntu. But when I try to run it on the actual server it gives me EOF error and crashes Starting export of 1036 revisions ... fatal: EOF in data (1825 bytes remaining) fast-import: dumping crash report to .git/fast_import_crash_11804 Edit 2: I also tried it on a new CentOS system and received the following error fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree. Use '--' to separate paths from revisions

    Read the article

  • Is acoustic fingerprinting too broad for one audio file only?

    - by IBG
    We were looking for some topics related to audio analysis and found acoustic fingerprinting. As it is, it seems like the most famous application for it is for identification of music. Enter our manager, who requested us to research and possible find an algorithm or existing code that we can use for this very simple approach (like it's easy, source codes don't show up like mushrooms): Always-on app for listening Compare the audio patterns to a single audio file (assume sound is a simple beep) If beep is detected, send notification to server With a flow this simple, do you think acoustic fingerprinting is a broad approach to use? Should we stop and take another approach? Where to best start? We haven't started anything yet (on the development side) on this regard, so I want to get other opinion if this is pursuit is worth it or moot.

    Read the article

  • Gathering all data in single iteration vs using functions for readable code

    - by user828584
    Say I have an array of runners with which I need to find the tallest runner, the fastest runner, and the lightest runner. It seems like the most readable solution would be: runners = getRunners(); tallestRunner = getTallestRunner(runners); fastestRunner = getFastestRunner(runners); lightestRunner = getLightestRunner(runners); ..where each function iterates over the runners and keeps track of the largest height, greatest speed, and lowest weight. Iterating over the array three times, however, doesn't seem like a very good idea. It would instead be better to do: int greatestHeght, greatestSpeed, leastWeight; Runner tallestRunner, fastestRunner, lightestRunner; for(runner in runners){ if(runner.height > greatestHeight) { greatestHeight = runner.height; tallestRunner = runner; } if(runner.speed > ... } While this isn't too unreadable, it can get messy when there is more logic for each piece of information being extracted in the iteration. What's the middle ground here? How can I use only a single iteration while still keeping the code divided into logical units?

    Read the article

  • How do you visually represent programming skills?

    - by TomSchober
    I had a discussion with a recruiter recently that made me wish I could visually represent programming skills. In trying to explain how skills relate, what are the important properties of those skills? Would a tagging model work (i.e. "Design Pattern," "Programming Language," "IDE," or "VCS")? Are they really hierarchical? Clarification: The real problem I see is communicating the level of granularity among skill sets. For instance saying someone "knows Java" is a uselessly broad term in describing what someone can DO. However saying they know how to write web services with the Java Programming language is a bit better. To go even further, saying they know Spring as a tool under all that is probably specific enough. What should we call those levels of granularity? What are the relationships between the terms we use? i.e. Framework to Language, Tool to Language, Framework to Solution(like web services), etc.

    Read the article

  • Using Sql Server Change Data Capture with a frequently changing schema

    - by Pete
    We are looking into enabling Sql Server Change Data Capture for a new subsystem we are building. It's not really because we need it, but we are being pushed for having a complete history traceability, and CDC would nicely solve this requirement with minimum effort on our parts. We are following an agile development process, which in this case means that we frequently make changes to the database schema, e.g. adding new columns, moving data to other columns, etc. We did a small test where we created a table, enabled CDC for that table, and then added a new column to the table. Changes to the new column is not registered in the CDC table. Is there a mechanism to update the CDC table to the new schema, and are there any best practices to how you deal with captured data when migrating the database schema?

    Read the article

  • Why does DataContractJsonSerializer not include generic like JavaScriptSerializer?

    - by Patrick Magee
    So the JavaScriptSerializer was deprecated in favor of the DataContractJsonSerializer. var client = new WebClient(); var json = await client.DownloadStringTaskAsync(url); // http://example.com/api/people/1 // Deprecated, but clean looking and generally fits in nicely with // other code in my app domain that makes use of generics var serializer = new JavaScriptSerializer(); Person p = serializer.Deserialize<Person>(json); // Now have to make use of ugly typeof to get the Type when I // already know the Type at compile type. Why no Generic type T? var serializer = new DataContractJsonSerializer(typeof(Person)); Person p = serializer.ReadObject(json) as Person; The JavaScriptSerializer is nice and allows you to deserialize using a type of T generic in the function name. Understandably, it's been deprecated for good reason, with the DataContractJsonSerializer, you can decorate your Type to be deserialized with various things so it isn't so brittle like the JavaScriptSerializer, for example [DataMember(name = "personName")] public string Name { get; set; } Is there a particular reason why they decided to only allow users to pass in the Type? Type type = typeof(Person); var serializer = new DataContractJsonSerializer(type); Person p = serializer.ReadObject(json) as Person; Why not this? var serializer = new DataContractJsonSerializer(); Person p = serializer.ReadObject<Person>(json); They can still use reflection with the DataContract decorated attributes based on the T that I've specified on the .ReadObject<T>(json)

    Read the article

  • How to create an auto-grader in and for Python

    - by recluze
    I'm trying to create an auto-grader for one of my beginning programming courses for python. From my online search, I've come to know that it is effectively a unit test framework that tests the student's code rather than production code but I'm not really sure how to structure the flow of the program. Can anyone please provide a strategy for submission of code by students and automating the whole process of marking? For instance, how would the student code be submitted and then stored/structured on disk, how would the grades be stored/reported? I'm only looking for a broad strategy and will try on my own to fill in the blanks. (I asked this on stockoverflow.com initially but it's considered as off-topic and I was suggested to ask here.)

    Read the article

  • How can we plan projects realistically while accounting for support issues?

    - by Thomas Clayson
    We're having a problem at work: we're trying to schedule work so that we can assess time scales and get deadline dates. The problem is that it's difficult to plan for a project without knowing everything that's going to happen. For instance, right now we've planned all our projects through the start of December, however in that time we will have various in house and external meetings, teleconferences and extra work. It's all well and good to say that a project will take three weeks, but if there is a week's worth of interruption in that time then the date of completion will be pushed back a week. The problem is 3 fold: When we schedule projects the time scales are taken literally. If we estimate three weeks, the deadline is set for three week's time, the client is told, and there is no room for extension. Interim work and such means that we lose productive time working on the project. Sometimes clients don't have the time that we need to take to do the work, so they'll sometimes come to us and say they need a project done by the end of the month even when we think that the work will take two months - not to mention we already have work to be doing. We have a Gantt chart which we are trying to fill in with all the projects we have and we fill in timesheets, but they're not compared to the Gantt chart at all. This makes it difficult to say "Well, we scheduled 3 weeks for this project, but we've lost a week here so the deadline has to move back a week." It's also not professional to keep missing deadlines we've communicated to the client. How do other people deal with this type of situation? How do you manage the planning of projects? How much "extra" time do you schedule into a project to account for non-project work that occurs during a project? How do you deal with support issues and bugs and stuff? Things you can't account for during planning? UPDATE Lots of good answers thank you.

    Read the article

  • glx not working, optirun works, gnome in fallback mode

    - by user26766
    It all started when I installed nvidia's own driver. Uninstalling it and reverting back to nvidia-current didn't solve the problem, so I have been playing with this for a while. Now nvidia-current seems to be functional. It seems glx support is missing, and my intel graphics is not responding. gnome loads only in fallback mode. Here are some outputs: glxinfo name of display: :0.0 Error: couldn't find RGB GLX visual or fbconfig glxgears Error: couldn't get an RGB, Double-buffered visual optirun glxgears works fine lspci | grep VGA 00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09) 01:00.0 VGA compatible controller: NVIDIA Corporation GF108 [GeForce GT 540M] (rev ff) how can I fix this? thanks,

    Read the article

  • pykaraoke on xp pro

    - by user170175
    i have dell laptops they all have xp-pro on them.what is happening is i have pykaraoke 7.1 on a disk and installed it on a couple of laptops and it works great.the other laptops say pykaraoke bad configeration,reinstall may fix this.i do that and i8t still doesnt work says the same thing.i even copyed the program from a working laptop and that didnt work.it doesnt make cence that it works on some but not the others.

    Read the article

  • Importing Debian Bugs to Launchpad

    - by noddy
    While reading about how the bugs from debian are imported to launchpad, I came across a blueprint https://blueprints.launchpad.net/launchpad/+spec/debian-bug-import which was used initially to import bugs from debian. I cannot find the script that was used to import them or the logic that was used. Did the people import all the bugs from debian or did they filter the bugs. And how are the bugs presently imported from debian to launchpad. I came across a script in launchpad which imports bugs from debian given certain bug numbers but I wanted to know whether there is some automation that exists for importing relevant debian bugs to launchpad. Thanks.

    Read the article

  • sell ccv good and fresh sell cvv all country fullz info

    - by underworld
    ICQ: 640240418 YH: underworld_cvv Mail: [email protected] WELCOME TO MY UNDERWORLD ! I'm is Professional seller,more than 5 years experience,i started work in 2008,i have sold cvv credit card to many customers all over the world. Selling cvv, fullz many country as: Canada,USA,Australia,UK...all And many country in Europe: Fr,Ger,Spain,Ita... I hope we will work together for a long time. Always sell cvv quality with high balance. I have a website but if you want buy cvv good price please contact me. Have Cvv with Bin or Cvv with DOB,VBV if customer claim. List Price Some Cvv (good price for good buyer) -Us: 5$ /1 -Us VBV-DOB : 8$ /1 -Us fullz : 40$ /1 -Us (amex,discover) : 8$ /1 -Ca : 10$ /1 -Ca DOB : 20$ /1 -Ca fullz : 50$ /1 -Ca with bin : 15$ /1 -Au : 10$ /1 -Au DOB : 20$ /1 -Uk : 10$ /1 -Uk DOB-VBV : 20$ /1 -Fr : 15$ /1 -Fr DOB-VBV : 25$ /1 -Ger : 18$ /1 -Ger with DOB : 25$ /1 -Spain : 15$ /1 -Spain Fullz : 40$ /1 -Ita : 15$ /1 -Ita with DOB : 25$ /1 -Japan : 15$ /1 -Japan with DOB : 25$ /1 Cvv random country -Denmark : 25$ /1 -Sweden : 20$ /1 -Switzerland : 20$ /1 -Slovakia : 20$ /1 -Netherlands : 18$ /1 -Mexico : 15 /1 -Middle East : 18$ /1 -New zeland : 18$ /1 -Asia : 15$ /1 -Ireland : 18$ /1 -Belgium : 15$ /1 -Taiwan : 15$ /1 -UAE : 20$ /1 And many country... Some Bins -Us bins: 517805,488893,492536,408181,542432,482880,374355,374372... -Ca bins: 450003,450008,451242,450060,549198,533833,519123,544612... -Uk bins: 4547,5506,5569,5404,5031,4921,5505,5506,4921,4550... -Ger bins: 492942,490762,530127... -Au bins: 543568,450605,494053,450606,456475,521893,519163... -Fr bins: 497847,497831,497841,497849,497820,497825,497833... -And others bins for others country... Format France fullz Nom : di murro Prenom : mariano Adresse : rue des caillettes Ville : Corbeil Essonnes Code Postale : 91100 Telephone : 33672492372 ========== (2eme Tape) ========== Nom de Bank : crédit agricole Nom de Carte Bancaire : di murro mariano Date de naissance : 12 / 02 / 1969 Type de carte : MasterCard Numero de carte : 5131018223855xxx Numero de compte : Date d'expiration : 10 / 2014 CVN : 336 -WARRANTY time is 12 HOURS. Any cvv purchase over 12 hours can not warranty. -If you buy over 30 cvvs, i will sell for you best price. -I will discount for you if you are reseller or you order everyday many on the next day. -I only accept payment money by PerfectMoney (PM) Western Union (WU) and MoneyGram. -I will prove to you that I am the best sellers. And make sure you will enjoy doing business with me. Contact: ICQ: 640240418 YH: underworld_cvv Mail: [email protected]

    Read the article

  • How do I reset the default icons from the desktop icons?

    - by Jens Reubsaet
    I know this question sounds cryptic, but what I mean is this: I set different icons for the 'home' and mounted volumes on the desktop, but I want to revert that action. How do I do that? I already tried to do it from the icon selection dialog by clicking revert, but no effect. How do I restore this? (the desktop icons are from the default GNOME Icon Theme but I have the Faience icon theme: these do not really match up). Thanks in advance! I'm running Ubuntu-GNOME 13.04 64-bit (GNOME 3.8.2) I set the icons by right clicking, clicking the icon and selecting it by the dialog.

    Read the article

  • In dual boot PC, the boot/GRUB menu suddenly disappeared (Ubuntu option is not appearing anymore)

    - by iammilind
    I have been using Ubuntu 13.04 as my primary OS for quite sometime on Sony VAIO laptop with other OS being windows 8 (never use it). Till today, everything was fine. In the evening I had shut down my PC and closed the lid; Typically I do this when the shutting down screen is still on. But probably this time it was fatal. When I again restarted my PC, now no menu is appearing for selecting OS and it directly goes for Windows 8. My question is similar to this thread, but I don't have Ubuntu CD as I had installed using pen drive sometime back. Is there any (genuine or workaround) easier way to get back the GRUB menu back in the place? Note that keyboard shortcuts in Sony VAIO is different, here I have an "Assist" menu as well to get those internal options.

    Read the article

  • Ubuntu desktop and dash problems

    - by user170163
    I am not sure if i have posted it to right place, so if no please don't judge me, I am a newbie. I installed Ubuntu 13.04 and I am happy with it. I have two OS's in dual boot. Ubuntu and Windows 7. in Ubuntu I have 2 problems. The first one is when I suspend my system I cannot resume it again. It sometimes show me the password screen (user names and etc. (sorry i don't know the exact name of it)) and sometimes just a blank screen. what can be the problem? The second one is this: When I hit ALT+F2 it looks like this ( but not always. when I restart the system everything is OK till about 30-40 minutes. and then it looks like this. Please help, I really like Ubuntu but these 2 problems ruin my plans about it. Thanks

    Read the article

  • Internet connection randomly drops out

    - by Dr_Bunsen
    Since a week or 2, I have this random network failures. No error pops up, the system says it's still connected to the internet(wifi and wired). The problem is, I can't connect to anything, even a ping google.com gives no feedback. And after many network-manager resets it will work again, for just a minute, and drop out again. I noticed that the /etc/resolv.conf contains this line: nameserver 127.0.0.1 I left out the "Do not edit" stuff, and after it worked for a second, this line is added: search lan When I change the nameserver to 8.8.8.8, I am still able to connect to anywhere. Does anyone got a clue what is happening here? I will provide any information asked. Thanks in advance p.s. I run Ubuntu 13.04 since lastnight(24-06-2013)

    Read the article

  • How can I define custom keyboard mappings to resize, move, and manage windows?

    - by fumon
    I just returned to ubuntu (13.04) after a year using OS X exclusively. I love the improvements that have come to ubuntu and unity, and I'm glad to be back. There's just one thing, though... Slate is a simple OS X tool that allows users to quickly create powerful keyboard macros and really take advantage of their screen space. I have to say I was spoiled by it. Even on a tiny laptop, my workflow was never interrupted by changing workspaces or leaving the keyboard to adjust a window, because perfect adjustment was a keystroke or two away. For example: bind h:ctrl;alt;cmd resize -10% +0 # this increases the window's left width by 10% bind h:shift;alt nudge -10% +0 # this moves the window left by 10% You make a big config file, and like vim, tmux, and everything else, it just becomes muscle memory. I can't seem to find a way to achieve anything close to this in linux or ubuntu. I've tried to make do with compiz window settings and the built-in stuff Ubuntu offers, but it's not even in the same realm. Although to be fair, this level of tuning isn't something most people care about. Thanks, guys. :) Any feedback would be appreciated.

    Read the article

  • I forgot the password to a cbz/zip file

    - by hurley
    I forgot the password to a cbz file, which when I open it says it only contains empty pages, so i rename it to zip, since I read it will open anyway, and I enter what I supposed to be the password, and it starts extracting some 100 files, but it stops and asks for a password again and none of my known passwords work. Help? it's a backup for over 2 years of work. I'm using Archive Manager at Ubuntu 13.

    Read the article

  • I can't install libtiff on my 64-bit Ubuntu.

    - by marwa
    When I try to install libtiff on my 64-bit Ubuntu, I get the following error: sudo apt-get install libtiff Reading package lists... Done Building dependency tree Reading state information... Done Package libtiff is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source E: Package 'libtiff' has no installation candidate ubuntu@ip-10-119-97-123:/mnt$ libtiff-memcached libtiff-memcached: command not found

    Read the article

  • Why can't I download applications from neither Muon Softwware Center nor Synaptic Package manager?

    - by The Drummer from Kubuntu
    Why can't I download applications from neither Muon Softwware Center nor Synaptic Package manager? When I try to download an app from my Kubuntu 12.04 LTS softaware center, it tells me that I can't download any app. SAme thing in Synaptic Package manager : I get an error telling that I can't change anything on my system. The only solution I have is to use the cryted file technic, but I just do not like that. From the terminal, I get an error after I downloaded the package that either the package contains an error or that there is an error from this package. Thank you for your time, your answer and your work. This is very important, I have to install an app for my work.

    Read the article

  • What happens after `ubuntu-bug` has done it's thing?

    - by guntbert
    Until some time ago you ran apport-bug or ubuntu-bug to start reporting a bug. The system would then open launchpad with your account, upload the collected information and let you add more info to the bug report. Now when I run gksudo ubuntu-bug (for instance with a crash-file as argument) the common bug dialog appears and thats all. Where is the report being sent to? Definitely not to launchpad as a bug report (although in the concrete situation people have been able to file a report about that bug). So: where is this report sent to (and just maybe) how can I still file a bug report from my system (makes uploading of the pertaining files much easier) Could it be that "the system" decided that this would be a duplicate of an already existing bug?

    Read the article

  • Ubuntu 12.04 USB wireless not recognized

    - by Justin
    I have searched for awhile now for ways to fix my problem but have come up with nothing. I am running Ubuntu 12.04 on my desktop computer. I am unable to find the Enable Wireless button in the network area. It just doesn't appear. Everything else works on my laptop. I believe it's the drivers for my USB network adapter. I also have no way of using a wired connection at the moment. Thanks for any help!

    Read the article

  • How do I reset the password for Ubuntu 12.04 LTS

    - by user169930
    I installed Ubuntu 12.04 LTS using Wubi in the D: drive of my PC. I have Vista installed in the C: drive. I have forgotten my password for my Ubuntu Admin Account. I only have only access to the Guest login. Please note, I don't see any GRUB menu and get only Vista & Ubuntu as options while booting. I can't get into Recovery Mode of Ubuntu using Shift, ESC or any other way. Please let me know how to reset the password.

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >