Search Results

Search found 380 results on 16 pages for 'den bardadym'.

Page 8/16 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • Why does /**[newline] not always insert the Javadoc template including @param and @return in Eclipse

    - by Bas van den Broek
    I'm documenting code in Eclipse and have been using the /** followed by Enter alot to insert the Javadoc template. However this does not always work for some reason, it will create the template for writing comments but it won't automatically insert the @param and @return text. If I copy the exact same method to another class it will insert the full template. It would be a big help if anyone could tell me why it won't do this in some situations.

    Read the article

  • How can i put my form value in javascript array

    - by Lucas van den Abbeele
    I want to make a script where i can put my form in the javascript array invoer[] and display the total It constantly stops working and i searched a lot, i really can't find the right way :D This is my javascript code var strijk = ['broek', 'hemd', 'tshirt', 'lakens', 'korte broek', 'babykledij']; var minuten = [5, 10, 5, 6, 3, 3]; function invoerstrijk() { document.write("<form action='' method='get' name='strijkform'>"); for (var a = 0; a < minuten.length; a++) { document.write(strijk[a] + "<input id='" + strijk[a] + "' name ='" + strijk[a] + "' type='text' />" + "<BR>"); } document.write("<button onclick='opgeven()'>opgeven</button>"); document.write("</form>"); } function opgeven() { var invoer = []; for (var a = 0; a < minuten.length; a++) { invoer[a] = document.getElementByI(strijk[a]).value; } var totaal; for (var a = 0; a < minuten.length; a++) { totaal += parseint(invoer[a]) * parseint(minuten[a]); } document.write("<input name=" + strijk[a] + " type='text' value=" + invoer[a] + " readonly />"); if (invoer != []) { document.write("totaal aantal minuten" + totaal); } else { document.write("geen invoer"); } } my html looks likes this <!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"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <script type="text/javascript" > //my javasccript </script> <button id="B1" onclick="invoerstrijk()" >Nieuwe strijk</button> </body> </html>

    Read the article

  • How to test Text Search accuracy and efficiency?

    - by DEN
    I have created a web application. One of the feature is text search which perform the boolean operator ( NOT, AND, OR) as well. However, I have no idea on calculating the search's accuracy and efficiency. For example: 1 . Probe identification system for a measurement instrument 2 . Pulse-based impedance measurement instrument 3 . Millimeter with filtered measurement mode when the user key in will return the result as below input :measurement instrument Result: 1,2 input : measurement OR instrument NOT milimeter Result: 1,2,3 so, i have no idea on what issue and what algorithm to calculate on the accuracy and efficiency of the text search.. anyone have any idea on that?

    Read the article

  • How do I limit JPQ output?

    - by den-javamaniac
    I need to limit number of entities returned by a query to some certain value inside a JPA query (through JPQL). Particularly: select m from Manual m //constraint e.g. in sql (mysql syntax) I would do it like: select * from Manual limit 1 The only solution that comes up is simply to get all entities and then choose first one, which is out of the issue. Any ideas?

    Read the article

  • C Remove the first line from a text file without rewriting file

    - by Tom Van den Bon
    Hi, I've got a service which runs all the time and also keeps a log file. It basically adds new lines to the log file every few seconds. I'm written a small file which reads these lines and then parses them to various actions. The question I have is how can I delete the lines which I have already parsed from the log file without disrupting the writing of the log file by the service? Usually when I need to delete a line in a file then I open the original one and a temporary one and then I just write all the lines to the temp file except the original which I want to delete. Obviously this method will not word here. So how do I go about deleting them ?

    Read the article

  • What's the point of the javascript navigator.javaEnabled function?

    - by den shade
    The navigator object has a javaEnabled function that indicates if the browser has javascript support. This seems to be a little odd: If JS is indeed enabled the function will return true, well obviously. If JS is disabled it will return <nothing since it is never run, javaScript is disabled. I must be missing something here, or is it really that useless this function?

    Read the article

  • The ultimate c# file and directory utility library?

    - by Serge van den Oever
    I find myself writing file and directory utility functions all the time, and I was wondering if there is good file and directory library that already implements a more extensive set than available by default in System.IO. The kind of functions I'm looking for is things like: public static void GetTemporaryDirectory() { string tempDirectory = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); Directory.CreateDirectory(tempDirectory); return tempDirectory; } public static void CreateEmptyFile(string filename) { File.Create(filename).Dispose(); } public static void CreateEmptyFile(string path, string filename) { File.Create(Path.Combine(path, filename)).Dispose(); } public static void CreateDirectory(string path) { Directory.CreateDirectory(path); } public static void CreateDirectory(string path, string childpath) { Directory.CreateDirectory(Path.Combine(path, childpath)); }

    Read the article

  • MS SQL Server stored procedure meaning

    - by den-javamaniac
    Hi. I'm developing a simple database architecture in VisualParadigm and lately ran over next code excerpt. IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'getType') AND type in (N'P', N'PC')) DROP PROCEDURE getType; Next goes my stored procedure: CREATE PROCEDURE getType @typeId int AS SELECT * FROM type t WHERE t.type_id = @typeId; Can anyone explain what does it mean? P.S.: It would be great, if you may also check for any syntax errors as I'm totally new to MSSQL and stored procedures.

    Read the article

  • Capistrano Error

    - by Casey van den Bergh
    I'm Running CentOS 5 32 bit version. This is my deploy.rb file on my local computer: #======================== #CONFIG #======================== set :application, "aeripets" set :scm, :git set :git_enable_submodules, 1 set :repository, "[email protected]:aeripets.git" set :branch, "master" set :ssh_options, { :forward_agent => true } set :stage, :production set :user, "root" set :use_sudo, false set :runner, "root" set :deploy_to, "/var/www/#{application}" set :app_server, :passenger set :domain, "aeripets.co.za" #======================== #ROLES #======================== role :app, domain role :web, domain role :db, domain, :primary => true #======================== #CUSTOM #======================== namespace :deploy do task :start, :roles => :app do run "touch #{current_release}/tmp/restart.txt" end task :stop, :roles => :app do # Do nothing. end desc "Restart Application" task :restart, :roles => :app do run "touch #{current_release}/tmp/restart.txt" end end And this the error I get on my local computer when I try to cap deploy. executing deploy' * executingdeploy:update' ** transaction: start * executing deploy:update_code' executing locally: "git ls-remote [email protected]:aeripets.git master" command finished in 1297ms * executing "git clone -q [email protected]:aeripets.git /var/www/seripets/releases/20111126013705 && cd /var/www/seripets/releases/20111126013705 && git checkout -q -b deploy 32ac552f57511b3ae9be1d58aec54d81f78f8376 && git submodule -q init && git submodule -q sync && export GIT_RECURSIVE=$([ ! \"git --version\" \\< \"git version 1.6.5\" ] && echo --recursive) && git submodule -q update --init $GIT_RECURSIVE && (echo 32ac552f57511b3ae9be1d58aec54d81f78f8376 > /var/www/seripets/releases/20111126013705/REVISION)" servers: ["aeripets.co.za"] Password: [aeripets.co.za] executing command ** [aeripets.co.za :: err] sh: git: command not found command finished in 224ms *** [deploy:update_code] rolling back * executing "rm -rf /var/www/seripets/releases/20111126013705; true" servers: ["aeripets.co.za"] [aeripets.co.za] executing command command finished in 238ms failed: "sh -c 'git clone -q [email protected]:aeripets.git /var/www/seripets/releases/20111126013705 && cd /var/www/seripets/releases/20111126013705 && git checkout -q -b deploy 32ac552f57511b3ae9be1d58aec54d81f78f8376 && git submodule -q init && git submodule -q sync && export GIT_RECURSIVE=$([ ! \"git --version`\" \< \"git version 1.6.5\" ] && echo --recursive) && git submodule -q update --init $GIT_RECURSIVE && (echo 32ac552f57511b3ae9be1d58aec54d81f78f8376 /var/www/seripets/releases/20111126013705/REVISION)'" on aeripets.co.za

    Read the article

  • CI controller function is ignored

    - by den-javamaniac
    Hi. I'm trying to pass through a CI tutorial (writing a simple forum) and I can't make a controller function called. To be more specific I have this in a controller: function __construct() { parent::Controller(); $this->load->helper('url'); } function index() { $data['title'] = "Wlcome to Gossip"; $data['heading'] = "Welcome to Gossip"; $data['query'] = $this->db->get('topic')->result(); $this->load->view('welcome', $data); } function topic() { echo 'testing...'; } and when I'm trying to access the /index.php/forum/topic/ uri it just prints out my index() function. Can any one point out what may cause the problem?

    Read the article

  • Simple check for SELECT query empty result

    - by den-javamaniac
    Hi. Can anyone point out how to check if a select query returns non empty result set? For example I have next query: SELECT * FROM service s WHERE s.service_id = ?; Should I do something like next: ISNULL(SELECT * FROM service s WHERE s.service_id = ?) to test if result set is not empty?

    Read the article

  • Empty database output in CI

    - by den-javamaniac
    Hi. I'm building a simple app and trying to test DB result output. But unfortunately all I'm getting is an array of size 0. Here's the controller code excerpt: $data['query'] = $this->db->query('SELECT role_id, role_privilege FROM role'); $this->load->view('welcome_message', $data); And a view code excerpt: <?php echo count($query->result_array())."<br/>"; foreach ($query->result() as $row){ echo $row->role_id . '<br/>'; echo $row->role_privilege . '<br/>'; } echo 'Total result '.$query->num_rows(); ?> And what I get is next: 0 Total result Running query from a command line gives a 2 rowed output. Can someone point out what i'm missing?

    Read the article

  • Silverlight Cream for February 13, 2011 -- #1046

    - by Dave Campbell
    In this Issue: Loek van den Ouweland, Colin Eberhardt, Rudi Grobler, Joost van Schaik, Mike Taulty(-2-, -3-), Deborah Kurata, David Kelley, Peter Foot, Samuel Jack(-2-), and WindowsPhoneGeek(-2-). Above the Fold: Silverlight: "Silverlight Simple MVVM Commanding" Deborah Kurata WP7: "WP7 CustomInputPrompt control with Cancel button" WindowsPhoneGeek Expression Blend: "Silverlight Templated Image Button with two images" Loek van den Ouweland Shoutouts: Dave Campbell posted a write-up about the project he's on and the use of Sterling: Sterling Object-Oriented Database for ISO 1.0 Released!... Also see Jeremy Likness' post on the 1.0 release: Sterling Object-Oriented Database 1.0 RTM Not necessarily Silverlight, but darn cool, a great control by Sasha Barber: WPF : A Weird 3d based control snoutholder announced new content: Windows Phone 7 QuickStarts Live! From SilverlightCream.com: Silverlight Templated Image Button with two images Loek van den Ouweland has a video tutorial up for creating an ImageButton with a hover state... Expression Blend coolness, and check out the external links he has to their training site. Windows Phone 7 Performance Measurements – Emulator vs. Hardware Colin Eberhardt's latest is a popular post comparing performance metrics between the WP7 emulator and a real device. Mileage may vary, but I'm pretty sure the overall results are conculsive, and should help the way you view your app as you're building in the emulator. WP7: WebClient vs HttpWebRequest Rudi Grobler's latest is a discussion of WebClient and HttpWebRequest, gives coding examples of each plus discussion of why you may choose one over the other... and pay attention to his comment about mobile providers. A Blendable Windows Phone 7 / Silverlight clipping behavior Joost van Schaik posted this WP7/Silverlight clipping behavior he developed because all the other solutions were not blendable. Another really useful piece of code from Joost! Blend Bits 22–Being Stylish Mike Taulty has 3 more episodes in his Blend Bits series... first up is on one Styles... explicit, implicit, inheriting... you name it, he's covering it! Blend Bits 23–Templating Part 1 MIke Taulty then has the beginning of a series within his Blend Bits series on Templating. This is something you just have to either bite the bullet and go with Blend to do, or consume someone else's work. Mike shows us how to do it ourself by tweaking the visual aspects of a checkbox Blend Bits 24–Templating Part 2 In part 2 of the Templating series, Mike Taulty digs deeper into Blend and cracks open the Listbox control to take a bunch of the inner elements out for a spin... fun stuff and great tutorial, Mike! Silverlight Simple MVVM Commanding Deborah Kurata has another great MVVM post up... if you don't have your head wrapped around commanding yet, this is a good place to start that process... VB and C# as always. App Development for Windows Phone 7 101 David Kelley goes through the basics of producing a WP7 app both from the Silverlight and XNA side... good info and good external links to get you going. Copyable TextBlock for Windows Phone Peter Foot takes a look at the Copy/Paste functionality in WP7 and how to apply it to a TextBlock... which is NOT an out-of-the-box solution. How to deploy to, and debug, multiple instances of the Windows Phone 7 emulator Samuel Jack has a couple posts up this week... first is this clever one on running multiple copies of the emulator at once... too cool for debugging a multi-player game! Multi-player enabling my Windows Phone 7 game: Day 3 – The Server Side Samuel Jack's latest is a detailed look at his day 3 adventure of taking his multi-player game to WP7... lots of information and external links... what do you say, give him another day? :) WP7 CustomInputPrompt control with Cancel button WindowsPhoneGeek has a couple more posts up... first is this "CustomInputPrompt" control based off the InputPrompt from Coding4Fun. Implementing Windows Phone 7 DataTemplateSelector and CustomDataTemplateSelector In his latest post, WindowsPhoneGeek writes a DataTemplateSelector to allow different data templates for different list elements based on the type of the element. Stay in the 'Light! Twitter SilverlightNews | Twitter WynApse | WynApse.com | Tagged Posts | SilverlightCream Join me @ SilverlightCream | Phoenix Silverlight User Group Technorati Tags: Silverlight    Silverlight 3    Silverlight 4    Windows Phone MIX10

    Read the article

  • Danke für die gute Zusammenarbeit im FY12

    - by A&C Redaktion
    Liebe Oracle Partner, und schon wieder ist ein Geschäftsjahr zu Ende gegangen. Als erstes möchte ich Ihnen, unseren Partnern, sagen: Sie leisten seit Jahren einen fundamentalen Beitrag zum Erfolg von Oracle – auch im Fiskaljahr 2012. Herzlichen Dank dafür! Wenn wir auf das letzte Jahr zurückblicken, gab es unter dem Motto „Oracle on Oracle“ herausragende Produktvorstellungen, Events und Partner Programme. Zu den wichtigsten technischen Innovationen gehörte sicherlich die Oracle Database Appliance speziell für kleinere Unternehmen. Auch die Daten-Explosion, zu der wir jeden Tag beitragen, stellt für alle Unternehmen eine Herausforderung dar. Um diese „Big Data“ effizient zu verwalten, haben wir die Exa-Familie erweitert. So stehen neben der Exadata Database Machine nun auch Exalogic und Exalytics – mit zuverlässiger Hardware, ausgereifter Software und Support aus einer Hand – je nach Bedarf zur Verfügung. Da ist für jeden Kunden was dabei. Die Oracle Optimized Solutions unserer VADs waren ein weiteres wichtiges Thema, speziell für den Mittelstand, über das wir auch hier im Blog berichtet haben. Für ISVs wurden die Exastack Ready und Exastack Optimized Programme entwickelt. Speziell für Partner wurden Partner Sales Books zu den Fokus-Themen, wie beispielsweise Cloud Computing, erstellt. Im OPN stehen Ihnen mehr als 30 deutschsprachige Marketing-Kits zur Verfügung, um Sie bei der täglichen Vertriebsarbeit zu unterstützen. Und mit dem überarbeiteten und erweiterten Solutions Catalog im OPN können Sie von Endkunden ganz einfach nach Ihrem Lösungsangebot gefunden werden. Dies sind nur einige Beispiele, wie wir versuchen, Sie bei Ihrem Geschäft zu unterstützen. Ich hoffe, wir schaffen das auch weiterhin so gut wie bisher. Was das neue Fiskaljahr bringt, erfahren Sie beim EMEA Partner Kickoff am 29. Juni Normal 0 21 false false false DE X-NONE X-NONE MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;} und demnächst hier im Blog. Aber soviel sei schon verraten: Meine Glückszahl ist die 13 – und Ihre? Herzlichst, Ihre Silvia Kaske Senior Direktor Alliances & Channel Tech Europe North Oracle Deutschland B.V. & Co. KG

    Read the article

  • Danke für die gute Zusammenarbeit im FY12

    - by A&C Redaktion
    Liebe Oracle Partner, und schon wieder ist ein Geschäftsjahr zu Ende gegangen. Als erstes möchte ich Ihnen, unseren Partnern, sagen: Sie leisten seit Jahren einen fundamentalen Beitrag zum Erfolg von Oracle – auch im Fiskaljahr 2012. Herzlichen Dank dafür! Wenn wir auf das letzte Jahr zurückblicken, gab es unter dem Motto „Oracle on Oracle“ herausragende Produktvorstellungen, Events und Partner Programme. Zu den wichtigsten technischen Innovationen gehörte sicherlich die Oracle Database Appliance speziell für kleinere Unternehmen. Auch die Daten-Explosion, zu der wir jeden Tag beitragen, stellt für alle Unternehmen eine Herausforderung dar. Um diese „Big Data“ effizient zu verwalten, haben wir die Exa-Familie erweitert. So stehen neben der Exadata Database Machine nun auch Exalogic und Exalytics – mit zuverlässiger Hardware, ausgereifter Software und Support aus einer Hand – je nach Bedarf zur Verfügung. Da ist für jeden Kunden was dabei. Die Oracle Optimized Solutions unserer VADs waren ein weiteres wichtiges Thema, speziell für den Mittelstand, über das wir auch hier im Blog berichtet haben. Für ISVs wurden die Exastack Ready und Exastack Optimized Programme entwickelt. Speziell für Partner wurden Partner Sales Books zu den Fokus-Themen, wie beispielsweise Cloud Computing, erstellt. Im OPN stehen Ihnen mehr als 30 deutschsprachige Marketing-Kits zur Verfügung, um Sie bei der täglichen Vertriebsarbeit zu unterstützen. Und mit dem überarbeiteten und erweiterten Solutions Catalog im OPN können Sie von Endkunden ganz einfach nach Ihrem Lösungsangebot gefunden werden. Dies sind nur einige Beispiele, wie wir versuchen, Sie bei Ihrem Geschäft zu unterstützen. Ich hoffe, wir schaffen das auch weiterhin so gut wie bisher. Was das neue Fiskaljahr bringt, erfahren Sie beim EMEA Partner Kickoff am 29. Juni Normal 0 21 false false false DE X-NONE X-NONE MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;} und demnächst hier im Blog. Aber soviel sei schon verraten: Meine Glückszahl ist die 13 – und Ihre? Herzlichst, Ihre Silvia Kaske Senior Direktor Alliances & Channel Tech Europe North Oracle Deutschland B.V. & Co. KG

    Read the article

  • Silverlight Cream for February 02, 2011 -- #1039

    - by Dave Campbell
    In this Issue: Tony Champion, Gill Cleeren, Alex van Beek, Michael James, Ollie Riches, Peter Kuhn, Mike Ormond, WindowsPhoneGeek(-2-), Daniel N. Egan, Loek Van Den Ouweland, and Paul Thurott. Above the Fold: Silverlight: "Using the AutoCompleteBox" Peter Kuhn WP7: "Windows Phone Image Button" Loek Van Den Ouweland Training: "New WP7 Virtual Labs" Daniel N. Egan Shoutouts: SilverlightShow has their top 5 most popular news articles up: SilverlightShow for Jan 24-30, 2011 Rudi Grobler posted answers he gives to questions about Silverlight - Where do I start? Brian Noyes starts a series of Webinars at SilverlightShow this morning at 10am PDT: Free Silverlight Show Webinar: Querying and Updating Data From Silverlight Clients with WCF RIA Services Join your fellow geeks at Gangplank in Chandler Arizona this Saturday as Scott Cate and AZGroups brings you Azure Boot Camp – Feb 5th 2011 From SilverlightCream.com: Deploying Silverlight with WCF Services Tony Champion takes a step out of his norm (Pivot) and has a post up about deploying WCF Services with your SL app, and how to take the pain out of that without pulling out your hair. Getting ready for Microsoft Silverlight Exam 70-506 (Part 3) Gill Cleeren's part 3 of getting ready for the Silverlight Exam is up at SilverlightShow... with links to the first two parts. There's so much good information linked off these... thanks Gill and 'The Show'! A guide through WCF RIA Services attributes Alex van Beek has a post up you will probably want to bookmark unless you're not using WCF RIA... do you know all the attributes by heart? ... how about an excellent explanation of 10 of them? Using DeferredLoadListBox in a Pivot Control Michael James discusses using the DeferredLoadListBox, and then also using it with the Pivot control... but not without some pain points which he defines and gives the workaround for. WP7: Know your data Ollie Riches' latest is about Data and WP7 ... specifically 'knowing' what data you're needing/using to avoid the 90MB memory limit... He gives a set of steps to follow to measure your data model to avoid getting in trouble. Using the AutoCompleteBox Peter Kuhn takes a great look at the AutoCompleteBox... the basics, and then well beyond with custom data, item templates, custom filters, asynchronous filtering, and a behavior for MVVM async filtering. OData and Windows Phone 7 Part 2 Mike Ormond has part 2 of his OData/WP7 post up... lashing up the images to go along with the code this time out... nice looking app. WP7 RoundToggleButton and RoundButton in depth WindowsPhoneGeek is checking out the RoundToggleButton and RoundButton controls from the Coding4fun Toolkit in detail... of course where to get them, and then the setup, demo project included. All about Dependency Properties in Silverlight for WP7 WindowsPhoneGeek's latest post is a good dependency-property discussion related to WP7 development, but if you're just learning, it's a good place to learn about the subject. New WP7 Virtual Labs Daniel N. Egan posted links to 6 new WP7 Virtual Labs released on 1/25. Windows Phone Image Button Loek Van Den Ouweland has a style up on his blog that gives you an imageButton for your WP7 apps, and a sweet little video showing how it's done in Expression Blend too. Yet another free Windows Phone book for developers Paul Thurott found a link to another Free eBook for WP7 development. This one is by Puja Pramudya and is an English translation of the original, and is an introductory text, but hey... it's free... give it a look! Stay in the 'Light! Twitter SilverlightNews | Twitter WynApse | WynApse.com | Tagged Posts | SilverlightCream Join me @ SilverlightCream | Phoenix Silverlight User Group Technorati Tags: Silverlight    Silverlight 3    Silverlight 4    Windows Phone MIX10

    Read the article

  • Use jquery to create a multidimensional array

    - by Simon M White
    I'd like to use jquery and a multidemensional array to show a random quote plus the name of the individual who wrote it as a separate item. I'll then be able to use css to style them differently. The quote will change upon page refresh. So far i have this code which combines the quote and the name and person who wrote it: $(document).ready(function(){ var myQuotes = new Array(); myQuotes[0] = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec in tortor mauris. Peter Jones, Dragons Den"; myQuotes[1] = "Curabitur interdum, nibh et fringilla facilisis, lacus ipsum pulvinar mauris, eu facilisis justo arcu eget diam. Duis id sagittis elit. Theo Pathetis, Dragons Den"; myQuotes[2] = "Vivamus purus purus, tincidunt et porttitor et, euismod sit amet urna. Etiam sollicitudin eros nec metus pretium scelerisque. James Caan, Dragons Den"; var myRandom = Math.floor(Math.random()*myQuotes.length); $('.quote-holder blockquote span').html(myQuotes[myRandom]); }); any help would be greatly appreciated.

    Read the article

  • adresse book with C programming, i have problem with library i think, couldn't complite my code

    - by osabri
    I've divided my code in small programm so it can be easy to excute /* ab_error.c : in case of errors following messages will be displayed */ #include "adressbook.h" static char *errormsg[] = { "", "\nNot enough space on disk", "\nCannot open file", "\nCannot read file", "\nCannot write file" }; void check(int error) { switch(error) { case 0: return; case 1: write_file(); case 2: case 3: case 4: system("cls"); fputs(errormsg[error], stderr); exit(error); } } 2nd /* ab_fileio.c : functions for file input/output */ include "adressbook.h" static char ab_file[] = "ADRESSBOOK.DAT"; //file to save the entries int read_file(void) { int error = 0; FILE *fp; ELEMENT *new_e, *last_e = NULL; DATA buffer; if( (fp = fopen(ab_file, "rb")) == NULL) return -1; //no file found while (fread(&buffer, sizeof(DATA), 1, fp) == 1) //reads one list element after another { if( (new_e = make_element()) == NULL) { error = 1; break; //not enough space } new_e->person = buffer; //copy data to new element new_e->next = NULL; if(hol.first == NULL) //list is empty? hol.first = new_e; //yes else last_e->next = new_e; //no last_e = new_e; ++hol.amount; } if( !error && !feof(fp) ) error = 3; //cannot read file fclose(fp); return error; } /-------------------------------/ int write_file(void) { int error = 0; FILE *fp; ELEMENT *p; if( (p = hol.first) == NULL) return 0; //list is empty if( (fp = fopen(ab_file, "wb")) == NULL) return 2; //cannot open while( p!= NULL) { if( fwrite(&p->person, sizeof(DATA), 1, fp) < 1) { error = 4; break; //cannot write } p = p->next; } fclose(fp); return error; } 3rd /* ab_list.c : functions to manipulate the list */ #include "adressbook.h" HOL hol = {0, NULL}; //global definition for head of list /* -------------------- */ ELEMENT *make_element(void) { return (ELEMENT *)malloc( sizeof(ELEMENT) ); } /* -------------------- */ int ins_element( DATA *newdata) { ELEMENT *new_e, *pre_p; if((new_e = make_element()) == NULL) return 1; new_e ->person = *newdata; // copy data to new element pre_p = search(new_e->person.family_name); if(pre_p == NULL) //no person in list { new_e->next = hol.first; //put it to the begin hol.first = new_e; } else { new_e->next = pre_p->next; pre_p->next = new_e; } ++hol.amount; return 0; } int erase_element( char name, char surname ) { return 0; } /* ---------------------*/ ELEMENT *search(char *name) { ELEMENT *sp, *retp; //searchpointer, returnpointer retp = NULL; sp = hol.first; while(sp != NULL && sp->person.family_name != name) { retp = sp; sp = sp->next; } return(retp); } 4th /* ab_screen.c : functions for printing information on screen */ #include "adressbook.h" #include <conio.h> #include <ctype.h> /* standard prompts for in- and output */ static char pgmname[] = "---- Oussama's Adressbook made in splendid C ----"; static char options[] = "\ 1: Enter new adress\n\n\ 2: Delete entry\n\n\ 3: Change entry\n\n\ 4: Print adress\n\n\ Esc: Exit\n\n\n\ Your choice . . .: "; static char prompt[] = "\ Name . . . .:\n\ Surname . . :\n\n\ Street . . .:\n\n\ House number:\n\n\ Postal code :\n\n\ Phone number:"; static char buttons[] = "\ <Esc> = cancel input <Backspace> = correct input\ <Return> = assume"; static char headline[] = "\ Name Surname Street House Postal code Phone number \n\ ------------------------------------------------------------------------"; static char further[] = "\ -------- continue with any key --------"; /* ---------------------------------- */ int menu(void) //show menu and read user input { int c; system ("cls"); set_cur(0,20); puts(pgmname); set_cur(6,0); printf("%s", options); while( (c = getch()) != ESC && (c < '1' || c > '4')) putch('\a'); return c; } /* ---------------------------------- */ int print_adr_book(void) //display adressbook { int line = 1; ELEMENT *p = hol.first; system("cls"); set_cur(0,20); puts(pgmname); set_cur(2,0); puts(headline); set_cur(5,0); while(p != NULL) //run through list and show entries { printf("%5d %-15s ",line, p->person.family_name); printf("%-12s %-15s ", p->person.given_name, p->person.street); printf("%-4d %-5d %-12d\n",p->person.house_number, p->person.postal_code, p->person.phone); p = p->next; if( p == NULL || ++line %16 == 1) //end of list or screen is full { set_cur(24,0); printf("%s",further); if( getch() == ESC) return 0; set_cur(5,0); scroll_up(0,5,24);//puts(headline); } } return 0; } /* -------------------------------------------*/ int make_entry(void) { char cache[50]; DATA newperson; ELEMENT *p; while(1) { system("cls"); set_cur(0,20); puts(pgmname); set_cur(6,0); puts("Please enter new data:"); set_cur(10,0); puts(prompt); set_cur(24,0); printf("%s",buttons); balken(10, 25, MAXL, ' ',0x70); //input name if(input(newperson.family_name, MAXL, ESC, CR) == ESC) return 0; balken(12,25, MAXL, ' ', 0x70); //surname if(input(newperson.given_name, MAXL, ESC, CR) == ESC) return 0; balken(14,25, 30, ' ', 0x70); //street if(input(newperson.street, 30, ESC, CR) == ESC) return 0; balken(16,25, 4, ' ',0x70); //housenumber if(input(cache, 4, ESC, CR) == ESC) return 0; newperson.house_number = atol(cache); //to string balken(18,25, 5, ' ',0x70); //postal code if(input(cache, 5, ESC, CR) == ESC) return 0; newperson.postal_code = atol(cache); //to string balken(20,25, 20, ' ',0x70); //phone number if(input(cache, 20, ESC, CR) == ESC) return 0; newperson.phone = atol(cache); //to string p = search(newperson.phone); if( p!= NULL && p->person.phone == newperson.phone) { set_cur(22,25); puts("phonenumber already exists!"); set_cur(24,0); printf("%s, further"); getch(); continue; } } } 5th /* adress_book_project.c : main program to create an adressbook */ /* copyrights by Oussama Sabri, June 2010 */ #include "adressbook.h" //project header file int main() { int rv, cmd; //return value, user command if ( (rv = read_file() ) == -1) // no data saved yet rv = make_entry(); check(rv); //prompts an error and quits program on disfunction do { switch (cmd = menu())//calls menu and gets user input back { case '1': rv = make_entry(); break; case '2': //delete entry case '3': //changes entry rv = change_entry(cmd); break; case '4': //prints adressbook on screen rv = print_adr_book(); break; case ESC: //end of program system ("cls"); rv = 0; break; } }while(cmd!= ESC); check ( write_file() ); //save adressbook return 0; } 6th /* Getcb.c --> Die Funktion getcb() liefert die naechste * * Tastatureingabe (ruft den BIOS-INT 0x16 auf). * * Return-Wert: * * ASCII-Code bzw. erweiterter Code + 256 */ /* Hinweis: Es muss ein DOS-Compiler verwendet werden. * * (z.B. der GNU-Compiler fuer DOS auf der CD) */ #include <dos.h> int getcb(void) { union REGS intregs; intregs.h.ah = 0; // Subfunktion 0: ein Zeichen // von der Tastatur lesen. int86( 0x16, &intregs, &intregs); if( intregs.h.al != 0) // Falls ASCII-Zeichen, return (intregs.h.al); // dieses zurueckgeben. else // Sonst den erweiterten return (intregs.h.ah + 0x100); // Code + 256 } 7th /* PUTCB.C --> enthaelt die Funktionen * * - putcb() * * - putcb9() * * - balken() * * - input() * * * * Es werden die Funktionen 9 und 14 des Video-Interrupts * * (ROM-BIOS-Interrupt 0x10) verwendet. * * * * Die Prototypen dieser Funktionen stehen in BIO.H */ /* Hinweis: Es muss ein DOS-Compiler verwendet werden. * * (z.B. der GNU-Compiler fuer DOS auf der CD) */ #include <dos.h> #define VIDEO_INT 0x10 /*---------------------------------------------------------------- * putcb(c) gibt das Zeichen auf der aktuellen Cursor-Position * am Bildschirm aus. Der Cursor wird versetzt. * Steuerzeichen Back-Space, CR, LF und BELL werden * ausgefuehrt. * Return-Wert: keiner */ void putcb(unsigned char c) /* Gibt das Zeichen in c auf */ { /* den Bildschirm aus. */ union REGS intregs; intregs.h.ah = 14; /* Subfunktion 14 ("Teletype") */ intregs.h.al = c; intregs.h.bl = 0xf; /* Vordergrund-Farbe im */ /* Grafik-Modus. */ int86(VIDEO_INT, &intregs, &intregs); } /*---------------------------------------------------------------- * putcb9(c,count,mode) gibt das Zeichen in c count-mal im * angegebenen Modus auf der aktuellen * Cursor-Position am Bildschirm aus. * Der Cursor wird nicht versetzt. * * Return-Wert: keiner */ void putcb9( unsigned char c, /* das Zeichen */ unsigned count, /* die Anzahl */ unsigned mode ) /* Low-Byte: das Atrribut */ { /* High-Byte: die Bildschirmseite*/ union REGS intregs; intregs.h.ah = 9; /* Subfunktion 9 des Int 0x10 */ intregs.h.al = c; intregs.x.bx = mode; intregs.x.cx = count; int86( VIDEO_INT, &intregs, &intregs); } /*---------------------------------------------------------------- * balken() positioniert den Cursor und zeichnet einen Balken, * wobei Position, L„nge, Fllzeichen und Attribut * als Argumente bergeben werden. * Der Cursor bleibt auf der ersten Position im Balken. */ void balken( unsigned int zeile, /* Start-Position */ unsigned int spalte, unsigned int laenge, /* Laenge des Balkens */ unsigned char c, /* Fuellzeichen */ unsigned int modus) /* Low-Byte: Attribut */ /* High-Byte: Bildschirmseite */ { union REGS intregs; intregs.h.ah = 2; /* Cursor auf der angegebenen */ intregs.h.dh = zeile; /* Bildschirmseite versetzen. */ intregs.h.dl = spalte; intregs.h.bh = (modus >> 8); int86(VIDEO_INT, &intregs, &intregs); putcb9(c, laenge, modus); /* Balken ausgeben. */ } /*---------------------------------------------------------------- * input() liest Zeichen von der Tastatur ein und haengt '\0' an. * Mit Backspace kann die Eingabe geloescht werden. * Das Attribut am Bildschirm bleibt erhalten. * * Argumente: 1. Zeiger auf den Eingabepuffer. * 2. Anzahl maximal einzulesender Zeichen. * 3. Die optionalen Argumente: Zeichen, mit denen die * Eingabe abgebrochen werden kann. * Diese Liste muá mit CR = '\r' enden! * Return-Wert: Das Zeichen, mit dem die Eingabe abgebrochen wurde. */ #include <stdarg.h> int getcb( void); /* Zum Lesen der Tastatur */ int input(char *puffer, int max,... ) { int c; /* aktuelles Zeichen */ int breakc; /* Abruchzeichen */ int nc = 0; /* Anzahl eingelesener Zeichen */ va_list argp; /* Zeiger auf die weiteren Arumente */ while(1) { *puffer = '\0'; va_start(argp, max); /* argp initialisieren */ c = getcb(); do /* Mit Zeichen der Abbruchliste vergleichen */ if(c == (breakc = va_arg(argp,int)) ) return(breakc); while( breakc != '\r' ); va_end( argp); if( c == '\b' && nc > 0) /* Backspace? */ { --nc; --puffer; putcb(c); putcb(' '); putcb(c); } else if( c >= 32 && c <= 255 && nc < max ) { ++nc; *puffer++ = c; putcb(c); } else if( nc == max) putcb('\7'); /* Ton ausgeben */ } } 8th /* Video.c --> Enthaelt die Funktionen * cls(), * scroll_up(), scroll_down(), * set_cur(), get_cur(), * set_screen_page(), get_screen_page() * * Die Prototypen dieser Funktionen befinden sich in BIO.H */ /* Hinweis: Es muss ein DOS-Compiler verwendet werden. * * (z.B. der GNU-Compiler fuer DOS auf der CD) */ #include <dos.h> #include "bio.h" #define VIDEO_INT 0x10 typedef unsigned char BYTE; void scroll_up( int anzahl, int anf_zeile, int end_zeile) { /* Fenster hoch rollen. */ union REGS intregs; intregs.x.ax = 0x600 + anzahl; /* Subfunktion AH = 6, */ /* AL = Anzahl Zeilen. */ intregs.x.cx = anf_zeile << 8; /* CH=anf_zeile, cl=0 */ intregs.x.dx = (end_zeile <<8) | 79; /* DH=end_zeile,DL=79 */ intregs.h.bh = 7; /* normales Attribut */ int86(VIDEO_INT, &intregs, &intregs); } void scroll_down( int anzahl, int anf_zeile, int end_zeile) { /* Fenster runter rollen. */ union REGS intregs; intregs.x.ax = 0x700 + anzahl; /* Subfunktion AH = 7, */ /* AL = Anzahl Zeilen. */ intregs.x.cx = anf_zeile << 8; /* CH=anf_zeile, cl=0 */ intregs.x.dx = (end_zeile <<8) | 79; /* DH=end_zeile,DL=79 */ intregs.h.bh = 7; /* normales Attribut */ int86(VIDEO_INT, &intregs, &intregs); } void set_cur( int zeile, int spalte) /* versetzt den Cursor */ { /* der aktuellen Bildschirmseite.*/ union REGS intregs; intregs.h.ah = 2; intregs.h.dh = (BYTE)zeile; intregs.h.dl = (BYTE)spalte; intregs.h.bh = (BYTE)get_screen_page(); int86(VIDEO_INT, &intregs, &intregs); } void get_cur(int *zeile, int *spalte) /* holt die Cursor- */ { /* Position der aktuellen Bildschirmseite.*/ union REGS intregs; intregs.h.ah = 3; intregs.h.bh = (BYTE)get_screen_page(); int86(VIDEO_INT, &intregs, &intregs); *zeile = (unsigned)intregs.h.dh; *spalte = (unsigned)intregs.h.dl; } void cls(void) { scroll_up(0,0,24); /* Gesamten Bildschirm loeschen. */ set_cur(0,0); /* Cursor in Home-Position. */ } int get_screen_page(void) /* Aktuelle Bildschirmseite holen.*/ { union REGS intregs; intregs.h.ah = 15; /* Subfunktion AH = 15: */ /* Bildschirm-Modus feststellen. */ int86(VIDEO_INT, &intregs, &intregs); return (intregs.h.bh); } void set_screen_page(int seite) /* setzt die aktive Seite des */ { /* Bildschirmpuffers auf die */ /* angegebene Seite. */ union REGS intregs; intregs.x.ax = 0x500 + seite; /* Subfunktion AH = 5 */ int86(VIDEO_INT, &intregs, &intregs); } /* ------------------------------------------------------------- Ein kleines Testprogramm : */ /* #include <stdio.h> int main() { cls(); set_cur(23, 0); printf("Weiter mit <Return>\n"); set_cur(12, 20); printf("Ein Test!\n"); getchar(); scroll_up(3, 5, 20); getchar(); scroll_down(6, 5, 20); getchar(); set_screen_page(1); printf("\nAuf der 2. Seite !\n"); getchar(); set_screen_page(0); set_cur(0,0); printf("\nWieder auf der 1. Seite !\n"); getchar(); cls(); return 0; } */ /* Video.c --> Enthaelt die Funktionen * cls(), * scroll_up(), scroll_down(), * set_cur(), get_cur(), * set_screen_page(), get_screen_page() * * Die Prototypen dieser Funktionen befinden sich in BIO.H */ /* Hinweis: Es muss ein DOS-Compiler verwendet werden. * * (z.B. der GNU-Compiler fuer DOS auf der CD) */ #include <dos.h> #include "bio.h" #define VIDEO_INT 0x10 typedef unsigned char BYTE; void scroll_up( int anzahl, int anf_zeile, int end_zeile) { /* Fenster hoch rollen. */ union REGS intregs; intregs.x.ax = 0x600 + anzahl; /* Subfunktion AH = 6, */ /* AL = Anzahl Zeilen. */ intregs.x.cx = anf_zeile << 8; /* CH=anf_zeile, cl=0 */ intregs.x.dx = (end_zeile <<8) | 79; /* DH=end_zeile,DL=79 */ intregs.h.bh = 7; /* normales Attribut */ int86(VIDEO_INT, &intregs, &intregs); } void scroll_down( int anzahl, int anf_zeile, int end_zeile) { /* Fenster runter rollen. */ union REGS intregs; intregs.x.ax = 0x700 + anzahl; /* Subfunktion AH = 7, */ /* AL = Anzahl Zeilen. */ intregs.x.cx = anf_zeile << 8; /* CH=anf_zeile, cl=0 */ intregs.x.dx = (end_zeile <<8) | 79; /* DH=end_zeile,DL=79 */ intregs.h.bh = 7; /* normales Attribut */ int86(VIDEO_INT, &intregs, &intregs); } void set_cur( int zeile, int spalte) /* versetzt den Cursor */ { /* der aktuellen Bildschirmseite.*/ union REGS intregs; intregs.h.ah = 2; intregs.h.dh = (BYTE)zeile; intregs.h.dl = (BYTE)spalte; intregs.h.bh = (BYTE)get_screen_page(); int86(VIDEO_INT, &intregs, &intregs); } void get_cur(int *zeile, int *spalte) /* holt die Cursor- */ { /* Position der aktuellen Bildschirmseite.*/ union REGS intregs; intregs.h.ah = 3; intregs.h.bh = (BYTE)get_screen_page(); int86(VIDEO_INT, &intregs, &intregs); *zeile = (unsigned)intregs.h.dh; *spalte = (unsigned)intregs.h.dl; } void cls(void) { scroll_up(0,0,24); /* Gesamten Bildschirm loeschen. */ set_cur(0,0); /* Cursor in Home-Position. */ } int get_screen_page(void) /* Aktuelle Bildschirmseite holen.*/ { union REGS intregs; intregs.h.ah = 15; /* Subfunktion AH = 15: */ /* Bildschirm-Modus feststellen. */ int86(VIDEO_INT, &intregs, &intregs); return (intregs.h.bh); } void set_screen_page(int seite) /* setzt die aktive Seite des */ { /* Bildschirmpuffers auf die */ /* angegebene Seite. */ union REGS intregs; intregs.x.ax = 0x500 + seite; /* Subfunktion AH = 5 */ int86(VIDEO_INT, &intregs, &intregs); } /* ------------------------------------------------------------- Ein kleines Testprogramm : */ /* #include <stdio.h> int main() { cls(); set_cur(23, 0); printf("Weiter mit <Return>\n"); set_cur(12, 20); printf("Ein Test!\n"); getchar(); scroll_up(3, 5, 20); getchar(); scroll_down(6, 5, 20); getchar(); set_screen_page(1); printf("\nAuf der 2. Seite !\n"); getchar(); set_screen_page(0); set_cur(0,0); printf("\nWieder auf der 1. Seite !\n"); getchar(); cls(); return 0; } */ /* BIO.H --> Enthaelt die Prototypen der BIOS-Funktionen. */ /* --- Funktionen in VIDEO.C --- */ extern void scroll_up(int anzahl, int anf_zeile,int end_zeile); extern void scroll_down(int anzahl, int anf_zeile, int end_zeile); extern void set_cur(int zeile, int spalte); extern void get_cur(int *zeile, int *spalte); extern void cls(void); extern int get_screen_page(void); extern void set_screen_page(int page); /* --- Funktionen in GETCB.C / PUTCB.C --- */ extern int getcb(void); extern void putcb(int c); extern void putcb9(int c, unsigned count, unsigned modus); extern void balken(int zeile, int spalte, int laenge, int c, unsigned modus); extern int input(char *puffer, int max,... ); need your help, can't find my mistakes:((

    Read the article

  • Address book with C programming; cannot compile my code.

    - by osabri
    I've divided my code into small programs so it can be easy to excute /* ab_error.c : in case of errors following messages will be displayed */ #include "adressbook.h" static char *errormsg[] = { "", "\nNot enough space on disk", "\nCannot open file", "\nCannot read file", "\nCannot write file" }; void check(int error) { switch(error) { case 0: return; case 1: write_file(); case 2: case 3: case 4: system("cls"); fputs(errormsg[error], stderr); exit(error); } } 2nd /* ab_fileio.c : functions for file input/output */ #include "adressbook.h" static char ab_file[] = "ADRESSBOOK.DAT"; //file to save the entries int read_file(void) { int error = 0; FILE *fp; ELEMENT *new_e, *last_e = NULL; DATA buffer; if( (fp = fopen(ab_file, "rb")) == NULL) return -1; //no file found while (fread(&buffer, sizeof(DATA), 1, fp) == 1) //reads one list element after another { if( (new_e = make_element()) == NULL) { error = 1; break; //not enough space } new_e->person = buffer; //copy data to new element new_e->next = NULL; if(hol.first == NULL) //list is empty? hol.first = new_e; //yes else last_e->next = new_e; //no last_e = new_e; ++hol.amount; } if( !error && !feof(fp) ) error = 3; //cannot read file fclose(fp); return error; } /*-------------------------------*/ int write_file(void) { int error = 0; FILE *fp; ELEMENT *p; if( (p = hol.first) == NULL) return 0; //list is empty if( (fp = fopen(ab_file, "wb")) == NULL) return 2; //cannot open while( p!= NULL) { if( fwrite(&p->person, sizeof(DATA), 1, fp) < 1) { error = 4; break; //cannot write } p = p->next; } fclose(fp); return error; } 3rd /* ab_list.c : functions to manipulate the list */ #include "adressbook.h" HOL hol = {0, NULL}; //global definition for head of list /* -------------------- */ ELEMENT *make_element(void) { return (ELEMENT *)malloc( sizeof(ELEMENT) ); } /* -------------------- */ int ins_element( DATA *newdata) { ELEMENT *new_e, *pre_p; if((new_e = make_element()) == NULL) return 1; new_e ->person = *newdata; // copy data to new element pre_p = search(new_e->person.family_name); if(pre_p == NULL) //no person in list { new_e->next = hol.first; //put it to the begin hol.first = new_e; } else { new_e->next = pre_p->next; pre_p->next = new_e; } ++hol.amount; return 0; } int erase_element( char name, char surname ) { return 0; } /* ---------------------*/ ELEMENT *search(char *name) { ELEMENT *sp, *retp; //searchpointer, returnpointer retp = NULL; sp = hol.first; while(sp != NULL && sp->person.family_name != name) { retp = sp; sp = sp->next; } return(retp); } 4th /* ab_screen.c : functions for printing information on screen */ #include "adressbook.h" #include <conio.h> #include <ctype.h> /* standard prompts for in- and output */ static char pgmname[] = "---- Oussama's Adressbook made in splendid C ----"; static char options[] = "\ 1: Enter new adress\n\n\ 2: Delete entry\n\n\ 3: Change entry\n\n\ 4: Print adress\n\n\ Esc: Exit\n\n\n\ Your choice . . .: "; static char prompt[] = "\ Name . . . .:\n\ Surname . . :\n\n\ Street . . .:\n\n\ House number:\n\n\ Postal code :\n\n\ Phone number:"; static char buttons[] = "\ <Esc> = cancel input <Backspace> = correct input\ <Return> = assume"; static char headline[] = "\ Name Surname Street House Postal code Phone number \n\ ------------------------------------------------------------------------"; static char further[] = "\ -------- continue with any key --------"; /* ---------------------------------- */ int menu(void) //show menu and read user input { int c; system ("cls"); set_cur(0,20); puts(pgmname); set_cur(6,0); printf("%s", options); while( (c = getch()) != ESC && (c < '1' || c > '4')) putch('\a'); return c; } /* ---------------------------------- */ int print_adr_book(void) //display adressbook { int line = 1; ELEMENT *p = hol.first; system("cls"); set_cur(0,20); puts(pgmname); set_cur(2,0); puts(headline); set_cur(5,0); while(p != NULL) //run through list and show entries { printf("%5d %-15s ",line, p->person.family_name); printf("%-12s %-15s ", p->person.given_name, p->person.street); printf("%-4d %-5d %-12d\n",p->person.house_number, p->person.postal_code, p->person.phone); p = p->next; if( p == NULL || ++line %16 == 1) //end of list or screen is full { set_cur(24,0); printf("%s",further); if( getch() == ESC) return 0; set_cur(5,0); scroll_up(0,5,24);//puts(headline); } } return 0; } /* -------------------------------------------*/ int make_entry(void) { char cache[50]; DATA newperson; ELEMENT *p; while(1) { system("cls"); set_cur(0,20); puts(pgmname); set_cur(6,0); puts("Please enter new data:"); set_cur(10,0); puts(prompt); set_cur(24,0); printf("%s",buttons); balken(10, 25, MAXL, ' ',0x70); //input name if(input(newperson.family_name, MAXL, ESC, CR) == ESC) return 0; balken(12,25, MAXL, ' ', 0x70); //surname if(input(newperson.given_name, MAXL, ESC, CR) == ESC) return 0; balken(14,25, 30, ' ', 0x70); //street if(input(newperson.street, 30, ESC, CR) == ESC) return 0; balken(16,25, 4, ' ',0x70); //housenumber if(input(cache, 4, ESC, CR) == ESC) return 0; newperson.house_number = atol(cache); //to string balken(18,25, 5, ' ',0x70); //postal code if(input(cache, 5, ESC, CR) == ESC) return 0; newperson.postal_code = atol(cache); //to string balken(20,25, 20, ' ',0x70); //phone number if(input(cache, 20, ESC, CR) == ESC) return 0; newperson.phone = atol(cache); //to string p = search(newperson.phone); if( p!= NULL && p->person.phone == newperson.phone) { set_cur(22,25); puts("phonenumber already exists!"); set_cur(24,0); printf("%s, further"); getch(); continue; } } } 5th /* adress_book_project.c : main program to create an adressbook */ /* copyrights by Oussama Sabri, June 2010 */ #include "adressbook.h" //project header file int main() { int rv, cmd; //return value, user command if ( (rv = read_file() ) == -1) // no data saved yet rv = make_entry(); check(rv); //prompts an error and quits program on disfunction do { switch (cmd = menu())//calls menu and gets user input back { case '1': rv = make_entry(); break; case '2': //delete entry case '3': //changes entry rv = change_entry(cmd); break; case '4': //prints adressbook on screen rv = print_adr_book(); break; case ESC: //end of program system ("cls"); rv = 0; break; } }while(cmd!= ESC); check ( write_file() ); //save adressbook return 0; } 6th /* Getcb.c --> Die Funktion getcb() liefert die naechste * * Tastatureingabe (ruft den BIOS-INT 0x16 auf). * * Return-Wert: * * ASCII-Code bzw. erweiterter Code + 256 */ /* Hinweis: Es muss ein DOS-Compiler verwendet werden. * * (z.B. der GNU-Compiler fuer DOS auf der CD) */ #include <dos.h> int getcb(void) { union REGS intregs; intregs.h.ah = 0; // Subfunktion 0: ein Zeichen // von der Tastatur lesen. int86( 0x16, &intregs, &intregs); if( intregs.h.al != 0) // Falls ASCII-Zeichen, return (intregs.h.al); // dieses zurueckgeben. else // Sonst den erweiterten return (intregs.h.ah + 0x100); // Code + 256 } 7th /* PUTCB.C --> enthaelt die Funktionen * * - putcb() * * - putcb9() * * - balken() * * - input() * * * * Es werden die Funktionen 9 und 14 des Video-Interrupts * * (ROM-BIOS-Interrupt 0x10) verwendet. * * * * Die Prototypen dieser Funktionen stehen in BIO.H */ /* Hinweis: Es muss ein DOS-Compiler verwendet werden. * * (z.B. der GNU-Compiler fuer DOS auf der CD) */ #include <dos.h> #define VIDEO_INT 0x10 /*---------------------------------------------------------------- * putcb(c) gibt das Zeichen auf der aktuellen Cursor-Position * am Bildschirm aus. Der Cursor wird versetzt. * Steuerzeichen Back-Space, CR, LF und BELL werden * ausgefuehrt. * Return-Wert: keiner */ void putcb(unsigned char c) /* Gibt das Zeichen in c auf */ { /* den Bildschirm aus. */ union REGS intregs; intregs.h.ah = 14; /* Subfunktion 14 ("Teletype") */ intregs.h.al = c; intregs.h.bl = 0xf; /* Vordergrund-Farbe im */ /* Grafik-Modus. */ int86(VIDEO_INT, &intregs, &intregs); } /*---------------------------------------------------------------- * putcb9(c,count,mode) gibt das Zeichen in c count-mal im * angegebenen Modus auf der aktuellen * Cursor-Position am Bildschirm aus. * Der Cursor wird nicht versetzt. * * Return-Wert: keiner */ void putcb9( unsigned char c, /* das Zeichen */ unsigned count, /* die Anzahl */ unsigned mode ) /* Low-Byte: das Atrribut */ { /* High-Byte: die Bildschirmseite*/ union REGS intregs; intregs.h.ah = 9; /* Subfunktion 9 des Int 0x10 */ intregs.h.al = c; intregs.x.bx = mode; intregs.x.cx = count; int86( VIDEO_INT, &intregs, &intregs); } /*---------------------------------------------------------------- * balken() positioniert den Cursor und zeichnet einen Balken, * wobei Position, L„nge, Fllzeichen und Attribut * als Argumente bergeben werden. * Der Cursor bleibt auf der ersten Position im Balken. */ void balken( unsigned int zeile, /* Start-Position */ unsigned int spalte, unsigned int laenge, /* Laenge des Balkens */ unsigned char c, /* Fuellzeichen */ unsigned int modus) /* Low-Byte: Attribut */ /* High-Byte: Bildschirmseite */ { union REGS intregs; intregs.h.ah = 2; /* Cursor auf der angegebenen */ intregs.h.dh = zeile; /* Bildschirmseite versetzen. */ intregs.h.dl = spalte; intregs.h.bh = (modus >> 8); int86(VIDEO_INT, &intregs, &intregs); putcb9(c, laenge, modus); /* Balken ausgeben. */ } /*---------------------------------------------------------------- * input() liest Zeichen von der Tastatur ein und haengt '\0' an. * Mit Backspace kann die Eingabe geloescht werden. * Das Attribut am Bildschirm bleibt erhalten. * * Argumente: 1. Zeiger auf den Eingabepuffer. * 2. Anzahl maximal einzulesender Zeichen. * 3. Die optionalen Argumente: Zeichen, mit denen die * Eingabe abgebrochen werden kann. * Diese Liste muá mit CR = '\r' enden! * Return-Wert: Das Zeichen, mit dem die Eingabe abgebrochen wurde. */ #include <stdarg.h> int getcb( void); /* Zum Lesen der Tastatur */ int input(char *puffer, int max,... ) { int c; /* aktuelles Zeichen */ int breakc; /* Abruchzeichen */ int nc = 0; /* Anzahl eingelesener Zeichen */ va_list argp; /* Zeiger auf die weiteren Arumente */ while(1) { *puffer = '\0'; va_start(argp, max); /* argp initialisieren */ c = getcb(); do /* Mit Zeichen der Abbruchliste vergleichen */ if(c == (breakc = va_arg(argp,int)) ) return(breakc); while( breakc != '\r' ); va_end( argp); if( c == '\b' && nc > 0) /* Backspace? */ { --nc; --puffer; putcb(c); putcb(' '); putcb(c); } else if( c >= 32 && c <= 255 && nc < max ) { ++nc; *puffer++ = c; putcb(c); } else if( nc == max) putcb('\7'); /* Ton ausgeben */ } } 8th /* Video.c --> Enthaelt die Funktionen * cls(), * scroll_up(), scroll_down(), * set_cur(), get_cur(), * set_screen_page(), get_screen_page() * * Die Prototypen dieser Funktionen befinden sich in BIO.H */ /* Hinweis: Es muss ein DOS-Compiler verwendet werden. * * (z.B. der GNU-Compiler fuer DOS auf der CD) */ #include <dos.h> #include "bio.h" #define VIDEO_INT 0x10 typedef unsigned char BYTE; void scroll_up( int anzahl, int anf_zeile, int end_zeile) { /* Fenster hoch rollen. */ union REGS intregs; intregs.x.ax = 0x600 + anzahl; /* Subfunktion AH = 6, */ /* AL = Anzahl Zeilen. */ intregs.x.cx = anf_zeile << 8; /* CH=anf_zeile, cl=0 */ intregs.x.dx = (end_zeile <<8) | 79; /* DH=end_zeile,DL=79 */ intregs.h.bh = 7; /* normales Attribut */ int86(VIDEO_INT, &intregs, &intregs); } void scroll_down( int anzahl, int anf_zeile, int end_zeile) { /* Fenster runter rollen. */ union REGS intregs; intregs.x.ax = 0x700 + anzahl; /* Subfunktion AH = 7, */ /* AL = Anzahl Zeilen. */ intregs.x.cx = anf_zeile << 8; /* CH=anf_zeile, cl=0 */ intregs.x.dx = (end_zeile <<8) | 79; /* DH=end_zeile,DL=79 */ intregs.h.bh = 7; /* normales Attribut */ int86(VIDEO_INT, &intregs, &intregs); } void set_cur( int zeile, int spalte) /* versetzt den Cursor */ { /* der aktuellen Bildschirmseite.*/ union REGS intregs; intregs.h.ah = 2; intregs.h.dh = (BYTE)zeile; intregs.h.dl = (BYTE)spalte; intregs.h.bh = (BYTE)get_screen_page(); int86(VIDEO_INT, &intregs, &intregs); } void get_cur(int *zeile, int *spalte) /* holt die Cursor- */ { /* Position der aktuellen Bildschirmseite.*/ union REGS intregs; intregs.h.ah = 3; intregs.h.bh = (BYTE)get_screen_page(); int86(VIDEO_INT, &intregs, &intregs); *zeile = (unsigned)intregs.h.dh; *spalte = (unsigned)intregs.h.dl; } void cls(void) { scroll_up(0,0,24); /* Gesamten Bildschirm loeschen. */ set_cur(0,0); /* Cursor in Home-Position. */ } int get_screen_page(void) /* Aktuelle Bildschirmseite holen.*/ { union REGS intregs; intregs.h.ah = 15; /* Subfunktion AH = 15: */ /* Bildschirm-Modus feststellen. */ int86(VIDEO_INT, &intregs, &intregs); return (intregs.h.bh); } void set_screen_page(int seite) /* setzt die aktive Seite des */ { /* Bildschirmpuffers auf die */ /* angegebene Seite. */ union REGS intregs; intregs.x.ax = 0x500 + seite; /* Subfunktion AH = 5 */ int86(VIDEO_INT, &intregs, &intregs); } /* ------------------------------------------------------------- Ein kleines Testprogramm : */ /* #include <stdio.h> int main() { cls(); set_cur(23, 0); printf("Weiter mit <Return>\n"); set_cur(12, 20); printf("Ein Test!\n"); getchar(); scroll_up(3, 5, 20); getchar(); scroll_down(6, 5, 20); getchar(); set_screen_page(1); printf("\nAuf der 2. Seite !\n"); getchar(); set_screen_page(0); set_cur(0,0); printf("\nWieder auf der 1. Seite !\n"); getchar(); cls(); return 0; } */ /* Video.c --> Enthaelt die Funktionen * cls(), * scroll_up(), scroll_down(), * set_cur(), get_cur(), * set_screen_page(), get_screen_page() * * Die Prototypen dieser Funktionen befinden sich in BIO.H */ /* Hinweis: Es muss ein DOS-Compiler verwendet werden. * * (z.B. der GNU-Compiler fuer DOS auf der CD) */ #include <dos.h> #include "bio.h" #define VIDEO_INT 0x10 typedef unsigned char BYTE; void scroll_up( int anzahl, int anf_zeile, int end_zeile) { /* Fenster hoch rollen. */ union REGS intregs; intregs.x.ax = 0x600 + anzahl; /* Subfunktion AH = 6, */ /* AL = Anzahl Zeilen. */ intregs.x.cx = anf_zeile << 8; /* CH=anf_zeile, cl=0 */ intregs.x.dx = (end_zeile <<8) | 79; /* DH=end_zeile,DL=79 */ intregs.h.bh = 7; /* normales Attribut */ int86(VIDEO_INT, &intregs, &intregs); } void scroll_down( int anzahl, int anf_zeile, int end_zeile) { /* Fenster runter rollen. */ union REGS intregs; intregs.x.ax = 0x700 + anzahl; /* Subfunktion AH = 7, */ /* AL = Anzahl Zeilen. */ intregs.x.cx = anf_zeile << 8; /* CH=anf_zeile, cl=0 */ intregs.x.dx = (end_zeile <<8) | 79; /* DH=end_zeile,DL=79 */ intregs.h.bh = 7; /* normales Attribut */ int86(VIDEO_INT, &intregs, &intregs); } void set_cur( int zeile, int spalte) /* versetzt den Cursor */ { /* der aktuellen Bildschirmseite.*/ union REGS intregs; intregs.h.ah = 2; intregs.h.dh = (BYTE)zeile; intregs.h.dl = (BYTE)spalte; intregs.h.bh = (BYTE)get_screen_page(); int86(VIDEO_INT, &intregs, &intregs); } void get_cur(int *zeile, int *spalte) /* holt die Cursor- */ { /* Position der aktuellen Bildschirmseite.*/ union REGS intregs; intregs.h.ah = 3; intregs.h.bh = (BYTE)get_screen_page(); int86(VIDEO_INT, &intregs, &intregs); *zeile = (unsigned)intregs.h.dh; *spalte = (unsigned)intregs.h.dl; } void cls(void) { scroll_up(0,0,24); /* Gesamten Bildschirm loeschen. */ set_cur(0,0); /* Cursor in Home-Position. */ } int get_screen_page(void) /* Aktuelle Bildschirmseite holen.*/ { union REGS intregs; intregs.h.ah = 15; /* Subfunktion AH = 15: */ /* Bildschirm-Modus feststellen. */ int86(VIDEO_INT, &intregs, &intregs); return (intregs.h.bh); } void set_screen_page(int seite) /* setzt die aktive Seite des */ { /* Bildschirmpuffers auf die */ /* angegebene Seite. */ union REGS intregs; intregs.x.ax = 0x500 + seite; /* Subfunktion AH = 5 */ int86(VIDEO_INT, &intregs, &intregs); } /* ------------------------------------------------------------- Ein kleines Testprogramm : */ /* #include <stdio.h> int main() { cls(); set_cur(23, 0); printf("Weiter mit <Return>\n"); set_cur(12, 20); printf("Ein Test!\n"); getchar(); scroll_up(3, 5, 20); getchar(); scroll_down(6, 5, 20); getchar(); set_screen_page(1); printf("\nAuf der 2. Seite !\n"); getchar(); set_screen_page(0); set_cur(0,0); printf("\nWieder auf der 1. Seite !\n"); getchar(); cls(); return 0; } */ /* BIO.H --> Enthaelt die Prototypen der BIOS-Funktionen. */ /* --- Funktionen in VIDEO.C --- */ extern void scroll_up(int anzahl, int anf_zeile,int end_zeile); extern void scroll_down(int anzahl, int anf_zeile, int end_zeile); extern void set_cur(int zeile, int spalte); extern void get_cur(int *zeile, int *spalte); extern void cls(void); extern int get_screen_page(void); extern void set_screen_page(int page); /* --- Funktionen in GETCB.C / PUTCB.C --- */ extern int getcb(void); extern void putcb(int c); extern void putcb9(int c, unsigned count, unsigned modus); extern void balken(int zeile, int spalte, int laenge, int c, unsigned modus); extern int input(char *puffer, int max,... ); need your help, can't find my mistakes:((

    Read the article

  • Windows Security Videos auf Channel 9

    - by Your DisplayName here!
    Ich habe vor ein paar Wochen mit Lori drei Videos zum Thema Windows Security für Entwickler aufgenommen – die sind nun Online. Der erste Teil beschäftigt sich mit den absoluten Grundlagen der Windows Sicherheit. Was ist ein Konto? Was ist eine SID? Was ist ein Windows Token? Weiterhin wird gezeigt, wie sich diese grundlegenden Windows Einrichtungen über Managed Code anprogrammieren lassen. Der Vortrag endet mit einem kleinen Einblick in die Vorgehensweise von UAC, und wie dieses programmatisch verwendet werden kann. http://channel9.msdn.com/Blogs/Lori/Windows-Security-fr-Developers-Teil-1 Teil zwei beschäfitgt sich mit Zugriffs-Kontrolllisten, und wie diese mit .NET Code gelesen und geschrieben werden können. Weiterhin werden die beiden verwandten Konzepte Logon Session und Impersonierung besprochen. Beide Einrichtungen erzeugen einen neuen Token, sind aber grundlegend verschieden in ihren Einsatzgebieten. http://channel9.msdn.com/Blogs/Lori/Windows-Security-fr-Developers-Teil-2 Teil drei stellt das Kerberos Netzwerk-Authentifizierungsprotokoll vor. Da dieses Protokoll standardmäßig in Active Directory verwendet wird, sollten man es in den Grundzügen kennen. Natürlich kann auch Kerberos aus Managed Code verwendet werden – die abschließende Demo zeigt wie dies funktioniert. http://channel9.msdn.com/Blogs/Lori/Windows-Security-fr-Developers-Teil-3 …und noch ein kleines Interview http://channel9.msdn.com/Blogs/Lori/Interview-mit-Dominick-Baier Viel Spaß ;)

    Read the article

  • links for 2010-05-19

    - by Bob Rhubart
    Presentations from #otnarchday in Dallas now available on Slideshare Includes presentations on IT Optimization, Application Integration Architecture, Application Grid, and Infrastructure Consolidation. More to come. Anthony Shorten: JMX Based Monitoring - Part Four - Business App Server Monitoring Anthony Shorten discuss a new Oracle Utilities Application Framework V4 feature that allows JMX to be used for management and monitoring the Oracle Utilities business application server component. (tags: oracle otn java architect) New book: Oracle Coherence 3.5 An overview of the new book by authors Aleksandar Seovic, Mark Falco, Patrick Peralta. (tags: oracle otn grid architect) Douwe Pieter van den Bos: Next step in Virtualization: VirtualBox 3.2 "For businesses, VirtualBox just might be the answer they where looking for," says Douwe Pieter van den Bos. "A simple and widely supported virtual machine." (tags: oracle otn virtualization architect) Maurice Gamanho: Python and Ruby in Tuxedo Maurice Gamanho's quick overview of new features in Oracle's Service Architecture Leveraging Tuxedo (SALT) 11gR1. (tags: oracle otn soa architect) Live Webcast: Oracle and AmberPoint - May 20, 2010 - 10 a.m. PT/1 p.m. ET Ed Horst and Ashish Mohindroo discuss the advantages of the Oracle and AmberPoint combination. (tags: oracle otn architect soa governance)

    Read the article

  • SOA &amp; BPM Integration Days February 23rd &amp; 24th 2011 D&uuml;sseldorf Germany

    - by Jürgen Kress
    The key German SOA Experts will present at the SOA & BPM Integration Days 2011 for all German SOA users it’s the key event in 2001, make sure you register today! Speakers include: Torsten Winterberg OPITZ Hajo Normann HP Guido Schmutz Trivadis Dirk Krafzig SOAPARK Niko Köbler OPITZ Clemens Utschig-Utschig Boehringer Ingelheim Nicolai Josuttis IT communication Bernd Trops SOPERA   Berthold Maier Oracle Deutschland Jürgen Kress Oracle EMEA The agenda is exciting for all SOA and BPA experts! See you in Düsseldorf Germany!   Es ist soweit: Die Entwickler Akademie und das Magazin Business Technology präsentieren Ihnen die ersten SOA, BPM & Integration Days! Das einzigartige Trainingsevent versammelt für Sie die führenden Köpfe im deutschsprachigen Raum rund um SOA,  BPM und Integration.  Zwei Tage lang erhalten Sie ohne Marketingfilter wertvolle Informationen, Erkenntnisse und  Erfahrungen aus der täglichen Projektarbeit. Sie müssen sich nur noch entscheiden, welche persönlichen Themenschwerpunkte Sie setzen möchten. Darüber hinaus bietet sich Ihnen die einmalige Chance, ihre Fragen und Herausforderungen mit den Experten aus der Praxis zu diskutieren. In den SOA, BPM & Integration Days profitieren Sie von der geballten Praxiserfahrung der Autorenrunde des SOA Spezial Magazins (Publikation des Software & Support Verlags), bekannter Buchautoren und langjährigen Sprechern der JAX-Konferenzen. Dieses Event sollten Sie auf keinen Fall verpassen!  Details und Anmeldung unter: www.soa-bpm-days.de For more information on SOA Specialization and the SOA Partner Community please feel free to register at www.oracle.com/goto/emea/soa (OPN account required) Blog Twitter LinkedIn Mix Forum Wiki Website Technorati Tags: SOA & BPM Integration Days,SOA,BPM,Hajo Normnn,Torsten Winterberg,Clemens Utschig-Utschig,Berthold Maier,Bernd Trops,Guido Schmutz,Nicolai Josuttis,Niko Köbler,Dirk Krafzig,Jürgen Kress,Oracle,Jax,Javamagazin,entwickler adademiem,business technology

    Read the article

  • Erfolgreicher Start für Solution Center von Azlan

    - by A&C Redaktion
    Von links nach rechts: Rainer Hunkler, Hunkler GmbH & Co. KG / Birgit Nehring, Director Software & Solutions TDAzlan Am 11. Juni war es so weit: Der Distributor Tech Data Azlan eröffnete feierlich das zertifizierte Oracle Solutions Center (wir berichteten). Zugegen waren auch diverse Oracle Partner. Sie sind es, an die sich das neue Angebot vorrangig richtet: Das beeindruckend ausgestattete Oracle Authorized Solutions Center (OASC) steht Partnern künftig zur Verfügung, um vor allem Engineered Systems, aber auch Klassiker wie den Sparc-Server zu testen und ihren Kunden live vorzuführen. Unterstützt werden Interessierte dabei durch den Azlan-Consultant Ingo Frobenius und sein Team ausgewiesener Oracle Spezialisten. Es ist sogar möglich, die Systeme auszuleihen, wenn der Test in einer besonderen Umgebung erfolgen soll. Gemeinsam mit Birgit Nehring, Director Software und Solutions bei Azlan, feierten hochrangige Oracle Vertreter wie Christian Werner diesen Meilenstein für Oracle und Azlan. Einen ausführlichen Bericht von der Eröffnung mit Hintergründen zur Neuausrichtung im Channel-Business und der Oracle Strategie bezüglich Engineered Systems lesen Sie in der aktuellen Ausgabe der IT-Business unter der Überschrift „Azlan nimmt Demo-Center für Oracle Produkte in Betrieb“.

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >