Daily Archives

Articles indexed Sunday December 9 2012

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

  • Using NSpec at various architectural layers

    - by nono
    Having read the quick start at nspec.org, I realized that NSpec might be a useful tool in a scenario which was becoming a bit cumbersome with NUnit alone. I'm adding an OAuth (or, DotNetOpenAuth) to a website and quickly made a mess of writing test methods such as [Test] public void UserIsLoggedInLocallyPriorToInvokingExternalLoginAndExternalLoginSucceedsAndExternalProviderIdIsNotAlreadyAssociatedWithUserAccount() { ... } ... and I wound up with maybe a dozen permutations of this theme, for the user already being logged in locally and not locally, the external login succeeding or failing, etc. Not only were the method names unwieldy, but every test needed a setup that contained parts in common with a different set of other tests. I realized that NSpec's incremental setup capabilities would work great for this, and for a while I was trucking a long wonderfully, with code like act = () => { actionResult = controller.ExternalLoginCallback(returnUrl); }; context["The user is already logged in"] = () => { before = () => identity.Setup(x => x.IsAuthenticated).Returns(true); context["The external login succeeds"] = () => { before = () => oauth.Setup(x => x.VerifyAuthentication(It.IsAny<string>())).Returns(new AuthenticationResult(true, providerName, "provideruserid", "username", new Dictionary<string, string>())); context["External login already exists for current user"] = () => { before = () => authService.Setup(x => x.ExternalLoginExistsForUser(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())).Returns(true); it["Should add 'login sucessful' alert"] = () => { var alerts = (IList<Alert>)controller.TempData[TempDataKeys.AlertCollection]; alerts[0].Message.should_be_same("Login successful"); alerts[0].AlertType.should_be(AlertType.Success); }; it["Should return a redirect result"] = () => actionResult.should_cast_to<RedirectToRouteResult>(); }; context["External login already exists for another user"] = () => { before = () => authService.Setup(x => x.ExternalLoginExistsForAnyOtherUser(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())).Returns(true); it["Adds an error alert"] = () => { var alerts = (IList<Alert>)controller.TempData[TempDataKeys.AlertCollection]; alerts[0].Message.should_be_same("The external login you requested is already associated with a different user account"); alerts[0].AlertType.should_be(AlertType.Error); }; it["Should return a redirect result"] = () => actionResult.should_cast_to<RedirectToRouteResult>(); }; This approach seemed to work magnificently until I prepared to write test code for my ApplicationServices layer, to which I delegate viewmodel manipulation from my MVC controllers, and which coordinates the operations of the lower data repository layer: public void CreateUserAccountFromExternalLogin(RegisterExternalLoginModel model) { throw new NotImplementedException(); } public void AssociateExternalLoginWithUser(string userName, string provider, string providerUserId) { throw new NotImplementedException(); } public string GetLocalUserName(string provider, string providerUserId) { throw new NotImplementedException(); } I have no idea what in the world to name the test class, the test methods, or even if I should perhaps include the testing for this layer into the test class from my large code snippet above, so that a single feature or user action could be tested without regard to architectural layering. I can't find any tutorials or blog posts which cover more than simple examples, so I would appreciate any recommendations or pointing in the right direction. I would even welcome "your question is invalid"-type answers as long as some explanation is provided.

    Read the article

  • Problems with wired ethernet connection Ubuntu 11.10

    - by Andrew Fielden
    After some partition shuffling, I've got a problem on my 11.10 system. The wired ethernet interface fails to come up, although the wireless interface is working. I'm using NetworkManager. I thought this may be a problem with NetworkManager, so I checked the config files, which look ok. I then tried re-installing the package, but this didn't resolve the issues. I'm not sure at this point if the problem is due to software configuration, or a hardware problem. I've also tried the cable in other router ports, but same problem. The symptoms are:- System settings - Network reports that the cable is unplugged (it isn't) ifconfig reports the following eth0 Link encap:Ethernet HWaddr f0:4d:a2:a2:a7:fe UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:10 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:792 (792.0 B) TX bytes:0 (0.0 B) Interrupt:46 Base address:0xe000 My /etc/network/interfaces file has the following: auto lo iface lo inet loopback My /etc/resolv.conf file has the following: # Generated by NetworkManager The router's red light is on for this port dmesg reports ADDRCONF(NETDEV_UP): eth0: link is not ready

    Read the article

  • I am not able to install wine

    - by Jose Ramon
    I can't install wine in Ubuntu 12.10. The report is: Los siguientes paquetes tienen dependencias incumplidas: (The following packages have unmet dependencies) wine1.4: PreDepends: dpkg (>= 1.15.7.2~) pero 1.16.7ubuntu6 no está instalado Depends: libc6 (>= 2.14) pero 2.15-0ubuntu20 no está instalado Depends: wine1.4-amd64 (= 1.4.1-0ubuntu1) pero 1.4.1-0ubuntu1 no está instalado Depends: wine1.4-i386 (= 1.4.1-0ubuntu1) pero no va a ser instalado I would like that you help me in this problem. Thanks for everything.

    Read the article

  • Can't remove device from Ubuntu One

    - by oshirowanen
    I have a few devices connected to my Ubuntu One account. From https://one.ubuntu.com/account/, I removed the device I no longer wanted connected. It seemed to remove successfully. However, as I test when I deleted some files from the Ubuntu One directory from the removed device, I noticed that the file also got removed from the Ubuntu One online account and also from all the other connected devices. So my question is. How do I remove a device from ubuntu one?

    Read the article

  • upgrading libglu1-mesa to its latest version

    - by Abderrahmane TAHRI JOUTI
    Yesterday I needed to install freeglut3, and ubuntu was saying that it needed libglu1-mesa=8.0.4-0ubuntu0.2 while 8.1~git1206081121.640409~gd~p was to be installed. So in order I did apt-get install --reinstall libglu1-mesa=8.0.4-0ubuntu0.2 and freeglut3 finally got installed. when I started ubuntu today, It got me onto Unity 2D. I got from that that what I did yesterday was not wise. Now compiz cannot start properly I suppose. I don't know if it is going to work, but if I install the version I had yesterday will it switch automatically ? Also, I do not know how to do it, installing the latest version of libglu1-mesa

    Read the article

  • Cannot Create Bootable USB Drive from .iso file

    - by tarabyte
    I've tried formatting the flash drive as FAT as well as Mac OS journaled through diskutility but still cannot successfully create a bootable drive. I'm following the directions here exactly: http://www.ubuntu.com/download/help/create-a-usb-stick-on-mac-osx Environment: Macbook Pro trying to create a bootable flash drive for a Macbook Pro. 8GB flash drive. Tested ubuntu-12.04.1 as well as ubuntu 12.20 .iso 64-bit downloads. Nothing to repair in disk utility for this hard drive. Every time I finish step 8 of the tutorial I get "file system not recognized" with the options to "initialize" meaning to reformat my drive, "ignore" or "eject." When I try to re-inspect the flash drive in disk utility after plugging it back in I see that it has some error when I try to verify it but the "repair" button is disabled. I just want to boot to ubuntu when my mac first starts up. Oh the pain. http://lifehacker.com/5934942/how-to-dual-boot-linux-on-your-mac-and-take-back-your-powerhouse-apple-hardware "linux is free insomuch as your time is worthless" - old wise man

    Read the article

  • Steam-Linux behind a proxy server

    - by Karthik
    I just downloaded Steam Beta from here. I installed the package, and when I start steam, I get the following It then says, unable to connect. When I start it from the terminal, I get this error. SteamUpdater: Error: Download failed: http error 407 Since I get a 407 error, it is related to Proxy Authentication. I have set up my http_proxy, ftp_proxy, https_proxy environment variables. I am behind an authenticated proxy server. How do I get Steam working from behind a proxy server?

    Read the article

  • Ubuntu 12.04 on virtualBox

    - by user113573
    im trying to set up ubuntu one on ubuntu 12.04 in VirtualBox and right after step number 3 i get "sorry, an error has occurred and ubuntu one needs to close" and under show details it shows " attributeError "nonotype object has no attribute 'stop" ". i do not use any type of proxy. im thinking it may not be possible to use ubuntu one under a vm environment just thought i would ask here first. thanks for looking!.

    Read the article

  • internet sharing over wifi between ubuntu 11.10 and windows7

    - by Vivek Pradhan
    So i have looked up a lot of forums for these solution but haven't really found one that works. I have a laptop running ubuntu 11.10 connected to the ethernet cord at home and i want to share the internet over wifi with my friend's laptop running windows7. I did not think it would be so difficult, I tried a lot of things: I went to networks and then wireless and set up a wifi hotspot, my laptop got connected to it and the ipv4 was set to "shared to other computers". Thankfully the network was discoverable and after some tries my friend was able to connect to the network, but it still showed that there was no internet access. I tried coniguring the tcp addresses of the wifi on his laptop. Bottom line: did not work. I went to the network manager, clicked on create a new wireless network, created one with security WEP 40/128 bit passphrase, tried the other 2 options later, and did the same thing as with the wifi, this network was also not discoverable initially and after some tries, we could connect to it but then ICS was not working although there was a working internet on my ubuntu laptop. I would really appreciate if some one who has faced a similar problem and got it fixed to please give me a step by step solution of how to get this work, because this is a prety common problem with ubuntu distros I have noticed. Note: This however seems to work with ubuntu to ubuntu connections, but specifically cross OS connections like windows or my phone running android ICS are not able to see or if connect not able to share internet on my laptop

    Read the article

  • Converting Celsius Processor Temperature to Fahrenheit

    - by WindowsEscapist
    I'm editing a Conky theme. I would like it to output the processor temperatures in degrees Fahrenheit instead of Celsius. In the ~/.conkyrc file, the command sensors | grep 'Core 0' | cut -c18-19 is used to find the temperature in Celsius for the first processor core. I want to use bc to compute this (give it outputvalue*9/5+32). Problem is, bc wants just absolute values, and I see no way to pass it program output. If I try to use something like temp=$(sensors | grep 'Core 0' | cut -c18-19) & echo 'temp*9/5+32' | bc, it ends up giving me 32 because it registers "temp" as a 0.

    Read the article

  • Give permissions for packages downloaded from the internet and lock them in Ubuntu 12.04 sidebar

    - by JuninhoDG
    I downloaded NetBeans IDE and Eclipse IDE from the internet and installed then. Well, the Eclipse IDE works fine, but when I execute NetBeans IDE directly from the link, without sudo permission, it shows me lots of error telling that some files are read only. This does not happens when I'm using the terminal to call the .sh script with sudo permissions. Another thing that bothers me: How can I fix my shortcuts in the Ubuntu's 12.04 sidebar? I want to combine a launcher with enough permissions to do everything it's needing and fix it in my sidebar. Is it possible?

    Read the article

  • Problems updating and re-installing VLC Ubuntu 11.10

    - by irma claeys
    I can't seem to fix or update, upgrade VLC AT ALL; this is what I get when trying to install, I had vlc before, but was not working properly so I uninstalled it; then I try to Install again to have the full properties. So now I cannot install as I get this message, I have tried everything and have checked with your site for additional info; any suggestions to someone who is new to Ubuntu and Linux altogether?? Package dependencies cannot be resolved This error could be caused by required additional software packages which are missing or not installable. Furthermore there could be a conflict between software packages which are not allowed to be installed at the same time The following packages have unmet dependencies: vlc: Depends: vlc-nox (= 1.1.12-2~oneiric1) but 2.1.0~~git20121022+r2158-0~r88~oneiric1 is to be installed Depends: libaa1 (>= 1.4p5) but 1.4p5-38build1 is to be installed Depends: libavcodec-extra-53 (>= 4:0.7-1) but 4:0.7.6ubuntu0.11.10.1+medibuntu1 is to be installed Depends: libavutil-extra-51 (>= 4:0.7-1) but 4:0.7.6ubuntu0.11.10.1+medibuntu1 is to be installed Depends: libc6 (>= 2.8) but 2.13-20ubuntu5.3 is to be installed Depends: libfreetype6 (>= 2.2.1) but 2.4.4-2ubuntu1.2 is to be installed Depends: libgcc1 (>= 1:4.1.1) but 1:4.6.1-9ubuntu3 is to be installed Depends: libqtcore4 (>= 4:4.7.0~beta1) but 4:4.7.4-0ubuntu8.2 is to be installed Depends: libqtgui4 (>= 4:4.5.3) but 4:4.7.4-0ubuntu8.2 is to be installed Depends: libsdl-image1.2 (>= 1.2.10) but 1.2.10-2.1 is to be installed Depends: libsdl1.2debian (>= 1.2.10-1) but 1.2.14-6.1ubuntu4 is to be installed Depends: libstdc++6 (>= 4.6) but 4.6.1-9ubuntu3 is to be installed Depends: libxcb-xv0 (>= 1.2) but 1.7-3 is to be installed Depends: zlib1g (>= 1:1.2.3.3.dfsg) but 1:1.2.3.4.dfsg-3ubuntu3 is to be installed

    Read the article

  • Can't install Skype In Ubuntu 64 bit

    - by Huei
    I can't download skype, is skype currently not available for ubuntu linux 64bit 12.10? 1.dowload skype in official website 2.import canonical repo The following packages have unmet dependencies: skype:Depends: skype-bin but it is no going to be installed this problem exists,what is skype-bin ? even i can't download it (sudo apt-get install skype-bin E: Package 'skype-bin' has no installation candidate

    Read the article

  • How to remove geoclue-master?

    - by dunderhead
    Looking in System Monitor I saw a process called geoclue-master. As far as I can tell, this reports my precise location to applications and the internet. This computer is sitting in the same office all the time so I have no need whatsoever for such a thing, and would rather have the memory and processor cycles that this unnecessary service uses up - however small - free for things that I do need and want. I could not find instructions for disabling and removing this service so I renamed the file, but then the calendar disappeared from the notification area. Is there a way to remove this service but leave the calendar? I'm using 11.10.

    Read the article

  • YouTube Copyright

    - by Matt Walker
    I am interested in making a trailer channel, but I need to know if I can just take recently released movie trailers and upload the videos to my channel. It might sound like a dumb question, but I am just wondering if I can do this without penalty (i.e YouTube deleting my account) For Ex. Taking the new star trek trailer and uploading it to my channel. Great answers so far, however I want to have a channel based solely on Trailers. How do I go about doing this?

    Read the article

  • Vector vs Scalar velocity?

    - by Serguei Fedorov
    I am revamping an engine I have been working on and off on for the last few weeks to use a directional vector to dictate direction; this way I can dictate the displacement based on a direction. However, the issue I am trying to overcome is the following problem; the speed towards X and speed towards Y are unrelated to one another. If gravity pulls the object down by an increasing velocity my velocity towards the X should not change. This is very easy to implement if my speed is broken into a Vector datatype, Vector.X dictates one direction Vector.Y dictates the other (assuming we are not concerned about the Z axis). However, this defeats the purpose of the directional vector because: SpeedX = 10 SpeedY = 15 [1, 1] normalized = ~[0.7, 0.7] [0.7, 0.7] * [10, 15] = [7, 10.5] As you can see my direction is now "scaled" to my speed which is no longer the direction that I want to be moving in. I am very new to vector math and this is a learning project for me. I looked around a little bit on the internet but I still want to figure out things on my own (not just look at an example and copy off it). Is there way around this? Using a directional vector is extremely useful but I am a little bit stumped at this problem. I am sorry if my mathematical understanding maybe completely wrong.

    Read the article

  • Game Engine with a real time renderer

    - by Maik Klein
    I am studying computer graphics since 3 semester and we just started with opengl. I really enjoy it and want to create my own little engine for learning purpose. I already read tons of different forum posts and saw the following engines. Panda3d, Ogre3d, NeoAxis, Irrlicht and Horde3d(graphics only). Now I don't want to use something like unity or cryengine because I want to start more lowlevel. Which of those engines is suited for realtime rendering? Something that cryengine offers - no baked lightmaps. Or at least gives me the option to add a realtime renderer?

    Read the article

  • Concept: Interpretive Spells [closed]

    - by Deathly
    The goal is to be able to create complex spells, that can manipulate the game's environment in non-preprogrammed ways, and to make the program understand spells. For example: $@ $=Big @=Fire You can probably understand what this one means. The player types, writes, or selects symbols. Of course, a spell can be only a few characters, or more sophisticated spells could potentially be hundreds or thousands of symbols long. How could something like this be accomplished?

    Read the article

  • What are the differences between these three patterns of "class" definitions in JavaScript?

    - by user1889765
    Are there any important/subtle/significant differences under the hood when choosing to use one of these three patterns over the others? And, are there any differences between the three when "instantiated" via Object.create() vs the new operator? The pattern that CoffeeScript uses when translating "class" definitions: Animal = (function() { function Animal(name) { this.name = name; } Animal.prototype.move = function(meters) { return alert(this.name + (" moved " + meters + "m.")); }; return Animal; })(); and The pattern that Knockout seems to promote: var DifferentAnimal = function(name){ var self = this; self.name = name; self.move = function(meters){ return alert(this.name + (" moved " + meters + "m.")); }; return {name:self.name, move:self.move}; } and The pattern that Backbone promotes: var OneMoreAnimal= ClassThatAlreadyExists.extend({ name:'', move:function(){} });

    Read the article

  • c++ - QListWidget

    - by user1889459
    I created a working QListWidget with multiple items, but I can't figure out how to make it user-friendly. It looks like this: 1000 1001 1002 ... But I want it to look like this, where firt 4 numbers have a meaning, while all the rest info is just for user. 1000 Name LastName and some other helpful info 1001 tom jeff smallville 1002 ming vase, 1992 ... For example, this line fotoId = ui->devices->currentItem()->text().toInt(); should give me same result in both cases.

    Read the article

  • Query a recordset

    - by Dion
    I'm trying to work out how to move the $sql_pay_det query outside of the $sql_pay loop (so in effect query on $rs_pay_det rather than creating a new $rs_pay_det for each iteration of the loop) At the moment my code looks like: //Get payroll transactions $sql_pay = 'SELECT Field1, DescriptionandURLlink, Field5, Amount, Field4, PeriodName FROM tblgltransactionspayroll WHERE CostCentreCode = "'.$cc.'" AND SubjectiveCode = "'.$subj.'" AND PeriodNo = "'.$month.'"'; $rs_pay = mysql_query($sql_pay); $row_pay = mysql_fetch_assoc($rs_pay); while($row_pay = mysql_fetch_array($rs_pay)) { $employee_name = $row_pay['Field1']; $assign_no = $row_pay['DescriptionandURLlink']; $pay_period = $row_pay['Field5']; $mth_name = $row_pay['PeriodName']; $amount = $row_pay['Amount']; $total_amount = $total_amount + $amount; $amount = my_number_format($amount, 2, ".", ","); $sql_pay_det = 'SELECT ElementDesc, Amount, WTEWorked, WTEPaid, WTEContract, Payscale FROM tblpayrolldetail WHERE CostCentreCode = "'.$cc.'" AND SubjectiveCode = "'.$subj.'" AND AccountingPeriod = "'.$mth_name.'" AND EmployeeRef = "'.$assign_no.'"'; $rs_pay_det = mysql_query($sql_pay_det); $row_pay_det = mysql_fetch_assoc($rs_pay_det); while($row_pay_det = mysql_fetch_array($rs_pay_det)) { $element_det = $row_pay_det['ElementDesc']; $amount_det = $row_pay_det['Amount']; $wte_worked = $row_pay_det['WTEWorked']; $wte_paid = $row_pay_det['WTEPaid']; $wte_cont = $row_pay_det['WTEContract']; $payscale = $row_pay_det['Payscale']; //Get band/point and annual salary where element is basic pay if ($element_det =="3959#Basic Pay"){ $sql_payscale = 'SELECT txtPayscaleName, Salary FROM tblpayscalemapping WHERE txtPayscale = "'.$payscale.'"'; $rs_payscale = mysql_query($sql_payscale); $row_payscale = mysql_fetch_assoc($rs_payscale); $grade = $row_payscale['txtPayscaleName']; $salary = "£" . my_number_format($row_payscale['Salary'], 0, ".", ","); } } } I've tried doing this: //Get payroll transactions $sql_pay = 'SELECT Field1, DescriptionandURLlink, Field5, Amount, Field4, PeriodName FROM tblgltransactionspayroll WHERE CostCentreCode = "'.$cc.'" AND SubjectiveCode = "'.$subj.'" AND PeriodNo = "'.$month.'"'; $rs_pay = mysql_query($sql_pay); $row_pay = mysql_fetch_assoc($rs_pay); //Get payroll detail recordset $sql_pay_det = 'SELECT ElementDesc, Amount, WTEWorked, WTEPaid, WTEContract, Payscale, EmployeeRef FROM tblpayrolldetail WHERE CostCentreCode = "'.$cc.'" AND SubjectiveCode = "'.$subj.'" AND AccountingPeriod = "'.$mth_name.'"'; $rs_pay_det = mysql_query($sql_pay_det); while($row_pay = mysql_fetch_array($rs_pay)) { $employee_name = $row_pay['Field1']; $assign_no = $row_pay['DescriptionandURLlink']; $pay_period = $row_pay['Field5']; $mth_name = $row_pay['PeriodName']; $amount = $row_pay['Amount']; $total_amount = $total_amount + $amount; $amount = my_number_format($amount, 2, ".", ","); //Query $rs_pay_det $sql_pay_det2 = 'SELECT ElementDesc, Amount, WTEWorked, WTEPaid, WTEContract, Payscale FROM "'.$rs_pay_det.'" WHERE EmployeeRef = "'.$assign_no.'"'; $rs_pay_det2 = mysql_query($sql_pay_det2); $row_pay_det2 = mysql_fetch_assoc($rs_pay_det2); while($row_pay_det = mysql_fetch_array($rs_pay_det)) { $element_det = $row_pay_det['ElementDesc']; $amount_det = $row_pay_det['Amount']; $wte_worked = $row_pay_det['WTEWorked']; $wte_paid = $row_pay_det['WTEPaid']; $wte_cont = $row_pay_det['WTEContract']; $payscale = $row_pay_det['Payscale']; //Get band/point and annual salary where element is basic pay if ($element_det =="3959#Basic Pay"){ $sql_payscale = 'SELECT txtPayscaleName, Salary FROM tblpayscalemapping WHERE txtPayscale = "'.$payscale.'"'; $rs_payscale = mysql_query($sql_payscale); $row_payscale = mysql_fetch_assoc($rs_payscale); $grade = $row_payscale['txtPayscaleName']; $salary = "£" . my_number_format($row_payscale['Salary'], 0, ".", ","); } } } But I get an error on $row_pay_det2 saying that "mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource"

    Read the article

  • How to run R through PHP with exec?

    - by dkar
    I am going to ask something, that I know that it has been asked already some times. But since, all of the past posts are quite old and none of them answer my problem..I try again. I am completely new in R language and relative new in php. What I want to do is to use the exec() function from php in order to execute a R script. Most of the people here will start talking about rapache, rserve and I don't know what else..but since I am not familiar with all these technologies, I prefer just using exec. The code I will show here is working just fine when I run it with Rscript from the terminal. # R script png("temp.png") plot(5,5) dev.off() But when I try to run it either with Rscript or with R CMD BATCH from PHP, like this: echo exec("Rscript my_rscript.R"); //OR //echo exec("R CMD BATCH my_rscript.R"); I get nothing back. I have checked if exec() function is available and if it works. Everything is ok with this. I read also, that I might have to change the permissions of the webserver...but I don't know how to do this in mamp. I hope I am clear with my problem and someone can help. Thanks Dimitris

    Read the article

  • Using multiple named outlets and a wrapper view with no content in Emberjs

    - by user1889776
    I'm trying to use multiple named outlets with Ember.js. Is my approach below correct? Markup: <script type="text/x-handlebars" data-template-name="application"> <div id="mainArea"> {{outlet main_area}} </div> </script> <script type="text/x-handlebars" data-template-name="home"> <ul id="sections"> {{outlet sections}} </ul> <ul id="categories"> {{outlet categories}} </ul> </script> <script type="text/x-handlebars" data-template-name="sections"> {{#each section in controller}} <li><img {{bindAttr src="section.image"}}></li> {{/each}} </script> <script type="text/x-handlebars" data-template-name="categories"> {{#each category in controller}} <img {{bindAttr src="category.image"}}> {{/each}} </script>? JS Code: Here I set the content of the various controllers to data grabbed from a server and connect outlets with their corresponding views. Since the HomeController has no content, set its content to an empty object - a hack to get the rid of this error message: Uncaught Error: assertion failed: Cannot delegate set('categories' ) to the 'content' property of object proxy : its 'content' is undefined. App.Router = Ember.Router.extend({ enableLogging: false, root: Ember.Route.extend({ index: Ember.Route.extend({ route: '/', connectOutlets: function(router){ router.get('sectionsController').set('content',App.Section.find()); router.get('categoriesController').set('content', App.Category.find()); router.get('applicationController').connectOutlet('main_area', 'home'); router.get('homeController').connectOutlet('home', {}); router.get('homeController').connectOutlet('categories', 'categories'); router.get('homeController').connectOutlet('sections', 'sections'); } }) }) });

    Read the article

  • calling .ajax() from an eventHandler c# asp.ent

    - by ibininja
    Good day...! In the code behind (upload.aspx) I have an event that returns the number of bytes being streamed; and as I debug it, it works fine. I wanted to reflect the numbers returned from the eventHandler on a progress bar and this is where I got lost. I tried using jQuery's .ajax() function. this is how I implemented it: In the EventHandler in my code behind I added this code to call the .ajax() function: Page.ClientScript.RegisterStartupScript(this.GetType(), "UpdateProgress", "<script type='text/javascript'>updateProgress();</script>"); My plan is whenever the eventHandler function changes the values of bytes being streamed it calls the javascript function "updateProgress()" The .ajax() function "UpdateProgress()" is as: function updateProgress() { $.ajax({ type: "POST", url: "upload.aspx/GetData", data: "{}", contentType: "application/json; charset=utf-8", dataType: "json", async: true, success: function (msg) { $("#progressbar").progressbar("option", "value", msg.d); } }); } I made sure that the function GetData() is [System.Web.Services.WebMethod] and that it is static as well. so the workflow of what I am trying to implement is as: - Click On Upload button - The Behind code starts executing and EventHandler triggers - The EventHandler calls .ajax() function - The .ajax() function retrieves the bytes being streamed and updates progress bar. When I ran the code; all runs well except that the .ajax() is only executed when upload is finished (and progress bar also updates only when finished upload); even though I call .ajax() function every time in the eventHandler function as reflected above... What am I doing wrong? Am I thinking of this right? is there anything else I should add maybe an updatePanel or something? thank you

    Read the article

  • python-iptables: Cryptic error when allowing incoming TCP traffic on port 1234

    - by Lucas Kauffman
    I wanted to write an iptables script in Python. Rather than calling iptables itself I wanted to use the python-iptables package. However I'm having a hard time getting some basic rules setup. I wanted to use the filter chain to accept incoming TCP traffic on port 1234. So I wrote this: import iptc chain = iptc.Chain(iptc.TABLE_FILTER,"INPUT") rule = iptc.Rule() target = iptc.Target(rule,"ACCEPT") match = iptc.Match(rule,'tcp') match.dport='1234' rule.add_match(match) rule.target = target chain.insert_rule(rule) However when I run this I get this thrown back at me: Traceback (most recent call last): File "testing.py", line 9, in <module> chain.insert_rule(rule) File "/usr/local/lib/python2.6/dist-packages/iptc/__init__.py", line 1133, in insert_rule self.table.insert_entry(self.name, rbuf, position) File "/usr/local/lib/python2.6/dist-packages/iptc/__init__.py", line 1166, in new obj.refresh() File "/usr/local/lib/python2.6/dist-packages/iptc/__init__.py", line 1230, in refresh self._free() File "/usr/local/lib/python2.6/dist-packages/iptc/__init__.py", line 1224, in _free self.commit() File "/usr/local/lib/python2.6/dist-packages/iptc/__init__.py", line 1219, in commit raise IPTCError("can't commit: %s" % (self.strerror())) iptc.IPTCError: can't commit: Invalid argument Exception AttributeError: "'NoneType' object has no attribute 'get_errno'" in <bound method Table.__del__ of <iptc.Table object at 0x7fcad56cc550>> ignored Does anyone have experience with python-iptables that could enlighten on what I did wrong?

    Read the article

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