Daily Archives

Articles indexed Friday November 9 2012

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

  • C++ function returning pointer, why does this work ? [migrated]

    - by nashmaniac
    So heres a simple c++ function what it does it take an array of characters as its argument and a integer n and then creates a new character array with only n elements of the array. char * cutString(char * ch , int n){ char * p = new char[n]; int i ; for(i = 0 ; i < n ; i++) p[i] = ch[i]; while(i <= n ){ p[i++] = '\0'; } return p ; } this works just fine but if I change char * p = new char[n]; to char p[n]; I see funny characters what happens ? What difference does the former make also p is a temporary variable then how does the function returns it alright ?

    Read the article

  • Setting up Clojure Project And Sub Projects

    - by octopusgrabbus
    This is primarily a lein question about setting up a major project and its sub-projects, and is not intended to be a discussion question. Instead, I am interested in either a pointer to documentation or to a Clojure/lein best practices link. I have a municipal property assessments application that splits two master flies into different subset files, depending on whether a billing transfer is taking place or we want to batch update new accounts, rather than making our assessment department enter new accounts once in their system and then again in the tax collection system. My application is going to be large enough, that I can see a common library lein project with support functions, like splitting apart the files, and then individual lein projects that use the common library. Should the lein projects be set up at the same level and support included through the project.clj/core.clj files? Is there an advantage to creating lein new projects underneath a major project? Is there a problem with combing all functions in one project? I can probably make my one core.clj contain all flavors of the program, but coming from a C/C++ and Python background, I would prefer to have a lot of little projects.

    Read the article

  • how to detect keylogger in windows that hooked up key-press?

    - by saber tabatabaee yazdi
    For security reasons we have to detect all key-loggers and log them in somewhere like windows events. I have piece of C# code that it is very easy to install all clients and up and running every day in system trays and no one can close it. We want to modify that code and send logs to central web service in our network (that this also web service is installed last year and receive and log all another security logs).

    Read the article

  • Windows Phone 8 development on Windows 7 - is it or will be possible?

    - by Tiby
    I was trying to install Windows Phone 8 SDK on my Windows 7 machine and it hit me with the 'supported only on Windows 8' message. I actually wanted to develop Phone 7.5 apps on Visual Studio 2012, impossible thing with the 7.1 SDK, so I thought 8 SDK will do the job. As if it was not enough that the 8 SDK was controversial upon release, now that it's generally available, to me it seems like a horrible decision to make it available only for Windows 8, because in my humble opinion, no serious and sane developer will install Windows 8 ever, or at least in the near future, just because of the Metro UI. So, anyone knows any workarounds for developing Windows Phone 8 on Windows 7, or at least develop for 7.5 but using Visual Studio 2012?

    Read the article

  • Is there an API for determining congressional districts?

    - by ardavis
    I'm looking to determine the congressional district based on an address my user is providing. This will avoid having the user to look it up themselves. Does an API of this sort exist? Note Through my attempts to find one, I've only come across these: http://www.govtrack.us/developers/api (not sure how to submit an an address or zip code however) The following resources are available in the API ...Bills and resolutions in the U.S. Congress since 1973 (the 93rd Congress). ...A (bill, person) pair indicating cosponsorship, with join and withdrawn dates. ...Members of Congress and U.S. Presidents since the founding of the nation. ...Terms held in office by Members of Congress and U.S. Presidents. Each term corresponds with an election, meaning each term in the House covers two years (one 'Congress'), as President four years, and in the Senate six years (three 'Congresses'). ...Roll call votes in the U.S. Congress since 1789. How people voted is accessed through the Vote_voter API. ...How people voted on roll call votes in the U.S. Congress since 1789. See the Vote API. Filter on the vote field to get the results of a particular vote... http://www.opencongress.org/api (seems to be a way to find congress information, but not districts) This API provides programmers with structured access to all the data on OpenCongress, everything from official bill info to news and blog coverage to user-generated votes on bills and much more... This API defaults to returning XML. All queries can also return JSON... https://groups.google.com/forum/?fromgroups=#!topic/opendems-discuss/CeKyi_aANaE (similar question, no resolution) I've been looking over Open Dems, and seeing what's exposed at this point and what isn't. I work with Democrats Abroad, and am interested in using stuff from the lab for their sites. I quickly looked over the Precinct API, which does both more and less than what I'd need. An ideal resource would be any way of translating addresses into CD at the very least (getting state district data would be good as well), since that would make it easier for DA's membership to make a difference in races like last month's NY26 race... Update I'm looking at the source for the govtrack.us website and the 'doGeoCode' function may be useful. view-source:http://www.govtrack.us/congress/members If no one has any suggestions, I will try to go off of what they are doing.

    Read the article

  • Evaluating this huge .... thing? [closed]

    - by Shark
    I'll just leave this here: superTiled = ((((gctUINT32) (hardware->chipMinorFeatures)) >> (0 ? 12:12) & ((gctUINT32) ((((1 ? 12:12) - (0 ? 12:12) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 12:12) - (0 ? 12:12) + 1)))))) == (0x1 & ((gctUINT32) ((((1 ? 12:12) - (0 ? 12:12) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 12:12) - (0 ? 12:12) + 1))))))); If you can break it down into 'steps' or a single numeric value - props to you :) I see that this is generated/ unwrapped macros code but .... can't really wrap around it atm. The first person that breaks this down / simplifies it a bit gets to know which driver i found it in. Cheers :)

    Read the article

  • Are there new flexible texteditors? [closed]

    - by RParadox
    Vi(m) and Emacs are almost 40 years old. Why are they still the standard, and what attempts have been made at coming up with a new flexible editor? Are there any features which can not be built into vim/emacs? My question is similar to this one: Time to drop Emacs and vi? No one had a suggestion, which surprises me. I would have thought that the core of a texteditor is very small and that people brew their own. Perhaps nobody wants to deal with supporting all the modes? Edit to clarify my question: Instead of writing modes and scripts I ask myself, why there is not a much lightweight project, which lets people custom the editor more directly? Vim has 365395 LOC (C lines all included), Emacs 1.5 million LOC. Why is there a project with say 50k LOC, which is the core, why people can use more freely? Perhaps there is such project, I haven't looked very far. I thought about putting together modules from Vim myself and experimenting with some ideas. The core of editing shouldn't be more than 10k? Vim has a lot optimizations which is really an overkill nowadays. Basically I'm looking for a code base for my own editor and Vi/Emacs are I believe not intended to be used in this way. Bill Joy said the following about vi. http://web.cecs.pdx.edu/~kirkenda/joy84.html The fundamental problem with vi is that it doesn't have a mouse and therefore you've got all these commands. In some sense, its backwards from the kind of thing you'd get from a mouse-oriented thing. I think multiple levels of undo would be wonderful, too. But fundamentally, vi is still ed inside. You can't really fool it. Its like one of those pinatas - things that have candy inside but has layer after layer of paper mache on top. It doesn't really have a unified concept. I think if I were going to go back - I wouldn't go back, but start over again.

    Read the article

  • Pythonic use of the isinstance function?

    - by Pace
    Whenever I find myself wanting to use the isinstance() function I usually know that I'm doing something wrong and end up changing my ways. However, in this case I think I have a valid use for it. I will use shapes to illustrate my point although I am not actually working with shapes. I am parsing XML configuration files that look like the following: <square> <width>7</width> </square> <rectangle> <width>5</width> <height>7</height> </rectangle> <circle> <radius>4</radius> </circle> For each element I create an instance of the Shape class and build up a list of Shape objects in a class called the ShapeContainer. Different parts of the rest of my application need to refer to the ShapeContainer to get certain shapes. Depending on what the code is doing it might need just rectangles, or it might operate on all quadrangles, or it might operate on all shapes. I have created the following function in the ShapeContainer class (the actual function uses a list comprehension but I have expanded it here for readability): def locate(self, shapeClass): result = [] for shape in self.__shapes: if isinstance(shape,shapeClass): result.append(shape) return result Is this a valid use of the isinstance function? Is there another way I can do this which might be more pythonic?

    Read the article

  • iptables change destination address base on result from mysql

    - by user1812225
    I need to change destination address of tcp/ip packets based on result of execution mysql query... SELECT `score` FROM `reputation` WHERE `ip` = packet.source_ip if (score < a) then packet.destination_ip = ... else packet.destination_ip = ... What ways of solving this problem do you see? Thanks. P.S. this is important that destination host knows REAL ip address where packet came from, not IP address of firewall.

    Read the article

  • MVC design patterns

    - by insane-36
    I have an application and it does not use a very good structure. However it seems to me that I have tried to stick to mvc design pattern but a senior engineer claims that I have no design patterns and code are mesh. How I have structured the code : I have couple of nsmanagedobject model classes which represents model in my case and a reskit library which encapsulates the nsurlconnection and url request. I fetch the request from the view controller itself and then when the request get completed I create predicate and then populate it in tableview. Wherever I need custom view either I create it in nib or create in a custom subclass of UIView. I have use delegation pattern and notification to communication to view controller, views and block callback with restkit. But, the senior engineer is very new to ios. He has been doing it for 2 months now but he is a good java programmer. So, what is mvc pattern ? Is core data model not working as a model objects, view controller as controller and views. I dont seem to find any other places or any other cases to create my own model object since the most of the models are used as NSManagedObject subclass.

    Read the article

  • Is there a product planning tool that has these specific features? [closed]

    - by acjohnson55
    I am working on a web startup in the early stages, and we are struggling a bit to manage the scope and scheduling of our product. We have loads of high-level features in the pipeline, but we need a good way of scheduling them for release iterations and breaking them into actual tasks that can be scheduled (that could be a separate tool, but integration would be preferred). I would say that our product can be pretty cleanly divided into "aspects", and we want to be able to separate features by the aspect to which they apply. Perhaps most importantly, it should be really simple to create and move features between target release points. We don't have physical space for a war room type setup, so whatever we settle upon should ideally have a cloud-type web interface. Right now, we're using Excel to make a grid of product aspects vs. target releases, and we store features at the intersections. But this is not providing a good way of indexing tasks to those features or being able to move them around. I would much rather have something that automates the grid overview. I'm less interested in something that helps with low-level scheduling than I am in something that is good at organizing the product plan at the long-term, high-level view. Is there a product planning tool out there that matches these specifications?

    Read the article

  • What diagrams, other than the class diagram and the workflow diagram, are useful for explaining how an application works?

    - by Goran_Mandic
    I am working on a small Delphi project, composed of two units. One unit is for the GUI, and the other for data management, file parsing, list iterating and so on.. I've already made a class diagram, and my workflow looks like hell- it's too complex, even for anyone to read. I've considered making a dataflow diagram, but it would be even more complex. A use case diagram wouldn't be of use either. Am I missing some diagram type which could somehow represent the relationship between my two units?

    Read the article

  • Using 'new' in a projection?

    - by davenewza
    I wish to project a collection from one type (Something) to another type (SomethingElse). Yes, this is a very open-eneded question, but which of the two options below do you prefer? Creating a new instance using new: var result = query.Select(something => new SomethingElse(something)); Using a factory: var result = query.Select(something => SomethingElse.FromSomething(something)); When I think of a projection, I generally think of it as a conversion. Using new gives me this idea that I'm creating new objects during a conversion, which doesn't feel right. Semantically, SomethingElse.FromSomething() most definitely fits better. Although, the second option does require addition code to setup a factory, which could become unnecessarily compulsive.

    Read the article

  • How to do lazy loading in a SOA fashion?

    - by sun1991
    For example, I've got a root object exposed in a SOA service, say Invoice (Invoice has line items as children). Sometimes, I need to retrieve its detail line items. I'm thinking to make it lazy loading, because it's a traffic overhead to transfer line items every time Invoice is required. But in SOA fashion, it seems unlikely. Because all it can expose are Invoice POCOs, with contain no logic. Thus I cannot attach my lazy loading logic to Invoice to instruct it to load lines items when needed.

    Read the article

  • How do great enterprises estimate software development efforts?

    - by Ed Pichler
    I was learning about how to estimate software development effort, and would like to know how successful enterprises estimate their projects. How they do to know how much time a system will spend to be developed? What are the modern techniques to do this? What are the techniques used by these modern enterprises? Some articles and interviews of employees of those enterprises would be interesting. I asked on Project Management site of StackExchange too.

    Read the article

  • No text in working indicator-messages after enabling different icons depending on the status

    - by user106750
    My indicator-messages has some problems. As you can see in the image, there appears no text. The indicator is working correctly, if there is some income, a number will appear in its proper place or I will be able to see the minutes passed after I got an email, but still no information. As you can see in the picture, I changed the envelope icon for the status one. I configured it as is indicated in http://www.omgubuntu.co.uk/2012/08/ubuntu-add-new-message-indicator-icons, with the indicator changing depending on the status. But I modified it so I see the bubble. The bubble gets the arrow when I'm absent, for example, or an "X" of I'm disconnected, and also turns blue if there an income. I believe the problem is related with this new indicator. The first days, it was working fine, but then the text dissapeared. I've tried uninstalling and reinstalling the packet, with no success. I'm using ubuntu 12.10 64bits with Unity. Someone has an idea how to fix this? I would prefer conserving the characteristic of having different icons. Thanks a lot!!! Image here: http://i.stack.imgur.com/Ucgi4.png

    Read the article

  • bash profile works for user but not sudo

    - by user564448
    I've modified my .profile to include a folder if a flash drive is plugged in. When running the command as the user it works fine but tells me the scrip must be run by sudo (this is what i want). However, when i try to run it with sudo i get "command not found" I have a symlink (flash) in my /var/www folder pointing to my /media/flash drive. (nevermind this setup since is just for dev) this is my user's .profile : # set PATH so it includes flash scripts if [ -d "/var/www/flash/scripts" ] ; then PATH="/var/www/flash/scripts:$PATH" fi when trying to run as sudo i get: sudo: script: command not found any ideas?

    Read the article

  • front usb wont mount harddrives, internal usb ports do

    - by Thesgsuser
    I have noticed something in my new build, i am using Ubuntu desktop newest version my motherboard is the asus f1a75-m pro R2.0 with the usb ports in the back all my NTFS hard disks or usb sticks work fine, but then.. when i put them in the front usb ports of my chassis (silverstone milo ml-03) they wont mount... I have 2 usb 3.0 ports in front of the case connected with a internal usb 3.0 header. But i verified that the usb 3.0 ports on the back do mount the harddisk so it has nothing to do with usb 3.0 i think. The strange thing is, my mouse works fine on the front usb ports. Every usb hardware piece seems to work except if it has any memory inside it :( What seems to be the problem?

    Read the article

  • Unable to connect to wireless network

    - by Mike
    A real newbie here. Just downloaded Ubuntu 12.10, put on USB stick and have booted it on my other PC after modifying the boot sequence to boot from USB before hard drive where Windows XP lives. Have no problems with Windows and my wireless but not with Ubuntu. The PC is a Dell Latitude D630 laptop. According to Windows XP , the wireless card is a Dell Wireless 1490 Dual Band WLAN Mini-Card, my IP address is 192.168.0.193, subnet mask is 255.255.255.0, assigned by DHCP, SSID is HOME , type 802.11 and default gateway is 192.168.0.1. Ok, back to booting from USB and TRY option, I am Editing Network connections, I have created/configured "Wireless connection 1" with SSID of HOME and the only other thing I have changed is on the "Editing IPV4 routes for Wireless connection 1 I have enterred 192.168.0.193 , netmask 255.255.255.0 and gateway 192.168.0.1 Anyways , no go. Could use some help. Thanks, Mike from Montreal

    Read the article

  • "Virtual Machine Manager" and "Virtual Machine Server" setup manual

    - by urtihu
    Is there a manual available that covers the proper setup of a "Virtual Machine Server" with no GUI with an Ubuntu Workstation with a GUI and "Virtual Machine Manager" installed? Both are 12.04 version. I get the following error message: unable to connect to libvirt Verify that -The libvirt-bin package is installed -The libvirt daemon has been started -you are a member of the libvirtd group the package is installed for some reason starting the daemon seems to crash libvirtd start info: libvirt version 0.9.8 error: virExecWithHook:328 : cannot find 'pm-is-supported' in path: No such file or directory also qemucapsInit:856: Failed to get host power management capabilities So I guess I did not set the server up correctly. All manuals I found do not mention "Virtual Machine Manager". I only chose the packages to connect with SSH remotely and the "Virtual Machine Server" for the server installation. So I would like to find a manual that covers this combo or then covered only GUI machines that have both on the same machine, which will not really help with system performance as a hypervisor.

    Read the article

  • Configuring keyboard input to eliminate unused diacritics

    - by David Cesarino
    I'd like to change the way diacritics work under Xubuntu. My problem My native language is pt-BR and my notebook has an american keyboard. Thus, I use ' and " followed by keys like u and c to achieve things like ú, ç and ü. It all works well. However, in the case of apostrophes and quotes, that creates a problem when I use ' followed by: letters that won't accept the acute accent ( ´ , ACUTE ACCENT -- 0x00B4) at all, like t; and letters that won't accept the acute in pt-BR, like r. In 1, ' with t does absolutely nothing. In 2, ' with r creates r (LATIN SMALL LETTER R WITH ACUTE -- 0x0155), which is used, afaik, for some eastern european languages like slovak. It isn't used in portuguese, just like ?, s, z, ?, ?, ?, n and all consonants (portuguese do not take diacritics in consonants). Question That said, is there a way to better support the portuguese-brazilian language using an american keyboard? It is very common here --- I actually prefer the american keyboard to our own, known as “ABNT”. Desired solution I'd like to deactivate unused diacritics, so case 2 would behave just like case 1. Additionally, if possible, I'd like case 1 to behave like it does under Windows. As an example, typing ' followed by t should write 't (acute followed by T) instead of doing nothing. About 2, in my humble opinion, doing nothing is counterproductive. I realize the behavior is reasonable according to logic ("there isn't t-acute, so please tell the computer to typeset apostrophe --- ', SPACE --- instead of acute). But from a human, practical point of view, I think it makes more sense (to me, at least). Additional comments I believe this also applies to spanish, french, italian and other western european latin languages. On the console (Ctrl+Alt+F?), case 1 is not a problem. I don't need to press space as apostrophes are automatically added. However, there, I'm unable to access cedilla (ç). Two completely different behaviors. If it's just a matter of customizing text config files (possibly creating a custom layout or whatever), I'd be glad to share my efforts. I just need guide on the "howto" part. Somehow Google only points me to the "enough" people (those who cope with the situation and think that it works "well enough"). And since I have definitely migrated to Linux/Xubuntu after years, I'd like to leave just as I like it (and I'm sure others as well). For example, if there is some kind of scripting or definition to tell the computer to do what I described, so be it.

    Read the article

  • Is there a way to make the speaker silent while the headphone-jack keeps working? 12.04LTS

    - by Cees
    The PC I am working on is in a loud environment. If I need sound, I use the headphone. On my own account this is easy: I mute the speaker in the sound-setting. I am not the only user, others use the Guest-session. And that's what this question about: Is it possible to turn off the speaker by default on a guest-session AND leave the headphone-output working? If yes, how can I fix it? I tried to loosen the speaker (hardware) connection but it is soldered to the mainboard. The soundcard on the PC is: HDA Intel at 0xfea78000 irq 44 /proc/asound/pcm ---------------------------+ ¦00-00: ALC662 rev1 Analog : ALC662 rev1 Analog : playback 1 : capture 1¦ ¦00-02: ALC662 rev1 Analog : ALC662 rev1 Analog : capture 1 Ubuntu 12.04LTS is running on the system, my account has all the (admin) rights

    Read the article

  • 12.10 Unity doesn't appear when using Nvidia drivers

    - by Torben Gundtofte-Bruun
    I've just installed 12.10 from scratch. Unity also started okay, but in a poor resolution. I found a setting (I think it was in "software sources") to change the display driver to Nvidia, and then I rebooted. When Ubuntu now starts, it goes to the desktop (I see a file that I saved to the desktop) but there are no other screen elements -- no Unity, no menu bar at the top, no window decoration, nothing. Ctrl-Alt-T and Ctrl-Alt-F2 work as they should, but it's kinda limiting... How can I restore the default driver? I guess I need a way to open those "software sources" settings again - or anything else that could fix it! I hope I don't have to type all this by hand. How can I install a proper Nvidia driver so that I can get up to 1280x1024? My old tricks don't seem to work, but perhaps they might if I solve #1...

    Read the article

  • There's IP but can't reach gateway

    - by icky
    I have just installed ubuntu 12.04 on my new laptop, and brought it back to home, but I found the wireless network does not work. Strangely, it has the correct ip, but can't connect to the gateway. ifconfig gives ip 192.168.64.36, with broadcast 192.168.79.255 and mask 255.255.240.0, this are all correct, the gateway is at 192.168.64.1 cat /etc/resolv.conf nameserver 192.168.64.1 nameserver 127.0.0.1 which i think it's also right. but when I ping 192.168.64.1, all packages are lost. Please help me with this, I really do not know what happened to my network settings. Huckle, Thank you for your reply ifconfig wlan0 Link encap:Ethernet Hwaddr 88:f9:af:2a:ca:1b inet addr:192.168.64.36 Bcast:192.168.79.255 Mask:255.255.240.0 inet6 addr: fe80::8a9f:faff:fea2/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:27 errors:0 dropped:0 overruns:0 frame:0 TX packets:376 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:3950 TX byetes:60288 iwconfig wlan0 IEEE 802.11bgn ESSID:"Chiono" Mode:Managed Frequency:2.417 GHz Access Point: 82:54:99:94:6D:43 Bit Rate=13.5 Mb/s Tx-Power=13 dBm Retry long limit:7 RTS thr:off Fragment thr:off Encryption key:off Power Management:on Link Quality=70/70 Signal Level=-32 dBm Rx invalid nwid:0 Rx invalid crypt:0 RX invalid frag:0 Tx excessive retries: 9 Invalid misc:10 Missed beacon:0 route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface default 192.168.64.1 0.0.0.0 UG 0 0 0 wlan0 link-local * 255.255.0.0 U 1000 0 0 wlan0 192.168.64.0 * 255.255.240.0 U 2 0 0 0 wlan0 Thank you very much

    Read the article

  • Can't activate "mirror display"

    - by Nemo Peeters
    I have Ubuntu 12.04 on a Dell latitude E6410, I have a problem when using the VGA output I always have dual monitor and can't switch on the "mirror display" toggle under systems setting/displays. It's rather annoying when having to do presentation with a video projector. the option "mirror display" is in light grey and I can"t tick the box. Thanks for those who might have an idea how to resolve this? update: driver is: Intel® Ironlake Mobile x86/MMX/SSE2 card something like this ? description: VGA compatible controller product: Core Processor Integrated Graphics Controller vendor: Intel Corporation physical id: 2 bus info: pci@0000:00:02.0 version: 02 width: 64 bits clock: 33MHz

    Read the article

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