Daily Archives

Articles indexed Friday October 12 2012

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

  • How to select chosen columns from two different entities into one DTO using NHibernate?

    - by Pawel Krakowiak
    I have two classes (just recreating the problem): public class User { public virtual int Id { get; set; } public virtual string FirstName { get; set; } public virtual string LastName { get; set; } public virtual IList<OrgUnitMembership> OrgUnitMemberships { get; set; } } public class OrgUnitMembership { public virtual int UserId { get; set; } public virtual int OrgUnitId { get; set; } public virtual DateTime JoinDate { get; set; } public virtual DateTime LeaveDate { get; set; } } There's a Fluent NHibernate map for both, of course: public class UserMapping : ClassMap<User> { public UserMapping() { Table("Users"); Id(e => e.Id).GeneratedBy.Identity(); Map(e => e.FirstName); Map(e => e.LastName); HasMany(x => x.OrgUnitMemberships) .KeyColumn(TypeReflector<OrgUnitMembership> .GetPropertyName(p => p.UserId))).ReadOnly().Inverse(); } } public class OrgUnitMembershipMapping : ClassMap<OrgUnitMembership> { public OrgUnitMembershipMapping() { Table("OrgUnitMembership"); CompositeId() .KeyProperty(x=>x.UserId) .KeyProperty(x=>x.OrgUnitId); Map(x => x.JoinDate); Map(x => x.LeaveDate); References(oum => oum.OrgUnit) .Column(TypeReflector<OrgUnitMembership> .GetPropertyName(oum => oum.OrgUnitId)).ReadOnly(); References(oum => oum.User) .Column(TypeReflector<OrgUnitMembership> .GetPropertyName(oum => oum.UserId)).ReadOnly(); } } What I want to do is to retrieve some users based on criteria, but I would like to combine all columns from the Users table with some columns from the OrgUnitMemberships table, analogous to a SQL query: select u.*, m.JoinDate, m.LeaveDate from Users u inner join OrgUnitMemberships m on u.Id = m.UserId where m.OrgUnitId = :ouid I am totally lost, I tried many different options. Using a plain SQL query almost works, but because there are some nullable enums in the User class AliasToBean fails to transform, otherwise wrapping a SQL query would work like this: return Session .CreateSQLQuery(sql) .SetParameter("ouid", orgUnitId) .SetResultTransformer(Transformers.AliasToBean<UserDTO>()) .List<UserDTO>() I tried the code below as a test (a few different variants), but I'm not sure what I'm doing. It works partially, I get instances of UserDTO back, the properties coming from OrgUnitMembership (dates) are filled, but all properties from User are null: User user = null; OrgUnitMembership membership = null; UserDTO dto = null; var users = Session.QueryOver(() => user) .SelectList(list => list .Select(() => user.Id) .Select(() => user.FirstName) .Select(() => user.LastName)) .JoinAlias(u => u.OrgUnitMemberships, () => membership) //.JoinQueryOver<OrgUnitMembership>(u => u.OrgUnitMemberships) .SelectList(list => list .Select(() => membership.JoinDate).WithAlias(() => dto.JoinDate) .Select(() => membership.LeaveDate).WithAlias(() => dto.LeaveDate)) .TransformUsing(Transformers.AliasToBean<UserDTO>()) .List<UserDTO>();

    Read the article

  • Redirect To Another Site With Header Information Attached Javascript

    - by Nick LaMarca
    I am trying to make a client side click and redirect to another site with header information added, my client side code for the onclick is this: function selectApp(appGUID, userId ,embedUrl) { if(embedUrl==="") { var success = setAppGUID(appGUID); window.location.replace('AppDetail.aspx'); } else { $.ajax({ type: "POST", url: embedUrl, contentType: "text/html", beforeSend: function (xhr, settings) { xhr.setRequestHeader("UserId", userId); }, success: function (msg) { //go to slx window.location.replace(embedUrl); } }); } } And the server side code in "embedUrl" is protected void Page_Load(object sender, EventArgs e) { string isSet = (String)HttpContext.Current.Session["saveUserID"]; if (String.IsNullOrEmpty(isSet)) { NameValueCollection headers = base.Request.Headers; for (int i = 0; i < headers.Count; i++) { if (headers.GetKey(i).Equals("UserId")) { HttpContext.Current.Session["saveUserID"] = headers.Get(i); } } } else { TextBox1.Text = HttpContext.Current.Session["saveUserID"].ToString(); } } This seems to work but its not too elegant. Is there a way to redirect with header data? Without (what Im doing) Saving header info in a session var then doing a redirect in 2 seperate pieces.

    Read the article

  • How to test if a gawk string contain a number?

    - by Tim Menzies
    In gawk I know two ways to test if a string contains a number. Which is best? Method one: using regular expressions: function method1(x) { return x ~ /^[+-]?([0-9]+[.]?[0-9]*|[.][0-9]+)([eE][+-]?[0-9]+)?$/ } Method two: the coercion trick (simpler): function method2(x) { return (x != "") && (x+0 == x) } Is there any reason to favor the more complex method1 over the simpler method2?

    Read the article

  • Returning new base class when the parent class shared pointer is the return type

    - by Ben Dol
    Can you have a parent class shared pointer return type of a function and then return a new child class without it being a shared pointer? I'm not sure how shared pointers work in these situations, do they act like a regular pointer? Here is my example: BaseEventPtr Actions::getEvent(const std::string& nodeName) { if(asLowerCaseString(nodeName) == "action") return new ActionEvent(&m_interface); return nullptr; } ActionEvent is the subclass of BaseEvent in this situation. Cheers!

    Read the article

  • How to access website CMS with only access to database

    - by user1741615
    I have a website that uses an "in-house" cms and I don't know the login details. The platform itself doesn't have the "reset your password" functionality. I do have access to ftp and phmyadmin and I found the SQL table containing the user details, but of course the password is MD5 encryption. I tried manually creating a user in php my admin and filling in a password encrypted in MD5 (used a md service online for that), but it still doesn't work. Does anybody know other tricks I can use? Thanks.

    Read the article

  • How to show vertical scrollbar only for iframe?

    - by Adham
    The following html code deosn't show the vertical scrollabr . why ? <style> #mapIframe{ min-height:300px; overflow:auto !important; direction:rtl !important; overflow-x:hidden !important; overflow-y:scroll !important; height:100%; //optional, but it can't hurt. } </style> <iframe id="mapIframe" src="aurl" width="300" height="800" frameBorder="0">Browser not compatible.</iframe>

    Read the article

  • How to add multiple link styles on the same page?

    - by Darren Baker
    I have two hyperlinks on a page. I'm happy with the css on 'link1' (white text / red rollover) however I want to have a different styling for 'link2'. I've created a seperate css for this section and have managed to colour it green but I can't get rid of the red rollover effect? Does anyone know how to override the red rollover effect just on 'link2'? http://www.signport.co.uk/test/testsize3.html Thanks!

    Read the article

  • Activity triggered by a click on a Notification

    - by Zelig63
    From a Service, I trigger a Notification which, when clicked, has to launch an Activity. To do this, I use the following code : notification=new Notification(icone,title,System.currentTimeMillis()); intent=new Intent(getApplicationContext(),myActivity.class); intent.putExtra("org.mypackage.name",true); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); pendingIntent=PendingIntent.getActivity(getApplicationContext(),0,intent,PendingIntent.FLAG_ONE_SHOT); notification.setLatestEventInfo(getApplicationContext(),title,"Message",pendingIntent); notification.flags|=Notification.FLAG_AUTO_CANCEL; ((NotificationManager)contexte.getSystemService(Context.NOTIFICATION_SERVICE)).notify("label,0,notification); When I click on the Notification, the Activity is correctly launched. But it's Intent doesn't contain the extra boolean added with the line intent.putExtra("org.mypackage.name",true);. Does anyone have an idea of this behaviour? I can add that I use Android 4. Thanks in advance for the time you will spend trying to help me.

    Read the article

  • How to make DropDownList automatically be selected based on the Label.Text

    - by Archana B.R
    I have a DropDownlist in the GridView, which should be visible only when edit is clicked. I have bound the DropDownList from code behind. When I click on Edit, the label value of that cell should automatically get selected in the DropDownList. The code I have tried is: protected void GridView3_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { SqlCommand cmd = new SqlCommand("SELECT Location_Name FROM Location_Table"); DropDownList bind_drop = (e.Row.FindControl("DropList") as DropDownList); bind_drop.DataSource = this.ExecuteQuery(cmd, "SELECT"); bind_drop.DataTextField = "Location_Name"; bind_drop.DataValueField = "Location_Name"; bind_drop.DataBind(); string Loc_type = (e.Row.FindControl("id2") as Label).Text.Trim(); bind_drop.Items.FindByValue(Loc_type).Selected = true; } } When I run the code, it gives an exception error Object reference not set in the last line of the above code. Cannot find out whats wrong. Kindly help

    Read the article

  • Ruby Koans 202: Why does the correct answer give a syntax error?

    - by hlh
    I'm working through the about_classes.rb file in the Ruby Koans, and have hit a brick wall with the "inside_a_method_self_refers_to_the_containing_object" test. Here's the code: class Dog7 attr_reader :name def initialize(initial_name) @name = initial_name end def get_self self end def to_s __ end def inspect "<Dog named '#{name}'>" end end def test_inside_a_method_self_refers_to_the_containing_object fido = Dog7.new("Fido") fidos_self = fido.get_self assert_equal <Dog named 'Fido'>, fidos_self end So, I'm trying to make the first half of the assert_equal evaluate to the second half (fidos_self). When I work it out in irb, fidos_self returns <Dog named 'Fido'>, but I keep receiving a syntax error for that answer. I've seen this similar post: Ruby Koans: Where are the quotes in this return value?, but his solution (putting fido instead of <Dog named 'Fido'>) causes my rake to abort, saying the stack level is too deep. This is driving me nuts. What am I missing here?

    Read the article

  • Advice needed for a small web application's architecture/implementation

    - by Johhny P
    I was asked to build a website where a company's employees (around 20) could login and fill in their working schedules for a present and past (if needed) month. Employees should ofcourse only be able to see their own schedules, but the manager should have the privilege to access every schedule. I have little experience in web development therefore an advice is needed. I have already created a PHP/MySql login page. Now what? How do I go about it? Just some architectural or implementational(if you will) guidance would be really appreciated.

    Read the article

  • Error while sending message using xmpp4r_facebook

    - by santu
    I am following the instructions presented in http://dalibornasevic.com/posts/35-how-to-send-private-messages-with-facebook-api to send message to my friend and currently testing from command line. Following is the code I am using require 'xmpp4r_facebook' id = '<my facebook id>@chat.facebook.com' to = '<my friend facebook id>@chat.facebook.com' body = "hello, Im not spam!" subject = 'message from ruby' message = Jabber::Message.new to, body message.subject = subject client = Jabber::Client.new Jabber::JID.new(id) client.connect client.auth_sasl(Jabber::SASL::XFacebookPlatform.new(client, '<App ID>', '<access token got from https://developers.facebook.com/tools/explorer>', 'App Secret'), nil) I get the error RuntimeError: not-authorized from /Users/apple/.rvm/gems/ruby-1.9.3-p194/gems/xmpp4r_facebook-0.1.1/lib/xmpp4r_facebook.rb:103:in `auth' from /Users/apple/.rvm/gems/ruby-1.9.3-p194/gems/xmpp4r-0.5/lib/xmpp4r/client.rb:171:in `auth_sasl' from (irb):12 from /Users/apple/.rvm/rubies/ruby-1.9.3-p194/bin/irb:16:in `<main>'

    Read the article

  • msysgit git-am can't apply it's own git format-patch sequence

    - by Andrian Nord
    I'm using msysgit git on windows to operate on central svn repository. I'm using git as I want to have it's awesome little local branches for everything and rebasing on each other. I also need to update from central repo often, so using separate svn/git is not an option. Problem is - git svn --help (man page) says that it is not a good idea to use git merge into master branch (which is set to track from svn's trunk) from local branches, as this will ruin the party and git svn dcommit would not work anymore. I know that it's not exactly true and you may use git merge if you are merging from branch which was properly rebased on master prior merge, but I'm trying to make it safer and actually use git format-patch and git am. We are using code review, so I'm making patches anyway. I also knew about git cherry-pick, but I want to just git am /reviewed/patches/dir/* without actually recalling what commits was corresponding to this patches (without reading patches, that is). So, what's wrong with git svn and git am? It's simple - git am for a few very hard points is doing CRLF into LF conversion for patches supplied (git-mailsplit is doing this, to be precise), if not rebasing. git format-patch is also producing proper (LF-ended) patches. As my repo is mostly CRLF (and it should remain so), patches are, obviously, failing due to wrong EOL. Converting diffs to CRLF and somehow hacking git am to prevent it from conversion is not working, too. It will fail if any file was removed or deleted - git apply will complain about expected /dev/null (but he got /dev/null^M). And if I'm applying it with git am --ignore-space-change --ignore-whitespace that it will commit LF endings straight to the index, which is also weird. I don't know if it will preserve over commiting into svn (via git svn dcommit) and checking it out and I don't want to try out. Of course, it's still possible to try hacking around patches to convert only actual diffs, but this is too much hacks for simple task. So, I wonder, is there really no established way to produce patches and apply them to the same repo on the same system? It just feels weird that msysgit can't apply it's own patches.

    Read the article

  • How do i put this chunk of code into a php variable?

    - by Theron Chong
    if (isset($_SESSION['name'])){ //select BID and duedates which are between the range of 1-3 days // before due date from current date $query = "SELECT DueDate FROM item WHERE DueDate BETWEEN '$warning2' and '$warning' and user='$_SESSION[name]' ORDER BY DueDate DESC"; $find = mysql_query($query); $alert = mysql_num_rows($find); if ($alert>=1){ echo "You have got " .$alert. " item(s) due on: </br >"; while ($item = mysql_fetch_array($find)){ echo $item['DueDate']; echo "<br />"; } } echo "Success!"; } Question: How do i input all this code into a single php variable, say $alert. I am not clear of where to put single quotes or double quotes to make it work. At the end of the day, I will be using the variable for a javascript alert box.

    Read the article

  • How to copy a text array to a series of cells in Excel

    - by aSystemOverload
    I am dynamically creating a report, where I create a worksheet, bring in the records afresh. How can I easily type the field names and copy them to the cells. Without doing one cell per line, there are ~20 columns. I tried: dim fieldNames as variant fieldNames = ("'DS Date', 'A', 'B', 'A','S ASD', 'S','D S','D S', 'S','D S', 'SD', 'S','D'") Sheets("DATA").Range("C14:W14").Value = Application.WorksheetFunction.Transpose(fieldNames) But it just posts the whole thing in each cell? Any ideas?

    Read the article

  • Java Clock Assignment

    - by Mike S
    For my assignment we are suppose to make a clock. We need variables of hours, minutes, and seconds and methods like setHours/getHours, setMinutes/getMinutes, setSeconds/getSeconds. Now the parts of the assignment that I am having trouble on is that we need a addClock() method to make the sum of two clock objects and a tickDown() method which decrements the clock object and a tick() method that increments a Clock object by one second. Lastly, the part where I am really confused on is, I need to write a main() method in the Clock class to test the functionality of your objects with a separate Tester class with a main() method. Here is what I have so far... public class Clock { private int hr; //store hours private int min; //store minutes private int sec; //store seconds //Default constructor public Clock () { setClock (0, 0, 0); } public Clock (int hours, int minutes, int seconds) { setTimes (hours, minute, seconds); } public void setClock (int hours, int minutes, int seconds) { if(0 <= hours && hours < 24) { hr = hours; } else { hr = 0; } if(0 <= minutes && minutes < 60) { min = minutes; } else { min = 0; } if(0 <= seconds && seconds < 60) { sec = seconds; } else { sec = 0; } } public int getHours ( ) { return hr; } public int getMinutes ( ) { return min; } public int getSeconds ( ) { return sec; } //Method to increment the time by one second //Postcondition: The time is incremented by one second //If the before-increment time is 23:59:59, the time //is reset to 00:00:00 public void tickSeconds ( ) { sec++; if(sec > 59) { sec = 0; tickMinutes ( ); //increment minutes } } public void tickMinutes() { min++; If (min > 59) { min = 0; tickHours(); //increment hours } } public void tickHours() { hr++; If (hr > 23) hr = 0; } }

    Read the article

  • Using fft2 with reshaping for an RGB filter

    - by Mahmoud Aladdin
    I want to apply a filter on an image, for example, blurring filter [[1/9.0, 1/9.0, 1/9.0], [1/9.0, 1/9.0, 1/9.0], [1/9.0, 1/9.0, 1/9.0]]. Also, I'd like to use the approach that convolution in Spatial domain is equivalent to multiplication in Frequency domain. So, my algorithm will be like. Load Image. Create Filter. convert both Filter & Image to Frequency domains. multiply both. reconvert the output to Spatial Domain and that should be the required output. The following is the basic code I use, the image is loaded and displayed as cv.cvmat object. Image is a class of my creation, it has a member image which is an object of scipy.matrix and toFrequencyDomain(size = None) uses spf.fftshift(spf.fft2(self.image, size)) where spf is scipy.fftpack and dotMultiply(img) uses scipy.multiply(self.image, image) f = Image.fromMatrix([[1/9.0, 1/9.0, 1/9.0], [1/9.0, 1/9.0, 1/9.0], [1/9.0, 1/9.0, 1/9.0]]) lena = Image.fromFile("Test/images/lena.jpg") print lena.image.shape lenaf = lena.toFrequencyDomain(lena.image.shape) ff = f.toFrequencyDomain(lena.image.shape) lenafm = lenaf.dotMultiplyImage(ff) lenaff = lenafm.toTimeDomain() lena.display() lenaff.display() So, the previous code works pretty well, if I told OpenCV to load the image via GRAY_SCALE. However, if I let the image to be loaded in color ... lena.image.shape will be (512, 512, 3) .. so, it gives me an error when using scipy.fttpack.ftt2 saying "When given, Shape and Axes should be of same length". What I tried next was converted my filter to 3-D .. as [[[1/9.0, 1/9.0, 1/9.0], [1/9.0, 1/9.0, 1/9.0], [1/9.0, 1/9.0, 1/9.0]], [[1/9.0, 1/9.0, 1/9.0], [1/9.0, 1/9.0, 1/9.0], [1/9.0, 1/9.0, 1/9.0]], [[1/9.0, 1/9.0, 1/9.0], [1/9.0, 1/9.0, 1/9.0], [1/9.0, 1/9.0, 1/9.0]]] And, not knowing what the axes argument do, I added it with random numbers as (-2, -1, -1), (-1, -1, -2), .. etc. until it gave me the correct filter output shape for the dotMultiply to work. But, of course it wasn't the correct value. Things were totally worse. My final trial, was using fft2 function on each of the components 2-D matrices, and then re-making the 3-D one, using the following code. # Spiltting the 3-D matrix to three 2-D matrices. for i, row in enumerate(self.image): r.append(list()) g.append(list()) b.append(list()) for pixel in row: r[i].append(pixel[0]) g[i].append(pixel[1]) b[i].append(pixel[2]) rfft = spf.fftshift(spf.fft2(r, size)) gfft = spf.fftshift(spf.fft2(g, size)) bfft = spf.fftshift(spf.fft2(b, size)) newImage.image = sp.asarray([[[rfft[i][j], gfft[i][j], bfft[i][j]] for j in xrange(len(rfft[i]))] for i in xrange(len(rfft))] ) return newImage Any help on what I made wrong, or how can I achieve that for both GreyScale and Coloured pictures.

    Read the article

  • Jquery to slide on load

    - by Pexsol
    I have a simple slider that works on click. How can I automate it so it runs automatically yet keeping the click function as it is? $(document).ready(function() { var currentPosition = 0; var slideHeight = 360; var slides = $('.main-item'); var numberOfSlides = slides.length; var tracker = 0; $('.slider-height').css('height', slideHeight * numberOfSlides); $('.slide-option li a').click(function() { tracker = $('.slide-option li a').index($(this)); $('.slide-option li a').removeClass('current-item'); $(this).addClass('current-item'); //alert(tracker); $('.slider-height').animate({ 'top': slideHeight * (-tracker) }); return false; //alert(tracker); }); });

    Read the article

  • How to do elif statments more elegantly if appending to array in python

    - by user1741339
    I am trying to do a more elegant version of this code. This just basically appends a string to categorynumber depending on the number. Would appreciate any help. number = [100,150,200,500] categoryNumber = [] for i in range (0,len(number)): if (number [i] >=1000): categoryNumber.append('number > 1000') elif (number [i] >=200): categoryNumber.append('200 < number < 300') elif (number [i] >=100): categoryNumber.append('100 < number < 200') elif (number [i] >=50): categoryNumber.append('50 < number < 100') elif (number [i] < 50): categoryNumber.append('number < 50') for i in range(0,len(categoryNumber)): print i

    Read the article

  • UITableView: Mixing static and dynamic cells

    - by AlexR
    I am trying to mix dynamic and static cells in a grouped table view: I would like to get two sections with static cells at the top followed by a section of dynamic cells (please refer to the screenshot below). I have set the table view contents to static cells. I designed the static cells in Interface Builder and gave them identifiers related to their section and row: "section0static0", "section0static1", "section1static0" and "section1static1". I named the dynamic cell "section2dynamic". My delegate methods, in which I am trying to return the correct cell identifier (static or dynamic) are as follows: - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { switch (section) { case 0: return 2; break; case 1: return 2; break; case 2: return 0; break; default: break; } return 0; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @""; if (indexPath.section <= 1) CellIdentifier = [NSString stringWithFormat:@"section%istatic%i",indexPath.section,indexPath.row]; else CellIdentifier = [NSString stringWithFormat:@"section%idynamic",indexPath.section]; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath]; return cell; } Edit Based on AppleFreak's advice I have changed my code as follows: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell; if (indexPath.section <= 1) { // section <= 1 indicates static cells cell = [super tableView:tableView cellForRowAtIndexPath:indexPath]; } else { // section > 1 indicates dynamic cells CellIdentifier = [NSString stringWithFormat:@"section%idynamic",indexPath.section]; cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath]; } return cell; } However, my app crashes with error message Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UITableView dataSource must return a cell from tableView:cellForRowAtIndexPath:' for section 0 and row 0. The cell returned from cell = [super tableView:tableView cellForRowAtIndexPath:indexPath] for section 0 and row 0 is nil. What is wrong with my code? Could there be any problems with my outlets? I haven't set any outlets because I am subclassing UITableViewController and supposedly do not any outlets for tableview to be set (?). Any suggestions on how to better do it?

    Read the article

  • visual studio attaching to a process in debug mode

    - by user1612986
    i have a strange problem. the dll that i built (lets call it my.dll) in c++ visual studio 2010 uses a third party library (say tp.lib) which in turn calls a third party dll (say tp.dll). for debugging prupose i have in configurationProperties-debugging-command: Excel.exe and configurationProperties-debugging-commandArguments: "$(TargetPath)" in my computer i also set PATH variable to the directory where tp.dll resides now when i hit the F5 in visual studio excel opens up with my.dll and crashes giving me a "cannot open in dos mode" error. the reason this happens is tp.dll is not deployed when debug version of my.dll is deployed. when i open an instance of excel seperately and manually drop the debug version of my.dll then everything works fine and i can see all my functions that i wrote in my.dll the only issue is now i do not know how to debug becuase i do not know how to attach visual studio to the instance of excel i opened up seperately. my question is: 1 how can i attach visual studio to an already opened instance of Excel or 2 how can i hit F5 and still make Excel pick up the required tp.dll from the directory specified in the PATH variable before it starts to deploy my.dll. any of these two will allow my to step through the code for the purpose of debugging. thanks in advance.

    Read the article

  • Trouble getting $.ajax() to work in PhoneGap against a locally hosted server

    - by David Gutierrez
    Currently trying to make an ajax post request to an IIS Express hosted MVC 4 Web API end point from an android VM (Bluestacks) on my machine. Here are the snippets of code that I am trying, and cannot get to work: $.ajax({ type: "POST", url: "http://10.0.2.2:28434/api/devices", data: {'EncryptedPassword':'1234','UserName':'test','DeviceToken':'d234'} }).always(function( data, textStatus, jqXHR ) { alert( textStatus ); }); Whenever I run this request I always get back a textStatus of 'error'. After hours of trying different things, I pushed my End Point to an actual server, and was able to actually get responses back in PhoneGap if I built up an XMLHttpRequest by hand, like so: var request = new XMLHttpRequest(); request.open("POST", "http://172.16.100.42/MobileRewards/api/devices", true); request.onreadystatechange = function(){//Call a function when the state changes. console.log("state = " + request.readyState); console.log("status = " + request.status); if (request.readyState == 4) { if (request.status == 200 || request.status == 0) { console.log("*" + request.responseText + "*"); } } } request.send("{EncryptedPassword:1234,UserName:test,DeviceToken:d234}"); Unfortunately, if I try to use $.ajax() against the same end point in the snippet above I still get a status text that says 'error', here is that snippet for reference: $.ajax({ type: "POST", url: "http://172.16.100.42/MobileRewards/api/devices", data: {'EncryptedPassword':'1234','UserName':'test','DeviceToken':'d234'} }).always(function( data, textStatus, jqXHR ) { alert( textStatus ); }); So really, there are a couple of questions here. 1) Why can't I get any ajax calls (post or get) to successfully hit my End Point when it's hosted via IIS Express on the same machine that the Android VM is running? 2) When my end point is hosted on an actual server, through IIS and served through port 80, why can't I get post requests to be successful when I use jquery's ajax calls? (Even though I can get it to work by manually creating an XMLHttpRequest) Thanks

    Read the article

  • Microsoft Dog Food Days

    - by Chris Haaker
    There is a free two-day event called "Dog Food Conference 2012" being held at the Microsoft offices in Columbus, Ohio (home to my beloved Ohio State Buckeyes) that looks to be promising. It covers a wide-array of technologies with a Microsoft focus and some other things pertinent to the IT community. From the site: "This is a local conference by community IT professionals showcasing Microsoft technologies. There will be speakers from MS Gold Certified Partners, MS MVPs, IT authors, community leads, and MS Corp subject matter experts."

    Read the article

  • Don't Call it a Comeback

    - by Chris Haaker
    I received the email like most of you about Jeff and crew stepping down and selling the blog to another company. That it is a long time associate and friend of the team we have all grown to know and love, I feel much better about the move. Who cares, Chris, you haven't blogged religiously in ages! I know, and its a crime. Blame life, Twitter, my kids, laziness or whatever else you can think of. I always tell myself I am going to make a comeback - - "Don't call it a comeback - I been here for years." But after a few posts I seem to lose my steam. Its hard to explain, hell, I can't explain it. But we'll see what happens this time. Just don't call it a comeback.  2012 rMBP 15" Quad Core 2.33 GHz 16GB Memory 258GB SSDMarsEdit 3.5 (Please Microsoft Live Team - Make LiveWriter for OS X)

    Read the article

  • Exchange 2013 goes RTM!

    - by marc dekeyser
    Exchange 2013 has been signed off and is now RTM! Hoozaaa!!   From the Exchange team blog: Today we reached an important milestone in the development of the new Exchange. Moments ago, the Exchange engineering team signed off on the Release to Manufacturing (RTM) build. This milestone means the coding and testing phase of the project is complete and we are now focused on releasing the new Exchange via multiple distribution channels to our business customers. General availability is planned for the first quarter of 2013. We have a number of programs that provide business customers with early access so they can begin testing, piloting and adopting Exchange within their organizations: We will begin rolling out new capabilities to Office 365 Enterprise customers in our next service updates, starting in November through general availability. Volume Licensing customers with Software Assurance will be able to download Exchange Server 2013 through the Volume Licensing Service Center by mid-November. These products will be available on the Volume Licensing price list on December 1. Read more…

    Read the article

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