Daily Archives

Articles indexed Tuesday December 11 2012

Page 4/16 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Passing 2D array with variable dimensions as function argument

    - by TheCrazyProgrammer
    I just saw the following code among the successful submissions at codechef. http://www.codechef.com/viewplaintext/1595846 I used to think that float max(int n,int arr[n][n]) {....} is not allowed in C++ (as 'n' is a variable). My CodeBlocks (on windows) with MinGW [gcc 4.4] gives compile time error. that "error: array bound is not an integer constant. Then how can be such a solution be accepted by CodeChef's judge. Is there any special flag that allows us to do that in C++??? EDIT: A link showing status as AC (accepted) : http://www.codechef.com/viewsolution/1595846

    Read the article

  • Spring import runs hibernate persistence twice

    - by Jaanus
    I have 2 spring configurations : spring-servlet.xml spring-security.xml needed to add this line to security: <beans:import resource="spring-servlet.xml"/> Now hibernate is ran twice, this is log screenshot : my web.xml: <servlet> <servlet-name>spring</servlet-name> <servlet-class> org.springframework.web.servlet.DispatcherServlet </servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>spring</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping> <listener> <listener-class> org.springframework.web.context.ContextLoaderListener </listener-class> </listener> <context-param> <param-name>contextConfigLocation</param-name> <param-value> /WEB-INF/spring-security.xml </param-value> </context-param>

    Read the article

  • Change Border in Excel left,right,bottom and top

    - by Le Viet Hung
    Firstly i changed color borders of my sheet to white, because i want to have a white sheet. Then i made some headers and want to make border around it. The Problem is it made borders between the values in header but top, down are not seenable. My code: xlWorkSheet5.Columns.Borders.Color = System.Drawing.ColorTranslator.ToOle(System.Drawing.Color.White); // Color Sheet5 to white, BusLoad xlWorkSheet5.Columns.NumberFormat = "@"; Excel.Range rng = (Excel.Range)xlWorkSheet5.get_Range("A7","J7"); rng.RowHeight = 25.5; rng.BorderAround2(Excel.XlLineStyle.xlContinuous, Excel.XlBorderWeight.xlHairline, Excel.XlColorIndex.xlColorIndexAutomatic, Excel.XlColorIndex.xlColorIndexAutomatic); rng.Borders.LineStyle = Excel.XlLineStyle.xlContinuous; rng.Borders.Weight = 1d; rng.Font.Bold = true; rng.HorizontalAlignment = Microsoft.Office.Interop.Excel.XlHAlign.xlHAlignCenter; rng.Interior.Color = System.Drawing.ColorTranslator.ToOle(System.Drawing.Color.LightGray);

    Read the article

  • Issue on dojo onlick event on html button

    - by Cuong Le
    I am a new kid with dojo, I got weird issue which I take lots of time and have not yet found out, assume I have 4 buttons: <button id="btnMoveFirst" data-dojo-type="dijit.form.Button" iconclass="plusIcon"> &lt; &lt;</button> <button id="btnMovePrev" data-dojo-type="dijit.form.Button" iconclass="plusIcon"> &lt;</button> <button id="btnMoveNext" data-dojo-type="dijit.form.Button" iconclass="plusIcon"> &gt;</button> <button id="btnMoveLast" data-dojo-type="dijit.form.Button" iconclass="plusIcon"> &gt; &gt;</button> And use dojo with event onclick as below: dojo.connect(dijit.registry.byId('btnMoveFirst'), "onclick", function(evt){ alert('test1'); }); dojo.connect(dijit.registry.byId('btnMovePrev'), "onclick", function(evt){ alert('test2'); }); dojo.connect(dijit.registry.byId('btnMoveNext'), "onclick", function(evt){ alert('test3'); }); dojo.connect(dijit.registry.byId('btnMoveLast'), "onclick", function(evt){ alert('test4'); }); But when I click any one of 4 buttons, or even any button in form, I got 4 alerts instead of only correct one. Does anyone know this?

    Read the article

  • how to get value of button through jquery in formcollection with id of form collection?

    - by AbhijitPandya
    i have formcollection and two buttons like <form id="frmSubmitTax" method="post"> <input type="submit" id="btnTaxSave" value="Save" /> <input type="submit" id="btnTaxNext" value="Next" /> </form> i m submitting form through jquery and i want to get value of button while form submitting jquery code $('frmSubmitTax').live('submit', function (e) { get value of button that which button is submitted...... });

    Read the article

  • Include a tpl file with variables (Smarty)

    - by user1640660
    I have a "links.tpl" file which contains lines with many variables such as below {assign var=link_main value="index.php"} {assign var=link_login value="?a=login"} but when i include this file in home.tpl using {include file="file.tpl"} the variables {$link_main}, {$link_login} are not included i put the {assign var=link_main value="index.php"} in home.tpl and it works but not from included file i have tried adding scope=global to variable and parent to include but nothing happened I tried the last few hours finding a solution, any help is appreciated

    Read the article

  • How to find out all versions of iPad from user-agent string?

    - by User11091981
    I wanted to find out all the version's of iPad (excluding iPhone, iPod) from user agent string, currently while testing I got the following string Mozilla/5.0 (iPad; CPU OS 5_1_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9B206 Safari/7534.48.3 Question: Will the following code works fine for all the iPad's? String userAgentStr = request.getHeader("User-agent"); if (userAgentStr.contains("iPad")) { //do my logic } EDIT: I am using Dolphin browser from iPad but I am getting the following UA string: Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_2_1 like Mac OS X; en_US) AppleWebKit/533.17.9 (KHTML, like Gecko) Mobile/8C148 Safari/6533.18.5 Similarly iBrowser from iPad UA string is: Mozilla/5.0 (iPhone; CPU iPhone OS 5_1_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Mobile/9B206 So my above code is breaking...

    Read the article

  • Linux reboot() system call: why it calls do_exit(0) after kernel_halt()?

    - by axeoth
    This is related to: http://stackoverflow.com/a/13413099/1284631 Now, the question is: Why the reboot() system call, when called with LINUX_REBOOT_CMD_HALT parameter (see here: http://lxr.linux.no/linux+v3.6.6/kernel/sys.c#L480) is calling do_exit(0) after having already called kernel_halt(), as calling kernel_halt() boils down to calling stop_this_cpu() (see here: http://lxr.linux.no/linux+v3.6.6/arch/x86/kernel/process.c#L519), as part of native_machine_halt() (see here: http://lxr.linux.no/linux+v3.6.6/arch/x86/kernel/reboot.c#L680). Or, it seems to me that stop_this_cpu() is never returning (it ends with an infinite loop). So, it is do_exit(0) called just in case that kernel_halt() doesn't do its job and it return? Why not panic() directly instead, then?

    Read the article

  • Collision detection between layers in Cocos2d?

    - by ipodfreak0313
    I am making a game in Cocos2d. I have enemies that shoot, and have the character shoot. I created a separate layer for the enemies (and their bullets) and a separate layer for the character (and its bullets). The problem is, I don't know how to detect collisions between the two layers. Note, I have the Scene in HelloWorldLayer, and each of the above layers is a child of the scene. Any help is appreciated. Thanks!

    Read the article

  • Keep a Google Maps v3 Map Hidden, show when needed

    - by Dr1Ku
    Is there a way of preventing Google Maps (JS, v3) of being displayed from the get-go ? I do some pre-processing and would like to show my 'Loading' spinner until everything is good to go (more eloquently put, hide the map -- e.g. the container div -- until all preprocessing is complete -- at which point, show the map). Hooking to the map's 'idle' event doesn't help that much, since the map is already displayed when this event hits. I know that the container div gets inline-styled by GMaps after loading, my first idea is to clear out the style attr (whilst listening to 'idle'), but it would be interesting to see if there is a way of creating the map and not displaying it until all pre-processing is done. Maybe by using an argument to the new google.maps.Map constructor, or a MapOption ? Any thoughts on this ? Thank you in advance !

    Read the article

  • GNU screen cannot find terminfo entry on HP-UX

    - by Ency
    I am trying to make screen work on HP-UX B.11.23 U ia64 0308561483 unlimited-user license. Please notice I do not have root access. I have already compiled screen successfully, configured with LIBS=-lcurses. When I try to start screen it wrotes Cannot find terminfo entry for 'xterm'. But there ARE terminfos for the terminal type in screen-4.0.3> ls -a /usr/share/lib/terminfo/x/ . .. x-hpterm x1700 x1720 x1750 xitex xl83 xterm xterms I thing the problem may be there are in non-standard path, because according to man page standard path is /usr/lib/terminfo/?/* What I tried: But as I said I do not have root access so cant make symlink, anyway I tried run screen with filled TERMINFO_DIRS (TERMINFO_DIRS=/usr/share/lib/terminfo/x/ ./screen and TERMINFO_DIRS=/usr/share/lib/terminfo/ ./screen) but none of them work - same error. Change TERM to different values - same error Cannot find terminfo entry for <WHATEVER WHAT WAS IN TERM VAR>. Put something into screenrc and run ./screen -c screenrc screen-4.0.3> cat screenrc attrcolor b ".I" term xterm termcap xterm* LP:hs@ termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm' defbce "on" But no luck so far, have you got any suggestions? Need some additional information, let me know.

    Read the article

  • How do I copy files between harddrives on Ubuntu CLI?

    - by ed209
    I have a dedicated server with a 120gb main ssd. The server happens to come with a couple of 3000GB hard drives. I'd like to use them to back up my main drive. Preferably, I'd like one as an exact copy of the main SSD and the other with incremental backups of the mysql database and a user uploads file. These are the drives I have Disk /dev/sda: 120.0 GB, 120034123776 bytes 255 heads, 63 sectors/track, 14593 cylinders, total 234441648 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x000f2e18 Device Boot Start End Blocks Id System /dev/sda1 2048 4196352 2097152+ 83 Linux /dev/sda2 4198400 5246976 524288+ 83 Linux /dev/sda3 5249024 234441647 114596312 83 Linux Disk /dev/sdb: 3000.6 GB, 3000592982016 bytes 255 heads, 63 sectors/track, 364801 cylinders, total 5860533168 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk identifier: 0x00000000 Disk /dev/sdb doesn't contain a valid partition table Disk /dev/sdc: 3000.6 GB, 3000592982016 bytes 255 heads, 63 sectors/track, 364801 cylinders, total 5860533168 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk identifier: 0x00000000 Disk /dev/sdc doesn't contain a valid partition table The first problem I have, is that I have no idea how to copy from one drive to another. Kind of embarrassing I know, but I don't know where to start. I'm thinking of this in terms of Mac OS cli where I'm able to copy between /Volumes - is there an equivalent? (there is nothing under /mnt or /media)

    Read the article

  • Standard for feeding test data to a Nagios plugin?

    - by chiborg
    I'm developing a Nagios plugin in Perl (no Nagios::Plugin, just plain Perl). The error condition I'm checking for normally comes from a command output, called inside the plugin. However, it would be very inconvenient to create the error condition, so I'm looking for a way to feed test output to the plugin to see if it works correctly. The easiest way I found at the moment would be with a command line option to optionally read input from a file instead of calling the command. if($opt_f) { open(FILE, $opt_f); @output = <FILE>; close FILE; } else { @output = `my_command`; } Are there other, better ways to do this?

    Read the article

  • How can i set up email alerts for disk failures on a windows server 2012 box?

    - by Leo
    I have a windows 2012 server with 3 storage spaces set up, each containing a mirrored pair of 2TB drives. What is the best way to set up alerting so that i receive an alert when a physical disk fails? Ideally i would like these alerts to be sent via email to a pre-defined address. The current server set up is as follows: Intel Core i7 2600k 3.4GHz Socket 1155 8MB Cache Asrock H77 PRO4/MVP Socket 1155 VGA DVI HDMI 7.1 Channel Audio ATX Motherboard 16GB RAM 1 x 60GB SSD (OS) 6 x 2TB SATA III 7200 HDD (DATA)

    Read the article

  • Finding proof of server being compromised by Black Hole Toolkit exploit

    - by cosmicsafari
    I recently took over maintenance of a company server. (Just Host, C Panel, Linux server), theres a tonne of websites on it which i know nothing about. It had came to my attention that a client had attempted to access one of the websites hosted on this server and was met with a warning from windows defender. It had blocked access because it said the website had been compromised by the Black Hole Toolkit or something to that effect. Anyway I went in and updated various plugins and deleted some old suspect websites. I have since ran the website in question through a few online malware scanners and its comes up clean everytime. However im not convinced. Do any of you guys know extensive ways i can check that the server isn't still compromised. I have no way to install any malware scanners or anti virus programs on the server as it is horribly locked down by Just Host.

    Read the article

  • Automatically restore windows network drive (red "X") via batch file

    - by user33958
    i need check if a network drive is mapped and accessible. From time to time windows displays a red X on the drive, and i would need to manually click the drive in explorer to reconnect. I already found solutions which involve editing the registry which unfortunately isn´t possible. So i would need a batch file checking for connection, and (re-)mounting the drive. What i´m using at the moment: IF NOT EXIST z: net use z: \\10.211.55.5\test

    Read the article

  • Software Raid1 with Trim

    - by Penetal
    I have two Crucial C300 SSD disks that I would like to use as my OS disks in my new home server. I have read around a little and some places say that TRIM is simply not supported on any raid config, hw or sw. Then on some other sites I have seen that new support have come for SW raid via LVM somehow, and this is what I'm curious to know about. Can I get Raid 1 and still have TRIM enabled on SW raid by abstracting it with LVM or in any other way? I will most likely be using either Debian or CentOS.

    Read the article

  • could corosync can support unicast heartbeat mode?

    - by Emre He
    could corosync can support unicast heartbeat mode? from another thread in serverfault, some guy raised below corosync conf: totem { version: 2 secauth: off interface { member { memberaddr: 10.xxx.xxx.xxx } member { memberaddr: 10.xxx.xxx.xxx } ringnumber: 0 bindnetaddr: 10.xxx.xxx.xxx mcastport: 694 } transport: udpu } is this conf type means unicast mode? thanks, Emre

    Read the article

  • Forward requests to IIS Application/Folder to Apache server on another port

    - by TheGwa
    I have found many questions and answers for ways of doing this using asapi filters or ARR and URL Rewrite, but none are clear and concise and I am sure many people have this issue. I am looking for a best practice step by step solution to the following scenario: I have a development server accessible externally via a specific port for testing. Eg. rnd.domain.com:8888. So there is one port in and out of this machine accessible to the world. On this server I have a number of Apache or other servers using specific ports such as 8080. IIS is bound to port 80 locally as well as 8888 to get external requests and works perfectly. I would like to use an application (folder) in IIS such as rnd.domain.com:8888/mapserver to map to the local apache server in both directions. The same solution must apply in production where the domain is mapped to port 80. eg. production.domain.com/mapserver maps to 8080 on production server

    Read the article

  • How to enable mod_info in Apache?

    - by Amit Nagar
    I gone through the apache guide to enable to mod_info. As per doc: To configure mod_info, add the following to your httpd.conf file. Location /server-info SetHandler server-info /Location You may wish to use mod_access inside the directive to limit access to your server configuration information: Location /server-info SetHandler server-info Order deny,allow Deny from all Allow from yourcompany.com Location Once configured, the server information is obtained by accessing http://your.host.dom/server-info In my case the this link is not giving any info. Http 404 NOT FOUND error Is there anything I need to install as mod_info.c or something ? Is there anything i need to put as AddModule or something ? In Error log : File does not exist: /usr/local/apache2/htdocs/example1/server-info I have 3 virtual host. One of this as default which use example1 as Docroot dir. I am not sure where this page (server-info) should be ? in case of server-status, it's working fine

    Read the article

  • What is the Name of this Type of Screw? (from for HP quick deploy rail kit in a square hole Rack)

    - by kockiren
    I need the name of the screw for the HP quick deploy rail kit. The screw clicks into the square holes of the rack. It is a Gen4 Rail kit but the screw is like the Gen8 Rail kit ones. I called HP support, but they couldn't really help me. Unfortunately the rack manual does not name this screw either. After googling a while, I found the compatible "Thumb Style Rack Screws". It would do the job but isn't exactly what I am looking for. So, what is the name of the pictured screw.

    Read the article

  • On apache how do I allow access to only to a single file?

    - by sriram
    I have a apache machine which is serving a .js file. That file should be the only file that need to seen. I have configured to do so in my apache like this : <Location /var/www/test/test.js> Order allow,deny Allow from all </Location> The site address is test.in which points to test.js file in /var/www/test directory. That is working fine. But I wish when the user tries to hit test.in/someurl (which is not available) or some other url than test.in need to give an message with 401 error. How do I do that?

    Read the article

  • Preventing logrotate's dateext from overwriting files

    - by Thirler
    I'm working with a system where I would like to use the dateext function of logrotate (or some other way) to add the date to a logfile when it is rotated. However in this system it is important that no logging is missing and dateext will overwrite any existing files (which will happen if logrotate is called twice on a day). Is there a reliable way to prevent dateext to overwrite existing files, but instead make another file?. It is acceptable that either no rotate happens or a file is created with a less predictable name (date with an extra number, or the time or something).

    Read the article

  • Building a WSUS server: where to start?

    - by eleven81
    Rather than having all of my computers go out to the internet and download their Automatic Updates, I am seriously considering building a WSUS server. That is, a Windows Update server. I have read some articles, and they have been helpful, but not complete. The following is what I have gleaned are the steps I need to take: Commission a computer to be the server with Windows 2003 Server. Install the WSUS package(s) and select the type of updates to check for. Configure the rest of my computers to be clients of this server. Set the clients to receive updates from the server. My questions are as follows: Does the server have to run Windows 2003 Server, or will Windows XP Professional work? Where do I download the WSUS packages from? How can I configure my computers to look for updates from my server instead of the internet? Thanks!!

    Read the article

  • RHEL json gem installation requires make?

    - by Salahuddin559
    When I try to install json gem (gem install json), at first it fails to do so, because of some dev package issue. After fixing it, it fails saying that "sh: make: command not found" and "ERROR: Error installing json: ERROR: Failed to build gem native extension.". Why is it failing on make? Notice this is not Mac, this is in RHEL 5 (4 or 5, not sure). Why is it not able to do some "build gem native extension"?

    Read the article

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