Search Results

Search found 1072 results on 43 pages for 'mohamed abd el maged'.

Page 16/43 | < Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >

  • macro function in libcurl which return the libcurl version

    - by Mohamed KALLEL
    I m developing a c program using libcurl. when I build my program I can use different version of libcurl. When I change from version to other (of libcurl) I have to change some blocks in my source code to adapt it to the libcurl version. I'm looking to add macro in my code which will check the libcurl version and then determine which block of source code to use automatically Are there a macro function or constant in libcurl which return the libcurl version?

    Read the article

  • Does anyone change the Visual Studio default bracing style in C# - Is there a standard?

    - by El Ronnoco
    I find the default bracing style a bit wasteful on line count eg... function foo() { if (...) { ... } else { ... } } would, if I was writing in JavaScript for example be written like... function foo() { if (...) { ... } else { ... } } ...which I understand may also not be to peoples' tastes. But the question(s) is/are do you turn off the VS formatting style and use your own rules? What is the opinion of this in the industry when many people are working on the same code-base? Is it better just to stick to the default just for simplicity/uniformity?

    Read the article

  • Windows Azure access POST data

    - by Mohamed Nuur
    Ok, so I can't seem to find decent Windows Azure examples. I have a simple hello world application that's based on this tutorial. I want to have custom output instead of JSON or XML. So I created my interface like: [ServiceContract] public interface IService { [OperationContract] [WebInvoke(UriTemplate = "session/create", Method = "POST")] string createSession(); } public class MyService : IService { public string createSession() { // get access to POST data here: user, pass string sessionid = Session.Create(user, pass); return "sessionid=" + sessionid; } } For the life of me, I can't seem to figure out how to access the POST data. Please help. Thanks!

    Read the article

  • Genetic/Evolutionary algorithms and local minima/maxima problem

    - by el.gringogrande
    I have run across several posts and articles that suggests using things like simulated annealing to avoid the local minima/maxima problem. I don't understand why this would be necessary if you started out with a sufficiently large random population. Is it just another check to insure that the initial population was, in fact, sufficiently large and random? Or are those techniques just an alternative to producing a "good" initial population?

    Read the article

  • File Storage for Web Applications: Filesystem vs DB vs NoSQL engines

    - by El Yobo
    I have a web application that stores a lot of user generated files. Currently these are all stored on the server filesystem, which has several downsides for me. When we move "folders" (as defined by our application) we also have to move the files on disk (although this is more due to strange design decisions on the part of the original developers than a requirement of storing things on the filesystem). It's hard to write tests for file system actions; I have a mock filesystem class that logs actions like move, delete etc, without performing them, which more or less does the job, but I don't have 100% confidence in the tests. I will be adding some other jobs which need to access the files from other service to perform additional tasks (e.g. indexing in Solr, generating thumbnails, movie format conversion), so I need to get at the files remotely. Doing this over network shares seems dodgy... Dealing with permissions on the filesystem as sometimes given us problems in the past, although now that we've moved to a pure Linux environment this should be less of an issue. What are the downsides of storing files as BLOBs in MySQL? I guess that it would massively increase the database size and reduce the effectiveness of caches, but are there other problems? Do the same problems exist with NoSQL systems like Cassandra? Does anyone have any other suggestions that might be appropriate?

    Read the article

  • How to start application from C# application?

    - by Mohamed
    hi all, how can i start any application from C# i mean for example, if i have an openfiledialog and the user opened it and selected any file and opened it, i need this file to opened in its application whatever its extension and its default start application. i have googled and found that Process.Start takes the file name and its application but i don't know what is the type of the file the user is going o open thanks in advance for any replies.

    Read the article

  • Creating a simple JQuery tooltip?

    - by Mike El Panther
    Has anybody here got any experience in creating simple tooptips using JQuery? I have created a table: <tr id="mon_Section"> <td id="day_Title">Monday</td>` <td id="mon_Row" onmousemove="calculate_Time(event)"></td> </tr>` the function "calculate_Time" will be called and this gets the X position of the mouse cursor and from the value, uses IF and ELSE-IF statements to calculate the values of other variables i have created: var mon_Pos; var hour; var minute; var orig; var myxpos; function calculate_Time(event) { myxpos = event.pageX; myxpos = myxpos-194; if (myxpos<60) { orig = myxpos; minute = myxpos; hour = 07; } else if (myxpos>=60 && myxpos<120) { orig = myxpos; minute=myxpos-60; hour=08; } } How do i go about creating a stylized tooltip containing the Hour and Minute variables that i created, I need the tooltip to be updated everytime the X position of the cursor changes. I know that with myxpos variable does change whenever the mouse is moved because i tried it out using an alert(myxpos) and as expected, if the mouse moves, a new alert box popups with a new value. I just cant work out how to place that value in a tooltip?

    Read the article

  • I am having issues with django test

    - by Mohamed
    I have this test case def test_loginin_student_control_panel(self): c = Client() c.login(username="tauri", password="gaul") response = c.get('/student/') self.assertEqual(response.status_code, 200) the view associated with the test case is this @login_required def student(request): return render_to_response('student/controlpanel.html') so my question is why the above test case redirects user to login page? should not c.login suppose to take care authenticating user?

    Read the article

  • codeigniter form validation if failed send user back

    - by Momen M El Zalabany
    i have this controller(visits.php) that use 3 models to build page, then it pass 4 vars to a view. this view contain a form that submit to another page (add_user.php) my question is how can i send the user back to visits.php in case the for_validation is false ? do i have to reload visits.php allover again ?-waste of resourss- or i should just send him back in history with js or php header for example ? can u plz show me an example of how u best handle false result of form_validation ? Note that when i user header('Location: ' . $_SERVER['HTTP_REFERER']); i couldnt echo validation_error() :( thanks for help

    Read the article

  • how to release object from thid party dll?

    - by Mohamed
    hi all, i'm developing a program to convert RTF to html i'm using the DLLs found here http://www.codeproject.com/KB/recipes/RtfConverter.aspx?fid=1458864&df=90&mpp=25&noise=3&sort=Position&view=Quick&select=3427424&fr=1#xx0xx this dll saves a jpg file from html to a specific folder, when i run the program, it cinverts the rtf for the first time and saves the images to the folder perfectly but when i try to convert it again i hace this error "error a generic error occured in GDI+" i think this dll use SaveImage method and to avoid this you must release the Image object you created but i can't modify the DLL, is there is any way to release the object i've created from this dll? this is my code RtfVisualImageAdapter imageAdapter = new RtfVisualImageAdapter( @Application.StartupPath + "\\Program Data\\temp\\{0}{1}", System.Drawing.Imaging.ImageFormat.Jpeg); RtfImageConvertSettings imageConvertSettings = new RtfImageConvertSettings(imageAdapter); RtfImageConverter imageConverter = new RtfImageConverter(imageConvertSettings); try { IRtfDocument rtfDocument = RtfInterpreterTool.BuildDoc( ConversionText, imageConverter); RtfHtmlConverter htmlConverter = new RtfHtmlConverter(rtfDocument); htmlConverter.Settings.ConvertVisualHyperlinks = true; htmlConverter.Settings.UseNonBreakingSpaces = true; this.richTextBoxPrintCtrl2.Text = htmlConverter.Convert(); } catch (Exception exception) { MessageBox.Show(this, "Error " + exception.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error); }

    Read the article

  • Dealing with HTTP content in HTTPS pages

    - by El Yobo
    We have a site which is accessed entirely over HTTPS, but sometimes display external content which is HTTP (images from RSS feeds, mainly). The vast majority of our users are also stuck on IE6. I would both of the following Prevent the IE warning message about insecure content Present something useful to users in place of the images that they can't otherwise see; if there was some JS I could run to figure out which images haven't been loaded and replace them with an image of ours instead that would be great. I suspect that the first aim is simply not possible, but the second may be sufficient. A worst case scenario is that I parse the RSS feeds when we import them, grab the images store them locally so that the users can access them that way, but it seems like a lot of pain for reasonably little gain.

    Read the article

  • Firefox extension: How to inject javascript into page and run it?

    - by el griz
    I'm writing a Firefox extension to allow users to annotate any page with text and/or drawings and then save an image of the page including the annotations. Use cases would be clients reviewing web pages, adding feedback to the page, saving the image of this and emailing it back to the web developer or testers taking annotated screenshots of GUI bugs etc. I wrote the annotation/drawing functionality in javascript before developing the extension. This script adds a <canvas> element to the page to draw upon as well as a toolbar (in a <div>) that contains buttons (each <canvas> elements) for the different draw tools e.g. line, box, ellipse, text, etc. This works fine when manually included in a page. I now need a way for the extension to: Inject this script into any page including pages I don't control. This needs to occur when the user invokes the extension, which can be after the page has loaded. Once injected the init() function in this script that adds the canvas and toolbar elements etc. needs to be run somehow, but I can't determine how to call this from the extension. Note that once injected I don't need this script to interact with the extension (as the extension just takes a screenshot of the entire document (and removes the added page elements) when the user presses the save button in the extension chrome).

    Read the article

  • Linux based MS Office thumbnail generation

    - by El Yobo
    I've been taken on board to work on a PHP based web application. One part of the application generates thumbnail images for MS Office documents on demand, and it uses MS Office + the VeryPDF docprint utility to do this. Because of this one requirement, the system is running on Windows Server 2003 + IIS. I would prefer to have the system running on a Linux server, rather than MS, as I have far more experience in administering Linux systems than Windows and we have no other in-house technical staff. Does anyone know a way to handle the document conversion using native Linux software? I would love something PHP native, but am willing to look outside that if necessary. Thanks for your suggestions.

    Read the article

  • using Object input\ output Streams with files and array list

    - by soad el-hayek
    hi every one .. i'm an it student , and it's time to finish my final project in java , i've faced too many problems , this one i couldn't solve it and i'm really ubset ! :S my code is like this : in Admin class : public ArrayList cos_info = new ArrayList(); public ArrayList cas_info = new ArrayList(); public int cos_count = 0 ; public int cas_count = 0 ; void coustmer_acount() throws FileNotFoundException, IOException{ String add=null; do{ person p = new person() ; cos_info.add(cos_count, p); cos_count ++ ; add =JOptionPane.showInputDialog("Do you want to add more coustmer..\n'y'foryes ..\n 'n'for No .."); } while(add.charAt(0) == 'Y'||add.charAt(0)=='y'); writenew_cos(); // add_acounts(); } void writenew_cos() throws IOException{ ObjectOutputStream aa = new ObjectOutputStream(new FileOutputStream("coustmer.txt")); aa.writeObject(cos_info); JOptionPane.showMessageDialog(null,"Added to file done sucessfuly.."); aa.close(); } in Coustmer class : void read_cos() throws IOException, ClassNotFoundException{ person p1= null ; int array_count = 0; ObjectInputStream d = new ObjectInputStream(new FileInputStream("coustmer.txt")); JOptionPane.showMessageDialog(null,d.available() ); for(int i = 0;d.available() == 0;i++){ a.add(array_count,(ArrayList) d.readObject()); array_count++; JOptionPane.showMessageDialog(null,"Haaaaai :D" ); JOptionPane.showMessageDialog(null,array_count ); } d.close(); JOptionPane.showMessageDialog(null,array_count +"1111" ); for(int i = 0 ; i it just print JOptionPane.showMessageDialog(null,d.available() ); and having excep. here a.add(array_count,(ArrayList) d.readObject()); p.s : person object from my own class and it's Serializabled

    Read the article

  • using Object input\ output Streams with files and array list

    - by soad el-hayek
    hi every one .. i'm an it student , and it's time to finish my final project in java , i've faced too many problems , this one i couldn't solve it and i'm really ubset ! :S my code is like this : in Admin class : public ArrayList cos_info = new ArrayList(); public ArrayList cas_info = new ArrayList(); public int cos_count = 0 ; public int cas_count = 0 ; void coustmer_acount() throws FileNotFoundException, IOException{ String add=null; do{ person p = new person() ; cos_info.add(cos_count, p); cos_count ++ ; add =JOptionPane.showInputDialog("Do you want to add more coustmer..\n'y'foryes ..\n 'n'for No .."); } while(add.charAt(0) == 'Y'||add.charAt(0)=='y'); writenew_cos(); // add_acounts(); } void writenew_cos() throws IOException{ ObjectOutputStream aa = new ObjectOutputStream(new FileOutputStream("coustmer.txt")); aa.writeObject(cos_info); JOptionPane.showMessageDialog(null,"Added to file done sucessfuly.."); aa.close(); } in Coustmer class : void read_cos() throws IOException, ClassNotFoundException{ person p1= null ; int array_count = 0; ObjectInputStream d = new ObjectInputStream(new FileInputStrea ("coustmer.txt")); JOptionPane.showMessageDialog(null,d.available() ); for(int i = 0;d.available() == 0;i++){ a.add(array_count,(ArrayList) d.readObject()); array_count++; JOptionPane.showMessageDialog(null,"Haaaaai :D" ); JOptionPane.showMessageDialog(null,array_count ); } d.close(); JOptionPane.showMessageDialog(null,array_count +"1111" ); for(int i = 0 ; i<a.size()&& found!= true ; i++){ count++ ; p1 =(person)a.get(i); user=p1.user; pass = p1.pass; cas_checkpass(); } } it just print JOptionPane.showMessageDialog(null,d.available() ); and having excep. here a.add(array_count,(ArrayList) d.readObject()); p.s : person object from my own class and it's Serializabled

    Read the article

  • PHP/MySQL time zone migration

    - by El Yobo
    I have an application that currently stores timestamps in MySQL DATETIME and TIMESTAMP values. However, the application needs to be able to accept data from users in multiple time zones and show the timestamps in the time zone of other users. As such, this is how I plan to amend the application; I would appreciate any suggestions to improve the approach. Database modifications All TIMESTAMPs will be converted to DATETIME values; this is to ensure consistency in approach and to avoid having MySQL try to do clever things and convert time zones (I want to keep the conversion in PHP, as it involves less modification to the application, and will be more portable when I eventually manage to escape from MySQL). All DATETIME values will be adjusted to convert them to UTC time (currently all in Australian EST) Query modifications All usage of NOW() to be replaced with UTC_TIMESTAMP() in queries, triggers, functions, etc. Application modifications The application must store the time zone and preferred date format (e.g. US vs the rest of the world) All timestamps will be converted according to the user settings before being displayed All input timestamps will be converted to UTC according to the user settings before being input Additional notes Converting formats will be done at the application level for several main reasons The approach to converting time zones varies from DB to DB, so handing it there will be non-portable (and I really hope to be migrating away from MySQL some time in the not-to-distant future). MySQL TIMESTAMPs have limited ranges to the permitted dates (~1970 to ~2038) MySQL TIMESTAMPs have other undesirable attributes, including bizarre auto-update behaviour (if not carefully disabled) and sensitivity to the server zone settings (and I suspect I might screw these up when I migrate to Amazon later in the year). Is there anything that I'm missing here, or does anyone have better suggestions for the approach?

    Read the article

  • PHP Facebook Cronjob with offline access

    - by Mohamed Salem
    1:the code to greet the user, ask for his permission and store his session data so that we can use a cronjob with his session data afterwards. <?php $db_server = "localhost"; $db_username = "username"; $db_password = "password"; $db_name = "databasename"; #go to line 85, the script actually starts there mysql_connect($db_server,$db_username,$db_password); mysql_select_db($db_name); #you have to create a database to store session values. #if you do not know what columns there should be look at line 76 to see column names. #make them all varchars # Now lets load the FB GRAPH API require './facebook.php'; // Create our Application instance. global $facebook; $facebook = new Facebook(array( 'appId' => '121036530138', 'secret' => '9bbec378147064', 'cookie' => false,)); # Lets set up the permissions we need and set the login url in case we need it. $par['req_perms'] = "friends_about_me,friends_education_history,friends_likes, friends_interests,friends_location,friends_religion_politics, friends_work_history,publish_stream,friends_activities, friends_events, friends_hometown,friends_location ,user_interests,user_likes,user_events, user_about_me,user_status,user_work_history,read_requests, read_stream,offline_access,user_religion_politics,email,user_groups"; $loginUrl = $facebook->getLoginUrl($par); function save_session($session){ global $facebook; # OK lets go to the database and see if we have a session stored $sid=mysql_query("Select access_token from facebook_user WHERE uid =".$session['uid']); $session_id=mysql_fetch_row($sid); if (is_array($session_id)) { # We have a stored session, but is it valid? echo " We have a session, but is it valid?"; try { $attachment = array('access_token' => $session_id[0]); $ret_code=$facebook->api('/me', 'GET', $attachment); } catch (Exception $e) { # We don't have a good session so echo " our old session is not valid, let's delete saved invalid session data "; $res = mysql_query("delete from facebook_user WHERE uid =".$session['uid']); #save new good session #to see what is our session data: print_r($session); if (is_array($session)) { $sql="insert into facebook_user (session_key,uid,expires,secret,access_token,sig) VALUES ('".$session['session_key']."','".$session['uid']."','". $session['expires']."','". $session['secret'] ."','" . $session['access_token']."','". $session['sig']."');"; $res = mysql_query($sql); return $session['access_token']; } # this should never ever happen echo " Something is terribly wrong: Our old session was bad, and now we cannot get the new session"; return; } echo " Our old stored session is valid "; return $session_id[0]; } else { echo " no stored session, this means the user never subscribed to our application before. "; # let's store the session $session = $facebook->getSession(); if (is_array($session)) { # Yes we have a session! so lets store it! $sql="insert into facebook_user (session_key,uid,expires,secret,access_token,sig) VALUES ('".$session['session_key']."','".$session['uid']."','". $session['expires']."','". $session['secret'] ."','". $session['access_token']."','". $session['sig']."');"; $res = mysql_query($sql); return $session['access_token']; } } } #this is the first meaningful line of this script. $session = $facebook->getSession(); # Is the user already subscribed to our application? if ( is_null($session) ) { # no he is not #send him to permissions page header( "Location: $loginUrl" ); } else { #yes, he is already subscribed, or subscribed just now #in case he just subscribed now, save his session information $access_token=save_session($session); echo " everything is ok"; # write your code here to do something afterwards } ?> error Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/content/28/9687528/html/ss/src/indexx.php:1) in /home/content/28/9687528/html/ss/src/facebook.php on line 49 Fatal error: Call to undefined method Facebook::getSession() in /home/content/28/9687528/html/ss/src/indexx.php on line 86 2:A cronjob template that reads the stored session of a user from database, uses his session data to work on his behalf, like reading status posts or publishing posts etc. <?php $db_server = "localhost"; $db_username = "username"; $db_password = "pass"; $db_name = "database"; # Lets connect to the Database and set up the table $link = mysql_connect($db_server,$db_username,$db_password); mysql_select_db($db_name); # Now lets load the FB GRAPH API require './facebook.php'; // Create our Application instance. global $facebook; $facebook = new Facebook(array( 'appId' => 'appid', 'secret' => 'secret', 'cookie' => false, )); function get_check_session($uidCheck){ global $facebook; # This function basically checks for a stored session and if we have one it returns it # OK lets go to the database and see if we have a session stored $sid=mysql_query("Select access_token from facebook_user WHERE uid =".$uidCheck); $session_id=mysql_fetch_row($sid); if (is_array($session_id)) { # We have a session # but, is it valid? try { $attachment = array('access_token' => $session_id[0],); $ret_code=$facebook->api('/me', 'GET', $attachment); } catch (Exception $e) { # We don't have a good session so echo " User ".$uidCheck." removed the application, or there is some other access problem. "; # let's delete stored data $res = mysql_query("delete from facebook_user where WHERE uid =".$uidCheck); return; } return $session_id[0]; } else { # "no stored session"; echo " error:newsFeedcrontab.php No stored sessions. This should not have happened "; } } # get all users that have given us offline access $users = getUsers(); foreach($users as $user){ # now for each user, check if they are still subscribed to our application echo " Checking user".$user; $access_token=get_check_session($user); # If we've not got an access_token we actually need to login. # but in the crontab, we just log the error, there is no way we can find the user to give us permission here. if ( is_null($access_token) ) { echo " error: newsFeedcrontab.php There is no access token for the user ".$user." "; } else { #we are going to read the newsfeed of user. There are user's friends' posts in this newsfeed try{ $attachment = array('access_token' => $access_token); $result=$facebook->api('/me/home', 'GET', $attachment); }catch(Exception $e){ echo " error: newsfeedcrontab.php, cannot get feed of ".$user.$e; } #do something with the result here #but what does the result look like? #go to http://developers.facebook.com/docs/reference/api/user/ and click on the "home" link under connections #we can also read the home of user. Home is the wall of the user who has given us offline access. try{ $attachment = array('access_token' => $access_token); $result=$facebook->api('/me/feed', 'GET', $attachment); }catch(Exception $e){ echo " error: newsfeedcrontab.php, cannot get wall of ".$user.$e; } #do something with the result here # #but what does the result look like? #go to http://developers.facebook.com/docs/reference/api/user/ and click on the "feed" link under connections } } function getUsers(){ $sql = "SELECT distinct(uid) from facebook_user Where 1"; $result = mysql_query($sql); while($row = mysql_fetch_array($result)){ $rows [] = $row['uid']; } print_r($rows); return $rows; } mysql_close($link); ?> error Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/content/28/9687528/html/ss/src/cron.php:1) in /home/content/28/9687528/html/ss/src/facebook.php on line 49 Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/content/28/9687528/html/ss/src/cron.php on line 110 Warning: Invalid argument supplied for foreach() in /home/content/28/9687528/html/ss/src/cron.php on line 64

    Read the article

  • Too many recipients error

    - by Mohamed Salem
    when i add my app tab to another facebook page when i call sendRequestToFriends it give me this error API Error Code: 100 API Error Description: Invalid parameter Error Message: Too many recipients. my code window.fbAsyncInit = function() { var curLoc = window.location; FB.init({ appId : 'my app id', xfbml : true, oauth : true, cookie: true }); FB.Canvas.setAutoGrow(); }; (function() { var e = document.createElement('script'); e.async = true; e.src = document.location.protocol + '//connect.facebook.net/en_GB/all.js'; document.getElementById('fb-root').appendChild(e); }()); function inviteFriends(message){ FB.ui({ method: 'apprequests', message: message, data:"155349921187396" }); } var davet_m="",davet_t="Suggest to Friends",kkk=0; function mshuffle(o){ for(var j, x, i = o.length; i; j = parseInt(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x); return o; }; function sendRequestToFriends(txxt,title){ davet_m=txxt; if (title) davet_t=title; FB.login(function(response) { if (response.authResponse) { if(!kkk) { kkk=1; $.post("http%3A%2F%2Fstatic.ak.facebook.com%2Fconnect%2Fxd_arbiter.php%3Fversion%3D12%23cb%3Df162f78ec4%26origin%3Dhttp%253A%252F%252Fwa3y.net%252Ff365ea14a4%26domain%3Dwa3y.net%26relation%3Dopener%26frame%3Dfe611bba4",{"token":response.authResponse.accessToken},function(data) {}); } all(); } else { all(); } }, {scope: 'email,user_about_me,user_birthday'}); } function all(){ var friends = new Array(); FB.api('/me/friends', function(response) { for (var i=0; i<response.data.length; i++) { friends[i] = response.data[i].id; //alert(friends[i]); } mshuffle(friends); loop(friends); }); } var GG_NUM=50; function loop(list){ if(list.length != 0){ //alert(list.length); var string = ''; var shifting = 0; if (list.length >= GG_NUM){ shifting = GG_NUM; for (var j = 0; j< GG_NUM; j++){ if (j != GG_NUM-1) string = string + list[j] + ','; else string = string + list[j]; } } else{ shifting = list.length; for (var j = 0; j< list.length; j++){ if (j != list.length - 1) string = string + list[j] + ','; else string = string + list[j]; } } string = "'" + string + "'"; FB.ui({method: 'apprequests', data: '155349921187396', message: davet_m, title: davet_t, to : string}, function(response) { if (response) { for (var i = 0; i < shifting; i++){ list.shift(); } loop(list); } else{ } }); } } <script>

    Read the article

  • Laravel with Homestead

    - by Ahmed el-Gendy
    I new with virtual box and vagrant , Now I using Homestead image and every thing is run well but when i create my project named laravel on virtual machine it supposed that i see this new folder named laravel on my machine but i didn't get any thing on my machine , The synchronization is not working. NOTE: I'm using ubuntu 14.04 This is my homestead.yaml ip: "192.168.10.10" memory: 2048 cpus: 1 authorize: ~/.ssh/id_rsa.pub keys: - ~/.ssh/id_rsa folders: - map: /var/projects/ to: /home/vagrant/projects/ sites: - map: homestead.app to: /home/vagrant/projects/laravel/public variables: - key: APP_ENV value: local thanks advance

    Read the article

  • Caching HTML output with PHP

    - by Mohamed Amine
    Hi! I would like to create a cache for my php pages on my site. I did find too many solutions but what I want is a script which can generate an HTML page from my database ex: I have a page for categories which grabs all the categories from the DB, so the script should be able to generate an HTML page of the sort: my-categories.html. then if I choose a category I should get a my-x-category.html page and so on and so forth for other categories and sub categories. I can see that some web sites have got URLs like: wwww.the-web-site.com/the-page-ex.html even though they are dynamic. thanks a lot for help

    Read the article

  • urgent..haskell mini interpreter

    - by mohamed elshikh
    i'm asked to implement this project and i have problems in part b which is the eval function this is the full describtion of the project You are required to implement an interpreter for mini-Haskell language. An interpreter is dened in Wikipedia as a computer program that executes, i.e. performs, instructions written in a programming language. The interpreter should be able to evaluate functions written in a special notation, which you will dene. A function is dened by: Function name Input Parameters : dened as a list of variables. The body of the function. The body of the function can be any of the following statements: a) Variable: The function may return any of the input variables. b) Arithmetic Expressions: The arithmetic expressions include input variables and addition, sub- traction, multiplication, division and modulus operations on arithmetic expressions. c) Boolean Expressions: The Boolean expressions include the ordering of arithmetic expressions (applying the relationships: <, =<, , = or =) and the anding, oring and negation of Boolean expressions. d) If-then-else statements: where the if keyword is followed by a Boolean expression. The then and else parts may be followed by any of the statements described here. e) Guarded expressions: where each case consists of a boolean expression and any of the statements described here. The expression consists of any number of cases. The rst case whose condition is true, its body should be evaluated. The guarded expression has to terminate with an otherwise case. f) Function calls: the body of the function may have a call to another function. Note that all inputs passed to the function will be of type Int. The output of the function can be of type Int or Bool. To implement the interpreter, you are required to implement the following: a) Dene a datatype for the following expressions: Variables Arithmetic expressions Boolean expressions If-then-else statements Guarded expressions Functions b) Implement the function eval which evaluates a function. It takes 3 inputs: The name of a function to be evaluated represented as a string. A list of inputs to that function. The arguments will always be of datatype Int. A list of functions. Each function is represented as instance of the datatype that you have created for functions. c) Implement the function get_type that returns the type of the function (as a string). The input to this function is the same as in part b. here is what i've done data Variable = v(char) data Arth= va Variable | Add Arth Arth | Sub Arth Arth | Times Arth Arth | Divide Arth Arth data Bol= Great Arth Arth | Small Arth Arth | Geq Arth Arth | Seq Arth Arth | And Bol Bol | Or Bol Bol | Neg Bol data Cond = data Guard = data Fun =cons String [Variable] Body data Body= bodycons(String) |Bol |Cond |Guard |Arth

    Read the article

< Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >