When installing a node package using sudo npm link in the package's directory, how can I uninstall the package once I'm done with development? npm link installs the package as a symbolic link in the system's global package location ('/usr/local/lib`). This allows you to test the package while still developing it, without having to install it over and over again. Which npm command do I need to run to remove the link again?
I have seen the following two accessible Booleans: System.Web.Mvc.Controller.User.Identity.IsAuthenticated System.Web.Mvc.Controller.Request.IsAuthenticated Is there a difference between these. They both seem to do the same thing so I am not sure which to use. What I would like to do is: @if (User.Identity.IsAuthenticated) { if (User.IsInRole("Admin")) { @Html.ActionLink("Admin", "AdminController") } } or @if (Request.IsAuthenticated) { if (User.IsInRole("Admin")) { @Html.ActionLink("Admin", "AdminController") } } Would either of the above work equally well?
Can I control the different decimal digits output in vector in r? > c(2.44,5) [1] 2.44 5.00 If I want to get the following output format how can I do? For the vector, one is 2.44, other is 5. 2.44 5 it can not work for me. > c(2.44,round(5,0)) [1] 2.44 5.00
I'm trying to send a hex string to a tcp socket. I have some problems with the format or conversion of this string, cause I'm not very sure what the format its using. I've written a WindowsPhone app which is working fine based on Socket Class. This app emulates request, that are normaly send from a desktop program to a device which hosts a webservice. Via wireshark, I found out, that the webservice will accept an input stream (think its in hex) and returns a 2nd. hex stream which contains the data I need. So the desktop app is sending a stream and Wireshark shows when : Data (8 bytes) Data: 62
I'm not experienced in programming, but I was wondering what the difference was between setting a variable through a method. Ex: void setShowFPS(boolean b){ this.showFps = b; } vs. just calling the variable showFps = false;
I store my .ics calender on a webdav server. With Thunderbird/Lighning I can read and write the calendar. But how to deal with Outlook? Outlook can only read the ics file remotely. Synchronization using google calender is not an option for me.
I am using Python, and I am trying to write a simple program that simulates a rock, paper, scissors game. Everything works except for when I enter an invalid response (something other than rock, paper, or scissors) when I get this error: Traceback (most recent call last): File "C:/Users/home/Desktop/BAGARDNER/Python/rock_pape_scissors.py", line 88, in <module> main() File "C:/Users/home/Desktop/BAGARDNER/Python/rock_pape_scissors.py", line 14, in main number = user_guess() File "C:/Users/home/Desktop/BAGARDNER/Python/rock_pape_scissors.py", line 48, in user_guess return number UnboundLocalErro
I am using Python, and I am trying to write a simple program that simulates a rock, paper, scissors game. Everything works except for when I enter an invalid response (something other than rock, paper, or scissors) when I get this error: Traceback (most recent call last): File "C:/Users/home/Desktop/BAGARDNER/Python/rock_pape_scissors.py", line 88, in <module> main() File "C:/Users/home/Desktop/BAGARDNER/Python/rock_pape_scissors.py", line 14, in main number = user_guess() File "C:/Users/home/Desktop/BAGARDNER/Python/rock_pape_scissors.py", line 48, in user_guess return number UnboundLocalErro
I cannot get Netbeans 7.3.1 to create a Maven Web Application in the directory I specify. OS: Windows 7 x64 NetBeans: 7.3.1 Maven: 3.0.4/3.0.5 I am using the NetBeans GUI and its internal Maven 3.0.5 for creating that type of project. It always creates the project in the root of my D:\ drive, regardless of which folder I specify. Here's an example: After I click the 'finish' button after having provided all the needed parameters to create the project: > cd D:\Java\Test; JAVA_HOME=D:\\Java\\jdk6update23 "M2_HOME=D:\\Program Files (x86)\\maven\\apache-maven-3.0.4" > "\"D:\\Program Files > (x86)\
I have been wondering if there is any way in the android API (or any other lib/framework) that can help me to detect if my device screen is mirrored using WiDi,Miracast or MHL or basically any other technique for mirroring your screen. Br, Inx
I have a PhoneGap app for Android which I am trying to run in the Android emulator. The app has a simple html page which has a button. On click, the button calls a RESTful webservice using javascript XMLHttpRequest and the service returns back base 64 encoded data for a pdf. Then from the javascript function, I try to load the pdf data in my html page in the app as below document.location.href = 'data:application/pdf;base64,' + pdfData.childNodes[0].data; But this does nothing. The data is returned correctly and I checked the logs for it. But the pdf is not displayed at all. Any idea what is c
If I run the following code: x = 1 class Incr: print(x) x = x + 1 print(x) print(x) It prints: 1 2 1 Okay no problems, that's exactly what I expected. And if I do the following: x = 1 class Incr: global x print(x) x = x + 1 print(x) print(x) It prints: 1 2 2 Also what I expected. No problems there. Now if I start making an increment function as follows: x = 1 def incr(): print(x) incr() It prints 1 just as I expected. I assume it does this because it cannot find x in its local scope, so it searches its enclosing scope and finds x there. So far no problems. Now if I do: x = 1 def incr(): print(
Need to find memory leaks in code? Does Valgrind indicate memory leaks as they happen during run time? How can I integrate Valgrind into my code base that runs on a proprietary tool chain.
I have two text files. Text-file-1 contains strings (one string per line); C 010 C 020 C 024 . . . Text-file-2 contains data in following format; C 005 Carbon D Carbon 1 D Carbon 2 D Carbon 3 D Carbon 4 C 010 Hydrogen D Hydrogen 1 D Hydrogen 2 C 017 Oxygen D Oxygen 1 C 020 Nitrogen D Nitrogen 1 D Nitrogen 2 D Nitrogen 3 C 024 Sulphur D Sulphur 1 D Sulphur 2 . . . Text-file-1 contains 30 lines but Text-file-2 contain huge data, and in the same format as I mentioned. I can grep the text in Text-file-2 found in Text-file-1 using following command; awk 'NR==FNR { A[$2]=1; next }; A[$2]' Text-file-
I want to change the Git default remote branch destination so I could just git push Instead of: git push upstream Currently this is set to the origin remote and I want to set it to a different remote. I tried to remove the original (cloned from) remote git remote rm origin Which did remove the original remote. But doesn't solve the git push problem. I still get: fatal: No configured push destination. Either specify the URL from the command-line or configure a remote repository using... I also tried to play with: git remote set-url --push myfork origin and other options but none seem to work (m
I need to extract a associative array keys into a string and implode with "/" or any character/symbols. For eg: $array = array([key1] => array([key11] => array([key111] => 'value111', [key112] => 'value112', [key113] => 'value113', ), ), ); I need an output as below array: array([0] => 'key1/key11/key111',[1] => 'key1/key11/key112', [2] => 'key1/key11/key112');
I am trying to replicate what you can see here in this image. I want to be able to either type in the text field above the box or just click on the option directly. What would be the best way to go about that? Is there anything bootstrap related that exists already?
I am trying to learn how to parse data from HTML using Excel VBA. So I found one example online which works fine but when I change URL address from www.yahoo.com to local HTML file on C it gives me error i.e. Method 'busy' of object 'IwebBrowser2' failed. Code is: Sub GetBodyText() Dim URL As String Dim Data As String URL = "file:///C:/test.html" Dim ie As Object Dim ieDoc As Object Set ie = CreateObject("InternetExplorer.Application") ie.navigate URL Do Until (ie.readyState = 4 And Not ie.Busy) DoEvents Loop Set ieDoc = ie.Document Data = ieDoc.body.innerText 'Split Data into separate lines '
In eclipse Kepler i have took the project from SVN and when i am doing Right Click on Project->Team->Sychronised With repository it is showing 10000 changes while few hour back i took the whole project from svn, but still it is showing ? with all the files . Can any one tell what is the issue and how can i resolve it? One more thing i have to add in eclipse my project look like projectName[/trunk/workspace/projectname] it mean my project well connected with SVN. Even i Have done Team->Update to Head and Team->Update to Version but no any success.
I am getting this and a couple other weird error messages on my main ASP MVC 3 layout page. I am using the following scripts <script src="@Url.Content("~/Scripts/modernizr-1.7.min.js")" type="text/javascript"></script> <script src="@Url.Content("~/Scripts/jquery-1.8.3.js")" type="text/javascript"></script> <script src="@Url.Content("~/Scripts/jquery-ui.js")" type="text/javascript"></script> <script src="@Url.Content("~/Scripts/typeahead.js")" type="text/javascript"></script> And trying to get the typeahead.js to work in our nav bar. Below is the code I currently have on my machine. I had this
I'm Binding to a Grid class (UserId,FirstName,LastName,Choice). Does anybody know how to put this code in a column (Choice) in a Kendo Grid in MVC 4: @(Html.Kendo().DropDownList() .Name("Test") .DataTextField("Text") .DataValueField("Value") .Events(e => e.Change("change")) .BindTo(new List<SelectListItem>() { new SelectListItem() { Text = "Option1", Value = "1" }, new SelectListItem() { Text = "Option2", Value = "2" } })) <script> function change() { var value = $("#Choice").val(); } </script> .... columns.Bound(p=> p.FirsName); columns.Bound(p => p.LastName); //How to Bind Choice??? I also n
I have 2 gears in OpenShift configured as follows: application gear, scalable, running PHP 5.3 database gear, non scalable, running MySQL Database 5.1 and phpMyAdmin I am running PrestaShop's installation code on my application gear, and it failed on this code: install/models/Database.php: Db::checkConnection($server, $login, $password, $database, true) returns 1. I am new to OpenShift and not sure if I should use port forwarding, etc. I run env | grep OPENSHIFT_MYSQL on my database gear, get: OPENSHIFT_MYSQL_DB_PORT=3306 OPENSHIFT_MYSQL_DB_HOST=127.xx.xx.x OPENSHIFT_MYSQL_DB_PASSWORD=XXXXXXX
What the reason of my mistake? I have to entities. Their relation is many to many. prepod: @Entity(name = "prepod") public class Prepod { private Long id; List<Student> students = new ArrayList<Student>(); @ManyToMany public List<Student> getStudents() { return students; } public void setStudents(List<Student> students) { this.students = students; } @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "id") public Long getId() { return id; } public void setId(Long i) { id = i; } } student: @Entity @Table(name="Student") public class Student { private Long id; private String n
I want to use gSOAP to connect the HTTPS web services, what i found about how to it using gSOAP is to call soap_ssl_client_context() first, the example i found from here is if (soap_ssl_client_context( &soap, //1 SOAP_SSL_DEFAULT, //2 "client.pem", //3 /* keyfile: required only when client must authenticate to server (see SSL docs on how to obtain this file) */ "password", //4 /* password to read the key file (not used with GNUTLS) */ "cacerts.pem", //5 /* cacert file to store trusted certificates (needed to verify server) */ NULL, //6 /* capath to directory with trusted certificates */ NULL /
I might be overlooking the obvious but I am trying to do a basic string concatenation and it does not seem to play to well I have the following variables var plug = "myPlug"; var pdiv = "<p></p>"; var tab_id = "#someID"; $(tab_id + "p:contains('" + plug + "')").parent().next().append(pdiv); For some reason tab_id does not get substituted. Any help would be appreciated.
I am trying to use a css selector to select and item but only work for xpath. What would be the equivalent of this xpath to css. driver.findElement(By.xpath("(//img[@alt='Authorise this row'])[2].click(); If I use the css img[alt='Authorise this row'] I get a lot of results through say firefinder. Is there a way like xpath where you can get a particular index of the result
I was debugging a localhost asp.net and I have made some very minor code changes and ran it again and now I get an error I have never gotten before. In nice big blue letters it tells me "This page can't be displayed". Apart from taking everything to forumula, what do you think would cause this error and how would I go about fixing it? It offers a button that says "Fix connection problems", but this is a localhost browser, so there are no connection, really. I clicked the button anyway and it did not offer any solution. I also refreshed the page, as suggested and it did nothing. I test my local
I came across a problem while creating RTF template for BI publisher. I am displaying a table in the header (not an MS word header but header identified as something above start:body tag) of an RTF template. That table has 3 rows, I need to display one of those rows only in the first page and not in other pages. I did not find any method on querying for the page number. So, I used a flag in the following manner: (Here, suffix _f denotes RTF field). The following is what my RTF file looks like: +---------------------------------------------------------------------------------+ ¦ init_f ¦ Row to
I am experimenting with TestNG and it is working from eclipse. I created a test suite and trying to run it from command line. Build fails with error saying Final output during build says: [testng] =============================================== [testng] Suite [testng] Total tests run: 1, Failures: 0, Skips: 1 [testng] Configuration Failures: 1, Skips: 2 [testng] =============================================== [testng] [testng] The tests failed. testng-results.xml and index.html don't have any failures reported. testng-failed.xml is like this: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE su