Search Results

Search found 30785 results on 1232 pages for 'solution explorer'.

Page 77/1232 | < Previous Page | 73 74 75 76 77 78 79 80 81 82 83 84  | Next Page >

  • Project Euler, Problem 10 java solution now working

    - by Dennis S
    Hi, I'm trying to find the sum of the prime numbers < 2'000'000. This is my solution in java but I can't seem get the correct answer. Please give some input on what could be wrong and general advice on the code is appreciated. Printing 'sum' gives: 1308111344, which is incorrect. /* The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17. Find the sum of all the primes below two million. */ class Helper{ public void run(){ Integer sum = 0; for(int i = 2; i < 2000000; i++){ if(isPrime(i)) sum += i; } System.out.println(sum); } private boolean isPrime(int nr){ if(nr == 2) return true; else if(nr == 1) return false; if(nr % 2 == 0) return false; for(int i = 3; i < Math.sqrt(nr); i += 2){ if(nr % i == 0) return false; } return true; } } class Problem{ public static void main(String[] args){ Helper p = new Helper(); p.run(); } }

    Read the article

  • Configure nHibernate for multiple-project solution

    - by NoOne
    Hello, Im doing a project with C# winforms. This project is composed by: Client project: Windows Forms where user will do CRUD operations on the models; Server project; Common Project: This project will hold the models (in the image only have the model Item); ListSingleton: Remote Object that will do the operations on the models; I already have all the communication working, but now I need to work on the persistence of the data in a mysql database. I was trying to use nHibernate but I’m having some troubles. My main problem is how to organize my hibernate configuration. In which project do I keep the mapping? Common project? In which project do I keep the hibernate configuration file (App.config)? ListSingleton project? In which project do I do this: Configuration cfg = new Configuration(); cfg.AddXmlFile("Item.hbm.xml"); ISessionFactory factory = cfg.BuildSessionFactory(); ISession session = factory.OpenSession(); ITransaction transaction = session.BeginTransaction(); Item newItem = new Item("BLAA"); // Tell NHibernate that this object should be saved session.Save(newItem); // commit all of the changes to the DB and close the ISession transaction.Commit(); session.Close(); In the ListSingleton project? Altho I had reference to the Common Project in the ListSingleton I keep getting error in the addXml line… My mapping is correct because I tried with a one-project solution and it worked :X

    Read the article

  • Best solution for __autoload

    - by tpk
    As our PHP5 OO application grew (in both size and traffic), we decided to revisit the __autoload() strategy. We always name the file by the class definition it contains, so class Customer would be contained within Customer.php. We used to list the directories in which a file can potentially exist, until the right .php file was found. This is quite inefficient, because you're potentially going through a number of directories which you don't need to, and doing so on every request (thus, making loads of stat() calls). Solutions that come to my mind... -use a naming convention that dictates the directory name (similar to PEAR). Disadvantages: doesn't scale too great, resulting in horrible class names. -come up with some kind of pre-built array of the locations (propel does this for its __autoload). Disadvantage: requires a rebuild before any deploy of new code. -build the array "on the fly" and cache it. This seems to be the best solution, as it allows for any class names and directory structure you want, and is fully flexible in that new files just get added to the list. The concerns are: where to store it and what about deleted/moved files. For storage we chose APC, as it doesn't have the disk I/O overhead. With regards to file deletes, it doesn't matter, as you probably don't wanna require them anywhere anyway. As to moves... that's unresolved (we ignore it as historically it didn't happen very often for us). Any other solutions?

    Read the article

  • CSS - Can't get the z-index to apply correctly in Internet Explorer

    - by peaki
    I've written a jQuery script to replace <select /> elements with some DIV's and UL's allowing my to simulate the original SELECT but also allow me to style it. So far, aside from a few minor bugs, it works rather nicely. However, in Internet Explorer, the 'options' div is getting rendered underneath the elements below the div. Here's the HTML: <div class="styledSelect-parent" style="display: inline-block; width: 59px;"> <div class="styledSelect-newSelect" style="position: relative;"> <input class="styledSelect-newSelect-selector" style="width: 59px;" readonly="readonly" name="hello" value="Test1" type="text"> <div class="styledSelect-newSelect-options" style="display: none; z-index: 20; width: 59px; position: absolute; left: 0px; top: 18px;"> <ul> <li>Test1</li> <li>Test2</li> <li>Test3</li> <li class="styledSelect-active">Test4</li> <li>Test1</li> <li>Test2</li> </ul> </div> </div> </div> <br /><br /> <div class="styledSelect-parent" style="display: inline-block; width: 59px;"> <div class="styledSelect-newSelect" style="position: relative;"> <input class="styledSelect-newSelect-selector" style="width: 59px;" readonly="readonly" name="hello" value="Test1" type="text"> <div class="styledSelect-newSelect-options" style="display: none; z-index: 20; width: 59px; position: absolute; left: 0px; top: 18px;"> <ul> <li class="styledSelect-active">Test1</li> <li>Test2</li> <li>Test3</li> </ul> </div> </div> </div> If I open the first select, the LI list sits underneath the second select box rather than above it. I can't get the z-indexes to work properly. What am I missing? :/

    Read the article

  • Is SharePoint a good solution for me?

    - by Pam Bullock
    My company has many branches that use the same software suite that we've written for them. We're looking at SharePoint as a way to open a dialog with them about the software - reviews, change requests (not official ones, just for us to get an idea and for them to discuss amongst themselves what would be helpful). We would also like to utilize the document repository feature and possibly the blog. SharePoint is already available to us if we'd like to use it so that's why we're looking into it. I've done a lot of research and watched a lot of starter tutorials. It seems like it has what we're looking for. For those of you that know it well: Do you think it would be a good solution for us? Do you think it would be overkill? If so, Do you have an alternative suggestion? Are there other aspects of SharePoint that I haven't discovered yet that seems like it would be helpful for what we're doing? I will continue to research online but it's always great to hear the opinion of someone experienced with the product. Thanks so much! Pam

    Read the article

  • Elegant solution to retrieve custom date and time?

    - by kefs
    I am currently using a date and time picker to retrieve a user-submitted date and time, and then I set a control's text to the date and time selected. I am using the following code: new DatePickerDialog(newlog3.this, d, calDT.get(Calendar.YEAR), calDT.get(Calendar.MONTH), calDT.get(Calendar.DAY_OF_MONTH)).show(); new TimePickerDialog(newlog3.this, t, calDT.get(Calendar.HOUR_OF_DAY), calDT.get(Calendar.MINUTE), true).show(); optCustom.setText(fmtDT.format(calDT.getTime())); Now, while the above code block does bring up the date and time widgets and sets the text, the code block is being executed in full before the user can select the date.. ie: It brings up the date box first, then the time box over that, and then updates the text, all without any user interaction. I would like the date widget to wait to execute the time selector until the date selection is done, and i would like the settext to execute only after the time widget is done. How is this possible? Or is there is a more elegant solution that is escaping me? Edit: This is the code for DatePickerDialog/TimePickerDialog which is located within the class: DatePickerDialog.OnDateSetListener d=new DatePickerDialog.OnDateSetListener() { public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) { calDT.set(Calendar.YEAR, year); calDT.set(Calendar.MONTH, monthOfYear); calDT.set(Calendar.DAY_OF_MONTH, dayOfMonth); //updateLabel(); } }; TimePickerDialog.OnTimeSetListener t=new TimePickerDialog.OnTimeSetListener() { public void onTimeSet(TimePicker view, int hourOfDay, int minute) { calDT.set(Calendar.HOUR_OF_DAY, hourOfDay); calDT.set(Calendar.MINUTE, minute); //updateLabel(); } }; Thanks in advance

    Read the article

  • Data Integration Solution?

    - by Shlomo
    At my company we have a number of data feeds and processing that run on any given day. The number of feeds and processing steps is starting to out-number the ability to manage it ad-hoc as it is managed currently. Is there a good solution that helps with logging and managing/scheduling dependencies? For example: A: When file x is FTP dropped into directory D1, kick off processing step B B: Load flat file into DB1 C: When file y is FTP dropped into directory D2, kick off processing Step D D: Load flat file into DB11 E: When B and D are done, churn through the data, and load new data into DB111. F: When Step E is done, launch application process P G: etc... I want those steps to run at the appropriate times, not to mention if B fails, there's no reason to run steps E & F, but I could still run C & D. When I re-run B successfully, it should trigger just E & F to re-run, not C & D. We're a .NET/C#/Sql Server shop, and I'm already familiar with SSIS. Is that really the best there is? That manages steps well, but not external dependencies, or logging. Open source (.NET) preferred, but not required.

    Read the article

  • Optimal (Time paradigm) solution to check variable within boundary

    - by kumar_m_kiran
    Hi All, Sorry if the question is very naive. I will have to check the below condition in my code 0 < x < y i.e code similar to if(x > 0 && x < y) The basic problem at system level is - currently, for every call (Telecom domain terminology), my existing code is hit (many times). So performance is very very critical, Now, I need to add a check for boundary checking (at many location - but different boundary comparison at each location). At very normal level of coding, the above comparison would look very naive without any issue. However, when added over my statistics module (which is dipped many times), performance will go down. So I would like to know the best possible way to handle the above scenario (kind of optimal way for limits checking technique). Like for example, if bit comparison works better than normal comparison or can both the comparison be evaluation in shorter time span? Other Info x is unsigned integer (which must be checked to be greater than 0 and less than y). y is unsigned integer. y is a non-const and varies for every comparison. Here time is the constraint compared to space. Language - C++. Now, later if I need to change the attribute of y to a float/double, would there be another way to optimize the check (i.e will the suggested optimal technique for integer become non-optimal solution when y is changed to float/double). Thanks in advance for any input. PS : OS used is SUSE 10 64 bit x64_64, AIX 5.3 64 bit, HP UX 11.1 A 64.

    Read the article

  • CSS layout changes in Internet explorer

    - by user1784103
    My problem: I just coded a website that is styled just fine in chrome and firefox. However in internet explorer(9) it breaks. the gray header background is supposed to be pushed up to the right of the logo block, and the buttons are supposed to be in the dark grey area. I posted my code. I'm no expert at css, any tips would be greatly appreciated. (the second image is displaying the desired result) the html: Website </head> <body> <div class="wrap_overall"> <div class="header"> <a href="http://localhost"> <img class="logo" src="http://localhost/images/logo.png" width="175" height="24" alt="weblogo" /> </a> </div> <div class="headerbg"></div> <!-- nav top highlight --> <div style="background-color:#6c6c6c;margin:9px0px0px;height:1px;width:1020px;z-index:1;"></div> <!-- nav bar --> <div style="background-color:#5a5a5a;height:53px;width:1020px;z-index:1;"></div> <!-- nav bottom frame --> <div style="background-color:#d4e6b6;height:13px;width:1020px;z-index:1;border-top:4px solid #9de629; margin:0px 0px 10px;"></div> <div class="nav_main"> <ul> <li> <a href="http://localhost/button1"> <img src="http://localhost/images/button1.png" width="63" height="18" alt="button1" /> </a> </li> <li> <a href="http://localhost/index.php?page=button2"> <img src="http://localhost/images/button2.png" width="59" height="18" alt="button2" /> </a> </li> <li> <a href="http://localhost/index.php?page=button3"> <img src="http://localhost/images/button3.png" width="62" height="18" alt="button3" /> </a> </li> <li> <a href="http://localhost/index.php?page=button4"> <img src="http://localhost/images/button4.png" width="41" height="18" alt="button4" /> </a> </li> <li> <a href="http://localhost/index.php?page=button5"> <img src="http://localhost/images/button5.png" width="73" height="18" alt="button5" /> </a> </li> </ul> </div> </div> </body> </html> the css: .logo { padding:60px 20px 50px 20px; } body { background-color:#282828; color:#FFFFFF; font-family: Arial, Helvetica, sans-serif; } body a, img{ border-style:none; color:#9de629; text-decoration:none;} body a:visited {color:#9de629;} body a:hover{ color:#FFFFFF; text-decoration:underline;} .wrap_overall { position:relative; width: 1020px; margin:0px auto; } .header { width:216px; height:148px; margin:0px 0px; padding:0px 0px; background-color:#252525; float:left; display:inline; } .headerbg { margin:0px 0px 0px; padding:0px 0px; width:1020px; height:148px; background-color:#c7c7c7; } .nav_main/*holds the buttons*/ { margin:0px 0px 1px 0px; padding:0px 0px 0px 0px; position:absolute; top:148px; left:363px; z-index:2; overflow: hidden; } .nav_main ul { margin:0px 0px 0px 0px; padding:0px 0px 0px 0px; overflow: hidden; } .nav_main ul li { margin:0px 0px 0px 0px; display: inline; float: left; } .nav_main ul li a { outline: none; border:none; margin:0px 0px 0px 0px; margin-right:-10px; height:54px; width:125px; color:#FFFFFF; background-image:url(../images/button.png); text-align:center; display:table-cell; vertical-align:middle; } .nav_main ul li a:hover { background-image:url(../images/buttonlight.png); }

    Read the article

  • sharepoint administrative server not started causing sharepoint deployment instability

    - by Nathan
    When i deploy anything to a variety of sharepoint servers i get problems with some packages failing, from what i can see the only error given is as below. The timer job for this operation has been created, but it will fail because the administrative service for this server is not enabled. If the timer job is sched uled to run at a later time, you can run the jobs all at once using stsadm.exe - o execadmsvcjobs. To avoid this problem in the future, enable the Windows ShareP oint Services administrative service, or run your operation through the STSADM.e xe command line utility. Is this a known problem? I googled for the text but got only one other person with the problem who simply worked round it. I'm trying to batch deploy solutions programmatically and so these errors render the whole code worthless if you have to go back and redo bits by hand afterwards. Is batch deployment simply not possible? Thanks!

    Read the article

  • Implementing emailing (bulk & event based) features for my website.

    - by Kabeer
    Hello. For my upcoming social networking website, I am looking for suggestions on the best way to implement emailing. Here are some of my requirements and constraints: Requirements: - Should be able to send emails based on events (new registrations, change password, etc.), promotions (advertisements based on user consent), bulk mails (newsletters), reminders (profile updates), etc. I hope I got the point through. - Should be able to process faults (incorrect email address, mail-box full, etc) - User initiated invites (inviting friends to connect) Constraints: - As of now I am looking at Godaddy for hosting. Subsequently I shall move to, may be Amazon Cloud. Godaddy seems to be excruciatingly conservative (not bad always) when it comes to the ability to send email. - My tests on Godaddy so far have been discouraging. There is limit to no. of emails I can send and sometimes if emails carries special characters it throws strange exceptions like there was a virus affected attachment (even though I hadn't attached a thing). The replies from Godaddy support have been equally funny. My intent is not to portray Godaddy as wrong but I am looking for a work-around that frees me from said constraints. I am looking for a mechanism / service that is either free of very cost effective. I wonder how other sites address this. Mine is a .Net / Windows based application.

    Read the article

  • How to properly diagram lambda expressions or traversals through them in Architecture Explorer?

    - by MainMa
    I'm exploring a piece of code in Architecture Explorer in Visual Studio 2010 to study the relations between methods. I noticed a strange behavior. Take the following source code. It generates a hello message based on a template and a template engine, the template engine being a method (a sort of strategy pattern simplified at a maximum for demo purposes). public string GenerateHelloMessage(string personName) { return this.ApplyTemplate( this.DefaultTemplateEngine, this.GenerateLocalizedHelloTemplate(), personName); } private string GenerateLocalizedHelloTemplate() { return "Hello {0}!"; } public string ApplyTemplate( Func<string, string, string> templateEngine, string template, string personName) { return templateEngine(template, personName); } public string DefaultTemplateEngine(string template, string personName) { return string.Format(template, personName); } The graph generated from this code is this one: Change the first method from this: public string GenerateHelloMessage(string personName) { return this.ApplyTemplate( this.DefaultTemplateEngine, this.GenerateLocalizedHelloTemplate(), personName); } to this: public string GenerateHelloMessage(string personName) { return this.ApplyTemplate( (a, b) => this.DefaultTemplateEngine(a, b), this.GenerateLocalizedHelloTemplate(), personName); } and the graph becomes: While semantically identical, those two versions of code produce different dependency graphs, and Architecture Explorer shows no trace of the lambda expression (while Visual Studio's code coverage, for example, shows them, as well as Code analysis seems to be able to understand that the link exists). How would it be possible, without changing the source code, to: Either force Architecture Explorer to display everything, including lambda expressions, Or make it traverse lambda expressions while drawing a dependency through them (so in this case, drawing the dependency from GenerateHelloMessage to DefaultTemplateEngine in the second example)?

    Read the article

  • jqGrid multi-checkbox custom edittype solution

    - by gsiler
    For those of you trying to understand jqGrid custom edit types ... I created a multi-checkbox form element, and thought I'd share. This was built using version 3.6.4. If anyone has a more efficient solution, please pass it on. Within the colModel, the appropriate edit fields look like this: edittype:'custom' editoptions:{ custom_element:MultiCheckElem, custom_value:MultiCheckVal, list:'Check1,Check2,Check3,Check4' } Here are the javascript functions (BTW, It also works – with some modifications – when the list of checkboxes is in a DIV block): //———————————————————— // Description: // MultiCheckElem is the "custom_element" function that builds the custom multiple check box input // element. From what I have gathered, jqGrid calls this the first time the form is launched. After // that, only the "custom_value" function is called. // // The full list of checkboxes is in the jqGrid "editoptions" section "list" tag (in the options // parameter). //———————————————————— function MultiCheckElem( value, options ) { //———- // for each checkbox in the list // build the input element // set the initial "checked" status // endfor //———- var ctl = ''; var ckboxAry = options.list.split(','); for ( var i in ckboxAry ) { var item = ckboxAry[i]; ctl += '<input type="checkbox" '; if ( value.indexOf(item + '|') != -1 ) ctl += 'checked="checked" '; ctl += 'value="' + item + '"> ' + item + '</input><br />&nbsp;'; } ctl = ctl.replace( /<br />&nbsp;$/, '' ); return ctl; } //———————————————————— // Description: // MultiCheckVal is the "custom_value" function for the custom multiple check box input element. It // appears that jqGrid invokes this function the first time the form is submitted and, the rest of // the time, when the form is launched (action = set) and when it is submitted (action = 'get'). //———————————————————— function MultiCheckVal(elem, action, val) { var items = ''; if (action == 'get') // the form has been submitted { //———- // for each input element // if it's checked, add it to the list of items // endfor //———- for (var i in elem) { if (elem[i].tagName == 'INPUT' && elem[i].checked ) items += elem[i].value + ','; } // items contains a comma delimited list that is returned as the result of the element items = items.replace(/,$/, ''); } else // the form is launched { //———- // for each input element // based on the input value, set the checked status // endfor //———- for (var i in elem) { if (elem[i].tagName == 'INPUT') { if (val.indexOf(elem[i].value + '|') == -1) elem[i].checked = false; else elem[i].checked = true; } } // endfor } return items; }

    Read the article

  • Table filtering in jquery - a more elegant solution please

    - by Neil Burton
    I want to filter certain rows out of a table and am using classes to categorise the rows. The below code enables me to show and hide row data categorised as "QUO" and "CAL" (eventually there will be other categories. Can someone point me towards a more elegant solution, so I don't have to duplicate code for each category as I have below? Thanks! <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <html> <head> <title>Untitled</title> <style> </style> <script src="Javascript/jquery-1.4.2.min.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function () { $("#toggle_ac_cal").click(function() { var checked_status = this.checked; if (checked_status==true) { $(".ac_cal").show() } else { $(".ac_cal").hide() } }); $("#toggle_ac_quo").click(function() { var checked_status = this.checked; if (checked_status==true) { $(".ac_quo").show() } else { $(".ac_quo").hide() } }); }); </script> </head> <body> <input type="checkbox" id="toggle_ac_cal" checked="checked" />CAL<br/> <input type="checkbox" id="toggle_ac_quo" checked="checked" />QUO<br/> <table> <tbody> <tr class="ac_cal"> <td>CAL</td> <td>10 Oct</td> <td>John Barnes</td> </tr> <tr class="ac_cal"> <td>CAL</td> <td>10 Oct</td> <td>Neil Burton</td> </tr> <tr class="ac_quo"> <td>QUO</td> <td>11 Oct</td> <td>Neil Armstrong</td> </tr> </tbody> </table> </body> </html>

    Read the article

  • Marshal.PtrToStructure (and back again) and generic solution for endianness swapping

    - by cgyDeveloper
    I have a system where a remote agent sends serialized structures (from and embedded C system) for me to read and store via IP/UDP. In some cases I need to send back the same structure types. I thought I had a nice setup using Marshal.PtrToStructure (receive) and Marshal.StructureToPtr (send). However, a small gotcha is that the network big endian integers need to be converted to my x86 little endian format to be used locally. When I'm sending them off again, big endian is the way to go. Here are the functions in question: private static T BytesToStruct<T>(ref byte[] rawData) where T: struct { T result = default(T); GCHandle handle = GCHandle.Alloc(rawData, GCHandleType.Pinned); try { IntPtr rawDataPtr = handle.AddrOfPinnedObject(); result = (T)Marshal.PtrToStructure(rawDataPtr, typeof(T)); } finally { handle.Free(); } return result; } private static byte[] StructToBytes<T>(T data) where T: struct { byte[] rawData = new byte[Marshal.SizeOf(data)]; GCHandle handle = GCHandle.Alloc(rawData, GCHandleType.Pinned); try { IntPtr rawDataPtr = handle.AddrOfPinnedObject(); Marshal.StructureToPtr(data, rawDataPtr, false); } finally { handle.Free(); } return rawData; } And a quick example structure that might be used like this: byte[] data = this.sock.Receive(ref this.ipep); Request request = BytesToStruct<Request>(ref data); Where the structure in question looks like: [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)] private struct Request { public byte type; public short sequence; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)] public byte[] address; } What (generic) way can I swap the endianness when marshalling the structures? My need is such that the locally stored 'public short sequence' in this example will be little-endian for displaying to the user. I don't want to have to swap the endianness on a structure-specific way. My first thought was to use Reflection, but I'm not very familiar with that feature. Also, I hoped that there would be a better solution out there that somebody could point me towards. Thanks in advance :)

    Read the article

  • PERL newbie : get a proper minimal debug_mode solution

    - by Michael Mao
    Hi all: I am learning PERL in a "head-first" manner. I am absolutely a newbie in this language: I am trying to have a debug_mode switch from CLI which can be used to control how my script works, by switching certain subroutines "on and off". And below is what I've got so far: #!/usr/bin/perl -s -w # purpose : make subroutine execution optional, # which is depending on a CLI switch flag use strict; use warnings; use constant DEBUG_VERBOSE => "v"; use constant DEBUG_SUPPRESS_ERROR_MSGS => "s"; use constant DEBUG_IGNORE_VALIDATION => "i"; use constant DEBUG_SETPPING_COMPUTATION => "c"; our ($debug_mode); mainMethod(); sub mainMethod # () { if(!$debug_mode) { print "debug_mode is OFF\n"; } elsif($debug_mode) { print "debug_mode is ON\n"; } else { print "OMG!\n"; exit -1; } checkArgv(); printErrorMsg("Error_Code_123", "Parsing Error at..."); verbose(); } sub checkArgv #() { print ("Number of ARGV : ".(1 + $#ARGV)."\n"); } sub printErrorMsg # ($error_code, $error_msg, ..) { if(defined($debug_mode) && !($debug_mode =~ DEBUG_SUPPRESS_ERROR_MSGS)) { print "You can only see me if -debug_mode is NOT set". " to DEBUG_SUPPRESS_ERROR_MSGS\n"; die("terminated prematurely...\n") and exit -1; } } sub verbose # () { if(defined($debug_mode) && ($debug_mode =~ DEBUG_VERBOSE)) { print "Blah blah blah...\n"; } } So far as I can tell, at least it works...: the -debug_mode switch doesn't interfere with normal ARGV the following commandlines work: ./optional.pl ./optional.pl -debug_mode ./optional.pl -debug_mode=v ./optional.pl -debug_mode=s However, I am puzzled when multiple debug_modes are "mixed", such as: ./optional.pl -debug_mode=sv ./optional.pl -debug_mode=vs I don't understand why the above lines of code "magically works". I see both of the "DEBUG_VERBOS" and "DEBUG_SUPPRESS_ERROR_MSGS" apply to the script, which is fine in this case. However, if there are some "conflicting" debug modes, I am not sure how to set the "precedence of debue_modes"? Also, I am not certain if my approach is good enough to Perlists and I hope I am getting my feet in the right direction. One biggest problem is that I now put if statements inside most of my subroutines for controlling their behavior under different modes. Is this okay? Is there a more elegant way? I know there must be a debug module from CPAN or elsewhere, but I wanna a real minimal solution that doesn't depend on any other module than the "default" And I cannot have any control on the environment where this script will be executed... Many thanks to the suggestions in advance.

    Read the article

  • Reducing Integer Fractions Algorithm - Solution Explanation?

    - by Andrew Tomazos - Fathomling
    This is a followup to this problem: Reducing Integer Fractions Algorithm Following is a solution to the problem from a grandmaster: #include <cstdio> #include <algorithm> #include <functional> using namespace std; const int MAXN = 100100; const int MAXP = 10001000; int p[MAXP]; void init() { for (int i = 2; i < MAXP; ++i) { if (p[i] == 0) { for (int j = i; j < MAXP; j += i) { p[j] = i; } } } } void f(int n, vector<int>& a, vector<int>& x) { a.resize(n); vector<int>(MAXP, 0).swap(x); for (int i = 0; i < n; ++i) { scanf("%d", &a[i]); for (int j = a[i]; j > 1; j /= p[j]) { ++x[p[j]]; } } } void g(const vector<int>& v, vector<int> w) { for (int i: v) { for (int j = i; j > 1; j /= p[j]) { if (w[p[j]] > 0) { --w[p[j]]; i /= p[j]; } } printf("%d ", i); } puts(""); } int main() { int n, m; vector<int> a, b, x, y, z; init(); scanf("%d%d", &n, &m); f(n, a, x); f(m, b, y); printf("%d %d\n", n, m); transform(x.begin(), x.end(), y.begin(), insert_iterator<vector<int> >(z, z.end()), [](int a, int b) { return min(a, b); }); g(a, z); g(b, z); return 0; } It isn't clear to me how it works. Can anyone explain it? The equivilance is as follows: a is the numerator vector of length n b is the denominator vector of length m

    Read the article

  • Default browser hangs

    - by Craig Hinrichs
    Intermittent hangs would occur when I would use Internet Explorer to open a new main page or new tab to a site I know would be up. The browser would open and say "Waiting for site example.com" and do nothing more. If I closed the window and reopened it it would immediately connect. Over time I would have to close and reopen the window to get to the page. This would happen to any page, including Google. Got sick of it and started using Chrome. I recently upgraded my anti-virus and am now experiencing the same issue with Chrome. I use AVG for my antivirus. Empirically it seems that if I don't make Chrome my default browser I don't experience the issue. I tested this theory for over two hours yesterday. Possible issues I have found this could be but not confirmed yet: MTU settings are not correct. I am infected but my antivirus has not caught it (unlikely but possible) ?? I would like to think this is related to my antivirus but I am unsure how to verify. I don't like the idea of killing my antivirus if #2 is a possibility. I am looking for tips on how I can troubleshoot possible issues.

    Read the article

  • Windows 7 PC cannot see some LAN PCs, but can access them via path

    - by zoot
    In an office LAN, with Windows 7 Professional workstations and a FreeNAS Samba server, 2 workstations have intermittent problems in browsing for the other workstations, as well as the FreeNAS server. However, so far, it appears that typing in the path to any of the workstations which aren't visible via the "browse" function, works. ie. the machine Workstation7 is not visible while browsing via Windows Explorer, but is accessible if I type \\Workstation7 in the path field. Occasionally the workstations exhibiting these symptoms show errors that their connection to the FreeNAS server has failed and only rebooting resolves the issue. All other workstations on the network use identical Windows 7 Professional installations and never have these problems. I've checked all machines and they're not using Home Groups. All are setup on the same WorkGroup as the FreeNAS server and the network type is set to Work Network. Temporarily disabling the firewall on the workstations with the issue made no difference, so I know this has nothing to do with the firewall settings. Any pointers would be appreciated. Thanks.

    Read the article

  • IE9 will not navigate to some websites but Google Chrome can

    - by Storchburp
    Was recommended by a friend to ask for help here. I am using Internet Explorer 9. As of two days ago I was suddenly unable to navigate to any part of the following websites: www.computerandvideogames.com www.deviantart.com www.cnet.com However I can still access all of them normally through Google Chrome. I am on a college network but these sites are also accessible through fixed terminals provided by the school and are definitely not blocked. I do not know of any other sites similarly affected. There is no popup, no error message, no diversion to a site telling me I can't access / am blocked etc. I can be on www.google.com and attempt to access these sites through the URL or google search, and my cursor will just show the little moving blue wheel next to the arrow for a couple of seconds, and the page displayed on my browser will not change; ie. not navigating at all. Running antivirus software, changing proxy settings in IE, clearing cookies, unplugging/plugging in computer, restarting PC etc have not changed the situation. Any assistance or advice would be greatly appreciated. Thanks in advance.

    Read the article

  • how to remove an entry from system tray?

    - by altvali
    I've searched for an answer to this one and I haven't found one yet. How do i remove a single item from Windows' System tray? I'm targeting Windows XP. Edit: This is not about preventing items from starting up. I want the program to keep running, I just need another script/program to remove the first one's entry from system tray. Second Edit: One approach that I can think of is to try to hide the intended app by modifying registry keys. On several test machines I've found some registry entries that match the System tray information at HKEY_USERS\something-that-looks-like S-1-5-21-682003330-1563985344-725345543-1003\Software\Microsoft\Windows\CurrentVersion\Explorer\TrayNotify with BalloonTip, IconStream and PastIconsStream containing systray information. The important one is IconStream. On other machines, these are found at hkey_classes_root/local/setting/software/microsoft/windows/currentversion/TrayNotify I'm quite sure there's no danger in changing those specific registries, but I don't know how to write code for that. Can anyone help me with the code and with confirming if this has the desired effect of hiding the systray icon for an active program?

    Read the article

  • Why are folders disappearing in Windows XP?

    - by XenoFoxx
    I am researching a problem for a friend, and unfortunatly do not have direct access to his computer. I've tried to gather as much information as possible and I have researched it on various websites. I've not found anyone having the same problem my friend is having. So here goes: He has a media server in his home running Microsoft Windows XP. It has 3 drives, 1 for the OS and 2 for mass storage. Not long ago he went to access one of the mass storage media drives and it was empty, except for a single folder. His first assumption was that his roommate had deleted everything on the drive (excluding the remaining folder). He then checked the properties of the drive and it was still saying that the hard drive was nearly full. I told him to check the recycling bin, thinking that whoever deleted them didn't clear them from recycling and that they were still taking up space on the drive. My friend said the recycling bin was empty. So we have a drive that the Windows file management system says is empty (again except for the remaining folder), but the properties of the drive say it's mostly full. Now it gets weirder My friend tried to create a new folder on this drive and it auto-named itself "New Folder(1)" which means that it recognizes there is already a "New Folder" in that directory. He tried to rename it to a name that he KNEW was there previsouly, and Windows wouldn't allow it because it was a duplicate folder name. SO now it seems the folders are there, but not displaying in Windows Explorer. Both of us have no idea why this is occuring, why the folders vanished, why the one remaining folder didn't vanish, or how to make them visable again. Anyone else ever experience this? I can get more details if needed.

    Read the article

  • User Receiving Partial Downloads

    - by JGB146
    Some background: I run a subscription-based poker strategy video website. Our videos range in length from 30 mins up to 80 mins, and in size from 20MB up to 500MB. The site is on a shared server with hostmonster.com One of my users is having problems downloading some of the larger video file. He reports problems with anything over 100MB. Basically, he's only getting part of the file, which means that the video stops before the end. He has tried multiple computers from multiple locations. He reports that he is able to successfully download 500MB files from other sites. He is using Internet Explorer (version unknown) as his browser. I have suggested that he try Firefox or Chrome to see if their download managers work any better for him, but as of yet I have not heard anything back. He has also reported that his downloads do not report any filesize. I see the same thing (no file size reported), but I have not experienced any problems with the downloads themselves. We pass the downloads through a php script which verifies login information and records the download to our database before returning the file. I suspect this is why there is no filesize reported. What else should I ask the user? What other things could he or I try?

    Read the article

  • Java applet class never found

    - by Andrew
    I am having a problem with the java plugins of all three major browsers: chromium, firefox and Internet Explorer. The issue is that applets will always fail to load and yield errors no matter what website or what applet I am trying to use. I can not see any of the example applets on oracle's website; I can not launch the minecraft browser applet; nor can I launch any applet across the web using any browser. I always receive a "class not found:AppletClassHere.class" error. I know that my browser plugin must be working correctly because I can launch the Cisco Nac applet each time I connect to my network and I can launch my own simple applets offline. I am connecting to the internet through a vpn in case that is important. It also seems like a lot of other people I know are having this issue. Re-installing the plugin does not appear to fix the issue. I am asking this question to find out the cause of this problem, and any possible solutions. Thank you.

    Read the article

  • Cannot access drive in Windows 7 after scandisk lockup, but can in safe mode....

    - by Matt Thompson
    I ran scandisk on my external USB drive due to the inability to delete a few files. Windows asked me if I wanted to unmount the drive before the scan, warning me that it would be unusable until the scan was finished, and I said yes. During the scan, my machine locked up, and I was forced to reboot the machine. When it came up, I was unable to access the drive, getting an error that "L:is not accessible, access is denied". Comupter Management sees the drive, and has the proper amount of disk space filled. I booted into safe mode, and can access the drive with no problems, and I noticed that in explorer, all the folders have locks on them. I booted back into windows, but still could not access the drive, getting the same error as above. Hovever, if I right click on the drive, select properties, and go to Customize, in the folder pictures ares, I select Choose File, and a window open up, that shows the root of the directory, with all the folder able to be accessed, but again, the icon is the folder icon with a lock on it. I can even copy files from the drive to another. So, the files are not gone, windows can obviously access the drive no matter what it thinks, so there has to be a problem with the flag windows put on the drive when it ran the original scan that failed. I was able to run a scan both in safe mode with no problems, and in windows. In windows, I received the cannot access error the first time I run scan disk on it, but if I try again, it works fine. Any ideas on how to clear the flag that windows set, so I can access the drive normally again?

    Read the article

< Previous Page | 73 74 75 76 77 78 79 80 81 82 83 84  | Next Page >