Search Results

Search found 976 results on 40 pages for 'josh'.

Page 27/40 | < Previous Page | 23 24 25 26 27 28 29 30 31 32 33 34  | Next Page >

  • Need some help accessing password string / Debugging

    - by Josh Lake
    I'm doing this code for the sole purpose in trying out how to get the password field masked. Any suggestions on where to go next? #include <iostream> #include <cmath> #include <stdio.h> #include <cstring> #include <conio.h> using namespace std; inline void keep_window_open() { char ch; cin>>ch; } int main() { cout << "Welcome to the Classified Network, DOD842349729961971\n"; cout << "Username: \n"; string admin = "gardinerca"; string root_password = "password1"; string full_name = "User Name"; string name; cin >> name; if (name == admin) { printf("Password: "); char password[10]; int i; for (i = 0; i <= 10; i++) { int c = getch(); if (c == '\n' || c == EOF) break; password[i] = c; printf("*"); } password[i] = '\0'; if (strcmp(password, root_password) == 0) { system("CLS"); cout << "Welcome " << full_name << " to the Classified Network\n"; cout << "Would you like to play a game? (Y or N)\n"; string play_game; cin >> play_game; if (play_game == "Y") { cout << "How many balls can you stick in your mouth?\n"; int balls; cin >> balls; string one; string two; one = "One Ball"; two = "Two Ball's"; if (balls == 1) cout << "You can honestly stick " << one << " in your mouth?"; } else { cout << "You have selected the No Option. Thats fine...we don't want to play with you either\n"; } } else { cout << "Invaild Password. Please contact system administrator.\n"; cin.clear(); system ("PAUSE"); } else { cout << "No Username found. Please contact system administrator.\n"; cin.clear(); system ("PAUSE"); } return 0; }

    Read the article

  • How to skip to next iteration in jQuery.each() util?

    - by Josh
    I'm trying to iterate through an array of elements. jQuery's documentation says: jquery.Each() documentation Returning non-false is the same as a continue statement in a for loop, it will skip immediately to the next iteration. I've tried calling 'return non-false;' and 'non-false;' (sans return) neither of which skip to the next iteration. Instead, they break the loop. What am i missing?

    Read the article

  • I asked this yesterday, after the input given I'm still having trouble implementing..

    - by Josh
    I'm not sure how to fix this or what I did wrong, but whenever I enter in a value it just closes out the run prompt. So, seems I do have a problem somewhere in my coding. Whenever I run the program and input a variable, it always returns the same answer.."The content at location 76 is 0." On that note, someone told me that "I don't know, but I suspect that Program A incorrectly has a fixed address being branched to on instructions 10 and 11." - mctylr but I'm not sure how to fix that.. I'm trying to figure out how to incorporate this idea from R Samuel Klatchko.. I'm still not sure what I'm missing but I can't get it to work.. const int OP_LOAD = 3; const int OP_STORE = 4; const int OP_ADD = 5; ... const int OP_LOCATION_MULTIPLIER = 100; mem[0] = OP_LOAD * OP_LOCATION_MULTIPLIER + ...; mem[1] = OP_ADD * OP_LOCATION_MULTIPLIER + ...; operand = memory[ j ] % OP_LOCATION_MULTIPLIER; operation = memory[ j ] / OP_LOCATION_MULTIPLIER; I'm new to programming, I'm not the best, so I'm going for simplicity. Also this is an SML program. Anyway, this IS a homework assignment and I'm wanting a good grade on this. So I was looking for input and making sure this program will do what I'm hoping they are looking for. Anyway, here are the instructions: Write SML (Simpletron Machine language) programs to accomplish each of the following task: A) Use a sentinel-controlled loop to read positive number s and compute and print their sum. Terminate input when a neg number is entered. B) Use a counter-controlled loop to read seven numbers, some positive and some negative, and compute + print the avg. C) Read a series of numbers, and determine and print the largest number. The first number read indicates how many numbers should be processed. Without further a due, here is my program. All together. int main() { const int READ = 10; const int WRITE = 11; const int LOAD = 20; const int STORE = 21; const int ADD = 30; const int SUBTRACT = 31; const int DIVIDE = 32; const int MULTIPLY = 33; const int BRANCH = 40; const int BRANCHNEG = 41; const int BRANCHZERO = 41; const int HALT = 43; int mem[100] = {0}; //Making it 100, since simpletron contains a 100 word mem. int operation; //taking the rest of these variables straight out of the book seeing as how they were italisized. int operand; int accum = 0; // the special register is starting at 0 int j; // This is for part a, it will take in positive variables in a sent-controlled loop and compute + print their sum. Variables from example in text. memory [0] = 1010; memory [01] = 2009; memory [02] = 3008; memory [03] = 2109; memory [04] = 1109; memory [05] = 4300; memory [06] = 1009; j = 0; //Makes the variable j start at 0. while ( true ) { operand = memory[ j ]%100; // Finds the op codes from the limit on the memory (100) operation = memory[ j ]/100; //using a switch loop to set up the loops for the cases switch ( operation ){ case 10: //reads a variable into a word from loc. Enter in -1 to exit cout <<"\n Input a positive variable: "; cin >> memory[ operand ]; break; case 11: // takes a word from location cout << "\n\nThe content at location " << operand << "is " << memory[operand]; break; case 20:// loads accum = memory[ operand ]; break; case 21: //stores memory[ operand ] = accum; break; case 30: //adds accum += mem[operand]; break; case 31: // subtracts accum-= memory[ operand ]; break; case 32: //divides accum /=(memory[ operand ]); break; case 33: // multiplies accum*= memory [ operand ]; break; case 40: // Branches to location j = -1; break; case 41: //branches if acc. is < 0 if (accum < 0) j = 5; break; case 42: //branches if acc = 0 if (accum == 0) j = 5; break; case 43: // Program ends exit(0); break; } j++; } return 0; }

    Read the article

  • How to nest a Location directive inside a virtual host config?

    - by Josh
    I am trying nest a Location directive inside a virtual host config like this: <VirtualHost *:80> ServerName mysite.com DocumentRoot /home/deployer/apps/mysite/current/public ErrorLog /var/log/prod.log <Location "/shop"> DocumentRoot /home/deployer/apps/mysite_shop/current/public ErrorLog /var/log/prod.log </Location> </VirtualHost> What I want to do is go to mysite.com/shop, and point it to another application. Is this possible? Is there another method of doing this? I get an error because apparently Location directives do not accept DocumentRoot. Thanks.

    Read the article

  • are fixtures loaded when using the sql dump to create a test database

    - by Josh Moore
    Because of some non standard table creation options I am forced to use the sql dump instead of the standard schema.rb (i.e. I have uncommented this line in the environment.rb config.active_record.schema_format = :sql). I have noticed that when I use the sql dump that my fixtures do not seem to be loaded into the database. Some data is loaded into it but, I am not sure where it is coming from. Is this normal? and if it is normal can anybody tell me where this other data is coming from?

    Read the article

  • Splitting PDF to png

    - by Josh Crowder
    I'm using paperclip to upload a pdf. Once the file is uploaded I need to split every page into a png. This is the command I think I need to use convert -size 640x300 fileName.pdf slide.png Now if I run that command from terminal it works fine, but I need a way of getting each slides name so I can add it into a model. What's the best way to achieve this?

    Read the article

  • Something Better than .NET Reflector?

    - by Josh Stodola
    I used to love Reflector back in the day, but ever since RedGate took over it has gone downhill dramatically. Now it forces me to update (which is absolutely ridiculous), half the time the update doesn't go smoothly, and it is increasingly hindering my productivity with each update. I am sick of it, and I am ready for something better. Does anybody know of a better disassembler?

    Read the article

  • Loading .sql files from within PHP

    - by Josh Smeaton
    I'm creating an installation script for an application that I'm developing and need to create databases dynamically from within PHP. I've got it to create the database but now I need to load in several .sql files. I had planned to open the file and mysql_query it a line at a time - until I looked at the schema files and realised they aren't just one query per line. So, please.. how do I load an sql file from within PHP? (as phpMyAdmin does with it's import command).

    Read the article

  • continuous integration web service

    - by Josh Moore
    I am in a position where I could become a team leader of a team distributed over two countries. This team would be the tech. team for a start up company that we plan to bootstrap on limited funds. So I am trying to find out ways to minimize upfront expenses. Right now we are planning to use Java and will have a lot of junit tests. I am planing on using github for VCS and lighthouse for a bug tracker. In addition I want to add a continuous integration server but I do not know of any continuous integration servers that are offered as a web service. Does anybody know if there are continuous integration servers available in a software as a service model? P.S. if anybody knows were I can get these three services at one location that would be great to know to.

    Read the article

  • Changing the onClick area when adding an event

    - by Josh Breslow
    Is there anyway to change what a user clicks on to add an event? Right now the entire day is clickable. This becomes an issue when the user needs to put focus back on that window, requiring a mouse click. If they click on the calendar, which takes up most of the page, then they launch the "Add Event" function. Is there a way to have a Plus sign (+), or whatever symbol in each day that when clicked, launches the "Add Event" function? Or... Is there a way to have a button across the top that said, "Add Event"?

    Read the article

  • how to write a script that logs into an application and checks a page

    - by josh
    Is it possible to write a script that will login to an application using uname/pwd? the username/password are not passed in through POST (they dont come in the URL) Basic steps I am looking for are: Visit url enter uname/pwd click a button click a link get the raw html to make sure it does not have 500 error Is that possible to do in any language? Please point me to some examples as well

    Read the article

  • How to read a (SharePoint) custom web part property before the page loads?

    - by Josh
    I have a custom web part in SharePoint that has one property. Here is it: // Specify report path private string _report_path = string.Empty; [WebBrowsable(true), Personalizable(true), WebDisplayName("Enter Path"), WebDescription("Embeds an OBIEE Report in the portal"), SPWebCategoryName("Report")] public string ReportPath { get { return _report_path; } set { _report_path = value; } } The problem is that, I have to refresh the page manually a second time for the property to get set. Apparently, I need to put the method inside a PreRender event. Does anyone know how I can do this? Thanks.

    Read the article

  • Problem using js jquery helper

    - by Josh R
    hi, I am using cakephp 1.3.6 and am trying to use inbuilt js helper. I have added var $helpers = array('Js' => array('Jquery')); in my controller. In my layout, I have included the jquery files and have also included echo $this->Js->writeBuffer(); before the </body> tag. I checked if the jquery libraries correctly but trying to create a simple accordian from the jqueryui.com, it works fine. But when I try <?php $this->Js->get('#element'); $this->Js->drag(array( 'container' => '#content', 'start' => 'onStart', 'drag' => 'onDrag', 'stop' => 'onStop', 'snapGrid' => array(10, 10), 'wrapCallbacks' => false )); ?> <div="element">something</div> It does not work. I appreciate any help. Thanks.

    Read the article

  • GORM "getNextException" equivalent

    - by Josh K
    GORM sits on top of [Hibernate](http://en.wikipedia.org/wiki/Hibernate_(Java). The issue is that sometimes Hibernate will throw exceptions from the JDBC driver that I can't figure out how to investigate. Specifically: Could not execute JDBC batch update; /* snip */ Caused by: java.sql.BatchUpdateException: /* snip */ [insert] was aborted. Call getNextException to see the cause. If it makes any difference I'm using PostgreSQL.

    Read the article

  • JumpLists Not Working in C# App

    - by Josh M.
    Hi, I'm trying to use the Recent and Frequent JumpLists in my C# app. I'm using the Windows API Codepack v1.1 (http://code.msdn.microsoft.com/WindowsAPICodePack). I initialize the JumpLists every time the app starts and I AddRecent() to the JumpList every time I open a project in the app. Something is missing becuase the JumpLists are simply not showing up when you right click the app's icon in the Taskbar. I got one file to show up once but that's it! Initialization: private void InitializeJumpLists() { if (TaskbarManager.IsPlatformSupported) { JumpList recentJumpList = null; JumpList frequentJumpList = null; TaskbarManager.Instance.ApplicationId = Application.ProductName; recentJumpList = JumpList.CreateJumpList(); recentJumpList.KnownCategoryToDisplay = JumpListKnownCategoryType.Recent; recentJumpList.Refresh(); frequentJumpList = JumpList.CreateJumpList(); frequentJumpList.KnownCategoryToDisplay = JumpListKnownCategoryType.Frequent; frequentJumpList.Refresh(); } } Opening the Project: private void OpenProject(string path, bool isFromRecentFilesList) { DialogResult result = ConfirmProjectClosing(); if (result == DialogResult.Yes) Save(); else if (result == DialogResult.Cancel) return; using (new Wait()) { //Code here opens the project, etc. //Try to add the file to the Jump List. if (TaskbarManager.IsPlatformSupported) JumpList.AddToRecent(path); //Code here finished up. } } What am I missing?

    Read the article

  • Replacing all GUIDs in a file with new GUIDs from the command line

    - by Josh Petrie
    I have a file containing a large number of occurrences of the string Guid="GUID HERE" (where GUID HERE is a unique GUID at each occurrence) and I want to replace every existing GUID with a new unique GUID. This is on a Windows development machine, so I can generate unique GUIDs with uuidgen.exe (which produces a GUID on stdout every time it is run). I have sed and such available (but no awk oddly enough). I am basically trying to figure out if it is possible (and if so, how) to use the output of a command-line program as the replacement text in a sed substitution expression so that I can make this replacement with a minimum of effort on my part. I don't need to use sed -- if there's another way to do it, such as some crazy vim-fu or some other program, that would work as well -- but I'd prefer solutions that utilize a minimal set of *nix programs since I'm not really on *nix machines. To be clear, if I have a file like this: etc etc Guid="A" etc etc Guid="B" I would like it to become this: etc etc Guid="C" etc etc Guid="D" where A, B, C, D are actual GUIDs, of course. (for example, I have seen xargs used for things similar to this, but it's not available on the machines I need this to run on, either. I could install it if it's really the only way, although I'd rather not)

    Read the article

  • Killing the mysqld process

    - by Josh K
    I have a table with ~800k rows. I ran an update users set hash = SHA1(CONCAT({about eight fields})) where 1; Now I have a hung Sequel Pro process and I'm not sure about the mysqld process. This is two questions: What harm can possibly come from killing these programs? I'm working on a separate database, so no damage should come to other databases on the system, right? Assume you had to update a table like this. What would be a quicker / more reliable method of updating without writing a separate script. I just checked with phpMyAdmin and it appears as though the query is complete. I still have Sequel Pro using 100% of both my cores though...

    Read the article

  • Big, Thick Reference Books (PHP / MySQL / Unix) [closed]

    - by Josh K
    I'm looking for in-depth reference books / guides in PHP, MySQL, and Unix. I'm aware there other other questions pertaining to good books for short references of function names, or detailed beginner guides to these systems. I'm looking for something different. I want a book that I can either use as a quick but in-depth (decent write up, not a pocket reference guide) reference to common functions (JOINS, string manipulation, Regular Expressions, etc) while also providing a detailed inner workings explanation on the system itself.

    Read the article

  • Connecting ipad to external monitor

    - by Josh P.
    I am trying to connect my ipad app to an external screen using the following (not checking the correct resolution for no - just want it up and running). - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [window addSubview:[navigationController view]]; if ([[UIScreen screens] count] > 1) { window.screen = [[UIScreen screens] objectAtIndex:1]; } [window makeKeyAndVisible]; return YES; } Is this supposed to redirect everything to the external monitor? How dows it work with touches/gestures? I see in the Apple apps, the controls etc are left on the ipad screen...

    Read the article

  • regex preg_match|preg_match_all in php

    - by Josh
    I'm trying to come up with a regex that constructs an array that looks like the one below, from the following string $str = 'Hello world [something here]{optional}{optional}{optional}{n possibilities of this}'; So far I have /^(\*{0,3})(.+)\[(.*)\]((?:{[a-z ]+})?)$/ Array ( [0] => Array ( [0] => Hello world [something here]{optional}{optional}{optional}{n possibilities of this} [1] => [2] => Hello world [3] => something here [4] => {optional} [5] => {optional} [6] => {optional} [7] => ... [8] => ... [9] => {n of this} ) ) What would be a good approach for this? Thanks

    Read the article

  • Getting IBindingList Property to sort by

    - by Josh
    I've got a class called DatagridBoundList that implements CollectionBase and IBindingList. The implementation of IBindingList.ApplySort looks like this so far: void IBindingList.ApplySort(PropertyDescriptor property, ListSortDirection direction) { throw new NotSupportedException(); } I'm binding the DatagridBoundList to a DataGridView (winforms). When I reflect over the property parameter, I can't seem to find the name of the actual property that the list needs to be sorted by. What's the trick to finding out the name of the property to sort by?

    Read the article

  • Fluent Nhibernate - Mapping child in parent when Child has reference to parent and not using a list

    - by Josh
    I have a child object in the database that looks like this: CREATE TABLE Child ( ChildId uniqueidentifier not null, ParentId uniqueidentifier not null ) An then I have a parent like so. CREATE TABLE Parent ( ParentId uniqueidentifier not null ) Now, the problem is that in my Parent class, I have public virtual Child Child { get; set; } I've tried references, hasone, referencesany and can't seem to get the mapping right. Anyone have any ideas? Thanks,

    Read the article

  • PHP with Javascript: Email confirmation script not working

    - by Josh K
    Hey Heres what i got: echo "<script type=\"text/javascript\"> function finishForm() { var answer = confirm('Are you sure these are the teams you want to enter with?'); if (answer) { if(document.getElementByID(emailconfirm).value == ".$_SESSION[Email].") { form.action=\"esubmit.php\"; form.submit(); } else { alert('E-mail address do not match'); return false; } } } function restartForm() { var answer = confirm('Are you sure you want to start over?'); if (answer) { form.action=\"e1.php\"; form.submit(); } } </script>"; I have a regular button calling this function. emailconfirm is a text input. I want to confirm that they have chosen the right teams, then check if the email in the session and the email confirmation text match. If they do match Then i want to submit the form. If they dont match, I want to alert the user they dont match, and just return to page so user can check emails and then resubmit. This script is in my header. EDIT: Haha sorry i submitted one before and it didnt go through, forgot to add my problem!! When you click the button it comes up with the confirmation, clicking either yes or no doesnt do anything. The alert doesnt pop up if they dont match and if they do match it doesnt submit. Also it might be good to note I had it without the email confirmation if statement and it worked fine (going to the submit page)

    Read the article

< Previous Page | 23 24 25 26 27 28 29 30 31 32 33 34  | Next Page >