I have to run a batch file without showing the command line but the Command line keeps on popping up. This is my code: @echo off :SAMPLE cd /d C: md %RANDOM% cd /d D: md %RANDOM% cd /d E: md %RANDOM% goto SAMPLE
I use HttpClient.GetAsync() method. I have a list of categories and want to pass it in query string. var categories = new List<int>() {1,2}; How can I pass List<int>/List<string> in query string? For example, https://example.com/api?categories=1,2 Of course, can use foreach and StringBuilder. But maybe there is a better way to do this? For example, work with .PostAsync() and json content very convenient: var categories = new List<int>() {1,2}; //init List var parametrs = new Dictionary<string, object>(); parametrs.Add("categories", categories); string jsonParams = JsonConvert.SerializeObject(p
Maybe I am using the wrong words to search google for this. But all i come up with is how to use .Net and C# on how to write a webservice. I know there is New-WebServiceProxy but I really would like to offer a service not consume it. There reason I would like to use PowerShell is because I would like to progress as quickly as possible and it's the language i am currently most familiar with. Also the WebService should only offer very basic functions. Any input on this? Thanks in advance
With a simple dictionary like: myDict = {'key1':1, 'key2':2} I can safely use: print myDict.get('key3') and even while 'key3' is not existent no errors will be thrown since .get() still returns None. Now how would I achieve the same simplicity with a nested keys dictionary: myDict={} myDict['key1'] = {'attr1':1,'attr2':2} The following will give a KeyError: print myDict.get('key1')['attr3'] This will go through: print myDict.get('key1').get('attr3') but it will fail with adn AttributeError: 'NoneType' object has no attribute 'get': print myDict.get('key3').get('attr1')
This is my first time trying to use the WEB API in a project and am not having any success with it... I keep getting 404 errors when I try and reach my api route in Fiddler. I tried looking a lot on the web and even here at the following link, but there are so many combinations, that I'm not sure what would work. HTTP 404 Page Not Found in Web Api hosted in IIS 7.5 If somebody can please help me with this to get the right settings I would really appreciate it. Here is my code: Web.config file: <?xml version="1.0" encoding="utf-8"?> <!-- For more information on how to configure your ASP.NET app
Need your help in Selenium Webdriver coding with Java. I have a scenario, where I create a Course name and submit it to the database and then later I need to search for the Course by the name I created it. Simply the work flow would be; 1. Type the course name in text box (Here I'm randomly generating a string so it's not hard coded, I need to retrieve exactly what I typed here) 2. Store the typed name 3. In the search box type that name private void createCurriculum() throws InterruptedException { selenium.open("http://url.com"); driver.findElement(By.id("Text1")).clear(); driver.findElement(
I am new to this stuff but I love it. I made a little REST Api using the Slim Framework. Now I would like to have an ongoing documentation about it. I think swagger is the right choice but I have not found out yet how to integrate it ? Cheers & thanks for your patience :)
Usually when we use input placeholder, the placeholder text will disappear as soon as the user type something. I'm thinking to give user an random example on input so user can mimic using placeholder. The problem is that, when user type something, the example will disappear. Is there any way to keep the placeholder visible when user type the beginning part of the placeholder text? Here's an example The placeholder text is 'Lorem ipsum dolor sit amet'. When user types 'Lorem ipsum', I assume that user will try to type the example so the text will still be visible. But when user types something
Just like the title above: how to concatenate two strings in JQuery? This is my code so far: $(document).ready(function(){ serviceName = '<?=$_GET['services'] . ".php";?>'; serviceID='<?= "#" .$_GET['services'];?>'; serviceClass = '<?=$_GET['services'];?>'; if (serviceName != "") { alert(serviceID); $('.main_content').load(serviceName); $(serviceID).addClass("it"); } }); As you can see in my above code, in variable name serviceID, I am concatenating hashtag and my GET value and I try to put it on ALERT and the result is correct, but when I assign it to .addClass it’s not working. Any alternati
I'm trying to integrate liquibase with our application. I'm executing it using Maven integration approach. When I execute, I see that creation script for databasechangelog invoked twice and get "Table already exist" error. Below are the statements from console. I'm using liquibase-core-3.1.1 jar. INFO 2014-04-28 06:49:liquibase: Successfully acquired change log lock INFO 2014-04-28 06:49:liquibase: Creating database history table with name: databasechangelog INFO 2014-04-28 06:49:liquibase: ChangeSet src/main/resources/sql/postGre/db.changelog-2.0.xml::1::fms ran successfully in 555ms INFO 201
Here is a brief description of what I am doing. The application has the form elements in JSP which redirects to the Controller class after pressing submit. The controller calls the service layer which in turn calls DAO and finally adds the records to the data base. The issue I am having is that in the Controller class, I can receive the request parameters (POST) but the thing is that there is an issue while calling the addStudent() of the service layer. The issue is with the Null Pointer Exception on object. Could you guys review the code and provide me suggestions? Here is the full Stacktrace
I am working on an Android app which needs a camera view in half of the app screen.I was able to do it successfully for an Android 4.0 device but it crashes when I try to run it on my Nexus One,although the minSDK version has been set to 2.2.Here's my camera preview class. package com.example.locationtest; import java.io.IOException; import android.content.Context; import android.hardware.Camera; import android.util.Log; import android.view.SurfaceHolder; import android.view.SurfaceView; public class CameraPreview extends SurfaceView implements SurfaceHolder.Callback { private static final Str
I've been struggling with this for the last couple of days, I'm trying to get an editable grid view system in asp.net using the fallowing tutorial: Editable Grid View System using BootStrap in ASP.Net I want to be able click "add new record" and the pop up modal should display and let me add a new record, the issue that I'm having is that whenever I clicked on "add new record" the <div class="modal-backdrop fade in"></div> seems to be covering everything. Here are some pictures describing the problem. Before I clicked: And after I clicked: I can't seem to find what's causing this. Please take
Consider the following assembly code: MOV [EAX], EBX [EAX] is memory and EBX is a register (in x86 Intel syntax). What is the difference between [EAX] and EBX? What will happen in the instruction above?
I'm new to magento. I've been trying to change from a 3 products per row layout to a 4 products per row layout. I've been searching but I can't find any solution. Here's my closest approach: I changed "app/design/frontend/default/mytemplate/template/catalog/product/list.phtml" and set '$_columnCount=4'. The problem is that I still receive 9 products each time, so I get 2 rows with 4 products each but the last one only has 1 product. Any help would be appreciated. Thanks in advance.
I have some problems with sencha touch. I have this simple code : items: [ { name: "horo", xtype: 'togglefield', label: 'Horodateur ?', labelWidth: '55%', disabled: false, listeners: { beforechange: function (slider, thumb, newValue, oldValue) { if (oldValue == 0 && newValue == 1) { alert("toto"); } }, change: function (slider, thumb, newValue, oldValue) { if (oldValue == 0 && newValue == 1) { alert("titi"); } else if (oldValue == 1 && newValue == 0) alert("tata"); } } }, And I have this error on my console : Uncaught TypeError: Cannot read property 'apply' of undefined. What's the problem ? M
In R I want to merge two dataframes on a range of dates, taking all rows from the second dataframe which fall on and between two columns of dates from the first dataframe. I couldn't find a strictly R function or version of the merge function that could do this, but I know there's a 'between' function in sql and I was thinking of trying the sqldf package (although I'm not well versed in sql). If there's a more R-ish way to do this, that would be preferable. Thank you in advance for your help! df1 <- structure(list(ID = 1:2, PtID = structure(c(1L, 1L), .Label = c("T031", "T040", "T045", "T064",
To prevent CSRF below were the steps i have followed: 1. First time when request comes(to loginfilter) session is null, create a session add token(randome number) to this new session by using setAttribute() and redirect to login.jsp screen using dispatcher.forward. 2. in login.jsp screen use getAttribute() store the token in the hidden filed. 3. on submit of login.jsp first request will come to loginfilter, here compare the token from the request with the token in the session, if matches then proceed with executing the action class. otherwise generate the new token for the same session and red
I am new to yum but I did RTFM and grepped all the available information and I still don't understand something basic. I have some foobar.repo file that yum uses that looks like this: [foobar] name=foobar baseurl=http://server/RPMS enabled=1 This works - I can do yum update foobar and it updates. But now I mv the directory RPMS to RPMS1 and I make the corresponding change in the foobar.repo file. Now surprisingly, update does not work anymore, it says that the file http://server/RPMS1/repodata/repomd.xml is not found. That is not the case, the file is there in the new directoryRPMS1 on the sam
I'm trying to recover from a PCA done with scikit-learn, which features are selected as relevant. A classic example with the Iris data set: import pandas as pd import pylab as pl from sklearn import datasets from sklearn.decomposition import PCA # Load data set iris = datasets.load_iris() df = pd.DataFrame(iris.data, columns=iris.feature_names) # Normalize data df_norm = (df - df.mean()) / df.std() # PCA pca = PCA(n_components=2) pca.fit_transform(df_norm.values) print pca.explained_variance_ratio_ This returns In [42]: pca.explained_variance_ratio_ Out[42]: array([ 0.72770452, 0.23030523]) Ho
I'm trying to recover from a PCA done with scikit-learn, which features are selected as relevant. A classic example with the Iris data set. import pandas as pd import pylab as pl from sklearn import datasets from sklearn.decomposition import PCA # Load data set iris = datasets.load_iris() df = pd.DataFrame(iris.data, columns=iris.feature_names) # Normalize data df_norm = (df - df.mean()) / df.std() # PCA pca = PCA(n_components=2) pca.fit_transform(df_norm.values) print pca.explained_variance_ratio_ This returns In [42]: pca.explained_variance_ratio_ Out[42]: array([ 0.72770452, 0.23030523]) Ho
I need to send the values to this pop up. this is open with in the same window. when am trying with the normal driver.findelement, its getting error message saying xpath cannot found This is my code import java.util.concurrent.TimeUnit; import org.openqa.selenium.By; import org.openqa.selenium.WebElement; import org.openqa.selenium.firefox.FirefoxDriver; public class Homepage_login { public static void main(String[] args) { // TODO Auto-generated method stub FirefoxDriver driver = new FirefoxDriver(); driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS); //driver.get("http://se.rdms
im trying to do a heap bottom up construction from Psuedo code from my text book however the output im getting is not a correct heap im getting out 2 9 8 6 5 7 anyone know where im going wrong(pseudo code is from a text book, and heap needs to be array) here is the PsuedoCode bottom up im working with //constructs a heap from elements of a given array by bottom up algorithm //input an array H[1...n] of orderable items //output a heap H[1...n] for i<- [n/2] downto 1 do k<-i; v<-H[k]; heap<-False while not heap and 2*k <= n do j<-2*k if(j<n) //there are two children if H[j] < H[j+1] j<- j+1 if v
I am new to SharePoint and Exploring the Office 365 Small business feature online using trial subscription. I'm able to create 'App Parts' using Office 365 Developer Site Subscription(by using 'NAPA' SharePoint Developer tool). Now I wanted to create SharePoint 'Custom WebPart' in Office 365 online without using Visual Studio 2010,2012,2013. Please Guide me on this by providing some reference links for creating "Custom WebParts" in Office 365 Online and how can i use created web parts. Edited: Are there any online tools or sharepoint apps like 'NAPA' available for develop custom Web Parts onli
Fiends, i sending JSON String with three parameters to java web service method. but on java side method cant print in console. Please guide me what i have to change from below code? String json = ""; HttpParams httpParams = new BasicHttpParams(); HttpConnectionParams.setConnectionTimeout(httpParams, 10000); HttpConnectionParams.setSoTimeout(httpParams, 10000); HttpClient httpclient = new DefaultHttpClient(); // Prepare a request object HttpPost httpPost = new HttpPost(url); HttpGet httpGet = new HttpGet(url); JSONObject jsonObject = new JSONObject(); try { jsonObject.put("name", "ghanshyam");
My previously working code crashes now. The core dump points to the constructor being called. I have tried to get bt, bt full and disassembly. I need some help to conclude what could cause segmentation fault while calling constructor? Code is run on QNX and there is console gdb only. The local variables are all 0, what could that mean ? Here's the o/p: (gdb) bt #0 0x481a95b0 in notifyDs3PathAlarmClrEvent__F9PATH_TYPEUi17DS3_PATH_ALARM_ID (path_Type=PATH_NULL, pathId=1215822164, alarm_Id=DS3_PATH_IDLE_ID) at /vob/qnx/cema-common/msg/PathObjMsg.h:47 (gdb) bt full #0 0x481a95b0 in notifyDs3PathAl
I have two similar websites.Some of the content are same in both sites.I have some files in specific folder in one website say A.I want to copy some specific files from Website A to website B. I have tried ftp functions in php but not working. <?php // define some variable $local_file = 'eg.html'; $server_file = 'http://example.com/horoscope/M12459TAM_03092009_123239.html'; // set up basic connection $conn_id = ftp_connect("example.com"); // login with username and password $login_result = ftp_login($conn_id, 'username', 'password'); echo is_array(ftp_nlist($conn_id, ".")) ? 'Connected!' : 'no
I'm facing a problem with the following exception. Can anyone help me fix the error? I have added axis.jar in classpath but I'm still facing this issue. java.lang.NoClassDefFoundError: Could not initialize class org.apache.axis.client.AxisClient org.apache.axis.client.Service.getAxisClient(Service.java:104) org.apache.axis.client.Service.<init>(Service.java:113) com.netsuite.webservices.platform_2013_2.NetSuiteServiceLocator.<init>(NetSuiteServiceLocator.java:12) com.zyom.netsuite.NetsuiteIntegrationManager.<init>(NetsuiteIntegrationManager.java:169) com.zyom.netsuite.NetsuiteIntegrationManage
This error has occurred some time ago, in 2011 http://cygwin.com/ml/cygwin/2013-11/msg00021.html From what I have read on this and some other posts, I see that they have written some ugly hack which parses a windows dll looking for this FAST_CWD variable. My best guess is that a newer windows update has again changed the dll and now the function is broken again. I am not familiar with the skills used while developing cygwin so I only guess on these things. Any suggestions? Also, maybe this log might shed some light: Dito@Kungi ~ $ serverx11 -bash: serverx11: command not found Dito@Kungi ~ $ st