Search Results

Search found 3479 results on 140 pages for 'chris cyvas'.

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

  • KSH shell script won't execute and returns 127 (not found)

    - by Chris Knight
    Can anyone enlighten me why the following won't work? $ groups staff btgroup $ ls -l total 64 -rw-rw---- 1 sld248 btgroup 26840 Apr 02 13:39 padaddwip.jks -rwxrwx--- 1 sld248 btgroup 1324 Apr 02 13:39 padaddwip.ksh $ ./padaddwip.ksh ksh: ./padaddwip.ksh: not found. $ echo $? 127 This is nearly identical to another script which works just fine. I can't see any differences between the two in terms of permissions or ownership. thanks in advance!

    Read the article

  • how to reuse subquery result in mysql

    - by chris
    I'm doing a statistic job like this: SUM |COND1 |COND2 |... -------------------------- 100 |80 | 70 |... The SUM result is calculated from multiple tables, and the CONDs are subset of that. I wrote a sql like this: select tmp1.id,sum,cond1,cond2 as count from ( select id, count(*) as sum from table_1 group by table1.id) tmp1 left join ( select id, count(*) as cond1 from table1 where condition1 group by table1.id) tmp2 on tmp1.id=tmp2.id left join ( select id, count(*) as cond2 from table1 where condition2 group by table1.id) tmp3 on tmp1.id=tmp3.id the problem is that this is very poor efficiency, it will be better if i could use the result of tmp1, but i don't know how to do that. update: simplified the sql, what i mean is how to reuse the first select result of table_1

    Read the article

  • ctypes and pointer manipulation

    - by Chris
    I am dealing with image buffers, and I want to be able to access data a few lines into my image for analysis with a c library. I have created my 8-bit pixel buffer in Python using create_string_buffer. Is there a way to get a pointer to a location within that buffer without re-creating a new buffer? My goal is to analyze and change data within that buffer in chunks, without having to do a lot of buffer creation and data copying. In this case, ultimately, the C library is doing all the manipulation of the buffer, so I don't actually have to change values within the buffer using Python. I just need to give my C function access to data within the buffer.

    Read the article

  • How to use JQuery to set the value of 2 html form select elements depending on the value of another

    - by Chris Stevenson
    My Javascript and JQuery skills are poor at best and this is ** I have the following three elements in a form : <select name="event_time_start_hours"> <option value="blank" disabled="disabled">Hours</option> <option value="blank" disabled="disabled">&nbsp;</option> <option value="01">1</option> <option value="02">2</option> <option value="03">3</option> <option value="04">4</option> <option value="05">5</option> <option value="06">6</option> <option value="07">7</option> <option value="08">8</option> <option value="09">9</option> <option value="10">10</option> <option value="11">11</option> <option value="12">12</option> <option value="midnight">Midnight</option> <option value="midday">Midday</option> </select> <select name="event_time_start_minutes"> <option value="blank" disabled="disabled">Minutes</option> <option value="blank" disabled="disabled">&nbsp;</option> <option value="00">00</option> <option value="15">15</option> <option value="30">30</option> <option value="45">45</option> </select> <select name="event_time_start_ampm"> <option value="blank" disabled="disabled">AM / PM</option> <option value="blank" disabled="disabled">&nbsp;</option> <option value="am">AM</option> <option value="pm">PM</option> </select> Quite simply, when either 'midnight' or 'midday' is selected in "event_time_start_hours", I want the values of "event_time_start_minutes" and "event_time_start_ampm" to change to "00" and "am" respectively. My VERY poor piece of Javascript says this so far : $(document).ready(function() { $('#event_time_start_hours').change(function() { if($('#event_time_start_hours').val('midnight')) { $('#event_time_start_minutes').val('00'); } }); }); ... and whilst I'm not terribly surprised it doesn't work, I'm at a loss as to what to do next. I want to do this purely for visual reasons for the user as when the form submits I ignore the "minutes" and "am/pm". I'm trying to decide whether it would be best to change the selected values, change the selected values and then disable the element or hide them altogether. However, without any success in getting anything to happen at all I haven't been able to try the different approaches to see what feels right. I've ruled out the obvious things like a duplicate element ID or simply not linking to JQuery. Thank you.

    Read the article

  • Django queries: Count number of objects with FK to model instance

    - by Chris Lawlor
    This should be easy but for some reason I'm having trouble finding it. I have the following: App(models.Model): ... Release(models.Model): date = models.DateTimeField() App = models.ForeignKey(App) ... How can I query for all App objects that have at least one Release? I started typing: App.objects.all().annotate(release_count=Count('??????')).filter(release_count__gt=0) Which won't work because Count doesn't span relationships, at least as far as I can tell. BONUS: Ultimately, I'd also like to be able to sort Apps by latest release date. I'm thinking of caching the latest release date in the app to make this a little easier (and cheaper), and updating it in the Release model's save method, unless of course there is a better way. Edit: I'm using Django 1.1 - not averse to migrating to dev in anticipation of 1.2 if there is a compelling reason though.

    Read the article

  • subgraph cluster ranking in dot

    - by Chris Becke
    I'm trying to use graphviz on media wiki as a documentation tool for software. First, I documented some class relationships which worked well. Everything was ranked vertically as expected. But, then, some of our modules are dlls, which I wanted to seperate into a box. When I added the nodes to a cluster, they got edged, but clusters seem to have a LR ranking rule. Or being added to a cluster broke the TB ranking of the nodes as the cluster now appears on the side of the graph. This graph represents what I am trying to do: at the moment, cluster1 and cluster2 appear to the right of cluster0. I want/need them to appear below. <graphviz> digraph d { subgraph cluster0 { A -> {B1 B2} B2 -> {C1 C2 C3} C1 -> D; } subgraph cluster1 { C2 -> dll1_A; dll1_A -> B1; } subgraph cluster2 { C3 -> dll2_A; } dll1_A -> dll2_A; } </graphviz>

    Read the article

  • Facebook Connect showPermissionDialog callback fires before user can even see the dialog

    - by Chris Hiester
    I'm doing a Facebook Connect integration for a site and when the user logs in, I need to ask for some permissions so I use FB.Connect.showPermissionDialog. I use its callback to see if permissions were granted. If they are granted, I want to submit the form. Here's what my code looks like: $("#form3").live("submit", function() { FB.Connect.showPermissionDialog('email, offline_access', function(perms) { if (!perms) { location.href="http://www.mysite.com/logout/"; return false; } else { save_session(); } }); }); The problem is that the form submits before the user can even see the permission dialog. Has anyone seen this before?

    Read the article

  • ASP.Net User Control Template Instantiation

    - by Chris
    Hi, I created a user control that has a template container. <cc:SearchResultItem ID="SearchResultItem1" Customer='<%# ((Customer)(((RepeaterItem)Container).DataItem)) %>' runat="server"> <NameTemplate> <%# Container.Name %> </NameTemplate> </cc:SearchResultItem> This is control is placed in a repeater which lists some customers. The customer is than bound to the user control. When the name template is instantiated in the container, the customer object is not yet available, but I need to access its name because it needs to get parsed before. protected void Page_Init(object sender, EventArgs e) { if (nameTemplate != null ) { // customer is null here, it is avaiable only after Page_Init... NameContainer container = new NameContainer(customer.Id, Parse(customer.Name)); nameTemplate.InstantiateIn(container); placeHolder.Controls.Add(container); } } Question: How can I access properties set for the user control BEFORE the template container is instantiated? Thanks in advance!

    Read the article

  • SQL Server 2008 Geography .STBuffer() distance measurement units

    - by Chris
    I'm working with a geographic point using lat/long and need to find other points in our database within a 5 mile radius of that point. However, I can't seem to find out what the "units" are for STBuffer, it doesn't seem to conform to feet, miles, meters, kilometers, etc. The documentation only refers to them as "units", any suggestions? Thanks [...] from geography::STGeomFromText('POINT(x y)', 4326).STBuffer(z).STIntersects(geography::STGeomFromText('POINT(' + CAST(v.Longitude as varchar(max)) + ' ' + CAST(v.Latitude as varchar(max)) + ')', 4326)) = 1

    Read the article

  • Converting time to Military

    - by Chris
    Maybe I'm seeing things.. In an attempt to turn a date with a format of "mm/dd/yyyy hh:mm:ss PM" into military time, the following replacement of a row value does not seem to take. Even though I am sure I have done this before (with column values other than dates). Is there some reason that row["adate"] would not accept a value assigned to it in this case? DateTime oos = DateTime.Parse(row["adate"].ToString()); row["adate"] = oos.Month.ToString() + "/" + oos.Day.ToString() + "/" + oos.Year.ToString() + " " + oos.Hour.ToString() + ":" + oos.Minute.ToString();

    Read the article

  • How do I get netcat to accept connections from outside the LAN?

    - by Chris
    I'm using netcat as a backend to shovel data back and forth for a program I'm making. I tested my program on the local network, and once it worked I thought it would be a matter of simply forwarding a port from my router to have my program work over the internet. Alas! This seems not to be the case. If I start netcat listening on port 6666 with: nc -vv -l -p 6666, then go to 127.0.0.1:6666 in a browser, as expected I see a HTTP GET request come through netcat (and my browser sits waiting in vain). If I go to my.external.ip.address:6666, however, nothing comes through at all and the browser displays 'could not connect to my.external.ip.address:6666'. I know that the port is correctly forwarded, as www.canyouseeme.org says port 6666 is open (and when netcat is not listening, that its closed). If I run netcat with -g my.adslmodem's.local.address to set the gateway address, I get the same behavior. Am I using this command line option correctly? Any insight as to what I'm doing wrong?

    Read the article

  • Can't get MySQL source query to work using Python mysqldb module

    - by Chris
    I have the following lines of code: sql = "source C:\\My Dropbox\\workspace\\projects\\hosted_inv\\create_site_db.sql" cursor.execute (sql) When I execute my program, I get the following error: Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'source C:\My Dropbox\workspace\projects\hosted_inv\create_site_db.sql' at line 1 Now I can copy and past the following into mysql as a query: source C:\\My Dropbox\\workspace\\projects\\hosted_inv\\create_site_db.sql And it works perfect. When I check the query log for the query executed by my script, it shows that my query was the following: source C:\\My Dropbox\\workspace\\projects\\hosted_inv\\create_site_db.sql However, when I manually paste it in and execute, the entire create_site_db.sql gets expanded in the query log and it shows all the sql queries in that file. Am I missing something here on how mysqldb does queries? Am I running into a limitation. My goal is to run a sql script to create the schema structure, but I don't want to have to call mysql in a shell process to source the sql file. Any thoughts? Thanks!

    Read the article

  • Problem with socket communication between C# and Flex

    - by Chris Lee
    Hi all, I am implementing a simulated b/s stock data system. I am using flex and c# for client and server sides. I found flash has a security policy and I handled the policy-file-request in my server code. But seems it doesn't work, because the code jumped out at "socket.Receive(b)" after connection. I've tried sending message on client in the connection handler, in that case the server can receive correct message. But the auto-generated "policy-file-request" can never be received, and the client can get no data sending from server. Here I put my code snippet. my ActionScript code: public class StockClient extends Sprite { private var hostName:String = "192.168.84.103"; private var port:uint = 55555; private var socket:XMLSocket; public function StockClient() { socket = new XMLSocket(); configureListeners(socket); socket.connect(hostName, port); } public function send(data:Object) : void{ socket.send(data); } private function configureListeners(dispatcher:IEventDispatcher):void { dispatcher.addEventListener(Event.CLOSE, closeHandler); dispatcher.addEventListener(Event.CONNECT, connectHandler); dispatcher.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler); dispatcher.addEventListener(ProgressEvent.PROGRESS, progressHandler); dispatcher.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler); dispatcher.addEventListener(ProgressEvent.SOCKET_DATA, dataHandler); } private function closeHandler(event:Event):void { trace("closeHandler: " + event); } private function connectHandler(event:Event):void { trace("connectHandler: " + event); //following testing message can be received, but client can't invoke data handler //send("<policy-file-request/>"); } private function dataHandler(event:ProgressEvent):void { //never fired trace("dataHandler: " + event); } private function ioErrorHandler(event:IOErrorEvent):void { trace("ioErrorHandler: " + event); } private function progressHandler(event:ProgressEvent):void { trace("progressHandler loaded:" + event.bytesLoaded + " total: " + event.bytesTotal); } private function securityErrorHandler(event:SecurityErrorEvent):void { trace("securityErrorHandler: " + event); } } my C# code: const int PORT_NUMBER = 55555; const String BEGIN_REQUEST = "begin"; const String END_REQUEST = "end"; const String POLICY_REQUEST = "<policy-file-request/>\u0000"; const String POLICY_FILE = "<?xml version=\"1.0\"?>\n" + "<!DOCTYPE cross-domain-policy SYSTEM \"http://www.adobe.com/xml/dtds/cross-domain-policy.dtd\">\n" + "<cross-domain-policy> \n" + " <allow-access-from domain=\"*\" to-ports=\"55555\"/> \n" + "</cross-domain-policy>\u0000"; ................ private void startListening() { provider = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); provider.Bind(new IPEndPoint(IPAddress.Parse("192.168.84.103"), PORT_NUMBER)); provider.Listen(10); isListened = true; while (isListened) { Socket socket = provider.Accept(); Console.WriteLine("connect!"); byte[] b = new byte[1024]; int receiveLength = 0; try { // code jump out at this statement receiveLength = socket.Receive(b); } catch (Exception e) { Debug.WriteLine(e.ToString()); } String request = System.Text.Encoding.UTF8.GetString(b, 0, receiveLength); Console.WriteLine("request:"+request); if (request == POLICY_REQUEST) { socket.Send(Encoding.UTF8.GetBytes(POLICY_FILE)); Console.WriteLine("response:" + POLICY_FILE); } else if (request == END_REQUEST) { Dispose(socket); } else { StartSocket(socket); break; } } } Sorry for the long code, please someone help with it, thanks a million

    Read the article

  • Help with PHP mailer script

    - by Chris
    Hi there, I'm clueless when it comes to PHP and have a script that emails the contents of a form. The trouble is it only sends me the comment when I want it to also send the name and email address that is captured. Anyone know how I can adjust this script to do this? A million thanks in advance! <?php error_reporting(E_NOTICE); function valid_email($str) { return ( ! preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $str)) ? FALSE : TRUE; } if($_POST['name']!='' && $_POST['email']!='' && valid_email($_POST['email'])==TRUE && strlen($_POST['comment'])>1) { $to = "[email protected]"; $headers = 'From: '.$_POST['email'].''. "\r\n" . 'Reply-To: '.$_POST['email'].'' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); $subject = "Contact Form"; $message = htmlspecialchars($_POST['comment']); if(mail($to, $subject, $message, $headers)) { echo 1; //SUCCESS } else { echo 2; //FAILURE - server failure } } else { echo 3; //FAILURE - not valid email } ?>

    Read the article

  • JavaScript query string

    - by Chris
    Is there any JavaScript library that makes a dictionary out of the query string, ASP.NET style? Something that would be used like: var query = window.location.querystring["query"]? Is a "query string" called something else outside the .NET realm? Why isn't location.search broken into a key/value collection already? EDIT: I have written my own function, thanks, but does any major JavaScript library do this?

    Read the article

  • markitup wysiwyg with a standard HTML form

    - by Chris
    Hi, I'm trying to use the markitup editor on my site and I'm having a problem trying to figure out what I need to do to submit the text area to my server side script. I'm guessing there is something simple that needs to be done but my lack of JS/JQuery knowledge is making it really hard to find a answer The editor works fine, I just want to use my own form and submit button with it, however when I try to submit the form I don't get any of the textarea data in my script. Any idea what I need to do? This is the min that works (before submit) In the Head of my HTML <script type="text/javascript" > <!-- $(document).ready(function() { $("#markItUp").markItUp(mySettings); }); --> </script> And the body: <form id="postpreview" name="newpost" action="/someurl" method="POST" /> <input type="hidden" name="key1" value="val1" /> <input type="hidden" name="key2" value="val2" /> <textarea name="text" id="markItUp"></textarea> <input id="SubmitPost" type="image" value="Continue" name="Doit" class="preview" src="/img/somimage" /> </form> As I said, everything prior to the submit works but once I submit I don't get anything for the form data element "text". I tried doing this in the head: <script type="text/javascript" > <!-- $(document).ready(function() { $("#markItUp").markItUp(mySettings); $("#SubmitPost").click(function(){ data = markItUp.textarea.value; $.post("scripturl",{ key1: "value1", key2: "value2", text: data }); }); }); --> </script> I've also tried: <script type="text/javascript" > <!-- $(document).ready(function() { $("#markItUp").markItUp(mySettings); $("#postpreview").submit(function(){ var data = $("#markItUp").html(); $.post("live",{ func: "posting", text: data }); return false; }); }); --> </script> And I have no luck - the last attempt above just disabled the form (so clicking on the submit or preview buttons did nothing). Any ideas? I guessing its really simple to use my own form but I have no clue how to do it. TIA!

    Read the article

  • Wikipedia API: list=alllinks confusion

    - by Chris Salij
    I'm doing a research project for the summer and I've got to use get some data from Wikipedia, store it and then do some analysis on it. I'm using the Wikipedia API to gather the data and I've got that down pretty well. What my questions is in regards to the links-alllinks option in the API doc here After reading the description, both there and in the API itself (it's down and bit and I can't link directly to the section), I think I understand what it's supposed to return. However when I ran a query it gave me back something I didn't expect. Here's the query I ran: http://en.wikipedia.org/w/api.php?action=query&prop=revisions&titles=google&rvprop=ids|timestamp|user|comment|content&rvlimit=1&list=alllinks&alunique&allimit=40&format=xml Which in essence says: Get the last revision of the Google page, include the id, timestamp, user, comment and content of each revision, and return it in XML format. The allinks (I thought) should give me back a list of wikipedia pages which point to the google page (In this case the first 40 unique ones). I'm not sure what the policy is on swears, but this is the result I got back exactly: <?xml version="1.0"?> <api> <query><normalized> <n from="google" to="Google" /> </normalized> <pages> <page pageid="1092923" ns="0" title="Google"> <revisions> <rev revid="366826294" parentid="366673948" user="Citation bot" timestamp="2010-06-08T17:18:31Z" comment="Citations: [161]Tweaked: url. [[User:Mono|Mono]]" xml:space="preserve"> <!-- The page content, I've replaced this cos its not of interest --> </rev> </revisions> </page> </pages> <alllinks> <l ns="0" title="!" /> <l ns="0" title="!!" /> <l ns="0" title="!!!" /> <l ns="0" title="!!!!" /> <l ns="0" title="!!!!!!!!!!!!!!!!!!!!!" /> <l ns="0" title="!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" /> <l ns="0" title="!!!!!!!!!!!!!!!!!!!!*was up all u hater just stopingby to show u some love*!!!!!!!!!!!!!!!!!!!!!!!!!!!" /> <l ns="0" title="!!!!!!!!!!!!&amp;&amp;&amp;&amp;&amp;&amp;&amp;&amp;&amp;&amp;&amp;********(( )))))F/W///CHRYSLER/FUCKING/FUCKING/FUCKING/I HATE THE QUEEN!!!/I AM HORRID HENRY/Chrysler Cirrus/php" /> <l ns="0" title="!!!!!Hephaestos IS A FUCKING WHINY GUY!!!!!!" /> <l ns="0" title="!!!!Do you really want to see this article on your default search?" /> <l ns="0" title="!!!!Legal!!!!" /> <l ns="0" title="!!!!YOU ARE A COCKSUCKING WHINY GREASER!!!!" /> <l ns="0" title="!!!BESQUERKAN!!!" /> <l ns="0" title="!!!Fuck You!!!" /> <l ns="0" title="!!!Fuck You!!! And Then Some" /> <l ns="0" title="!!!Fuck You!!! And Then some" /> <l ns="0" title="!!!Fuck You!!! And then Some" /> <l ns="0" title="!!!Fuck You!!! and Then Some" /> <l ns="0" title="!!!Three !!! Amigos!!!" /> <l ns="0" title="!!! (album)" /> <l ns="0" title="!!! (band)" /> <l ns="0" title="!!1" /> <l ns="0" title="!!BOSS!!" /> <l ns="0" title="!!Destroy-Oh-Boy!!" /> <l ns="0" title="!!Fuck you!!" /> <l ns="0" title="!!M" /> <l ns="0" title="!!Que Corra La Voz!!" /> <l ns="0" title="!! (chess)" /> <l ns="0" title="!! (disambiguation)" /> <l ns="0" title="!! 6- -.4rtist.com" /> <l ns="0" title="!!m" /> <l ns="0" title="!!suck my balls!!" /> <l ns="0" title="!!~~YOU WIN~~!!" /> <l ns="0" title="!&#039;O-!khung language" /> <l ns="0" title="!(1)Full Name:(2)Age:(3)Sex:(4)Occupation:(5)Phone Number: (6)Delivery Address:(7)Country of Residence:. Dr.John Aboh" /> <l ns="0" title="!-" /> <l ns="0" title="!-My Degrassi Top 10 Episodes" /> <l ns="0" title="!10 Show" /> <l ns="0" title="!2005" /> <l ns="0" title="!2006" /> </alllinks> </query> <query-continue> <revisions rvstartid="366673948" /> <alllinks alfrom="!2009" /> </query-continue> </api> As you can see if you look at the <alllinks> part, its just a load of random gobbledy-gook. No nearly what I thought I'd get. I've done a fair bit of searching but I can't seem to find a direct answer to my question. What should the list=alllinks option return? Why am I getting this crap in there? Thanks for your help

    Read the article

  • What alternatives are there to Google App Engine?

    - by Chris Marasti-Georg
    What alternatives are there to GAE, given that I already have a good bit of code working that I would like to keep. In other words, I'm digging python. However, my use case is more of a low number of requests, higher CPU usage type use case, and I'm worried that I may not be able to stay with App Engine forever. I have heard a lot of people talking about Amazon Web Services and other sorts of cloud providers, but I am having a hard time seeing where most of these other offerings provide the range of services (data querying, user authentication, automatic scaling) that App Engine provides. What are my options here?

    Read the article

  • ASM programming, how to use loop?

    - by chris
    Hello. Im first time here.I am a college student. I've created a simple program by using assembly language. And im wondering if i can use loop method to run it almost samething as what it does below the program i posted. and im also eager to find someome who i can talk through MSN messanger so i can ask you questions right away.(if possible) ok thank you .MODEL small .STACK 400h .data prompt db 10,13,'Please enter a 3 digit number, example 100:',10,13,'$' ;10,13 cause to go to next line first_digit db 0d second_digit db 0d third_digit db 0d Not_prime db 10,13,'This number is not prime!',10,13,'$' prime db 10,13,'This number is prime!',10,13,'$' question db 10,13,'Do you want to contine Y/N $' counter dw 0d number dw 0d half dw ? .code Start: mov ax, @data ;establish access to the data segment mov ds, ax mov number, 0d LetsRoll: mov dx, offset prompt ; print the string (please enter a 3 digit...) mov ah, 9h int 21h ;execute ;read FIRST DIGIT mov ah, 1d ;bios code for read a keystroke int 21h ;call bios, it is understood that the ascii code will be returned in al mov first_digit, al ;may as well save a copy sub al, 30h ;Convert code to an actual integer cbw ;CONVERT BYTE TO WORD. This takes whatever number is in al and ;extends it to ax, doubling its size from 8 bits to 16 bits ;The first digit now occupies all of ax as an integer mov cx, 100d ;This is so we can calculate 100*1st digit +10*2nd digit + 3rd digit mul cx ;start to accumulate the 3 digit number in the variable imul cx ;it is understood that the other operand is ax ;AND that the result will use both dx::ax ;but we understand that dx will contain only leading zeros add number, ax ;save ;variable <number> now contains 1st digit * 10 ;---------------------------------------------------------------------- ;read SECOND DIGIT, multiply by 10 and add in mov ah, 1d ;bios code for read a keystroke int 21h ;call bios, it is understood that the ascii code will be returned in al mov second_digit, al ;may as well save a copy sub al, 30h ;Convert code to an actual integer cbw ;CONVERT BYTE TO WORD. This takes whatever number is in al and ;extends it to ax, boubling its size from 8 bits to 16 bits ;The first digit now occupies all of ax as an integer mov cx, 10d ;continue to accumulate the 3 digit number in the variable mul cx ;it is understood that the other operand is ax, containing first digit ;AND that the result will use both dx::ax ;but we understand that dx will contain only leading zeros. Ignore them add number, ax ;save -- nearly finished ;variable <number> now contains 1st digit * 100 + second digit * 10 ;---------------------------------------------------------------------- ;read THIRD DIGIT, add it in (no multiplication this time) mov ah, 1d ;bios code for read a keystroke int 21h ;call bios, it is understood that the ascii code will be returned in al mov third_digit, al ;may as well save a copy sub al, 30h ;Convert code to an actual integer cbw ;CONVERT BYTE TO WORD. This takes whatever number is in al and ;extends it to ax, boubling its size from 8 bits to 16 bits ;The first digit now occupies all of ax as an integer add number, ax ;Both my variable number and ax are 16 bits, so equal size mov ax, number ;copy contents of number to ax mov cx, 2h div cx ;Divide by cx mov half, ax ;copy the contents of ax to half mov cx, 2h; mov ax, number; ;copy numbers to ax xor dx, dx ;flush dx jmp prime_check ;jump to prime check print_question: mov dx, offset question ;print string (do you want to continue Y/N?) mov ah, 9h int 21h ;execute mov ah, 1h int 21h ;execute cmp al, 4eh ;compare je Exit ;jump to exit cmp al, 6eh ;compare je Exit ;jump to exit cmp al, 59h ;compare je Start ;jump to start cmp al, 79h ;compare je Start ;jump to start prime_check: div cx; ;Divide by cx cmp dx, 0h ;reset the value of dx je print_not_prime ;jump to not prime xor dx, dx; ;flush dx mov ax, number ;copy the contents of number to ax cmp cx, half ;compare half with cx je print_prime ;jump to print prime section inc cx; ;increment cx by one jmp prime_check ;repeat the prime check print_prime: mov dx, offset prime ;print string (this number is prime!) mov ah, 9h int 21h ;execute jmp print_question ;jumps to question (do you want to continue Y/N?) this is for repeat print_not_prime: mov dx, offset Not_prime ;print string (this number is not prime!) mov ah, 9h int 21h ;execute jmp print_question ;jumps to question (do you want to continue Y/N?) this is for repeat Exit: mov ah, 4ch int 21h ;execute exit END Start

    Read the article

  • Using sectioned tables from an sqlite file with an iPhone uitableview

    - by Chris
    I am currently trying to make a sectioned table like this: Section 1: Entry 1 Entry 2 Entry 3 Section 2: Entry 4 Entry 5 Entry 6 Section 3: Entry 7 Entry 8 ... However, using this code: Event *lists = (Event *)[eventList objectAtIndex:indexPath.row]; accessStatement = "select * from DatabaseName"; [self findEvents]; // Code that builds each object's strings from database cell.textLabel.text = lists.name; Section 1: Entry 1 Entry 2 Entry 3 Section 2: Entry 1 Entry 2 Entry 3 Section 3: Entry 1 Entry 2 ... It keeps on repeating itself. How do I make the index so that it continues in each section rather than restarts? Thanks in advance.

    Read the article

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