Daily Archives

Articles indexed Tuesday November 13 2012

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

  • Terminate on instance "std::runtime_error" Hiphop-Php

    - by boundless08
    I have successfully built Hiphop-Php on an ubuntu server 12.04 LTS but when I run the command: $HPHP_HOME/src/hphp/hphp test.php This error occurs: terminate called after throwing an instance of 'std::runtime_error' what(): locale::facet::_S_create_c_locale name not valid Aborted (core dumped) The same error occured during the make command but I used sudo make and it dealt with that, but using sudo on the above just removes the Aborted (core dumped). This is happening on a remote server, but I have done the exact same before testing on a VM. I even got root access, as I thought that could help, but it's done nothing. Just so you know I built with USE_HHVM=0, I need the code unreadable and the bytecode format does this, but the VM I built was as well, I'm just stumped! Thanks in advance.

    Read the article

  • how can I display controller's variable (which is on a loop) on .html.erb page? ruby on rails

    - by rrz
    I have the following code listed below in my controller: struc = {'en' => 'english', 'es' => 'espaniol', 'de' => 'germany', 'fr' => 'french', 'it' => 'italy'} struc.each_pair do |key, value| @key=key @value=value end on my application.html.erb I have the following <select name="Language" onchange="location=this.options[this.selectedIndex].value;"> <option value="/<% @key %>/<%= @rem %>"><%= @value %></option> </select> Now how can i make the value of '@key' and '@value' appear recursively display on (application.html.erb)? Thanks in advance

    Read the article

  • Oracle - Trigger to check constraint before insert

    - by user1816507
    i would like to create a simple trigger to check a stored variable from a table. if the value of the variable is '1', then approve the insertion else if the value of the variable is '2', then prompt error message. CREATE OR REPLACE TRIGGER approval BEFORE INSERT ON VIP REFERENCING OLD AS MEMBER FOR EACH ROW DECLARE CONDITION_CHECK NUMBER; BEGIN SELECT CONDITION INTO CONDITION_CHECK FROM MEMBER; IF CONDITION_CHECK = '2' THEN RAISE_APPLICATION_ERROR (-20000, ' UPGRADE DENIED!'); END IF; END; But this trigger disable all the entries even when the condition value is '1'.

    Read the article

  • UIPickerview filling the screen

    - by Fischer
    I want an UIPickerView that fills all the screen. This is the code i have ... pickerView1 = [[UIPickerView alloc] init]; [pickerView1 setDelegate: self]; [pickerView1 setFrame: CGRectMake(0,0, 480, 320)]; [self.view addSubview: pickerView1]; This just fills the width, not the height, and I get this message in the output: " invalid height value 320.0 pinned to 216.0 " Why ? How can i adjust the height of the picker ???

    Read the article

  • Refreshing <div> and load data from php

    - by forgatn
    I have on my page and there is a tag where is some and values filled from mySQL DB. I need some JavaScript I think. When I select one option, I want to display in this propriate DATAs which are in DB. without refreshing whole page. Can you tell me how to do it, if you know that please?:) <div id="country1" class="tabcontent"> <label>Choose protocol</label> <SELECT name="cisloprot"> <?php $con = mysql_connect("localhost", "root", "123456"); $sql = "SELECT kod FROM prot GROUP BY kod"; $rs = mysql_query($sql,$con); while ($r = mysql_fetch_array($rs)) { echo "<OPTION VALUE=".$r['kod'].">".$r['kod']."</OPTION>"; } ?> </SELECT> </div>

    Read the article

  • Assigned numbers to movie clip to plug in formula... not working

    - by Matthew MlgPro Harding
    So I am attempting to vertically evenly space these movie clips so I came up with a math formula involving n( the button number) but Its not working. var buttonArray:Array = [ side_banner.btn1, side_banner.btn2, side_banner.btn3, side_banner.btn4]; var buttonCount:uint = buttonArray.length; for (var i:uint=0; i< buttonCount; i++) { buttonArray[i].addEventListener(MouseEvent.CLICK, outputNumber); buttonArray[i].theTrigger = [i + 1]; } function outputNumber(e:MouseEvent):void { trace( e.target.theTrigger); buttonArray[i].y = (((stage.stageHeight - 400)/4)*(e.target.theTrigger)) - ((stage.stageHeight - 400)/4)/2 } But apparently each movie clip doesn't actually have a numerical value just a numeric name... how can I get the "n" btn number to use my formula? Thanks

    Read the article

  • Querying datatable to get rows with a certain value in the first column

    - by user1776590
    I am currently using the code below and am wondering if it would be possible to query based on an entry value. At the moment it returns the number of rows that have been defined. var q = sqlData.AsEnumerable().Take(2); This data comes in from a database and is imputed into the table but at the moment it only returns database data into the datatable and allows me to select the first two rows and I was wondering if I can query the data table so that I can get the rows that I require based on an index in the actual table itself (e.g. in the table I find five rows and query this information out).

    Read the article

  • MySQL LEFT OUTER JOIN virtual table

    - by user1707323
    I am working on a pretty complicated query let me try to explain it to you. Here is the tables that I have in my MySQL database: students Table --- `students` --- student_id first_name last_name current_status status_change_date ------------ ------------ ----------- ---------------- -------------------- 1 John Doe Active NULL 2 Jane Doe Retread 2012-02-01 students_have_courses Table --- `students_have_courses` --- students_student_id courses_course_id s_date e_date int_date --------------------- ------------------- ---------- ---------- ----------- 1 1 2012-01-01 2012-01-04 2012-01-05 1 2 2012-01-05 NULL NULL 2 1 2012-01-10 2012-01-11 NULL students_have_optional_courses Table --- `students_have_optional_courses` --- students_student_id optional_courses_opcourse_id s_date e_date --------------------- ------------------------------ ---------- ---------- 1 1 2012-01-02 2012-01-03 1 1 2012-01-06 NULL 1 5 2012-01-07 NULL Here is my query so far SELECT `students_and_courses`.student_id, `students_and_courses`.first_name, `students_and_courses`.last_name, `students_and_courses`.courses_course_id, `students_and_courses`.s_date, `students_and_courses`.e_date, `students_and_courses`.int_date, `students_have_optional_courses`.optional_courses_opcourse_id, `students_have_optional_courses`.s_date, `students_have_optional_courses`.e_date FROM ( SELECT `c_s_a_s`.student_id, `c_s_a_s`.first_name, `c_s_a_s`.last_name, `c_s_a_s`.courses_course_id, `c_s_a_s`.s_date, `c_s_a_s`.e_date, `c_s_a_s`.int_date FROM ( SELECT `students`.student_id, `students`.first_name, `students`.last_name, `students_have_courses`.courses_course_id, `students_have_courses`.s_date, `students_have_courses`.e_date, `students_have_courses`.int_date FROM `students` LEFT OUTER JOIN `students_have_courses` ON ( `students_have_courses`.`students_student_id` = `students`.`student_id` AND (( `students_have_courses`.`s_date` >= `students`.`status_change_date` AND `students`.current_status = 'Retread' ) OR `students`.current_status = 'Active') ) WHERE `students`.current_status = 'Active' OR `students`.current_status = 'Retread' ) `c_s_a_s` ORDER BY `c_s_a_s`.`courses_course_id` DESC ) `students_and_courses` LEFT OUTER JOIN `students_have_optional_courses` ON ( `students_have_optional_courses`.students_student_id = `students_and_courses`.student_id AND `students_have_optional_courses`.s_date >= `students_and_courses`.s_date AND `students_have_optional_courses`.e_date IS NULL ) GROUP BY `students_and_courses`.student_id; What I want to be returned is the student_id, first_name, and last_name for all Active or Retread students and then LEFT JOIN the highest course_id, s_date, e_date, and int_date for the those students where the s_date is since the status_change_date if status is 'Retread'. Then LEFT JOIN the highest optional_courses_opcourse_id, s_date, and e_date from the students_have_optional_courses TABLE where the students_have_optional_courses.s_date is greater or equal to the students_have_courses.s_date and the students_have_optional_courses.e_date IS NULL Here is what is being returned: student_id first_name last_name courses_course_id s_date e_date int_date optional_courses_opcourse_id s_date_1 e_date_1 ------------ ------------ ----------- ------------------- ---------- ---------- ------------ ------------------------------ ---------- ---------- 1 John Doe 2 2012-01-05 NULL NULL 1 2012-01-06 NULL 2 Jane Doe NULL NULL NULL NULL NULL NULL NULL Here is what I want being returned: student_id first_name last_name courses_course_id s_date e_date int_date optional_courses_opcourse_id s_date_1 e_date_1 ------------ ------------ ----------- ------------------- ---------- ---------- ------------ ------------------------------ ---------- ---------- 1 John Doe 2 2012-01-05 NULL NULL 5 2012-01-07 NULL 2 Jane Doe NULL NULL NULL NULL NULL NULL NULL Everything is working except one thing, I cannot seem to get the highest students_have_optional_courses.optional_courses_opcourse_id no matter how I form the query Sorry, I just solved this myself after writing this all out I think it helped me think of the solution. Here is the solution query: SELECT `students_and_courses`.student_id, `students_and_courses`.first_name, `students_and_courses`.last_name, `students_and_courses`.courses_course_id, `students_and_courses`.s_date, `students_and_courses`.e_date, `students_and_courses`.int_date, `students_optional_courses`.optional_courses_opcourse_id, `students_optional_courses`.s_date, `students_optional_courses`.e_date FROM ( SELECT `c_s_a_s`.student_id, `c_s_a_s`.first_name, `c_s_a_s`.last_name, `c_s_a_s`.courses_course_id, `c_s_a_s`.s_date, `c_s_a_s`.e_date, `c_s_a_s`.int_date FROM ( SELECT `students`.student_id, `students`.first_name, `students`.last_name, `students_have_courses`.courses_course_id, `students_have_courses`.s_date, `students_have_courses`.e_date, `students_have_courses`.int_date FROM `students` LEFT OUTER JOIN `students_have_courses` ON ( `students_have_courses`.`students_student_id` = `students`.`student_id` AND (( `students_have_courses`.`s_date` >= `students`.`status_change_date` AND `students`.current_status = 'Retread' ) OR `students`.current_status = 'Active') ) WHERE `students`.current_status = 'Active' OR `students`.current_status = 'Retread' ) `c_s_a_s` ORDER BY `c_s_a_s`.`courses_course_id` DESC ) `students_and_courses` LEFT OUTER JOIN ( SELECT * FROM `students_have_optional_courses` ORDER BY `students_have_optional_courses`.optional_courses_opcourse_id DESC ) `students_optional_courses` ON ( `students_optional_courses`.students_student_id = `students_and_courses`.student_id AND `students_optional_courses`.s_date >= `students_and_courses`.s_date AND `students_optional_courses`.e_date IS NULL ) GROUP BY `students_and_courses`.student_id;

    Read the article

  • XML file does't load when HTML5 video plays

    - by DD77
    I should be able to loads the related XML file and displays the content of the XML file as the video plays back. What am I missing? DEMO JAVSCRIPT // properties var XML_PATH = "http://www.adjustyourset.tv/interview/cuepoints.xml"; var video_width; var video_height; var videos_array=new Array(); // init the application function init() { // call loadXML function loadXML(); } // XML loading function loadXML() { $.ajax({ type: "GET", url: XML_PATH, dataType: "xml", success: function onXMLloaded(xml) { // set cuepoints find("cuepoints"); find("cuepoints"); // loop for each cuepoint $(xml).find('cuepoint').each(function loopingItems(value) { // create an object var obj={timeStamp:$(this).find("timeStamp").text(), desc:$(this).find("desc").text(), thumbLink:$(this).find("thumbLink").text(), price:$(this).find("price").text()}; videos_array.push(obj); // append <ul> and timeStamp $("#mycustomscroll").append('<ul>'); $("#mycustomscroll").append('<a><li id="item">Time Stamp:'+obj.timeStamp+'</li></a>'); }); // close </ul> $("#mycustomscroll").append('</ul>'); // append li tags $("#leftcolumn").append('<li src="'+videos_array[0].desc+'"> <p src="'+videos_array[0].thumbLink+'" /></li>'); // append description $("#price").append(videos_array[0].price); // call addListeners function addListeners(); } }); }

    Read the article

  • How to create a jpeg using set of div with backgrounds - PHP/jQuery

    - by Dasun
    The final output of the image looks like this below. If you look into html parts, It's create using different divs as below. All the div are placed one on one using CSS and making the position to absolute. <div id="tproduct" class="timage" style="z-index: 30; background-image: url('main-mask.png') ;"></div> <div id="tdesign1" class="timage" style="z-index: 20; background-image: url('design1.png');"></div> <div id="tdesign2" class="timage" style="z-index: 20; background-image: url('design2.png');"></div> <div id="tmaincolor" class="timage" style="background-color:blue;"></div> <div id="tembellishment" class="timage" style="z-index: 10; background-image: url('flower.png');"></div> If we look at separately it will look like this below. etc My question is how can I create a single image using above set of divs and images? I can use PHP or jQuery? I only want the steps or guidance how it should be done. Thanks

    Read the article

  • IIS Restrict Access to Directory for table of users

    - by Dave
    I am trying to restrict access to files in a directory and it's sub directories based user rights. My user rights are stored in an MS SQL database in a custom format, however it is easy to query the list of users with rights to this directory. I need to know how to apply this to a web config on the server to authenticate against a query of a database table to determine if the username is authenticated and allowed to view the file. Of course if they are not they should be blocked / given a 404. I am using IIS and ASP.Net MVC3 with a form based security as opposed to the built in roles and responsibilities that was custom made for us and that works great. There are over 10k users tied to this non-Active Directory authentication so I am not planning to change my authentication type so please don't go there. It is not my decision on the choice of platform, or I would have gone with a LAMP server and been done with this. Edit 11-13-2012 @ 8:57a: In the web config can you put the result of an SQL query?

    Read the article

  • Convert Decimal number into Fraction

    - by alankrita
    I am trying to convert decimal number into its fraction. Decimal numbers will be having a maximum 4 digits after the decimal place. example:- 12.34 = 1234/100 12.3456 = 123456/10000 my code :- #include <stdio.h> int main(void) { double a=12.34; int c=10000; double b=(a-floor(a))*c; int d=(int)floor(a)*c+(int)b; while(1) { if(d%10==0) { d=d/10; c=c/10; } else break; } printf("%d/%d",d,c); return 0; } but I am not getting correct output, Decimal numbers will be of double precision only.Please guide me what I should do.

    Read the article

  • Two different seeds producing the same "random" sequence

    - by Ruud Lenders
    Maybe there is a very logic explanation for this, but I just can't seem to understand why the seeds 0 and 2,147,483,647 produce the same "random" sequence, using .NET's Random Class (System). Quick code example: ushort len = 8; Random r0 = new Random(0), r1 = new Random(1), r2 = new Random(int.MaxValue); //2,147,483,647 byte[] b0 = new byte[len], b1 = new byte[len], b2 = new byte[len]; r0.NextBytes(b0); r1.NextBytes(b1); r2.NextBytes(b2); for (int i = 0; i < len; i++) { System.Diagnostics.Debug.WriteLine("{0}\t\t{1}\t\t{2}", b0[i], b1[i], b2[i]); } Console.ReadLine(); Output: 26 70 26 12 208 12 70 134 76 111 130 111 93 64 93 117 151 115 228 228 228 216 163 216 As you can see, the first and the third sequence are the same. Can someone please explain this to me?

    Read the article

  • QPainter::drawText bounding boxes for each character

    - by satuon
    I'm using QPainter to draw multiline text on QImage. However, I also need to display a colored rectangle around each character's bounding box. So I need to know the bounding box that each character had when being drawn. For example, for painter.drawText(QRect(100, 100, 200, 200), Qt::TextWordWrap, "line\nline2", &r); I would need to get 10 rectangles, taking into account newlines, word-wrap, tabs, etc. For example, the rectangle of the second 'l' would be below the rectangle of the first 'l', instead of being to the right of 'e', because of the newline.

    Read the article

  • Calculate total time between Dates in Hours and Minutes

    - by matthew parkes
    Hi I’m trying to resolve a problem using VB and I need some assistance. I’m very new to the language (1 week). The problem is I have created a user form to show how many hours and minutes has elapsed between two different times similar to a time sheet. The user form consists of two calendars, and under each calendar there are two text boxes; one box each to record the Hour and Minute they left and two further boxes to record the time they arrived back. I have used the code to minus the calendars together (e.g calendar in – calendar out) then times this by 24 to indicate the hours away. Then under the calendar out I have a text box for the user to type in the hour they left. Then I minus the 24 by the Hour out e.g. if it was 24 -15 it will appear 9 ( 9 hours of that day ) then I would add that to the figure they inserted in the text box Hour in (Return Time). e.g 14. Then I would add them to together e.g. 9 + 14 = 23 and have this displayed in another text box Total Hours. Therefore it would display 23 meaning 23 hours. I have then want to show another two text boxes to indicate minutes. One for Minutes Out then Minutes In. I have the problem to convert these minutes for instance if it is the out time is 15:50 and the in time the next day is at 15:55 it displays as 24 (in one text box) and 105 minutes (in the other text box). I would like the minutes added to the hour and have the balance of the remaining minutes in the minute text box. This should display 24 (in one text box) and 5 (in another text box). The ultimate aim is to get a result that shows a person was absent for a number of days, hours and minutes, eg, 2 days, 5 hours and 10 minutes. Any ideas on how I can modify my code to achieve this? Here’s my code. Please Help Dim number1 As Date Dim number2 As Date Dim number3 As Integer Dim number4 As Integer Dim Number5 As Integer Dim Number6 As Integer Dim answer As Integer Dim answer2 As Integer Dim answer3 As Integer Dim answer4 As Integer Dim answer5 As String number1 = DTPicker1 number2 = DTPicker2 number3 = Txthourout number4 = TxtHourin Number5 = TxtMinuteout Number6 = TxtMinuetIn answer = number2 - number1 answer2 = answer * 24 answer3 = answer2 - number3 answer4 = answer3 + number4 answer5 = Number5 + Number6 TextBox1.Text = answer4 TextBox2.Text = answer5 End Sub

    Read the article

  • Regular expression to match HTML table row ( <tr> ) NOT containing a specific value

    - by user1821136
    I'm using Notepad++ to clean up a long and messy HTML table. I'm trying to use regular expressions even if I'm a total noob. :) I need to remove all the table rows that doesn't contain a specific value (may I call that substring?). After having all the file contents unwrapped, I've been able to use the following regular expression to select, one by one, every table row with all its contents: <tr>.+?</tr> How can I improve the regular expression in order to select and replace only table rows containing, somewhere inside a part of them, that defined substring? I don't know if this does matter but the structure of every table row is the following (I've put there every HTML tag, the dots stand for standard content/values) <tr> <td> ... </td> <td> ... </td> <td> <a sfref="..." href="...">!! SUBSTRING I HAVE TO MATCH HERE !!</a> </td> <td> <img /> </td> <td> ... </td> <td> ... </td> <td> ... </td> <td> ... </td> </tr> Thanks in advance for your help!

    Read the article

  • subversion: how to manage tweaked files

    - by punk4funk
    Our group is considering moving to SVN. But, I can't seem to find a way to do the following: I need to make minor tweaks locally to about 20 files in the repository w/o having SVN consider them "changed" and included in the commit. (Changes like communication time-outs and logging levels.) Ideally I would want to merge the tweaked files to newer versions in the repository. (Keeping the tweaked local file up-to-date with committed changes form other users.) I can't imagine we're unique in wanting/needing this. Are there best practices around this type of use case? One thing I'm considering is putting all the tweaked files into a branched "tweaked" working copy. Then merging my tweaked files into my "official" working copy. Then using a script, which compares the "tweaked" and "official" working copies, to update my ignore list. The script would also un-ignore and alert me to any files that had tweaks and other changes that, presumably, needed to be committed to the repository. This seems kinda hacky and I can't imagine there's not a better way.

    Read the article

  • SQL Queries SELECT IN and SELECT NOT IN

    - by Sequenzia
    Does anyone know why the results of the following 2 queries do not add up to the results of the 3rd one? SELECT COUNT(leadID) FROM leads WHERE makeID NOT IN (SELECT uploadDataMapID FROM DG_App.dbo.uploadData WHERE uploadID = 3 AND uploadRowID = 1) AND modelID NOT IN (SELECT uploadDataMapID FROM DG_App.dbo.uploadData WHERE uploadID = 3 AND uploadRowID = 2) SELECT COUNT(leadID) FROM Leads WHERE makeID IN (SELECT uploadDataMapID FROM DG_App.dbo.uploadData WHERE uploadID = 3 AND uploadRowID = 1) OR modelID IN (SELECT uploadDataMapID FROM DG_App.dbo.uploadData WHERE uploadID = 3 AND uploadRowID = 2) SELECT COUNT(leadID) FROM Leads The first query is the count I need. The second one is to tell the user how many records were suppressed based on the contents of the DG_App.dbo.uploadData table. The third query is just a straight count of all the records. When I run these the results of query 1 + the results of query 2 comes up about 46K records less than the count of the entire table. I have played with grouping the WHERE statements with () but that did not change the counts at all. This is MSSQL Server 2012. Any input on this would be great. Thanks

    Read the article

  • Twitter Bootstrap TypeAhead to work like DropDown List / Select Tag with Autocomplete Feature

    - by Dinesh P.R.
    I want to have a DropDown List / < Select HTML Tag behaviour with AutoComplete Feature using Twitter Bootstrap TypeAhead. The link here achieves the feature of Combo Box where user can provide his own input also. I want to restrict the User to select only from the option provided. Is there any way to tweek the Twitter Bootstrap TypeAhead Plugin to emulate the behaviour of DropDown List / Tag with Autocomplete Feature. I have referred the Following question before posting Adding a dropdown button to Twitter bootstrap typeahead component

    Read the article

  • Great Web Apps With New HTML5 APIs

    Great Web Apps With New HTML5 APIs This talk is in hebrew. It cover new techniques for building modern web apps and how to utilize the latest HTML5 APIs to create a new class of web apps that will delight and amaze your users. In this talk, Ido Green, developer advocate in Google and the author of Web Workers, will cover the following: - HTML5 APIs - New and useful. - Some tips on Chrome DevTools - ChromeOS update. From: GoogleDevelopers Views: 301 35 ratings Time: 01:08:05 More in Science & Technology

    Read the article

  • DevConnections Session Slides, Samples and Links

    - by Rick Strahl
    Finally coming up for air this week, after catching up with being on the road for the better part of three weeks. Here are my slides, samples and links for my four DevConnections Session two weeks ago in Vegas. I ended up doing one extra un-prepared for session on WebAPI and AJAX, as some of the speakers were either delayed or unable to make it at all to Vegas due to Sandy's mayhem. It was pretty hectic in the speaker room as Erik (our event coordinator extrodinaire) was scrambling to fill session slots with speakers :-). Surprisingly it didn't feel like the storm affected attendance drastically though, but I guess it's hard to tell without actual numbers. The conference was a lot of fun - it's been a while since I've been speaking at one of these larger conferences. I'd been taking a hiatus, and I forgot how much I enjoy actually giving talks. Preparing - well not  quite so much, especially since I ended up essentially preparing or completely rewriting for all three of these talks and I was stressing out a bit as I was sick the week before the conference and didn't get as much time to prepare as I wanted to. But - as always seems to be the case - it all worked out, but I guess those that attended have to be the judge of that… It was great to catch up with my speaker friends as well - man I feel out of touch. I got to spend a bunch of time with Dan Wahlin, Ward Bell, Julie Lerman and for about 10 minutes even got to catch up with the ever so busy Michele Bustamante. Lots of great technical discussions including a fun and heated REST controversy with Ward and Howard Dierking. There were also a number of great discussions with attendees, describing how they're using the technologies touched in my talks in live applications. I got some great ideas from some of these and I wish there would have been more opportunities for these kinds of discussions. One thing I miss at these Vegas events though is some sort of coherent event where attendees and speakers get to mingle. These Vegas conferences are just like "go to sessions, then go out and PARTY on the town" - it's Vegas after all! But I think that it's always nice to have at least one evening event where everybody gets to hang out together and trade stories and geek talk. Overall there didn't seem to be much opportunity for that beyond lunch or the small and short exhibit hall events which it seemed not many people actually went to. Anyways, a good time was had. I hope those of you that came to my sessions learned something useful. There were lots of great questions and discussions after the sessions - always appreciate hearing the real life scenarios that people deal with in relation to the abstracted scenarios in sessions. Here are the Session abstracts, a few comments and the links for downloading slides and  samples. It's not quite like being there, but I hope this stuff turns out to be useful to some of you. I'll be following up a couple of these sessions with white papers in the following weeks. Enjoy. ASP.NET Architecture: How ASP.NET Works at the Low Level Abstract:Interested in how ASP.NET works at a low level? ASP.NET is extremely powerful and flexible technology, but it's easy to forget about the core framework that underlies the higher level technologies like ASP.NET MVC, WebForms, WebPages, Web Services that we deal with on a day to day basis. The ASP.NET core drives all the higher level handlers and frameworks layered on top of it and with the core power comes some complexity in the form of a very rich object model that controls the flow of a request through the ASP.NET pipeline from Windows HTTP services down to the application level. To take full advantage of it, it helps to understand the underlying architecture and model. This session discusses the architecture of ASP.NET along with a number of useful tidbits that you can use for building and debugging your ASP.NET applications more efficiently. We look at overall architecture, how requests flow from the IIS (7 and later) Web Server to the ASP.NET runtime into HTTP handlers, modules and filters and finally into high-level handlers like MVC, Web Forms or Web API. Focus of this session is on the low-level aspects on the ASP.NET runtime, with examples that demonstrate the bootstrapping of ASP.NET, threading models, how Application Domains are used, startup bootstrapping, how configuration files are applied and how all of this relates to the applications you write either using low-level tools like HTTP handlers and modules or high-level pages or services sitting at the top of the ASP.NET runtime processing chain. Comments:I was surprised to see so many people show up for this session - especially since it was the last session on the last day and a short 1 hour session to boot. The room was packed and it was to see so many people interested the abstracts of architecture of ASP.NET beyond the immediate high level application needs. Lots of great questions in this talk as well - I only wish this session would have been the full hour 15 minutes as we just a little short of getting through the main material (didn't make it to Filters and Error handling). I haven't done this session in a long time and I had to pretty much re-figure all the system internals having to do with the ASP.NET bootstrapping in light for the changes that came with IIS 7 and later. The last time I did this talk was with IIS6, I guess it's been a while. I love doing this session, mainly because in my mind the core of ASP.NET overall is so cleanly designed to provide maximum flexibility without compromising performance that has clearly stood the test of time in the 10 years or so that .NET has been around. While there are a lot of moving parts, the technology is easy to manage once you understand the core components and the core model hasn't changed much even while the underlying architecture that drives has been almost completely revamped especially with the introduction of IIS 7 and later. Download Samples and Slides   Introduction to using jQuery with ASP.NET Abstract:In this session you'll learn how to take advantage of jQuery in your ASP.NET applications. Starting with an overview of jQuery client features via many short and fun examples, you'll find out about core features like the power of selectors for document element selection, manipulating these elements with jQuery's wrapped set methods in a browser independent way, how to hook up and handle events easily and generally apply concepts of unobtrusive JavaScript principles to client scripting. The second half of the session then delves into jQuery's AJAX features and several different ways how you can interact with ASP.NET on the server. You'll see examples of using ASP.NET MVC for serving HTML and JSON AJAX content, as well as using the new ASP.NET Web API to serve JSON and hypermedia content. You'll also see examples of client side templating/databinding with Handlebars and Knockout. Comments:This session was in a monster of a room and to my surprise it was nearly packed, given that this was a 100 level session. I can see that it's a good idea to continue to do intro sessions to jQuery as there appeared to be quite a number of folks who had not worked much with jQuery yet and who most likely could greatly benefit from using it. Seemed seemed to me the session got more than a few people excited to going if they hadn't yet :-).  Anyway I just love doing this session because it's mostly live coding and highly interactive - not many sessions that I can build things up from scratch and iterate on in an hour. jQuery makes that easy though. Resources: Slides and Code Samples Introduction to jQuery White Paper Introduction to ASP.NET Web API   Hosting the Razor Scripting Engine in Your Own Applications Abstract:The Razor Engine used in ASP.NET MVC and ASP.NET Web Pages is a free-standing scripting engine that can be disassociated from these Web-specific implementations and can be used in your own applications. Razor allows for a powerful mix of code and text rendering that makes it a wonderful tool for any sort of text generation, from creating HTML output in non-Web applications, to rendering mail merge-like functionality, to code generation for developer tools and even as a plug-in scripting engine. In this session, we'll look at the components that make up the Razor engine and how you can bootstrap it in your own applications to hook up templating. You'll find out how to create custom templates and manage Razor requests that can be pre-compiled, detecting page changes and act in ways similar to a full runtime. We look at ways that you can pass data into the engine and retrieve both the rendered output as well as result values in a package that makes it easy to plug Razor into your own applications. Comments:That this session was picked was a bit of a surprise to me, since it's a bit of a niche topic. Even more of a surprise was that during the session quite a few people who attended had actually used Razor externally and were there to find out more about how the process works and how to extend it. In the session I talk a bit about a custom Razor hosting implementation (Westwind.RazorHosting) and drilled into the various components required to build a custom Razor Hosting engine and a runtime around it. This sessions was a bit of a chore to prepare for as there are lots of technical implementation details that needed to be dealt with and squeezing that into an hour 15 is a bit tight (and that aren't addressed even by some of the wrapper libraries that exist). Found out though that there's quite a bit of interest in using a templating engine outside of web applications, or often side by side with the HTML output generated by frameworks like MVC or WebForms. An extra fun part of this session was that this was my first session and when I went to set up I realized I forgot my mini-DVI to VGA adapter cable to plug into the projector in my room - 6 minutes before the session was about to start. So I ended up sprinting the half a mile + back to my room - and back at a full sprint. I managed to be back only a couple of minutes late, but when I started I was out of breath for the first 10 minutes or so, while trying to talk. Musta sounded a bit funny as I was trying to not gasp too much :-) Resources: Slides and Code Samples Westwind.RazorHosting GitHub Project Original RazorHosting Blog Post   Introduction to ASP.NET Web API for AJAX Applications Abstract:WebAPI provides a new framework for creating REST based APIs, but it can also act as a backend to typical AJAX operations. This session covers the core features of Web API as it relates to typical AJAX application development. We’ll cover content-negotiation, routing and a variety of output generation options as well as managing data updates from the client in the context of a small Single Page Application style Web app. Finally we’ll look at some of the extensibility features in WebAPI to customize and extend Web API in a number and useful useful ways. Comments:This session was a fill in for session slots not filled due MIA speakers stranded by Sandy. I had samples from my previous Web API article so decided to go ahead and put together a session from it. Given that I spent only a couple of hours preparing and putting slides together I was glad it turned out as it did - kind of just ran itself by way of the examples I guess as well as nice audience interactions and questions. Lots of interest - and also some confusion about when Web API makes sense. Both this session and the jQuery session ended up getting a ton of questions about when to use Web API vs. MVC, whether it would make sense to switch to Web API for all AJAX backend work etc. In my opinion there's no need to jump to Web API for existing applications that already have a good AJAX foundation. Web API is awesome for real externally consumed APIs and clearly defined application AJAX APIs. For typical application level AJAX calls, it's still a good idea, but ASP.NET MVC can serve most if not all of that functionality just as well. There's no need to abandon MVC (or even ASP.NET AJAX or third party AJAX backends) just to move to Web API. For new projects Web API probably makes good sense for isolation of AJAX calls, but it really depends on how the application is set up. In some cases sharing business logic between the HTML and AJAX interfaces with a single MVC API can be cleaner than creating two completely separate code paths to serve essentially the same business logic. Resources: Slides and Code Samples Sample Code on GitHub Introduction to ASP.NET Web API White Paper© Rick Strahl, West Wind Technologies, 2005-2012Posted in Conferences  ASP.NET   Tweet !function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs"); (function() { var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true; po.src = 'https://apis.google.com/js/plusone.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s); })();

    Read the article

  • Browser Specific Extensions of HttpClient

    - by imran_ku07
            Introduction:                     REpresentational State Transfer (REST) causing/leaving a great impact on service/API development because it offers a way to access a service without requiring any specific library by embracing HTTP and its features. ASP.NET Web API makes it very easy to quickly build RESTful HTTP services. These HTTP services can be consumed by a variety of clients including browsers, devices, machines, etc. With .NET Framework 4.5, we can use HttpClient class to consume/send/receive RESTful HTTP services(for .NET Framework 4.0, HttpClient class is shipped as part of ASP.NET Web API). The HttpClient class provides a bunch of helper methods(for example, DeleteAsync, PostAsync, GetStringAsync, etc.) to consume a HTTP service very easily. ASP.NET Web API added some more extension methods(for example, PutAsJsonAsync, PutAsXmlAsync, etc) into HttpClient class to further simplify the usage. In addition, HttpClient is also an ideal choice for writing integration test for a RESTful HTTP service. Since a browser is a main client of any RESTful API, it is also important to test the HTTP service on a variety of browsers. RESTful service embraces HTTP headers and different browsers send different HTTP headers. So, I have created a package that will add overloads(with an additional Browser parameter) for almost all the helper methods of HttpClient class. In this article, I will show you how to use this package.           Description:                     Create/open your test project and install ImranB.SystemNetHttp.HttpClientExtensions NuGet package. Then, add this using statement on your class, using ImranB.SystemNetHttp;                     Then, you can start using any HttpClient helper method which include the additional Browser parameter. For example,  var client = new HttpClient(myserver); var task = client.GetAsync("http://domain/myapi", Browser.Chrome); task.Wait(); var response = task.Result; .                     Here is the definition  of Browser, public enum Browser { Firefox = 0, Chrome = 1, IE10 = 2, IE9 = 3, IE8 = 4, IE7 = 5, IE6 = 6, Safari = 7, Opera = 8, Maxthon = 9, }                     These extension methods will make it very easy to write browser specific integration test. It will also help HTTP service consumer to mimic the request sending behavior of a browser. This package source is available on github. So, you can grab the source and add some additional behavior on the top of these extensions.         Summary:                     Testing a REST API is an important aspect of service development and today, testing with a browser is crucial. In this article, I showed how to write integration test that will mimic the browser request sending behavior. I also showed an example. Hopefully you will enjoy this article too.

    Read the article

  • What I&rsquo;m working on for this blog&hellip;

    - by marc dekeyser
    Yes it has gone quiet again for the time being! As I am in training for Exchange 2013 and have the need to keep some customers happy (well, we all have to do something to earn our keep ;)) time to write blog posts or even work on my little side projects is limited. So for the time being there are no new blog posts coming but I’d like to tell you that you can expect posts on the following topics: * Automating lab server deployments (Using WDS and MDT 2012 RU1) * Scripts to automate application installations (and integration with the above) * Exchange 2013 posts * Exchange 2013 automation scripts (since I’m already seeing where I could do something here :P) As always, I’m still taking requests…

    Read the article

  • Total Solar Eclipse 13/November/2012 - update

    - by TATWORTH
    Panasonic Eclipse Live will start their broadcast at 18:30 UT tonight at https://www.facebook.com/PanasonicEclipseLive/app_435671416492320Alternative URLs are http://www.ustream.tv/channel/panasonic-eclipse-live-by-solar-power-1 and http://www.ustream.tv/channel/panasonic-eclipse-live-by-solar-power-2/collection/744e86aa753e(The start time is 04:30 by local Australian time and will be the 14/November for them.)

    Read the article

  • Setting Up Apache as a Forward Proxy with Cahcing

    - by Karl
    I am trying to set up Apache as a forward proxy with caching, but it does not seem to be working correctly. Getting Apache working as a forward proxy was no problem, but no matter what I do it is not caching anything, to disk or memory. I already checked to make sure nothing is conflicting in the mods_enabled directory with mod_cache (ended up commenting it all out) and also I tried moving all of the caching related fields to the configuration file for mod_cache. In addition I set up logging for caching requests, but nothing is being written to those logs. Below is my Apache config, any help would be greatly appreciated!! <VIRTUALHOST *:8080> ProxyRequests On ProxyVia On #ErrorLog "/var/log/apache2/proxy-error.log" #CustomLog "/var/log/apache2/proxy-access.log" common CustomLog "/var/log/apache2/cached-requests.log" common env=cache-hit CustomLog "/var/log/apache2/uncached-requests.log" common env=cache-miss CustomLog "/var/log/apache2/revalidated-requests.log" common env=cache-revalidate CustomLog "/var/log/apache2/invalidated-requests.log" common env=cache-invalidate LogFormat "%{cache-status}e ..." # This path must be the same as the one in /etc/default/apache2 CacheRoot /var/cache/apache2/mod_disk_cache # This will also cache local documents. It usually makes more sense to # put this into the configuration for just one virtual host. CacheEnable disk / #CacheHeader on CacheDirLevels 3 CacheDirLength 5 ##<IfModule mod_mem_cache.c> # CacheEnable mem / # MCacheSize 4096 # MCacheMaxObjectCount 100 # MCacheMinObjectSize 1 # MCacheMaxObjectSize 2048 #</IfModule> <Proxy *> Order deny,allow Deny from all Allow from x.x.x.x #IP above hidden for this post <filesMatch "\.(xml|txt|html|js|css)$"> ExpiresDefault A7200 Header append Cache-Control "proxy-revalidate" </filesMatch> </Proxy> </VIRTUALHOST> Thank you once again!

    Read the article

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