Daily Archives

Articles indexed Monday November 28 2011

Page 5/14 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • best way to authenticate and consume web service using phonegap (html5/javascript)

    - by Raiss
    I am going to develop a phonegap application which is pretty simple. I need to implement an authentication and some simple data transfer back and forth to the phone and server. I prefer to use ASP.NET as a web service and our database is MS SQL but I am not sure what approach should I take to create a secure communication between Phonegap App and webservice. The problem with a simple AJAX request is limitation in cross-domain and I’m not sure if JSONP is a good option. I was wondering if someone can tell me what technology I should use in order to make a semi secure connection which works with PhoneGap (html5, javascript ) and .Net webservice. I understand that it’s a general question but I need to know what technology is the best in such a case. thanks

    Read the article

  • Jquery radio button show and hide divs

    - by vzhen
    My html and jquery code here. The jquery code performs if value ending with 123 a specify div will show. But i got a problem here. After i clicked on value c123 and d123 and switch back to a and b radio buttons. The showed div will not disappear. How to fix this? <input type="radio" value="a" /> <input type="radio" value="b" /> <input type="radio" value="c123" /> <input type="radio" value="d123" /> $(".localBank").hide(); $("input[value$='123']").click(function() { var bank = $(this).val(); $(".localBank").hide(); $("#localBank"+bank).show(); });

    Read the article

  • Upload to a PHP Server, using Ajax ( XMLHttp POST)

    - by Krishnanunni
    Right now i'm using the below method to Upload a file to PHP <form enctype="multipart/form-data" action="http://sserver.com/fileupload.php" method="POST"> <input type="hidden" name="MAX_FILE_SIZE" value="30000000" /> <input type="hidden" name="filename" value="file_uploaded.gif" /> <input type="hidden" name="username" value="foobar"/> Please choose a file: <input name="uploaded" type="file" /><br /> <input type="submit" value="Upload" /> </form> I read the $_POST and $_FILE in php to complete upload like this. $target = $_SERVER['DOCUMENT_ROOT']."/test/upload/"; $target = $target . basename( $_FILES['uploaded']['name']) ; echo $target; $ok=1; if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)) { echo "The file ". basename( $_FILES['uploaded']['name']). " has been uploaded"; } else { echo "Sorry, there was a problem uploading your file."; } My questions is , can i change the above said code (HTML) to an Ajax XMLHttpRequest without changes in PHP.

    Read the article

  • Strange thing on IPv6 multicast program on Windows

    - by zhanglistar
    I have written an ipv6 multicast program on windows xp sp3. But a problem bothers me a lot. The sendto function implies no error, but I can't capture the packet using wireshark. I am sure the filter is right. Thanks in advance. And the code is as follows: #include "stdafx.h" #include <stdio.h> /* for printf() and fprintf() */ #include <winsock2.h> /* for socket(), connect(), sendto(), and recvfrom() */ #include <ws2tcpip.h> /* for ip_mreq */ #include <stdlib.h> /* for atoi() and exit() */ #include <string.h> /* for memset() */ #include <time.h> /* for timestamps */ #include <pcap.h> #include <Iphlpapi.h> #pragma comment(lib, "Ws2_32.lib") #pragma comment(lib, "wpcap.lib") #pragma comment(lib, "Iphlpapi.lib") int _tmain(int argc, _TCHAR* argv[]) { int sfd; int on, length, iResult; WSADATA wsaData; struct addrinfo Hints; struct addrinfo *multicastAddr, *localAddr; char buf[46]; // Initialize Winsock iResult = WSAStartup(MAKEWORD(2, 2), &wsaData); if (iResult != 0) { printf("WSAStartup failed: %d\n", iResult); return 1; } /* Resolve destination address for multicast datagrams */ memset(&Hints, 0, sizeof (Hints)); Hints.ai_family = AF_INET6; Hints.ai_socktype = SOCK_DGRAM; Hints.ai_protocol = IPPROTO_UDP; Hints.ai_flags = AI_NUMERICHOST; iResult = getaddrinfo("FF02::1:2", "547", &Hints, &multicastAddr); if (iResult != 0) { /* error handling */ printf("socket error: %d\n", WSAGetLastError()); return -1; } /* Get a local address with the same family (IPv4 or IPv6) as our multicast group */ Hints.ai_family = multicastAddr->ai_family; Hints.ai_socktype = SOCK_DGRAM; Hints.ai_flags = AI_PASSIVE; /* Return an address we can bind to */ if ( getaddrinfo(NULL, "546", &Hints, &localAddr) != 0 ) { printf("getaddrinfo() failed: %d\n", WSAGetLastError()); exit(-1); } // Create sending socket //sfd = socket (multicastAddr->ai_family, multicastAddr->ai_socktype, multicastAddr->ai_protocol); sfd = socket(AF_INET6, SOCK_DGRAM, IPPROTO_UDP); if (sfd == -1) { printf("socket error: %d\n", WSAGetLastError()); return 0; } /* Bind to the multicast port */ if ( bind(sfd, localAddr->ai_addr, localAddr->ai_addrlen) != 0 ) { printf("bind() failed: %d\n", WSAGetLastError()); exit(-1); } if (multicastAddr->ai_family == AF_INET6 && multicastAddr->ai_addrlen == sizeof(struct sockaddr_in6)) /* IPv6 */ { on = 1; if (setsockopt (sfd, IPPROTO_IPV6, IPV6_MULTICAST_IF, (char *)&on, sizeof (on) /*(char *)&interface_addr, sizeof(interface_addr)*/) == -1) { printf("setsockopt error:%d\n", WSAGetLastError()); return -1; } if (setsockopt (sfd, IPPROTO_IPV6, IPV6_MULTICAST_LOOP, (char *)&on, sizeof (on) /*(char *)&interface_addr, sizeof(interface_addr)*/) == -1) { printf("setsockopt error:%d\n", WSAGetLastError()); return -1; } struct ipv6_mreq multicastRequest; /* Multicast address join structure */ /* Specify the multicast group */ memcpy(&multicastRequest.ipv6mr_multiaddr, &((struct sockaddr_in6*)(multicastAddr->ai_addr))->sin6_addr, sizeof(struct in6_addr)); /* Accept multicast from any interface */ multicastRequest.ipv6mr_interface = 0; /* Join the multicast address */ if ( setsockopt(sfd, IPPROTO_IPV6, IPV6_JOIN_GROUP, (char*) &multicastRequest, sizeof(multicastRequest)) != 0 ) { printf("setsockopt() failed: %d\n", WSAGetLastError()); return -1; } on = 1; if (setsockopt (sfd, IPPROTO_IPV6, IPV6_MULTICAST_IF, (char *)&on, sizeof (on)) == -1) { printf("setsockopt error:%d\n", WSAGetLastError()); return 0; } } memset(buf, 0, sizeof(buf)); strcpy(buf, "hello world"); iResult = sendto(sfd, buf, strlen(buf), 0, (LPSOCKADDR) multicastAddr->ai_addr, multicastAddr->ai_addrlen); if (iResult == SOCKET_ERROR) { printf("setsockopt error:%d\n", WSAGetLastError()); return -1; /* Error handling */ } return 0; }

    Read the article

  • environment change in rake task

    - by Mellon
    I am developing Rails v2.3 app with MySQL database and mysql2 gem. I faced a weird situation which is about changing the environment in rake task. (all my setting and configurations for environment and database are correct, no problem for that.) Here is my simple story : I have a rake task like following: namespace :db do task :do_something => :environment do #1. run under 'development' environment my_helper.run_under_development_env #2. change to 'custom' environment RAILS_ENV='custom' Rake::Task['db:create'] Rake::Task['db:migrate'] #3. change back to 'development' environment RAILS_ENV='development' #4. But it still run in 'customer' environment, why? my_helper.run_under_development_env end end The rake task is quite simple, what it does is: 1. Firstly, run a method from my_helper under "development" environment 2. Then, change to "custom" environment and run db:create and db:migrate until now, everything is fine, the environment did change to "custom" 3. Then, change it back again to "development" environment 4. run helper method again under "development" environment But, though I have changed the environment back to "development" in step 3, the last method still run in "custom" environment, why? and how to get rid of it? --- P.S. --- I have also checked a post with the similar situation here, and tried to use the solution there like (in step 2): ActiveRecord::Base.establish_connection('custom') Rake::Task['db:create'] Rake::Task['db:migrate'] to change the database connection instead of changing environment but, the db:create and db:migrate will still run under "development" database, though the linked post said it should run for "custom" database... weird

    Read the article

  • Python Twitter library: which one?

    - by Parand
    I realize this is a bit of a lazyweb question, but I wanted to see which python library for Twitter people have had good experiences with. I've used Python Twitter Tools and like its brevity and beauty of interface, but it doesn't seem to be one of the popular ones - it's not even listed on the Twitter Libraries page. There are, however, plenty of others listed: oauth-python-twitter2 by Konpaku Kogasa. Combines python-twitter and oauth-python-twitter to create an evolved OAuth Pokemon. python-twitter by DeWitt Clinton. This library provides a pure Python interface for the Twitter API. python-twyt by Andrew Price. BSD licensed Twitter API interface library and command line client. twitty-twister by Dustin Sallings. A Twisted interface to Twitter. twython by Ryan McGrath. REST and Search library inspired by python-twitter. Tweepy by Josh Roesslein. Supports OAuth, Search API, Streaming API. My requirements are fairly simple: Be able to use OAuth Be able to follow a user Be able to send a direct message Be able to post Streaming API would be nice Twisted one aside (I'm not using twisted in this case), have you used any of the others, and if so, do you recommend them? [Update] FWIW, I ended up going with Python Twitter Tools again. The new version supported OAuth nicely, and it's a very clever API, so I stuck to it.

    Read the article

  • Custom UI design in Sencha and othere touch framworks

    - by vWebby
    Can someone please guide me regarding which touch framework (javascript) I should use to make a tablet app? I am new to this area and I am looking for something which allows me to play with my own UI design comfortably. I went through sencha as I heard its apt for a tablet app environment but I am (sorry, it might sound odd) not able to make out whether I can use my own UI design to make app in sencha. Or any other framework (stable) allows to use custom UI design?? Any help regarding this is appreciated .. thanks in advance

    Read the article

  • Trouble decoding JSON string with PHP

    - by Anthony
    I'm trying to send an array of objects from JS to PHP using JSON. I have an array of players as follows: var player; var players = new Array(); //loop for number of players player = new Object(); player.id = theID; players[i] = player; Then my AJAX call looks like this: JSONplayers = JSON.stringify(players); $.ajax({ type: "POST", url: "php/ajax_send_players.php", data: { "players" : JSONplayers } On the PHP side the decode function looks like this $players = $_REQUEST['players']; echo var_dump($players); $players = json_decode($players); echo 'players: ' .$players. '--'. $players[0] . '--'. $players[0]->id; Debugging in chrome, the JSON players var looks like this before it is sent: JSONplayers: "[{"id":"Percipient"},{"id":"4"}]" And when I vardump in PHP it looks OK, giving this: string(40) "[{\"id\":\"Percipient\"},{\"id\":\"4\"}]" But I can't access the PHP array, and the echo statement about starting with players: outputs this: players: ---- Nothing across the board...maybe it has something to do with the \'s in the array, I am new to this and might be missing something very simple. Any help would be greatly appreciated. note I've also tried json_decode($players, true) to get it as an assoc array but get similar results.

    Read the article

  • how can protected members of base class be accessed during unit test?

    - by amateur
    I am creating a unit test in mstest with rhino mocks. I have a class A that inherits class B. I am testing class A and create an instance of it for my test. The class it inherits, "B", has some protected methods and protected properties that I would like to access for the benefit of my tests. For example, validate that a protected property on my base class has the expected value. Any ideas how I might access these protected properties of class B during my test?

    Read the article

  • Moving items from one tableView to another tableView with extra's

    - by Totumus Maximus
    Let's say I have 2 UITableViews next to eachother on an ipad in landscape-mode. Now I want to move multiple items from one tableView to the other. They are allowed to be inserted on the bottom of the other tableView. Both have multiSelection activated. Now the movement itself is no problem with normal cells. But in my program each cell has an object which contains the consolidationState of the cell. There are 4 states a cell can have: Basic, Holding, Parent, Child. Basic = an ordinary cell. Holding = a cell which contains multiple childs but which wont be shown in this state. Parent = a cell which contains multiple childs and are shown directly below this cell. Child = a cell created by the Parent cell. The object in each cell also has some array which contains its children. The object also holds a quantityValue, which is displayed on the cell itself. Now the movement gets tricky. Holding and Parent cells can't move at all. Basic cells can move freely. Child cells can move freely but based on how many Child cells are left in the Parent. The parent will change or be deleted all together. If a Parent cell has more then 1 Child cell left it will stay a Parent cell. Else the Parent has no or 1 Child cell left and is useless. It will then be deleted. The items that are moved will always be of the same state. They will all be Basic cells. This is how I programmed the movement: *First I determine which of the tableViews is the sender and which is the receiver. *Second I ask all indexPathsForSelectedRows and sort them from highest row to lowest. *Then I build the data to be transferred. This I do by looping through the selectedRows and ask their object from the sender's listOfItems. *When I saved all the data I need I delete all the items from the sender TableView. This is why I sorted the selectedRows so I can start at the highest indexPath.row and delete without screwing up the other indexPaths. *When I loop through the selectedRows I check whether I found a cell with state Basic or Child. *If its a Basic cell I do nothing and just delete the cell. (this works fine with all Basic Cells) *If its a Child cell I go and check it's Parent cell immidiately. Since all Child cells are directly below the Parent cell and no other the the Parent's Childs are below that Parent I can safely get the path of the selected Childcell and move upwards and find it's Parent cell. When this Parent cell is found (this will always happen, no exceptions) it has to change accordingly. *The Parent cell will either be deleted or the object inside will have its quantity and children reduced. *After the Parent cell has changed accordingly the Child cell is deleted similarly like the Basic cells *After the deletion of the cells the receiver tableView will build new indexPaths so the movedObjects will have a place to go. *I then insert the objects into the listOfItems of the receiver TableView. The code works in the following ways: Only Basic cells are moved. Basic cells and just 1 child for each parent is moved. A single Basic/Child cell is moved. The code doesn't work when: I select more then 1 or all childs of some parent cell. The problem happens somewhere into updating the parent cells. I'm staring blindly at the code now so maybe a fresh look will help fix things. Any help will be appreciated. Here is the method that should do the movement: -(void)moveSelectedItems { UITableView *senderTableView = //retrieves the table with the data here. UITableView *receiverTableView = //retrieves the table which gets the data here. NSArray *selectedRows = senderTableView.indexPathsForSelectedRows; //sort selected rows from lowest indexPath.row to highest selectedRows = [selectedRows sortedArrayUsingSelector:@selector(compare:)]; //build up target rows (all objects to be moved) NSMutableArray *targetRows = [[NSMutableArray alloc] init]; for (int i = 0; i<selectedRows.count; i++) { NSIndexPath *path = [selectedRows objectAtIndex:i]; [targetRows addObject:[senderTableView.listOfItems objectAtIndex:path.row]]; } //delete rows at active for (int i = selectedRows.count-1; i >= 0; i--) { NSIndexPath *path = [selectedRows objectAtIndex:i]; //check what item you are deleting. act upon the status. Parent- and HoldingCells cant be selected so only check for basic and childs MyCellObject *item = [senderTableView.listOfItems objectAtIndex:path.row]; if (item.consolidatedState == ConsolidationTypeChild) { for (int j = path.row; j >= 0; j--) { MyCellObject *consolidatedItem = [senderTableView.listOfItems objectAtIndex:j]; if (consolidatedItem.consolidatedState == ConsolidationTypeParent) { //copy the consolidated item but with 1 less quantity MyCellObject *newItem = [consolidatedItem copyWithOneLessQuantity]; //creates a copy of the object with 1 less quantity. if (newItem.quantity > 1) { newItem.consolidatedState = ConsolidationTypeParent; [senderTableView.listOfItems replaceObjectAtIndex:j withObject:newItem]; } else if (newItem.quantity == 1) { newItem.consolidatedState = ConsolidationTypeBasic; [senderTableView.listOfItems removeObjectAtIndex:j]; MyCellObject *child = [senderTableView.listOfItems objectAtIndex:j+1]; child.consolidatedState = ConsolidationTypeBasic; [senderTableView.listOfItems replaceObjectAtIndex:j+1 withObject:child]; } else { [senderTableView.listOfItems removeObject:consolidatedItem]; } [senderTableView reloadData]; } } } [senderTableView.listOfItems removeObjectAtIndex:path.row]; } [senderTableView deleteRowsAtIndexPaths:selectedRows withRowAnimation:UITableViewRowAnimationTop]; //make new indexpaths for row animation NSMutableArray *newRows = [[NSMutableArray alloc] init]; for (int i = 0; i < targetRows.count; i++) { NSIndexPath *newPath = [NSIndexPath indexPathForRow:i+receiverTableView.listOfItems.count inSection:0]; [newRows addObject:newPath]; DLog(@"%i", i); //scroll to newest items [receiverTableView setContentOffset:CGPointMake(0, fmaxf(receiverTableView.contentSize.height - recieverTableView.frame.size.height, 0.0)) animated:YES]; } //add rows at target for (int i = 0; i < targetRows.count; i++) { MyCellObject *insertedItem = [targetRows objectAtIndex:i]; //all moved items will be brought into the standard (basic) consolidationType insertedItem.consolidatedState = ConsolidationTypeBasic; [receiverTableView.ListOfItems insertObject:insertedItem atIndex:receiverTableView.ListOfItems.count]; } [receiverTableView insertRowsAtIndexPaths:newRows withRowAnimation:UITableViewRowAnimationNone]; } If anyone has some fresh ideas of why the movement is bugging out let me know. If you feel like you need some extra information I'll be happy to add it. Again the problem is in the movement of ChildCells and updating the ParentCells properly. I could use some fresh looks and outsider ideas on this. Thanks in advance. *updated based on comments

    Read the article

  • How to Implement Custom List View for the list Items in Android Application

    - by avadhani
    I had a problem with the list view having both parent list and the child list of the list activity(implemented through database query). I wish to show them differing their properties by changing the text style (parent list items are in bold, child list items are in normal style). The following is the code from which all the child and parent list items having the same style(bold): String sql = "SELECT Parentid,Childid,Name from (select com.Parentid, com.Childid, com.Name from table1 mem inner join table2 cd on mem.column1=cd.column1 inner join table3 com on com.childid = mem.childid where Parentid is NULL UNION SELECT com.Parentid, com.Childid,com.Name from table1 mem inner join table3 com on com.childid = mem.childid inner join table2 cd on mem.column1=cd.column1 where Parentid is NOT NULL) a group by Parentid, Childid;"; Cursor cdata = myDbHelper.getView(sql); and the List Adapter is: private static final String fields[] = {"Name"}; int[] names = new int[] {R.id.name}; SimpleCursorAdapter adapter2 = new SimpleCursorAdapter(this,R.layout.clientlist1, cdata, fields,names ); and the clientlist.xml is: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent" android:id="@+id/MainLayout" android:padding="5px"> <TextView android:id="@+id/name" android:layout_alignParentRight="true" android:layout_width="fill_parent" android:layout_height="wrap_content" android:textSize="12sp" android:textColor="#104082" android:textStyle="bold" android:layout_weight="1" /> From this i am getting the list having the complete list having both parent and child list items in a single list view. I wish to differ in their text style(bold, normal) for parent and child items respectively. Please help me with the code/links. Thanks a lot in advance.

    Read the article

  • HTTPS intercept

    - by Adrian
    I don't know much about SSL, but I've read something and I was wondering if it's possible to intercept the communication between client and server (for example, a company can monitor employees data transfer?). I thought it was a difficult task, but it looks like that it is very simple. When a client requests a https connection the router can be instructed to intercept the key exchange and send to the server and the client it's own public keys (further it can encode/decode the hole traffic). Is it true, or I'm misunderstanding something?

    Read the article

  • New Bundling and Minification Support (ASP.NET 4.5 Series)

    - by ScottGu
    This is the sixth in a series of blog posts I'm doing on ASP.NET 4.5. The next release of .NET and Visual Studio include a ton of great new features and capabilities.  With ASP.NET 4.5 you'll see a bunch of really nice improvements with both Web Forms and MVC - as well as in the core ASP.NET base foundation that both are built upon. Today’s post covers some of the work we are doing to add built-in support for bundling and minification into ASP.NET - which makes it easy to improve the performance of applications.  This feature can be used by all ASP.NET applications, including both ASP.NET MVC and ASP.NET Web Forms solutions. Basics of Bundling and Minification As more and more people use mobile devices to surf the web, it is becoming increasingly important that the websites and apps we build perform well with them. We’ve all tried loading sites on our smartphones – only to eventually give up in frustration as it loads slowly over a slow cellular network.  If your site/app loads slowly like that, you are likely losing potential customers because of bad performance.  Even with powerful desktop machines, the load time of your site and perceived performance can make an enormous customer perception. Most websites today are made up of multiple JavaScript and CSS files to separate the concerns and keep the code base tight. While this is a good practice from a coding point of view, it often has some unfortunate consequences for the overall performance of the website.  Multiple JavaScript and CSS files require multiple HTTP requests from a browser – which in turn can slow down the performance load time.  Simple Example Below I’ve opened a local website in IE9 and recorded the network traffic using IE’s built-in F12 developer tools. As shown below, the website consists of 5 CSS and 4 JavaScript files which the browser has to download. Each file is currently requested separately by the browser and returned by the server, and the process can take a significant amount of time proportional to the number of files in question. Bundling ASP.NET is adding a feature that makes it easy to “bundle” or “combine” multiple CSS and JavaScript files into fewer HTTP requests. This causes the browser to request a lot fewer files and in turn reduces the time it takes to fetch them.   Below is an updated version of the above sample that takes advantage of this new bundling functionality (making only one request for the JavaScript and one request for the CSS): The browser now has to send fewer requests to the server. The content of the individual files have been bundled/combined into the same response, but the content of the files remains the same - so the overall file size is exactly the same as before the bundling.   But notice how even on a local dev machine (where the network latency between the browser and server is minimal), the act of bundling the CSS and JavaScript files together still manages to reduce the overall page load time by almost 20%.  Over a slow network the performance improvement would be even better. Minification The next release of ASP.NET is also adding a new feature that makes it easy to reduce or “minify” the download size of the content as well.  This is a process that removes whitespace, comments and other unneeded characters from both CSS and JavaScript. The result is smaller files, which will download and load in a browser faster.  The graph below shows the performance gain we are seeing when both bundling and minification are used together: Even on my local dev box (where the network latency is minimal), we now have a 40% performance improvement from where we originally started.  On slow networks (and especially with international customers), the gains would be even more significant. Using Bundling and Minification inside ASP.NET The upcoming release of ASP.NET makes it really easy to take advantage of bundling and minification within projects and see performance gains like in the scenario above. The way it does this allows you to avoid having to run custom tools as part of your build process –  instead ASP.NET has added runtime support to perform the bundling/minification for you dynamically (caching the results to make sure perf is great).  This enables a really clean development experience and makes it super easy to start to take advantage of these new features. Let’s assume that we have a simple project that has 4 JavaScript files and 6 CSS files: Bundling and Minifying the .css files Let’s say you wanted to reference all of the stylesheets in the “Styles” folder above on a page.  Today you’d have to add multiple CSS references to get all of them – which would translate into 6 separate HTTP requests: The new bundling/minification feature now allows you to instead bundle and minify all of the .css files in the Styles folder – simply by sending a URL request to the folder (in this case “styles”) with an appended “/css” path after it.  For example:    This will cause ASP.NET to scan the directory, bundle and minify the .css files within it, and send back a single HTTP response with all of the CSS content to the browser.  You don’t need to run any tools or pre-processor to get this behavior.  This enables you to cleanly separate your CSS into separate logical .css files and maintain a very clean development experience – while not taking a performance hit at runtime for doing so.  The Visual Studio designer will also honor the new bundling/minification logic as well – so you’ll still get a WYSWIYG designer experience inside VS as well. Bundling and Minifying the JavaScript files Like the CSS approach above, if we wanted to bundle and minify all of our JavaScript into a single response we could send a URL request to the folder (in this case “scripts”) with an appended “/js” path after it:   This will cause ASP.NET to scan the directory, bundle and minify the .js files within it, and send back a single HTTP response with all of the JavaScript content to the browser.  Again – no custom tools or builds steps were required in order to get this behavior.  And it works with all browsers. Ordering of Files within a Bundle By default, when files are bundled by ASP.NET they are sorted alphabetically first, just like they are shown in Solution Explorer. Then they are automatically shifted around so that known libraries and their custom extensions such as jQuery, MooTools and Dojo are loaded before anything else. So the default order for the merged bundling of the Scripts folder as shown above will be: Jquery-1.6.2.js Jquery-ui.js Jquery.tools.js a.js By default, CSS files are also sorted alphabetically and then shifted around so that reset.css and normalize.css (if they are there) will go before any other file. So the default sorting of the bundling of the Styles folder as shown above will be: reset.css content.css forms.css globals.css menu.css styles.css The sorting is fully customizable, though, and can easily be changed to accommodate most use cases and any common naming pattern you prefer.  The goal with the out of the box experience, though, is to have smart defaults that you can just use and be successful with. Any number of directories/sub-directories supported In the example above we just had a single “Scripts” and “Styles” folder for our application.  This works for some application types (e.g. single page applications).  Often, though, you’ll want to have multiple CSS/JS bundles within your application – for example: a “common” bundle that has core JS and CSS files that all pages use, and then page specific or section specific files that are not used globally. You can use the bundling/minification support across any number of directories or sub-directories in your project – this makes it easy to structure your code so as to maximize the bunding/minification benefits.  Each directory by default can be accessed as a separate URL addressable bundle.  Bundling/Minification Extensibility ASP.NET’s bundling and minification support is built with extensibility in mind and every part of the process can be extended or replaced. Custom Rules In addition to enabling the out of the box - directory-based - bundling approach, ASP.NET also supports the ability to register custom bundles using a new programmatic API we are exposing.  The below code demonstrates how you can register a “customscript” bundle using code within an application’s Global.asax class.  The API allows you to add/remove/filter files that go into the bundle on a very granular level:     The above custom bundle can then be referenced anywhere within the application using the below <script> reference:     Custom Processing You can also override the default CSS and JavaScript bundles to support your own custom processing of the bundled files (for example: custom minification rules, support for Saas, LESS or Coffeescript syntax, etc). In the example below we are indicating that we want to replace the built-in minification transforms with a custom MyJsTransform and MyCssTransform class. They both subclass the CSS and JavaScript minifier respectively and can add extra functionality:     The end result of this extensibility is that you can plug-into the bundling/minification logic at a deep level and do some pretty cool things with it. 2 Minute Video of Bundling and Minification in Action Mads Kristensen has a great 90 second video that shows off using the new Bundling and Minification feature.  You can watch the 90 second video here. Summary The new bundling and minification support within the next release of ASP.NET will make it easier to build fast web applications.  It is really easy to use, and doesn’t require major changes to your existing dev workflow.  It is also supports a rich extensibility API that enables you to customize it however you want. You can easily take advantage of this new support within ASP.NET MVC, ASP.NET Web Forms and ASP.NET Web Pages based applications. Hope this helps, Scott P.S. In addition to blogging, I use Twitter to-do quick posts and share links. My Twitter handle is: @scottgu

    Read the article

  • "Path Not Found" when attempting to write to a sub folder within a mapped drive

    - by Adam
    We have an interesting issue with one of our server shares, or possibly, our Win 7 desktops. When our users try to save files in a sub folder, either via copy/paste or through an application, to a mapped drive on our DC they receive an error saying "Path not found". They can however browse this folder and open files from it. This is where the "Path Not Found" error doesn't seem to stack up in my opinion. Users can however save files fine in the root folder of the mapped drive, it appears only to affect sub folders. It seems to be random which users and machines this affects. The users can log on to a different machine and be able to save in sub folders fine, on the same mapped drive. Event viewer hasn't been much help either. Currently, the only solution we have found is to image the machines affected which solves the issue. Our servers are Server 2008 R2 with Win 7 Pro desktops. Any help/pointers/suggestions would greatly be appreciated.

    Read the article

  • Apache 2.2.21 installation on Linux 6 but got error while accessing in browser

    - by JRanjan
    I am very new to linux. I have install apache 2.2.21 on linux 6 platform. While i am using ./apachectl start or ./apachectl -k start command it shows that apache is started. But while i am trying to to access apache default page in any browser using " http://:8080 " it shows page cannot be displayed. Can any one help me on this issue ??????? Plz its urgent.. I am also enclosing the error_log file as below: error_log file [Thu Nov 24 08:57:23 2011] [notice] Apache/2.2.21 (Unix) DAV/2 configured -- resuming normal operations [Fri Nov 25 01:45:58 2011] [notice] caught SIGTERM, shutting down [Fri Nov 25 01:46:12 2011] [notice] Digest: generating secret for digest authentication ... [Fri Nov 25 01:46:12 2011] [notice] Digest: done [Fri Nov 25 01:46:13 2011] [notice] Apache/2.2.21 (Unix) DAV/2 configured -- resuming normal operations [Fri Nov 25 01:54:58 2011] [notice] caught SIGTERM, shutting down [Fri Nov 25 01:55:10 2011] [notice] Digest: generating secret for digest authentication ... [Fri Nov 25 01:55:10 2011] [notice] Digest: done [Fri Nov 25 01:55:11 2011] [notice] Apache/2.2.21 (Unix) DAV/2 configured -- resuming normal operations [Fri Nov 25 01:58:10 2011] [notice] caught SIGTERM, shutting down [Fri Nov 25 01:59:41 2011] [notice] Digest: generating secret for digest authentication ... [Fri Nov 25 01:59:41 2011] [notice] Digest: done [Fri Nov 25 01:59:42 2011] [notice] Apache/2.2.21 (Unix) DAV/2 configured -- resuming normal operations [Fri Nov 25 03:23:14 2011] [notice] caught SIGTERM, shutting down [Fri Nov 25 03:27:36 2011] [notice] Digest: generating secret for digest authentication ... [Fri Nov 25 03:27:36 2011] [notice] Digest: done [Fri Nov 25 03:27:37 2011] [notice] Apache/2.2.21 (Unix) DAV/2 configured -- resuming normal operations [Fri Nov 25 08:52:27 2011] [notice] caught SIGTERM, shutting down [Fri Nov 25 08:52:43 2011] [notice] Digest: generating secret for digest authentication ... [Fri Nov 25 08:52:43 2011] [notice] Digest: done [Fri Nov 25 08:52:44 2011] [notice] Apache/2.2.21 (Unix) DAV/2 configured -- resuming normal operations [Fri Nov 25 09:21:39 2011] [notice] caught SIGTERM, shutting down [Fri Nov 25 09:21:57 2011] [notice] Digest: generating secret for digest authentication ... [Fri Nov 25 09:21:57 2011] [notice] Digest: done [Fri Nov 25 09:21:58 2011] [notice] Apache/2.2.21 (Unix) DAV/2 configured -- resuming normal operations [Mon Nov 28 01:06:58 2011] [notice] caught SIGTERM, shutting down [Mon Nov 28 01:07:58 2011] [notice] Digest: generating secret for digest authentication ... [Mon Nov 28 01:07:58 2011] [notice] Digest: done [Mon Nov 28 01:07:59 2011] [notice] Apache/2.2.21 (Unix) DAV/2 configured -- resuming normal operations

    Read the article

  • How is it possible that I can do a host lookup but not a curl?

    - by Daniel Quinn
    Has anyone ever seen this before? Note that this happens not only with google.com, but with every domain I try. It's a wireless connection (WEP), but I'm not sure how that would be relevant: $ curl -v google.com # This takes about 60s to return * getaddrinfo(3) failed for google.com:80 * Couldn't resolve host 'google.com' * Closing connection #0 curl: (6) Couldn't resolve host 'google.com' $ host google.com google.com has address 209.85.148.106 google.com has address 209.85.148.147 google.com has address 209.85.148.99 google.com has address 209.85.148.103 google.com has address 209.85.148.104 google.com has address 209.85.148.105 google.com mail is handled by 30 alt2.aspmx.l.google.com. google.com mail is handled by 40 alt3.aspmx.l.google.com. google.com mail is handled by 50 alt4.aspmx.l.google.com. google.com mail is handled by 10 aspmx.l.google.com. google.com mail is handled by 20 alt1.aspmx.l.google.com. $ cat /etc/resolv.conf # Generated by NetworkManager nameserver 192.168.1.201 $ cat /etc/hosts 127.0.0.1 localhost ::1 localhost $ netstat -rn Kernel IP routing table Destination Gateway Genmask Flags MSS Window irtt Iface 0.0.0.0 192.168.1.254 0.0.0.0 UG 0 0 0 wlan0 127.0.0.0 127.0.0.1 255.0.0.0 UG 0 0 0 lo 192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan0

    Read the article

  • Expanding to dual video cards

    - by Anthony Greco
    I know a lot of factors can go into play here, so I will list my current hardware and setup: MOBO: GIGABYTE GA-890FXA-UD5 [http://www.newegg.com/Product/Product.aspx?Item=N82E16813128441] Processor: AMD Phenom II X6 1090T Black Edition Thuban 3.2GHz [http://www.newegg.com/Product/Product.aspx?Item=N82E16819103849] Ram: G.SKILL Ripjaws Series 16GB (4 x 4GB) [https://secure.newegg.com/NewMyAccount/OrderHistory.aspx?RandomID=4933910872745320111128011418] Current video card: EVGA 01G-P3-1366-TR GeForce GTX 460 SE [http://www.newegg.com/Product/Product.aspx?Item=N82E16814130591] OS: Windows 7 Ultimate x64 Currently I can run 2 monitors just fine in my setup. However, I want to upgrade this to 4 monitors. My question is, what is the best way to do this? I remember in the past reading I need the same type of video card, however would any GeForce GTX work, or do i need that very specific model (EVGA 01G-P3-1366-TR GeForce GTX 460 SE)? Are there any issues I should be aware of before I order 2 new monitors and a video card? Are there video cards better setup for this? I know NVidia offers SLI, however I do not know if my mobo is compliant. My mobo also offers CrossFireX configuration, though from what it says only Radeon are compliant. Any suggestions / feedbacks on my best route with my current setup is appreciated. Even if you suggest buying 2 new identical video cards, as long as you can mention which and why that is better I really appreciate it. Note: I really do not do any gaming. I sometimes do some 3D work in Unity and very rarely in Maya. Besides that I mostly do all my computer work in Visual Studios and Photoshop. I however need the 2 extra monitors because I monitor sometimes 5 remote desktops at once and switching on only 2 is becoming a very big pain. Also seeing 3 side by side while I work on the 4th will be very helpful. Again, I appreciate any feedback, as I have googled a bunch and just want to make sure what I buy will work.

    Read the article

  • Subversion error: (405 Method Not Allowed) in response to MKCOL

    - by Sergio del Amo
    I am getting the following error while trying to commit a new directory addition. svn: Commit failed (details follow): svn: Server sent unexpected return value (405 Method Not Allowed) in response to MKCOL request for '.... I have never seen this error before. How can I fix this problem? Solution I managed to solve the problem: Delete the parent's directory of the folder giving the problem. Do SVN Update. A folder with the same name as the new one already existed in repository. Delete this folder. SVN commit. Copy the new folder, schedule for addition and SVN commit.

    Read the article

  • Latency in TCP/IP-over-Ethernet networks

    - by aix
    What resources (books, Web pages etc) would you recommend that: explain the causes of latency in TCP/IP-over-Ethernet networks; mention tools for looking out for things that cause latency (e.g. certain entries in netstat -s); suggest ways to tweak the Linux TCP stack to reduce TCP latency (Nagle, socket buffers etc). The closest I am aware of is this document, but it's rather brief. Alternatively, you're welcome to answer the above questions directly. edit To be clear, the question isn't just about "abnormal" latency, but about latency in general. Additionally, it is specifically about TCP/IP-over-Ethernet and not about other protocols (even if they have better latency characteristics.)

    Read the article

  • NIC are not advertising Correct Speeds

    - by Squidly
    I have an IBM x336 that is not advertising the proper LINK speeds. One interface is the other is not. I've tried to Force it to 1000/Full but then it just shows link down. I have confirmed the switch is set to auto negotiate like my switches. I have also changed out my Ethernet Cables. I'm at a loss where to look further. I have verified that it will connect at 1G on a different swtich. This also has happened on two different servers on the same switch. This is my output from mii-tool -v for each interface. eth0: negotiated 100baseTx-FD, link ok product info: vendor 00:08:18, model 24 rev 0 basic mode: autonegotiation enabled basic status: autonegotiation complete, link ok capabilities: 1000baseT-HD 1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD advertising: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control link partner: 1000baseT-HD 1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD eth1: negotiated 1000baseT-FD flow-control, link ok product info: vendor 00:08:18, model 24 rev 0 basic mode: autonegotiation enabled basic status: autonegotiation complete, link ok capabilities: 1000baseT-HD 1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD advertising: 1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control link partner: 1000baseT-HD 1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD

    Read the article

  • Installing mod_pagespeed (Apache module) on CentOS

    - by Sid B
    I have a CentOS (5.7 Final) system on which I already have Apache (2.2.3) installed. I have installed mod_pagespeed by following the instructions on: http://code.google.com/speed/page-speed/download.html and got the following while installing: # rpm -U mod-pagespeed-*.rpm warning: mod-pagespeed-beta_current_x86_64.rpm: Header V4 DSA signature: NOKEY, key ID 7fac5991 [ OK ] atd: [ OK ] It does appear to be installed properly: # apachectl -t -D DUMP_MODULES Loaded Modules: ... pagespeed_module (shared) And I've made the following changes in /etc/httpd/conf.d/pagespeed.conf Added: ModPagespeedEnableFilters collapse_whitespace,elide_attributes ModPagespeedEnableFilters combine_css,rewrite_css,move_css_to_head,inline_css ModPagespeedEnableFilters rewrite_javascript,inline_javascript ModPagespeedEnableFilters rewrite_images,insert_img_dimensions ModPagespeedEnableFilters extend_cache ModPagespeedEnableFilters remove_quotes,remove_comments ModPagespeedEnableFilters add_instrumentation Commented out the following lines in mod_pagespeed_statistics <Location /mod_pagespeed_statistics> **# Order allow,deny** # You may insert other "Allow from" lines to add hosts you want to # allow to look at generated statistics. Another possibility is # to comment out the "Order" and "Allow" options from the config # file, to allow any client that can reach your server to examine # statistics. This might be appropriate in an experimental setup or # if the Apache server is protected by a reverse proxy that will # filter URLs in some fashion. **# Allow from localhost** **# Allow from 127.0.0.1** SetHandler mod_pagespeed_statistics </Location> As a separate note, I'm trying to run the prescribed system tests as specified on google's site, but it gives the following error. I'm averse to updating wget on my server, as I'm sure there's no need for it for the actual module to function correctly. ./system_test.sh www.domain.com You have the wrong version of wget. 1.12 is required.

    Read the article

  • Any Linux distro which is supported on EFI enabled XServe

    - by geoaxis
    I am looking into installing Linux on a test XServe machine and see how it goes overall. We have our entire infrastructure on OSX and would like to move to Linux servers. Is there any distribution which has good support for XServe? Google search yielded nothing conclusive. I don't mind hacking around for personal use (compiling kernel, tweaking packages and configurations) but when running in production it's good to be cautious. Paying for commercial support is definitely an option.

    Read the article

  • Self Hosted Dropbox Alternative?

    - by Hutch
    Does anyone know of any self-hosted Dropbox alternatives? We have a need to share files/folders between staff and partners (small scale) and for various reasons we'd prefer to host it ourselves. Sharepoint seems a little too focussed on "check in/check out" and things like webdav/ftp seem a little kludgy. In an ideal world something where you (as an IT person) can setup an area, make a user "owner" and from there they can add their customers would be great. Windows or Virtual Appliance would be ideal.

    Read the article

  • Unable to install ffmpeg-php

    - by matt74tm
    I followed the instructions on http://www.mysql-apache-php.com/ffmpeg-install.htm but ffmpeg-php does not show up in my phpinfo() The commands I ran (in order) #yum install ffmpeg ffmpeg-devel ... Public key for faac-1.26-1.el5.rf.x86_64.rpm is not installed #rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm ... 1:rpmforge-release ########################################### [100%] #yum install ffmpeg ... Complete! #wget http://space.dl.sourceforge.net/project/ffmpeg-php/ffmpeg-php/0.6.0/ffmpeg-php-0.6.0.tbz2 ... #tar -xjf ffmpeg-php-0.6.0.tbz2 #cd ffmpeg-php-0.6.0 #phpize ... configure: error: ffmpeg headers not found. Make sure ffmpeg is compiled as shared libraries using the --enable-shared option #yum install ffmpeg-devel ... Complete! #./configure ... config.status: creating config.h #make ... Build complete. Don't forget to run 'make test'. #make install Installing shared extensions: /usr/local/lib/php/extensions/no-debug-non-zts-20090626/ #ls -al /usr/local/lib/php/extensions/no-debug-non-zts-20090626/ ... -rwxr-xr-x 1 root root 185285 Sep 20 03:36 ffmpeg.so* ... #nano /usr/local/lib/php.ini In which I put these two lines at the end of the php.ini file [ffmpeg] extension=ffmpeg.so Then, #service httpd restart But phpinfo() still does not show any 'ffmpeg' section. This is the correct php.ini because: #php -i | grep php\.ini Configuration File (php.ini) Path => /usr/local/lib Loaded Configuration File => /usr/local/lib/php.ini

    Read the article

  • Daily Weekly and Monthly DB backup with logrotate?

    - by benjisail
    I am currently keeping daily backup of my database by doing a daily mysqldump and by using logrotate to keep the 7 last days of mysqldump. I would like to improve this backup process to keep 7 daily backup, 3 weekly backups and 12 monthly backup. I found this article which explain how to di this with logrotate : http://www.hotcoding.com/os/sysadmin/35751.html However I am using the dateext logrotate option to name my backup files so I cannot use this solution. How can I do daily, weekly and monthly backup with logrotate and with the dateext option?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >