Daily Archives

Articles indexed Thursday May 29 2014

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

  • Excel 2010 Move data from multiple columns to single row

    - by frustrated529
    So frustrating! I get data sent to me and it looks like this: a 1 a --2 2 a-------3 3 b 1 b-- 2 2 b ------ 3 3 b------------ 4 4 and i need it to look like this: a 1 2 2 3 3 b 1 2 2 3 3 4 4 I have about 30 columns that needs to move to the top value in their group, then removing the duplicates. I have been searching forums for several days and trying bits and pieces of code. I am having such a tough time with VBA!!!!

    Read the article

  • Force Run System File Checker (SFC.exe)

    - by Zuck
    C:\Windows\system32>sfc /scannow Beginning system scan. This process will take some time. There is a system repair pending which requires reboot to complete. Restart Windows and run sfc again. Is there a way I can force SFC to scan again and make the new fixes on reboot? Probably by deleting some file or something? I removed C:\Windows\WinSxS\pending.xml by taking ownerships but it still shows the same message.

    Read the article

  • No HDMI audio - Windows 8 - ASUS H81M-PLUS

    - by Paul Wright
    I have an issue with HDMI audio on Windows 8 using an ASUS H81M-PLUS motherboard (without an external GFX card). There are many forum posts advising you to go into playback devices and setting HDMI to be default - I have done this. To eliminate what works and what doesn't work: I have not been able to get sound from my HDTV using HDMI. I have used this HDMI cable with my PS3, so this cable should be fine. I am able to use the HDMI cable in extended mode, so that I have two monitors (including the TV), just no audio. This HDMI cable goes straight from the motherboard to the TV. Below I have included 'Device manager', and 'Playback Devices' (Sound). Device Manager Playback Devices, showing disabled and disconnected devices I am at a loss. I have uninstalled all drivers, and then rebooted and made windows look for the correct ones, made sure the HDMI device was default. Thanks, Paul

    Read the article

  • How to best do foreach together with count in excel

    - by user3682637
    I have been trying to do some work in excel, but i seem to be stuck on one point in colum "A" i have: a, b, c, d, e in colum "B" i have: done, started, completed in colum "C" to colum "S" i have: some "X"'s but not in all fields. So my question is how do i do the following foreach row in excel.A Where Bx is done count("X", $row) I have tried pivot, countif, sumproduct but i cant seem to get it to work, any ideas?

    Read the article

  • Dual booting windows 8.1 and ubuntu

    - by Sriniketh
    I have a lenovo laptop with windows 8.1. I wanted to use ubuntu alongside windows. Hence, i downloaded the ubuntu 14.04 iso and created a live pendrive using Universal USB installer. I disabled secure boot and booted from the pendrive. All i get is the GNU GRUB command line version 2.X. I don't get a GUI for the GRUB and i don't know how to boot into ubuntu from the command line. I searched quite a few online forums but in vain. Can someone tell me how to proceed? Thanks in advance.

    Read the article

  • What does the NTFS encryption protect against?

    - by Ray
    I have encrypted a folder from the (PropertiesAdvancedEncrypt contents to secure data). However when I change my user profile to another one which is also an administrator the folder seems to be accessible as if nothing happened. What exactly does this encryption protect against. I'm looking to encrypt folders that no other user, or another OS or even if the HDD were to be removed and plugged to another device will be accessible. My OS is Windows 7 Ultimate. Any suggestions?

    Read the article

  • Remote Desktop Zooming

    - by codeulike
    Using Remote Desktop from a device with a hi-res screen (say, a Surface Pro) is decidedly tricky - as everything displays 1:1 scale and so looks tiny. If the machine you are remoting into runs Server 2008 R2 or later, you can change the dpi zooming setting (see here). But for older hosts, that doesn't work. Using normal Remote Desktop, you can connect with a lower resolution, say 1280x768, and turn on smart-sizing. However smart-sizing can scale down (to display a huge desktop in a small area) but does not seem to scale up (to display a small desktop in a big area). Using the Windows 8 Remote Desktop App, you can zoom - but you cannot set the default resolution of the host. What I want is a lower resolution in the host, scaled up to fit my screen. So both of those are close to what I want, but dont quite work. So question is: Does the Remote Desktop App allow screen resolution to be set somehow? Is there some other Remote Desktop client that can handle zooming better?

    Read the article

  • Windows 8 cannot connect remotely to Windows Server 2012

    - by raza naqvi
    I have installed Windows Server 2012 and then configured remote applications. At first it was working fine and I could be able to connect remotely and run remote applications from Windows 8 clients. But after few days the following error occurred: Remote Desktop Connection This computer can't connect to the remote computer. Try connecting again. If the problem continues, contact the owner of the remote computer or your network administrator. However I still can connect from Windows 7 without any problem. Only Windows 8 has a problem and cannot connect remotely. Neither remote apps nor RDP is working.

    Read the article

  • using python Paramiko for ssh: sudo: no tty present and no askpass program specified

    - by misteryes
    I want to use paramiko to ssh into a bunch a remote nodes and run some command line with root priviledge I have ssh key in my home directory and so i don't need to input password when I ssh into those remote nodes but when running the following script: def connect(hostname): ssh = paramiko.SSHClient() ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) ssh.connect(hostname, username='niky', pkey=paramiko.RSAKey.from_private_key(open('id_rsa'), 'passwd'), timeout = 240.0) return ssh def run(hostname): ssh = connect(hostname) (stdin, stdout, stderr) = ssh.exec_command("sudo ls") res = stderr.readlines() print hostname+': '+''.join(str(elem) for elem in res)+'\n' run(remote.nity.com) I got the following error: remote.nity.com: sudo: no tty present and no askpass program specified if I don't add sudo before ls everything works fine what are potential reasons ? thanks!

    Read the article

  • How do I use the webcam on my laptop?

    - by iOsBoy
    I have a Core i3 model of the dell laptop.There is a webcam placed on top of the laptop.It becomes usable automatically when I am trying to place a pic on some social media site or something.How do I use it to take pictures when I want? How do I start this camera? There is no option in my system that allows me to use this.I could'nt find any software for using this.Please help me.I have a windows 7 installed on my system.

    Read the article

  • Chrome does not re-draw properly on Windows 8

    - by Akshat Mittal
    There are a lot of problems with Chrome (24.0.1312.14 beta || But all this happened before update also) on Windows 8. Problems and explanations are listed below: Google Chrome re-draw time: When I switch tabs, the window retains the content of the previous tab and displays that even if I move my mouse, if only refreshes (re-draws) when there is a change on the webpage (like on hover) or I do a select all (or scroll). One thing to note is that the hover and select happens on the real page and not the retained image-like thing of the older webpage. Chrome is slow and laggy: Websites such as Facebook and Twitter (and more) have gone extremely laggy on Chrome (Win 8). When I was using Windows 7, I never experienced a lag or something. Also when using HTML-5 Websites, the transition (the -webkit-transition in CSS) goes extremely slow at times. Plugins Crash: Plugins like Flash Player, Shockwave Player, and more that are in-built into Chrome Crashes a lot, even when doing simple tasks like playing YouTube Videos, displaying ads or something. Chrome Crashes: Chrome has crashed over 100 times in the past month. Google Chrome just crashes randomly or I don't know the reason. Random Page crashes: Chrome results chrome://crash/(Copy-Paste this in address bar) on random pages even when the page is just loaded, I understand that this can happen on heavy HTML5 or JS websites but what about HTML only websites? Computer Freeze: Chrome sometimes, randomly, freezes my computer. Freeze in the sense, none of the other apps are also working. It's like the whole system freezes, I can not even switch to other apps. I am sure that this is because of Chrome since this happens only when Chrome is active. Most of the things above happens on Super User also, Super User never had any problem when using Chrome on Windows 7. UPDATE 1: @magicandre1981 Commented for trying to disable Hardware Acceleration. I tried it, it somewhat solved the problem but din't fix it. I am still experiencing all the above issues but less frequently (maybe because Chrome Restarted Completely) UPDATE 2: @avirk asked me to try a Stable Version of Chrome and Firefox, I din't experience any lag in Firefox, a little (negligible) lag in Chrome 22 (Maybe because its a new copy of Chrome, I haven't used it much). UPDATE 3: @NothingsImpossible said that He is also experiencing the same problem on Windows Server 2008! This seams to be a major issue now. He also said that GPU load is also high at the same time! Even I saw the same thing. UPDATE 4: Recently, Chrome updated to v24 Stable (I am using stable from a long time now). I was experiencing this problem a lot less in Chrome 23, but this is back in Chrome 24. Seams like Chrome 24 is the most affected from this bug, as this same problem was high in Chrome 24 beta also. UPDATE 5: Chrome was updated to v25 Stable. This problem is 99% Gone, it is still there in 1% of the cases. One such example is when I leave chrome inactive for a while with a few tabs open, the tabs go black and no activity can get them back to active state. If I open a new tab, the new tab is OK but the others are still black, I need to close all those tabs. UPDATE 6: Chrome updated to v27 Stable channel, this problem is nearly gone. This does happen occasionally, but not as frequent as in earlier versions of Chrome. UPDATE 7: I am on Chrome v35.0.1916.114 Stable, Windows 8.1 Pro Update 1. Some of the other problems appears to be back. Chrome is slow and laggy again. Re-draw time is getting worse. Is anybody else experiencing such issues? Does anybody have a solution to any of these?

    Read the article

  • facebook keeps freezing Chrome and Windows

    - by missingfaktor
    Hi, everyone. I am a Windows 7 and Chrome user. Lately (since past few months) my Chrome has been freezing, taking down whole operating system with it, leaving resetting the computer the only choice. Recently I discovered that the issue was with facebook tabs, and when I close those tabs (if it's not too late!), I can save Chrome and Windows from a complete crash. This is very annoying. Is there a solution for this problem? Maybe uninstalling/reinstalling some plugins? Please help. Thanks. PS: Let me know if for helping me with this issue you need to know the list of extensions I have installed. I'll provide it in as an addendum.

    Read the article

  • Task scheduled to wake laptop - only works when lid is open

    - by JD Pack
    I am running Windows 7 Starter on an Acer Aspire One laptop. I want my laptop to automatically run a task (backup the HDD to a network drive) once a week in the middle of the night. I scheduled the task in "Task Scheduler" and checked the box to wake the computer to run the task. I also changed the advanced power settings to allow wake timers. This was half of the solution. It now works flawlessly when the lid is open... the computer can wake itself up from either sleep or hibernate mode to perform the backup. When the lid is closed however, its sleeping beauty. Any ideas? I don't want to have to remember to open the lid once a week. It sort of defeats the purpose of an "automatic" backup. Update: I discovered that it can wake from sleep (or hybrid sleep), but not from hibernate when the lid is closed. This is good news. I'd still be curious about how to get it to work from hibernate, but I'm pretty happy about waking from sleep at least.

    Read the article

  • GlassFish/Java EE Community Open Forum Tomorrow!

    - by reza_rahman
    Still have lingering questions on the goals and future of GlassFish? Want to know a little more about the upcoming GlassFish 4.0.1 release? Something on your mind about Java EE 8/GlassFish 5? You have a golden opportunity to pose your questions and speak your mind tomorrow! The good folks over at C2B2 have gone through a lot of time and effort to organize a very useful online event for the London GlassFish User Group - they are having me answer all your questions online, in real time, "face-to-face". Steve Millidge of C2B2 will be moderating the questions and joining the conversation. Did I mention the event was online, free and open to anyone? The event is tomorrow (May 30th), so make sure to register as soon as possible through the C2B2 website (the registration page has more details on the event). It will be held at 4:30 PM BST / 11:30 AM EST / 8:30 AM PST - you must register to participate. Hope to talk to you tomorrow?

    Read the article

  • Openmatics Revolutionizes Fleet Management with Standards-Based Vehicle Telematics Platform

    - by Michael Snow
    Openmatics s.r.o. was founded in 2010 as a subsidiary of ZF Friedrichshafen AG, a global player in driveline and chassis technology. Oracle Customer:  Openmatics s.r.o.Location:  Pilsen, Czech RepublicIndustry:  AutomotiveEmployees:  70 Its goal was to develop and operate a flexible, open telematics platform for automotive applications, which is independent from vehicle and component suppliers—recognizing that the fragmented telematics market was not meeting today’s fleet management needs. Openmatics provides a rich product portfolio, and customers can extend the platform, as required, to meet their needs. Partners and third-parties can develop their own applications using the Openmatics’ software development kit and can sell them via the Openmatics app shop.ZF Friedrichshafen AG is a global player in driveline and chassis technology. With 121 production companies and 650 service partners in 26 countries, ZF is among the top 10 largest automotive suppliers worldwide. Founded in 1915 to develop and produce transmissions for airships and vehicles, the group’s product offerings now include transmissions and steering systems as well as chassis components and complete axle systems and modules.  A word from Openmatics s.r.o.  “Oracle WebCenter Portal, together with the underlying Oracle Application Development Framework, provided the fundamental infrastructure for the Openmatics platform. Fleet managers can now reduce fuel consumption and operating costs, and more efficiently manage vehicle usage, maintenance, and safety. The standards-based platform allows third-party suppliers to deploy their own vehicle telematics services as Openmatics apps and creates a de facto standard for the automotive industry, independent from a single manufacturer or service provider.” – Gero Strobel, Head of Development, Openmatics s.r.o. Challenges Create an industry standard for vehicle telematics by establishing a customizable platform that enables access to telematics information, such as current and past fuel consumption, through a web browser to better meet automotive market and customer needs Reduce fleet-management costs by eliminating the need to invest in isolated telematics hardware and software solutions per vehicle brand and vehicle component manufacturer Establish an open platform where third-party providers—such as original equipment manufacturers (OEM), insurers, fleet operators, and individual developers—can deploy their own vehicle telematics services Allow users to purchase targeted telematics services as single apps to reduce costs and ensure rapid growth of telematics services available on the platform Enable users to configure their telematics apps with ease to make sure the platform meets individual fleet management requirements, such as analyzing past and current fuel consumption of a truck fleet Solutions Deployed Oracle WebCenter Portal as a foundation for Openmatics, a standards-based automotive telematics platform that provides next-generation fleet management with unified digital communication from and to vehicles on the move Used Oracle Application Development Framework as the development framework for Oracle WebCenter Portal’s components and services, providing developers with ready-to-use software development kits with application programming interfaces, design templates, and visual tools that accelerated time to market Used Oracle Enterprise Pack for Eclipse to simplify telematics application development in Java Enabled fleet monitoring by recording vehicle data—such as fuel consumption information—through onboard units, delivering the information to Oracle Database, and making it accessible through a customizable app portfolio on any web browser Stored vehicle telematics data—sent as encrypted information—in Oracle Database, ensuring data integrity and immediate availability for the platform’s telematics applications Enabled a wide range of telematics services suppliers, from vehicle component manufacturers to fleet application developers, to offer vehicle telematics services on the Openmatics platform, ensuring platform independence from OEMs Provided Openmatics customers with the means to individually select the automotive telematics services that are relevant to their business requirements, eliminating the need to pay for superfluous information and reducing fleet management costs Oracle Products & Services Oracle Application Development Framework Oracle WebCenter Portal Oracle SOA Suite Oracle Enterprise Pack for Eclipse Oracle Database Oracle Consulting &amp;amp;amp;amp;amp;amp;amp;&amp;amp;amp;amp;amp;lt;span id=&amp;amp;amp;amp;amp;quot;XinhaEditingPostion&amp;amp;amp;amp;amp;quot;&amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;/span&amp;amp;amp;amp;amp;gt;amp;&amp;amp;amp;amp;amp;amp;lt;span id=&amp;amp;amp;amp;amp;amp;quot;XinhaEditingPostion&amp;amp;amp;amp;amp;amp;quot;&amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;lt;/span&amp;amp;amp;amp;amp;amp;gt;lt;p&amp;amp;amp;amp;amp;amp;amp;amp;gt; &amp;amp;amp;amp;amp;amp;amp;amp;lt;/p&amp;amp;amp;amp;amp;amp;amp;amp;gt;

    Read the article

  • New: Online NetBeans 8 Crash Course

    - by Geertjan
    On Twitter today I came across an announcement for a brand new on-line course in NetBeans 8. Since NetBeans 8 has been released during the past few months, the course is really very new. Go here to get there directly: https://www.video2brain.com/de/videotraining/netbeans-ide-8-0-crashkurs Here's the general idea. As you can see, the course is in German. With my basic understanding of German, I've had no problem in following the course. The trainer speaks clearly and slowly and everything is very well structured. The course covers all the basics of NetBeans IDE. From getting set up to using all the key features. The quality of the videos is great and the content is clear and informative. Once you've bought the course, all the lessons are unlocked. As you can see, they're all quite short and there's really a lot of content, didn't all fit into the screenshot: Quite some work must have gone into this. Here's one of the free lessons in the course, to give an idea of what you'll get: https://www.video2brain.com/de/tutorial/texte-internationalisieren This one is also free: https://www.video2brain.com/de/tutorial/eclipse-projekt-importieren I highly recommend this course especially if you're switching, or thinking about switching, from a different IDE and want to get a thorough overview of all the features that NetBeans IDE provides. Everything in the course is done within NetBeans, which means no slides, just code. You get to see the workflow of all the standard tasks and, for these purposes, the course does a really great job.

    Read the article

  • Oracle Data Warehouse and Big Data Magazine MAY Edition for Customers + Partners

    - by KLaker
    Follow us on The latest edition of our monthly data warehouse and big data magazine for Oracle customers and partners is now available. The content for this magazine is taken from the various data warehouse and big data Oracle product management blogs, Oracle press releases, videos posted on Oracle Media Network and Oracle Facebook pages. Click here to view the May Edition Please share this link http://flip.it/fKOUS to our magazine with your customers and partners This magazine is optimized for display on tablets and smartphones using the Flipboard App which is available from the Apple App store and Google Play store

    Read the article

  • ¿Qué es Social Cloud o computación en la nube social?

    - by RED League Heroes-Oracle
    La computación en nube es la creación de nuevas posibilidades para las empresas en sus negocios, como acercarse a los clientes a través de herramientas digitales. Es cruzar informaciones del registro de los clientes almacenadas en los servidores de la empresa, con informaciones sociales, o sea, con informaciones disponibles en la internet (redes sociales, blogs, geolocalización). Este cruce, seguramente, puede ayudar a entender mejor el comportamiento de sus consumidores y, a través de estos análisis, tomar diferentes acciones para estar cada vez más cerca de ellos o entender nuevas necesidades. El comportamiento de consumo se está alterando con el avance de la internet y de las nuevas tecnologías. Integrar estas nuevas tecnologías al negocio de la empresa es una gran oportunidad para acompañar los consumidores y observar nuevos patrones de comportamiento. Estos nuevos patrones pueden presentar nuevas oportunidades. Utilizar la computación en la nube para agregar conocimiento adicional a los que ya lo poseen puede ser una de las claves para la transformación de la realidad de la empresa. Actualmente, ¿cómo se comportan tus consumidores? ¿Qué suelen hacer? ¿Viajan mensualmente? ¿Tienen hijos? ¿Están buscando nuevos productos? ¿Qué productos buscan? ¿Dónde la mayor parte de tus consumidores está en el momento de ocio? ¡Saber dónde están en el momento de ocio puede ser una excelente oportunidad para que vean tu marca! ¿Cómo tratas hoy en día esos temas? ¡Las soluciones de Social Cloud de Oracle pueden ayudarte! Aprovecha y descarga GRATUITAMENTE el e-book – Simplifica tu movilidad empresarial y conoce el poder de transformación de la movilidad en tu negocio. LINK PARA DESCARGA: http://bit.ly/e-bookmobilidad

    Read the article

  • Adding attachments to HumanTasks *beforehand*

    - by ccasares
    For an demo I'm preparing along with a partner, we need to add some attachments to a HumanTask beforehand, that is, the attachment must be associated already to the Task by the time the user opens its Form. How to achieve this?, indeed it's quite simple and just a matter of some mappings to the Task's input execData structure. Oracle BPM supports "default" attachments (which use BPM tables) or UCM-based ones. The way to insert attachments for both methods is pretty similar. With default attachments When using default attachments, first we need to have the attachment payload as part of the BPM process, that is, must be contained in a variable. Normally the attachment content is binary, so we'll need first to convert it to a base64-string (not covered on this blog entry). What we need to do is just to map the following execData parameters as part of the input of the HumanTask: execData.attachment[n].content            <-- the base64 payload data execData.attachment[n].mimeType           <-- depends on your attachment                                               (e.g.: "application/pdf") execData.attachment[n].name               <-- attachment name (just the name you want to                                               use. No need to be the original filename) execData.attachment[n].attachmentScope    <-- BPM or TASK (depending on your needs) execData.attachment[n].storageType        <-- TASK execData.attachment[n].doesBelongToParent <-- false (not sure if this one is really                                               needed, but it definitely doesn't hurt) execData.attachment[n].updatedBy          <-- username who is attaching it execData.attachment[n].updatedDate        <-- dateTime of when this attachment is                                               attached  Bear in mind that the attachment structure is a repetitive one. So if you need to add more than one attachment, you'll need to use XSLT mapping. If not, the Assign mapper automatically adds [1] for the iteration.  With UCM-based attachments With UCM-based attachments, the procedure is basically the same. We'll need to map some extra fields and not to map others. The tricky part with UCM-based attachments is what we need to know beforehand about the attachment itself. Of course, we don't need to have the payload, but a couple of information from the attachment that must be checked in already in UCM. First, let's see the mappings: execData.attachment[n].mimeType           <-- Document's dFormat attribute (1) execData.attachment[n].name               <-- attachment name (just the name you want to                                               use. No need to be the original filename) execData.attachment[n].attachmentScope    <-- BPM or TASK (depending on your needs) execData.attachment[n].storageType        <-- UCM execData.attachment[n].doesBelongToParent <-- false (not sure if this one is really                                               needed, but it definitely doesn't hurt) execData.attachment[n].updatedBy          <-- username who is attaching it execData.attachment[n].updatedDate        <-- dateTime of when this attachment is                                               attached  execData.attachment[n].uri                <-- "ecm://<dID>" where dID is document's dID                                      attribute (2) execData.attachment[n].ucmDocType         <-- Document's dDocType attribute (3) execData.attachment[n].securityGroup      <-- Document's dSecurityGroup attribute (4) execData.attachment[n].revision           <-- Document's dRevisionID attribute (5) execData.attachment[n].ucmMetadataItem[1].name  <-- "DocUrl" execData.attachment[n].ucmMetadataItem[1].type  <-- STRING execData.attachment[n].ucmMetadataItem[1].value <-- Document's url attribute (6)  Where to get those (n) fields? In my case I get those from a Search call to UCM (not covered on this blog entry) As I mentioned above, we must know which UCM document we're going to attach. We may know its ID, its name... whatever we need to uniquely identify it calling the IDC Search method. This method returns ALL the info we need to attach the different fields labeled with a number above.  The only tricky one is (6). UCM Search service returns the url attribute as a context-root without hostname:port. E.g.: /cs/groups/public/documents/document/dgvs/mdaw/~edisp/ccasareswcptel000239.pdf However we do need to include the full qualified URL when mapping (6). Where to get the http://<hostname>:<port> value? Honestly, I have no clue. What I use to do is to use a BPM property that can always be modified at runtime if needed. There are some other fields that might be needed in the execData.attachment structure, like account (if UCM's is using Accounts). But for demos I've never needed to use them, so I'm not sure whether it's necessary or not. Feel free to add some comments to this entry if you know it ;-)  That's all folks. Should you need help with the UCM Search service, let me know and I can write a quick entry on that topic.

    Read the article

  • How to unit test models in MVC / MVR app?

    - by BBnyc
    I'm building a node.js web app and am trying to do so for the first time in a test driven fashion. I'm using nodeunit for testing, which I find allows me to write tests quickly and painlessly. In this particular app, the heavy lifting primarily involves translating SQL data into complex Javascript object and serving them to the front-end via json. Likewise, the app also spends a great deal of code validating and translating complex, multidimensional Javascript objects it receives from the front-end into SQL rows. Hence I have used a fat model design for the app -- most of the real code resides in the models, where the data translation happens. What's the best approach to test such models with unit tests? I mean in particular the methods that have create javascript objects from the SQL rows and serve them to the front-end. Right now what I'm doing is making particular requests of my models with the unit tests and checking the returned data for all of the fields that should be there. However I have a suspicion that this is not the most robust kind of testing I could be doing. My current testing design also means I have to package my app code with some dummy data so that my tests can anticipate the kind of data that the app should be returning when tests run.

    Read the article

  • How to structure my java packages

    - by MightyPork
    I have a Java library, quite a huge one. I'm asking regarding Best Practices of structuring the source. For example, the logging sybsystem: Option 1: All in one package, named to sort nicely Log - static accessor LogMonitor - interface for log minotor LogMonitorBase - abstract class LogMonitorStdout - print log to console LogWriter - interface for file logger LogWriterSimple - log writer with just one log file LogWriterArchiving - log writer that handles old log files Option 2: Subpackages for Monitors and Writers, with better names Log monitors/LogMonitor monitors/BaseMonitor monitors/StdoutMonitor writers/LogWriter writers/SimpleLog writers/ArchivingLog The second maybe looks better, but perhaps it's not so practical from the java point of view (two extra packages). What do you suggest as the best practice here? A lot in one package, grouped by naming prefixes, or a lot of subpackages with better names?

    Read the article

  • Is it feasible and useful to auto-generate some code of unit tests?

    - by skiwi
    Earlier today I have come up with an idea, based upon a particular real use case, which I would want to have checked for feasability and usefulness. This question will feature a fair chunk of Java code, but can be applied to all languages running inside a VM, and maybe even outside. While there is real code, it uses nothing language-specific, so please read it mostly as pseudo code. The idea Make unit testing less cumbersome by adding in some ways to autogenerate code based on human interaction with the codebase. I understand this goes against the principle of TDD, but I don't think anyone ever proved that doing TDD is better over first creating code and then immediatly therafter the tests. This may even be adapted to be fit into TDD, but that is not my current goal. To show how it is intended to be used, I'll copy one of my classes here, for which I need to make unit tests. public class PutMonsterOnFieldAction implements PlayerAction { private final int handCardIndex; private final int fieldMonsterIndex; public PutMonsterOnFieldAction(final int handCardIndex, final int fieldMonsterIndex) { this.handCardIndex = Arguments.requirePositiveOrZero(handCardIndex, "handCardIndex"); this.fieldMonsterIndex = Arguments.requirePositiveOrZero(fieldMonsterIndex, "fieldCardIndex"); } @Override public boolean isActionAllowed(final Player player) { Objects.requireNonNull(player, "player"); Hand hand = player.getHand(); Field field = player.getField(); if (handCardIndex >= hand.getCapacity()) { return false; } if (fieldMonsterIndex >= field.getMonsterCapacity()) { return false; } if (field.hasMonster(fieldMonsterIndex)) { return false; } if (!(hand.get(handCardIndex) instanceof MonsterCard)) { return false; } return true; } @Override public void performAction(final Player player) { Objects.requireNonNull(player); if (!isActionAllowed(player)) { throw new PlayerActionNotAllowedException(); } Hand hand = player.getHand(); Field field = player.getField(); field.setMonster(fieldMonsterIndex, (MonsterCard)hand.play(handCardIndex)); } } We can observe the need for the following tests: Constructor test with valid input Constructor test with invalid inputs isActionAllowed test with valid input isActionAllowed test with invalid inputs performAction test with valid input performAction test with invalid inputs My idea mainly focuses on the isActionAllowed test with invalid inputs. Writing these tests is not fun, you need to ensure a number of conditions and you check whether it really returns false, this can be extended to performAction, where an exception needs to be thrown in that case. The goal of my idea is to generate those tests, by indicating (through GUI of IDE hopefully) that you want to generate tests based on a specific branch. The implementation by example User clicks on "Generate code for branch if (handCardIndex >= hand.getCapacity())". Now the tool needs to find a case where that holds. (I haven't added the relevant code as that may clutter the post ultimately) To invalidate the branch, the tool needs to find a handCardIndex and hand.getCapacity() such that the condition >= holds. It needs to construct a Player with a Hand that has a capacity of at least 1. It notices that the capacity private int of Hand needs to be at least 1. It searches for ways to set it to 1. Fortunately it finds a constructor that takes the capacity as an argument. It uses 1 for this. Some more work needs to be done to succesfully construct a Player instance, involving the creation of objects that have constraints that can be seen by inspecting the source code. It has found the hand with the least capacity possible and is able to construct it. Now to invalidate the test it will need to set handCardIndex = 1. It constructs the test and asserts it to be false (the returned value of the branch) What does the tool need to work? In order to function properly, it will need the ability to scan through all source code (including JDK code) to figure out all constraints. Optionally this could be done through the javadoc, but that is not always used to indicate all constraints. It could also do some trial and error, but it pretty much stops if you cannot attach source code to compiled classes. Then it needs some basic knowledge of what the primitive types are, including arrays. And it needs to be able to construct some form of "modification trees". The tool knows that it needs to change a certain variable to a different value in order to get the correct testcase. Hence it will need to list all possible ways to change it, without using reflection obviously. What this tool will not replace is the need to create tailored unit tests that tests all kinds of conditions when a certain method actually works. It is purely to be used to test methods when they invalidate constraints. My questions: Is creating such a tool feasible? Would it ever work, or are there some obvious problems? Would such a tool be useful? Is it even useful to automatically generate these testcases at all? Could it be extended to do even more useful things? Does, by chance, such a project already exist and would I be reinventing the wheel? If not proven useful, but still possible to make such thing, I will still consider it for fun. If it's considered useful, then I might make an open source project for it depending on the time. For people searching more background information about the used Player and Hand classes in my example, please refer to this repository. At the time of writing the PutMonsterOnFieldAction has not been uploaded to the repo yet, but this will be done once I'm done with the unit tests.

    Read the article

  • Inserting data to database from Android

    - by Angel
    I have to build an application where the requirement is that my clients will send data from their Android device and I have to save that data to a database. I have done the part of coding that inserts data from Android emulator to my XAMPP database on localhost, now I have to implement the real thing. How can I connect the devices where my application will be installed to the XAMPP database I have created so that the data they send can be inserted into it?

    Read the article

  • How can I work out how many IP addresses there are in a given range?

    - by Jarede
    I'm wondering if there is a formula to work out the amount of IP addresses in a given range. I have a system that takes either a single IP address or a start and and end IP address: A single one might be: 145.16.23.241 A range might be: 145.16.23.122 - 145.16.23.144 The people inputting these aren't technical, nor are they receiving these details from technical people, so suggesting using CIDR notation isn't an answer for me. I want to be able to highlight that when entering a range such as: 122.100.10.12 - 128.10.200.140 it might not actually be a range and rather 2 singular IP addresses since such a range would comprise of x (large number of) IP addresses. Is there a basic formula to help me highlight this?

    Read the article

  • Should interface only be used for behavior and not to show logical data grouped together?

    - by jags
    Should an interface only be used to specify certain behavior? Would it be wrong to use interface to group logically related data? To me it looks like we should not use interface to group logically related data as structure seems a better fit. A class may be used but class name should indicate something like DTO so that user gets the impression that class does not have any behavior. Please let me know if my assumption is correct. Also, are there any exceptions where interface can be used to group logically related data?

    Read the article

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