question
stringlengths
11
28.2k
answer
stringlengths
26
27.7k
tag
stringclasses
130 values
question_id
int64
935
78.4M
score
int64
10
5.49k
I'm having a few problems breaking out an MsBuild package+deploy command into two separate commands. (I need to do this to pass additional parameters to MsDeploy). The command that works fine looks like this: msbuild "src\Solution.sln" /P:Configuration=Deploy-Staging /P:DeployOnBuild=True /P:DeployTarget=MSDep...
I've got this fixed now - I needed a different command to the one the automatically generated .cmd file was using, but comparing the two allowed me to fix it up (thanks @Vishal R. Joshi) The differences I needed was: basic authentication allow untrusted certificates ?site=staging.webserver on the end of the MsBuild.ax...
TeamCity
5,488,164
12
I have a build configuration which deploys my code to a machine. Depending on which machine I am deploying to (e.g. dev/uat/prod), I need to run as a different user. Rather than hardcoding the username and password in the build files (not really possible as they change regularly for security reasons) I would like to b...
The RunAs plugin combined with TeamCity 7's new Typed Parameters will let you make the password a "typed" parameter plugin. Then, when it's entered at the Run screen, it will not be visible in the build history. EDIT: Much later, as covered in the comments: You probably don't want to do this. Consider having separate p...
TeamCity
5,223,055
12
I vaguely remember reading "something" "somewhere" about using Trace.WriteLine over Console.Out.WriteLine in nUnit possibly in the context of reSharper or TeamCity but I cannot remember the details. Therefore the question is either in the context of nUnit running separately or within reSharper/TeamCity is there any ben...
Personally, I am not keen on embedding tracing in unit tests (using either method you mention). If a unit test requires this, it is most likely a sign that your unit test is too complex. If you need to trace logic through the unit test, you should use asserts throughout the test to programmatically check that the expec...
TeamCity
3,872,608
12
I have multiple svn roots configured in TeamCity. They all point to the same repository, but different paths (branches). All branches return the same value for revision. I want the branch specific revision numbers. Here is an excerpt from the build log after I've dumped all the defined properties: vcsroot.3_0_11__SP...
You just need to make multiple VCS Roots in your Administration settings and apply each one to the appropriate build. For instance, if svn://196.168.0.1/software is your SVN repository, then you might have VCS Roots for each of the following projects: svn://196.168.0.1/software/agent/trunk svn://196.168.0.1/softwa...
TeamCity
2,882,953
12
I have a .NET project with a Rake build script. Rake calls msbuild.exe to do the actual compilation. When I configure a TeamCity 5.0 build using the Rake runner, compilation errors are not recognized as such by TC. When a compilation error occurs: The build does abort and is flagged as a failure; The log overview doe...
The answer, as shown in this thread on the TeamCity support forum, is to tell MSBuild to use a special TeamCity log listener using the "/l" switch: msbuild /l:JetBrains.BuildServer.MSBuildLoggers.MSBuildLogger,<path to dll> The dll ships in the TeamCity agent directory: {agent}/plugins/dotnetplugin/bin/JetBrains.Build...
TeamCity
1,883,753
12
I've been reading through the TeamCity 4.x documentation, and I am confused what the difference between a server side checkout and an agent side checkout is, as mentioned in this snippet from their help section: Exclude checkout rules will only speed up server-side checkouts. Agent-side checkouts emulate the exclude c...
Ok, here is the answer from Pavel Sher (a JB guy) : The main reason why server side checkout exists - is to simplify administration overhead. With server side checkout you need to install VCS client software on the server only (applicable to Perforce, Mercurial, TFS, Clearcase, VSS). Network access to VCS...
TeamCity
1,799,309
12
We have been using Teamcity for some time for the Continous Integration in the project. Now we want to have some kind of hardware in the room that shows everyone that a build was broken. I've seen mentions to lava lamps and rabbits that can do this, but couldn't see any examples for Teamcity. Does anyone have a good su...
Teamcity has a buildbunny plugin for for integration with a Nabaztag (I wouldn't have recommended a Nabaztag some time ago but they are saved now). alt text http://www.agimatec.de/blog/wp-content/uploads/2008/07/nabaztag-speech.jpg If you are a team of Linux geeks, you may prefer the tux droid plugin. (source: walterc...
TeamCity
1,773,457
12
Is it possible to pin a build in Teamcity programmatically/automatically? I want to pin a build if a Deploy-build is successfull.
Just found out that its possible through the REST API I can f.ex send a PUT command like this http://teamcityserver:81/httpAuth/app/rest/builds/id:688/pin/ and then the build with id 688 (teamcity.build.id) will be pinned.
TeamCity
6,545,710
11
I have a TeamCity project with the following build configurations: Gather dependencies (expensive) Build Test Deploy Say I know whether I need to do it by changes to some file deps.txt. Here's what I want to do: I want to trigger builds on all changes in version control. If deps.txt has changed, I want to run builds...
You could combine 1 into 2, and then for the build step of 1 which gathers dependencies, write a custom script which uses the teamcity.build.changedFiles.file property (see TeamCity docs) to check if deps.txt has actually changed or not, and then either gather dependencies or not. The rest of the build steps from 2 wo...
TeamCity
45,971,745
11
I'm trying to restore NuGet packages for a .NET Core solution using NuGet Installer TeamCity build step. The 'MSBuild auto-detection' chooses MSBuild v4.0 instead of v15.0 which is required for .NET Core projects: [15:41:53][restore] Starting NuGet.exe 4.1.0.2450 from C:\TeamCity\buildAgent\tools\NuGet.CommandLine.4.1....
I managed to overcome this specifying the -MSBuildPath command line parameter:
TeamCity
44,522,321
11
This error occurs sometimes, usually this step works fine, but in about 10% cases it fails with below message. Nuget installer step is first build step, and also "clean checkout" is enabled in TeamCity, so there shouldn't be any process that uses file. [restore] The process cannot access the file 'C:\BuildAgent\work.....
Root cause of "my file is being used by another process" There are several things you can do, depending on what is the root cause: You use parallel build feature of MSBuild: According to his blog, It seems to not work well with NuGet package restore, because it could runs parallel package restore for each projects (an...
TeamCity
35,128,196
11
Basically I want to specify "all files that end with Test.dll", also known as *.Test.dll. *.Test.dll doesn't work, presumably because it matches only files in the current working directory. However, I didn't have any luck with **\*Test.dll either. For some reason I had to use **\bin\**\*Test.dll for it to find any test...
According to the TeamCity documention on Wildcards **\*Test.dll should have worked. So either it's a bug or the forward slash versus backward slash issue is significant.
TeamCity
13,084,822
11
Using TeamCity, I've set up several builds in a project. Most of the time I want to run each build as a standalone. However, sometimes I want to execute several builds with the same set of parameters. The builds all use the same template, so all of their parameters could, theoretically, be supplied by a single build. ...
I achieve this by calling the TeamCity REST API: Add a new step at the end of your build, using Command Line runner Do curl curl -X POST -H "Authorization: Bearer %TeamCityToken%" --header "Content-Type:application/xml" -d" <buildType id="Remote Deploy"/> <property name="tag" value="%NewVersion%"/> " http://te...
TeamCity
37,416,065
11
I've updated my app from DNX, ASP.NET 5 RC1 to ASP.NET Core 1.0 RC2. Locally it builds and runs fine. On the build server, I don't have Visual Studio installed, and the build fails with: error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Props" was ...
https://learn.microsoft.com/en-us/dotnet/articles/core/windows-prerequisites#issues Issues You may be blocked from installing the .NET Core Tooling Preview 2 for Visual Studio 2015 installer due to a temporary bug. To workaround it, run the installer from the commandline with the SKIP_VSU_CHECK=1 argument, as you see i...
TeamCity
37,326,569
11
For an old project I support, I've been performing some modernization. That has included various things: bumping the .NET Framework up to 4.6, and other upgrades. One of the things we have some leeway to do is make syntactic upgrades, provided we don't change business logic. We've also recently installed Visual Studi...
I feel vindicated; the funny path/version was in fact indicative of the true problem: the MSBuild.exe that was being ran was not the one installed by VS2015. As I read from here, the version of MSBuild.exe that is found in C:\Windows\Microsoft.NET\Framework\v4.0.30319 is actually a pre-C#6 version; for some reason, ins...
TeamCity
34,364,251
11
Using team city as our CI and I've started getting this error message. We've obviously updated System.Net.Http recently which now needs a new version of NuGet. How do I get team city to find the new NuGet version. I've tried installing VS2015 and updating NuGet package manager through there. I've tried pointing directl...
On your teamcity client you can configure the nuget versions available to your build agents. Go to Administration -> Integrations -> NuGet From this screen you can click Fetch NuGet and retrieve the latest version. Then you should be able to specify that version on your build step.
TeamCity
32,279,970
11
Given there are master and dev git branches, a git repository is hosted on the Github and TeamCity 9.0.1 installed as a CI server. The teamcity build project is configured to use github repository as a VCS root with refs/heads/master set as a default branch. The desired behavior is to run auto-merge from master to dev ...
The thing I really needed was to create a dedicated teamcity project (called Integration) which first handles commits in both master and dev branches. It was achieved by configuring a VCS Root for Integration project with refs/heads/dev specified as a default branch and +:refs/heads/master specified in a branches speci...
TeamCity
30,141,426
11
We have automated the builds of our current project by using TeamCity/Command Line Tools. To be sure to catch as much potential issues as possible, we have set the project to use the static analyser for each build. Several 3rd-party classes were flagged by the analyser so we excluded the dubious classes by flagging the...
I just ran into this issue and assume it is a bug with Clang. I think I found a workaround though. Try replacing this -w -Xanalyzer -analyzer-disable-checker with this ridiculously long line (keep scrolling to the right to see it all): -w -Xanalyzer -analyzer-disable-checker -Xanalyzer alpha -Xanalyzer -analyzer-disa...
TeamCity
19,863,242
11
I have a workspace with few projects that must be built as static libraries and I have schemes with tests for them. I want to configure TeamCity to build and test each of those libraries, but it does not work with following error: ... /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace code/MyAppli...
I found solution. The problem was about poor support of SenTestKit with xcodebuild command. To make it works I had to go Edit Scheme menu and set Run step so the test scheme became runnable. Thanks for solution this article. There're few things was actually different, it is a Test After Build setting and macros. In my ...
TeamCity
17,110,633
11
Is it possible to get two builds to checkout on the same directory and how can this be done please? Currently the two different builds are checking out to two different directories.
You can accomplish this by taking control of the checkout directory locations. First you need to define your checkout directory to something that can be known to both builds. In your build configuration, browse to Version Control Settings -> Checkout Settings. Change the Checkout Directory setting to Custom Path. ...
TeamCity
13,768,204
11
We have a TeamCity 7.1 installation that builds all branches from a GitHub repository. GitHub has a notification hook back to TeamCity to trigger a build on check-in. We also have TeamCity polling GitHub every 120 seconds to check for changes (in case the server was offline when a change was checked in). Our normal de...
Third build is actually the most valuable — it's the result of pull request auto merge (merge that happens, when you press the button at github).
TeamCity
12,634,440
11
I have created a release configuration project in Teamcity 6.5 using the "SLN Runner" for VS 2008 solutions. My debug solution builds fine along with the PDB files - however I simply cannot get the thing to build in Release mode, plus it will insist on defaulting to x64 architecture. I have tried the following: Set p...
May sound stupid but does all the Projects in your solution contain an Any CPU platform configuration for Release? This has caught us out a few times with some projects only pointing at x86 etc
TeamCity
7,067,477
11
Is there a way to specify which SVN revision to checkout in a TeamCity build? If I attempt to change the SVN URL to include the revision using the @ notation, eg. svn+ssh://svn/some/url@1234 then I get an error ("Unknown path kind"). I've searched all TeamCity documentation and can find nothing appropriate. The backgr...
Yes, just hit the ellipses next to the "Run" button to trigger a custom build and choose the revision from the "Last change to include" list in the resultant screen. BUT - you can only choose from revisions which the build has previously run. Unfortunately the only other option is to create a separate VCS root against ...
TeamCity
6,910,782
11
The recommended way to run scripts is powershell.exe -NonInteractive -Command " & some.ps1 " However for example TeamCity PowerShell runner uses: powershell.exe -NonInteractive -Command - < some.ps1 I do not have an idea what "- <" means and cannot find any information on subject. Any help?
Because powershell.exe is being invoked through the Windows shell, it is the same as if you were on a normal command prompt (cmd.exe). In that situation < pipes a file to the standard input (stdin) of the previous command. The help for powershell.exe states that if the value of -Command is simply -, the command text is...
TeamCity
6,816,923
11
I have a build that I know will fail randomly, around 5% of the time. This is due to an external resource that I have no control over. Setting a "Retry on Fail" build trigger is easy enough, except that it doesn't allow me to specify a number of retries before it stops trying all together. Is there a way to have TeamCi...
This feature was finally added in version 7.1, See http://youtrack.jetbrains.com/issue/TW-5165 and http://confluence.jetbrains.net/display/TCD7/What%27s+New+in+TeamCity+7.1
TeamCity
5,384,534
11
I have a build in TeamCity which runs against a project file names Web.csproj (inside a "Web" folder in the root) and targets "Package". It runs just fine and I get a nice Web\obj\Debug\Package folder with all the expected content. I then have a second build with an artifact dependency on the above path which is intend...
For the sake of completeness, the answer was that I hadn't defined an artefact path in the first build. Without specifying the output to save from this build, it won't be available in dependent builds.
TeamCity
4,093,854
11
We're setting up a TeamCity build server for continuous integration. To keep things clean, we don't want to install Visual Studio on the build server. I'm wondering how we can build Silverlight 4 apps without it? I'd expect there to be a Silverlight 4 SDK which installs separately from VS - but so far I haven't found o...
Visit the Silverlight Tools topic on MSDN, scroll down to toward the bottom you will find a section on the Silverlight 4 SDK which includes a link to an independent install for the SDK alone. This install should not require VS and is what you need for a CI machine.
TeamCity
3,971,733
11
I want to set up each TeamCity agent to use a local repository (maven.repo.local) in the agent's working directory (agent.work.dir). Is it possible to configure maven properties to use TeamCity properties in this way?
Enter -Dmaven.repo.local=%system.agent.work.dir%/.m2 for the setting Runner: Maven2 / JVM command line parameters
TeamCity
2,238,477
11
We have some unreliable tests - unreliable because of environmental reasons. We'd like to see a history of which tests have failed the most often, so we can drill into why and fix the environment issue that causes that particular failure or class of failure. Is this possible in TeamCity 6.0.3? We know about individual ...
If you go to the "Current problems" tab for a project, there is a link like "tests failed within 120 hours" at the top. There is some statistics which may be relevant to what you're looking for. UPDATE: In newer versions of TeamCity, this page is not available. But, there is a new Flaky tests tab, which shows informati...
TeamCity
5,975,527
10
I run MSTest to test WPF application (Coded UI Test) on a VM using Teamcity. I already installed test agent as interactive process but i keep getting this error in Teamcity log Error calling Initialization method for test class Squarebit.Apms.Terminal.Wpf.Test.CodedUITest1: Microsoft.VisualStudio.TestTools.UITest.Exten...
Coded UI tests (CUIT) can't run from a service account since they need access to Desktop Windowing API set. Please refer Installing the teamcity build agent section in http://jake.ginnivan.net/teamcity-ui-test-agent/ to setup teamcity agent as a non-service account.
TeamCity
24,901,757
10
I have a TeamCity build set up which does nothing but run integration tests. Sadly, the tests are a tad unreliable. Most of them work fine, but a few intermittently fail from time to time. I would dearly love to be able to get a graph of the most common test failures. Basically I want to know which tests fail most ofte...
You can get count on frequently of fail test details from teamcity by following steps as details in this link: Traverse with route : Projects -> (select proj) -> Current Problems (tab) -> View tests failed within the last 120hrs (link present at right side of page ) http://confluence.jetbrains.com/display/TCD7/Viewing+...
TeamCity
21,330,337
10
I am trying to use MSDeploy to deploy an MVC project to the server using TeamCity. When I do this on my computer in powershell, using the following command: msbuild.exe .\mvc.csproj /p:PublishProfile=DevServer /p:VisualStudioVersion=11.0 /p:DeployOnBuild=True /p:Password=MyPassword /p:AllowUntrustedCertificate=true It...
We do our WebDeploys with a TeamCity MSBuild step configured as follows: Build File Path: Server.csproj Command Line Parameters: /p:Configuration=%configuration% /p:DeployOnBuild=True /p:DeployTarget=MSDeployPublish /p:MsDeployServiceUrl=https://%web.deploy.server%:8172/MsDeploy.axd /p:DeployIisAppPath=%web.deploy.s...
TeamCity
14,235,960
10
Hi I installed teamcity longtime ago, on my home computer. I am trying to re-use it again now, but I forgot the admin username and password Is there a default admin user name? and how can I get the password? Thank
From TeamCity 8 you can log in as a super user and change the password that way. You just need to use an empty username and last occurrence of the "super user authentication token" found in the logs\teamcity-server.log file as your password. Please see the following for more information: TeamCity 8 - http://confluence...
TeamCity
4,057,891
10
I recently took charge of a software product which was evolved rather unorganized and I have established a new project structure,a source code repository, issue tracking and a buildsystem using nant and teamcity. I'm at the point where every commit to one of the major branches gets compiled, tested and build into a set...
Unless what you have is a massive multi-megabyte end-user application, generating patches (which I assume you want to be minimal) is a daunting task, since you'll have to provide patches from each previous version to the most up-to-date one. Alternatively, you can invest into autoupdate infrastructure, so that an app w...
TeamCity
6,993,086
10
There is a way to configure Teamcity to ignore some tests? I need to run these tests only locally, when they are running in Teamcity, must be ignored. I'm using nunit. This could be a directive, attribute, etc.
You can do this by adding test categories to your tests. [Category("LocalOnly")] [Test] public void MyLocalTest() { // Code omitted for brevity } You can then add that category to the NUnit runner's 'NUnit categories exclude:' field in the TeamCity build step. NUnit categories exclude: LocalOnly
TeamCity
33,876,192
10
I am trying to pass the branch names from TeamCity to OctopusDeploy so that we can easily track which branch a deployment came from. To do this I want to append the branch name onto the version number (or the nuget package built with octopack) so that I can display this in the OctopusDeploy UI. This works fine, except ...
Using a build script you can interact with the build process and specify a custom build number where you can replace the slashes. For more details you can check the TeamCity docs. Here you can find an c# example on how to alter the build number. By example, in order to mangle the build number you can add CommonAssembl...
TeamCity
33,419,119
10
I have a TeamCity server with its Nuget feed enabled. I would like to manually add some third-party nupkg files to it. Is it possible to do so?
You can add nupkg to a private feed either by using the out-of-the-box TeamCity "NuGet Publish" runner type step or by using the NuGet exe. Out of the Box NuGet Publish: configure a build step with runner type "NuGet Publish". Under NuGet settings, provide the location to your .nupkg file(s) relative to checkout direc...
TeamCity
28,321,036
10
We installed karma with the teamcity reporter on our build server. It was running unit tests through Chrome, Firefox, and IE and everything was working great. Then yesterday I noticed that Chrome was failing to report. IE and Firefox were still connecting and running all the unit tests but for some reason karma is not ...
This is a chrome bug with the latest release of chrome. The problem seems to be with launching chrome from a service. The chromium team has fixed the issue and it will be included with the next release which is expected around November 20, 2014 issue tracker
TeamCity
26,431,494
10
I am building my app in teamcity with xcodebuild command line tools. I am looking for a way to suppress or make the output less verbose but still show errors or failures if they happen. The build log becomes very large and the browser has a hard time loading it. Are there optional parameters I can pass in or a way to s...
It's not possible. However You can make the log more readable with xctool or xcpretty - not sure the size is also changed. Probably, it is.
TeamCity
26,068,730
10
I have a batch file that I use to copy a folder and it's contents to a new location, it also creates the folder name based on the date and time (and this works): SET TODAY=%DATE:/=-% SET NOW=%TIME::=-% XCOPY /S /Y "C:\BuildAgent\temp\buildTmp" "C:\Automation Results\%TODAY%_%NOW%\" I added a new Configuration Step to...
Use %% instead of % SET TODAY=%%DATE:/=-%% SET NOW=%%TIME::=-%% XCOPY /S /Y "C:\BuildAgent\temp\buildTmp" "C:\Automation Results\%%TODAY%%_%%NOW%%\" This will ensure the variables are treated as batch file variables instead of TeamCity variables.
TeamCity
23,886,583
10
I´m new with TeamCity and I don´t know how to run SQL scripts with it. Is the way simply selecting the path of those scripts in a Command Line Build Runner ? I´m pretty lost. Regards.
In a command line build step: Command executable: c:\Program Files\Microsoft SQL Server\100\Tools\Binn\sqlcmd.exe Command parameters: -S <server> -i <path_to_file> <== Note: that's a capital -S! You may need to change the 100 to something else, depending on the version of the SQL Server tools that you have installed on...
TeamCity
21,555,038
10
At work we've added SQL Database projects to our VS 2010 project as a way of keeping control of changes in stored procedures and schema changes. Unfortunately, it is now breaking the build on our TeamCity CI server. Is there a way to tell TeamCity not to build these projects or will I have to accept defeat and install ...
Option 1 Make a copy of your current .sln and remove the SQL db projects; then point TeamCity at this sln instead. Option 2 Make a new Build Configuration (you have Debug, Release and you could add DebugCI as an example) and tick the projects you want compiled in this configuration. Then in the build step setup type De...
TeamCity
15,158,116
10
I am very new to TeamCity and currently have a problem with an incompatible agent: Unmet requirements: DotNetFramework4.5_x86 exists Does anyone know how to fix this? Do I have to add a reference to .NET 4.5 somewhere? Any advice appreciated.
You have an agent requirement that DotNetFramework4.5_x86 exists, but on this agent it doesn't. If the requirement is required, you need to install .NET on that agent machine. TeamCity has detected that .NET is not installed on this machine so your build cannot run. If the requirement is incorrect and not needed by you...
TeamCity
13,312,796
10
I use the TeamCity (7.0) REST API to allow developers to trigger custom builds. I add the build to the queue like this: http://teamcity/httpAuth/action.html?add2Queue=[buildTypeId]&name=[propName]&value=[propValue] My question is how I best can track the progress of the build just triggered. The REST call does not retu...
After some further investigation I came up with a solution for this which seems to work fine: I found out that even though you did not get any information about the custom build properties using the "/builds/?locator=buildType:x" call, you could extract the build ID for each one of the builds in that list and then do a...
TeamCity
11,966,674
10
As per Teamcity REST API We can use the following to get XML Data curl -v --basic --user USERNAME:PASSWORD --request POST "http://teamcity:8111/httpAuth/app/rest/users/" --data @data.xml --header "Content-Type: application/xml" Can we do the same for JSON ? curl -v --basic --user USERNAME:PASSWORD --request POST "htt...
You need to set the Accept header not the Content-type header curl -v --basic --user USERNAME:PASSWORD --request POST "http://teamcity:8111/httpAuth/app/rest/users/" --data @data.json --header "Accept: application/json"
TeamCity
11,813,495
10
We use jetBrains TeamCity continuous integration server for builds. We've got tens of different projects in TeamCity, and want to see one big picture across them in terms of their development quality, to find out which projects are lacking quality and in which sense. We use metrics such as unit test coverage, cyclomati...
This question is pretty similar to another one I just answered. The answer is to use SonarQube.
TeamCity
11,156,335
10
We have a TeamCity instance with a variety of projects and build configurations on it, with no security set up at present. Although it's OK for most of the projects to be publicly visible, we'd like to set up a couple of projects that are only visible to certain users. Because there are many public projects already set...
In case anyone still needs an answer, this can be done by TeamCity itself. Go to Administration -> Groups -> 'Create new group'. For example, public Assign roles to this group. You can choose 'Grant role in selected projects' radio button and choose those public projects and click Assign button.
TeamCity
10,537,931
10
I'm migrating continuous integration system from Teamcity to Jenkins. We have a single svn repository for all our projects like this: project/dev_db_build (folder) project/module1 (folder) project/module2 (folder) projets/pom.xml For building db on CI server I use url project/dev_db_build and can pol this url to trigg...
Ideally, you should use a post-commit hook as suggested by @Mike, rather than polling. Otherwise, when configuring the Jenkins job, under 'Source Code Management' with 'Subversion' selected, there is an advanced button. Clicking this reveals an number of options, including 'Excluded Regions' If set, and Jenkins is set...
TeamCity
8,037,954
10
How can I automate executing a batch file from TeamCity. Can I create a TC build configuration and have the TC agent build that and automatically run the specified batch file? EDIT: batch script. echo off echo Do you want to deploy xxxx to DerServ(yn): set /p input= if "%input%" == "y" goto :1 if NOT "%input%" == "y...
Yes, you can do it using Command Line runner.
TeamCity
7,490,213
10
I'm setting up TeamCity for Continuous Integration and (hopefully) Continuous Deployment. Some of the build steps will involve private files, e.g. .snk files for strong naming .NET assemblies password/token files for publishing artifacts (for example to NuGet or CodePlex) Since these files contain private data I don'...
TeamCity supports multiple VCS roots, so you could just add an extra VCS root with these private files. Obviously this would require that the second repository is private - but that is what you want any way. Having those files in source control is a great thing.
TeamCity
6,721,000
10
I am trying to set up TeamCity behind nginx. I'd like https://public.address.com/teamcity/... to redirect to http://127.0.0.1:8111/..., but even though nginx does this successfully, the login page comes back with references that look like this: <script type="text/javascript" src="/res/-8762791360234593415.js?v=13058158...
I did this using the standard Teamcity Windows installer, and presumably it would work on any platform. Change Teamcity Location As per a comment by a JetBrains employee: To change TeamCity address from http://server/ to http://server/teamcity/, rename the <TeamCity home>\webapps\ROOT directory to <TeamCity home>\web...
TeamCity
6,071,426
10
We are using TFS 2010 for source control and project management, and TeamCity 6.0 for performing builds and build reporting (CI and daily deployments for testers). Setting up TFS source labeling in TeamCity to match the build number was very straightforward, but I cannot find a way to link this back to TFS Build Explo...
I don't know if you can, at least without some heavy VSX work or direct manipulation of the database, get the TeamCity builds to show up in the TFS Build Explorer. However, the "Found in Build:" drop down on in the bug workitem is a populated by a global list which you can add to pro grammatically using http://blogs.m...
TeamCity
4,889,410
10
Is it possible to Trigger an exe to run on a failed build? Can you do this within Team City?
If you specifically want the failed builds, you can set up the dependent build as Eric said, and have that secondary buildscript use the REST API to pull up a list of the failed builds for the actual project. If the latest build is in that failed builds list, then tell the build script to run the executable. If not, t...
TeamCity
4,671,888
10
I'm setting up a nightly build for continuous integration within TeamCity. I wanted to create an artifact dependency on the last complete build. But I notice that I have no artifacts created in my project. I'm building using MS build.
You need to specify what files you are interested in TeamCity saving as artifacts. This is done by changing the Artifact Path under General Settings when you edit the configuration. http://confluence.jetbrains.net/display/TCD5/Build+Artifact
TeamCity
4,277,348
10
I have a reoccurring problem with TeamCity. On my company I have installed TeamCity three different times and successfully connected them to some kind of SVN-repo. But after a while I have always got the same error, unable to access localhost, i.e. TeamCity's login-page (I start the browser and it can't find localhost...
It's solved. No valid information was to be found in any logs. The silly answer was that, for some reason, port 80, that Tomcat uses, was blocked by a "System:4"-process. After some research it turned out to be the AD. Never would have suspected that since it happened all of a sudden. That is, it worked for a couple o...
TeamCity
3,195,384
10
I'm new to Continuous Integration. I want an advice with what tool should I start deal with. I see that this is the biggest tools right now: CruiseControl.NET, TeamCity and Visual Studio Team System. I'm using this tools: Visual Studio 2010, Mercurial, NAnt, NUnit.
I would recommend TeamCity - free for up to three agents, 20 projects and 20 users, runs a variety of builders (NAnt included) and can parse NUnit results (Hudson can do all this too I believe, however I have no used it, so I can't speak from experience). Having worked with TFS, TeamCity, Bamboo and CC.NET, I can say t...
TeamCity
2,726,996
10
Any ideas?
With IIS 7.5 you can use Application Request Routing to route requests at teamcity.server.domain.com:80 to Tomcat at server.domain.com:81. I would consider this approach superior since the Tomcat Connector seems a bit flaky under WS2008 x64. Jon Alb has a good writeup on how to configure TeamCity plus IIS on WS2008: P...
TeamCity
858,790
10
I'm trying to use basic HTTP authentication in Python. I am using the Requests library: auth = requests.post('http://' + hostname, auth=HTTPBasicAuth(user, password)) request = requests.get('http://' + hostname + '/rest/applications') Response form auth variable: <<class 'requests.cookies.RequestsCookieJar'>[<Cookie J...
You need to use a session object and send the authentication each request. The session will also track cookies for you: session = requests.Session() session.auth = (user, password) auth = session.post('http://' + hostname) response = session.get('http://' + hostname + '/rest/applications')
AppDynamics
26,745,462
143
I want to use Serilog in an Azure Function v4 (.net 6) (the logs should be sent to Datadog). For this I have installed the following nuget packages: <PackageReference Include="Serilog" Version="2.10.0" /> <PackageReference Include="Serilog.Extensions.Logging" Version="3.1.0" /> <PackageReference Include="Serilog.Format...
Got it! After replacing all ILogger with ILogger<T> and removing the line builder.Services.AddSingleton<ILoggerProvider>(sp => new SerilogLoggerProvider(Log.Logger, true)); everything worked as expected. Startup.cs Log.Logger = new LoggerConfiguration() .MinimumLevel.Override("Microsoft", LogEventLevel.Warnin...
Datadog
71,034,036
19
Like this one: [ If yes, how do I create one? From all documentation I've read so far, it doesn't seem to support it. But I don't see anyone confirming that it's not supported anywhere.
2016 Confirmed on IRC (#datadog on freenode) that: Datadog doesn't support multiple Y-axis at this time. 2020: Now it is supported. See James' answer below.
Datadog
37,010,163
16
Does anyone know how to integrate Spring boot metrics with datadog? Datadog is a cloud-scale monitoring service for IT. It allows users to easily visualice their data using a lot of charts and graphs. I have a spring boot application that is using dropwizard metrics to populate a lot of information about all methods I ...
I've finally found a dropwizzard module that integrates this library with datadog: metrics-datadog I've created a Spring configuration class that creates and initializes this Reporter using properties of my YAML. Just insert this dependency in your pom: <!-- Send metrics to Datadog --> <dependency> <gro...
Datadog
34,398,692
15
Splunk has transaction command which can produce duration between logs grouped by id: 2020-01-01 12:12 event=START id=1 2020-01-01 12:13 event=STOP id=1 as it is described on Query for calculating duration between two different logs in Splunk Splunk - duration between two different messages by guid transaction time ...
You can use group queries to create transactions that will automatically calculate the duration. This screenshot is an example of logs grouped into transactions by CartId.
Datadog
62,782,910
14
I have a timeseries graph in a time board that displays data for one metric that has multiple tags called "page". The graph has one line for each tag and I'm running functions on the values, so the query for my data is "ewma_5(avg:client.load_time{env:prod}) by {page}". This query means the tooltip values when I hover ...
I asked DataDog support, and apparently as of January 2020 this is not possible, but is a feature request in their backlog. I know this is not a great answer to the question but if I hear that this changes, I will update my answer.
Datadog
57,918,254
12
I have a metric which has a tag with lots of different values (the value is a file name). How can I create a query that determines the number of different values of that tag exist on a metric? For example if 4 metrics are received during a time frame, with the following tags "file_name:dir/file1", "file_name:dir/file2"...
Either of the count_not_null() or count_nonzero() functions should get you where you want. If graph your metric, grouped by your tag, and then apply one of those functions, it should return the count of unique tag values under that tag key. So in your case: count_not_null(sum:your.metric.name{*} by {file_name}) And it ...
Datadog
61,108,009
11
Using JQ I would like to take a complex JSON object that includes JSON embedded as strings and then turn it all into a valid string I can easily embed in other JSON objects. For example, lets say I have this json object: { "region": "CA", "waf_rule_tags": "{\"RULEID:942100\":[\"application-multi\",\"language-multi...
In brief, tostring is your friend. Assuming that your original JSON object is in a file named object.json, and that the template is in template.json, you could write: jq --argfile object object.json '.text = ($object | tostring)' template.json Needless to say, there are numerous variations on this theme, e.g. jq -n 'i...
Datadog
61,492,210
11
DataDog is so useless in its querying and its intuitiveness ... I'm looking for a custom exception in the stack trace. I found individual log entries in the last 18 hours that contain my exception class name, but attempting to write a log query that will find me all the occurrences is returning nothing. E.g.: environme...
The following worked for me (where my stacktrace is in a stack_trace attribute) after reading the doco and trial and error: @stack_trace:*the?quick?brown?fox* i.e. to search on a phrase (multiple words), don't use quotes (so leading/trailing wildcards work) and replace spaces with ?
Datadog
66,639,586
10
I'm trying to learn how to use docker and am having some troubles. I'm using a docker-compose.yaml file for running a python script that connects to a mysql container and I'm trying to use ddtrace to send traces to datadog. I'm using the following image from this github page from datadog ddagent: image: datadog/d...
Containers are about isolation so in container "localhost" means inside container so ddtrace-test cannot find ddagent inside his container. You have 2 ways to fix that: Put network_mode: host in ddtrace-test so he will bind to host's network interface, skipping network isolation Change ddtrace-test to use "ddagent" h...
Datadog
52,390,678
10
The use case is this: I've several java applications running which all have to interact with different (each one has a specific target) elasticsearch indices. For instance an application A uses the indices A,B,C of ElasticSearch to query and update. Application B uses indices A,C,D(say). Some common interface is requi...
kafka provides publish/subscribe messaging as a distributed commit log. Usually you install kafka on each host where you need to produce some data to be forwarded somewhere else and all those hosts will together form a cluster. The good thing here is that if for some reason network connectivity becomes unstable or goes...
Fluentd
35,144,835
34
I am trying to find a way in Fluent-bit config to tell/enforce ES to store plain json formatted logs (the log bit below that comes from docker stdout/stderror) in structured way - please see image at the bottom for better explanation. For example, apart from (or along with) storing the log as a plain json entry under l...
Solution is as follows. [SERVICE] Flush 5 Daemon Off Log_Level debug Parsers_File parsers.conf [INPUT] Name forward storage.type filesystem Listen my_fluent_bit_service Port 24224 [FILTER] Name parser Parser docker Match ...
Fluentd
56,841,754
17
By reading the following post from 12factor I have come up with a question I'd like to check how you guys handle this. Basically, an app should write directly to stdout/stderr. Is there anyway to redirect these streams directly to fluentd (not bound to rsyslog/syslog)? As I become more aware of fluentd, I believe it wo...
You need to configure your process manager to use fluentd. "Twelve-factor app processes should [...] rely on the operating system’s process manager (such as Upstart, a distributed process manager on a cloud platform, or a tool like Foreman in development) to manage output streams [...]." Basically, the idea is that l...
Fluentd
28,730,462
15
I can't get Loki to connect to AWS S3 using docker-compose. Logs are visible in Grafana but the S3 bucket remains empty. The s3 bucket is public and I have an IAM role attached to allow s3:FullAccess. I updated loki to v2.0.0 and changed the period to 24h but it made no difference. There are no errors in the loki logs...
I finally did work this out. It requires a compactor but gives no warning about it. Best practice is to create an AWS s3 bucket without any public access. Next create an IAM user with programmatic access only. Create an access policy which gives full access only to the bucket you created. Attach the policy to the user'...
Fluentd
64,432,617
14
I was wondering how to use env vars in the Fluentd config, I tried: <match **> type elasticsearch logstash_format true logstash_prefix $ENV_VAR host *** port *** include_tag_key true tag_key _key </match> but it doesn't work, any idea?
EDIT: Here is a much better solution: If you pass "--use-v1-config" option to Fluentd, this is possible with the "#{ENV['env_var_name']" like this: <match foobar.**> # ENV["FOO"] is foobar type elasticsearch logstash_prefix "#{ENV['FOO']}" logstash_format true include_tag_key true tag_key _key host ...
Fluentd
27,233,761
13
I have source: <source> @type tail tag service path /tmp/l.log format json read_from_head true </source> I would like to make several filters on it and match it to several outputs: <source> @type tail tag service.pi2 path /tmp/out.log format json read_from_head true </source> ...
You can try using plugins copy and relabel to achieve this. Example configuration looks like this. //One Source <source> @type tail tag service path /tmp/l.log format json read_from_head true </source> //Now Copy Source Events to 2 Labels <match service> @type copy <store> @type relabel ...
Fluentd
53,960,655
11
I'm a bit confused at how to setup error reporting in kubernetes, so errors are visible in Google Cloud Console / Stackdriver "Error Reporting"? According to documentation https://cloud.google.com/error-reporting/docs/setting-up-on-compute-engine we need to enable fluentd' "forward input plugin" and then send exception...
The basic idea is to start a separate pod that receives structured logs over TCP and forwards it to Cloud Logging, similar to a locally-running fluentd agent. See below for the steps I used. (Unfortunately, the logging support that is built into Docker and Kubernetes cannot be used - it just forwards individual lines o...
Fluentd
36,379,572
10
I am trying to send data to graphite carbon-cache process on port 2003 using Ubuntu terminal: echo "test.average 4 `date +%s`" | nc -q0 127.0.0.1 2003 Node.js: var socket = net.createConnection(2003, "127.0.0.1", function() { socket.write("test.average "+assigned_tot+"\n"); socket.end(); }); It works fine whe...
The native JavaScript Date system works in milliseconds as opposed to seconds, but otherwise, it is the same "epoch time" as in UNIX. You can round down the fractions of a second and get the UNIX epoch by doing: Math.floor(+new Date() / 1000) Update: As Guillermo points out, an alternate syntax may be more readable: M...
Graphite
25,250,551
103
I am trying to run statsd/graphite which uses django 1.6. While accessing graphite URL, I get django module error File "/opt/graphite/webapp/graphite/urls.py", line 15, in from django.conf.urls.defaults import * ImportError: No module named defaults However, I do not find defaults django package inside ...
django.conf.urls.defaults has been removed in Django 1.6. If the problem was in your own code, you would fix it by changing the import to from django.conf.urls import patterns, url, include However, in your case the problem is in a third party app, graphite. The issue has been fixed in graphite's master branch and ver...
Graphite
19,962,736
99
I just installed graphite/statsd for production use. I'm really happy with it, but one of my co-workers asked me if there was a way to make it look prettier. Honestly, I can't say that I haven't wonder the same. Are there alternatives to the Graphite UI that do a better job rendering data, perhaps using one of the awes...
Try Grafana It has a very nice UI and advanced dashboard and graph editing features. Very simple to install.
Graphite
10,527,401
91
I'm playing with grafana and I want to create a panel where I compare data from one app server against the average of all the others except that one. Something like: apps.machine1.someMetric averageSeries(apps.*.not(machine1).someMetric) Can that be done? How?
Sounds like you want to filter a seriesList, you an do that inclusively using the 'grep' function or exclusively using the 'exclude' function exclude(apps.machine*.someMetric,"machine1") and pass that into averageSeries averageSeries(exclude(apps.machine*.someMetric,"machine1")) You can read more about those function...
Graphite
34,214,149
24
What will I need to use Etsy's Statsd in a Windows Environment? My intentions are to create a .net client to use Statsd.
I have statsd+graphite running in my Windows environment using the C# client NStatsD. Here are my notes for getting the Linux VM setup: Note: I know enough Linux to be dangerous but am otherwise a noob and could be doing something unwittingly horrible. Install Ubuntu Server 12.04. I used VirtualBox for dev and then la...
Graphite
5,436,606
22
We have a metric that we increment every time a user performs a certain action on our website, but the graphs don't seem to be accurate. So going off this hunch, we invested the updates.log of carbon and discovered that the action had happened over 4 thousand times today(using grep and wc), but according the Integral r...
After some research through the documentation, and some conversations with others, I've found the problem - and the solution. The way the whisper file format is designed, it expect you (or your application) to publish updates no faster than the minimum interval in your storage-schemas.conf file. This file is used to c...
Graphite
7,099,197
21
I'm using graphite to collect data, and I'd like to retrieve the total count of certain events over a period of time. Say, number of logins per week. However, I just need the total number, and don't need to see how it evolves over time. When I use something like from=-1w&target=summarize(stats.events.login.success,"1w"...
The problem here is that summarize doesn't align to the from field by default. summarize(seriesList, intervalString, func='sum', alignToFrom=False) If you do from=-1w&target=summarize(stats.events.login.success,"1w","sum",true)&format=json you should get just one datapoint. What it's doing right now is aligning your...
Graphite
13,589,350
20
I have a counter that measures the number items sold every 10 minutes. I currently use this to track the cumulative number of items: alias(integral(app.items_sold), 'Today') And it looks like this: Now, what I want to do to show how well we were are doing TODAY vs best, avg (or may median) worst day we've had for the...
The answer was to just flip the order to the function calls: (maxSeries before integral) Thanks to turner on the grafana@groups.io board for the answer alias(maxSeries(integral(timeStack(app.items_sold, '1d', 0, 90))),'Max') alias(averageSeries(integral(timeStack(app.items_sold, '1d', 0,90))), 'Avg') alias(minSeries(in...
Graphite
29,264,515
19
I'm using statsD to report counter data to graphite; sends a tick everytime I get a message. This works great, except in the situation when statsD has to restart for whatever reason. Then I get huge holes in my graphs, since statsD is now no longer sending '0' every 10 seconds for periods when I didn't get any messages...
Check out the function transformNull that Graphite provides. e.g. transformNull(stats.timers.deploys.all.duration.total.mean, 0) This will map sections with null data to 0.
Graphite
13,736,898
16
I have configured Graphite to monitor my application metrics. And I configured Zabbix to monitor my servers CPU and other metrics. Now I want to pass some critical Graphite metrics to Zabbix to add triggers for them. So I want to do something like $ whisper get prefix1.prefix2.metricName > 155 Is it possible? P.S. I...
You can use the whisper-fetch program which is provided in the whisper installation package. Use it like this: whisper-fetch /path/to/dot.wsp Or to get e.g. data from the last 5 minutes: whisper-fetch --from=$(date +%s -d "-5 min") /path/to/dot.wsp Defaults will result in output like this: 1482318960 21.187000 14823...
Graphite
25,651,902
15
I use statsd for measuring stats and Graphite for displaying these. Anyway, I would like to do a more sophisticated analysis in statistical software, to find out the relations between various variables. In order to do this, I need the "raw" data, which are usually displayed in Graphite as color lines. Is it possible to...
Yes. And it is straightforward. Server: graphite.example.com Metric: Graphite.system.data.ip-10-0-0-1.load As you might be aware, Graphite has a URL API. graphite.example.com/render/?target=Graphite.system.data.ip-10-0-0-1.load Returns the line-graph. To get data in csv or even json, append- &format=json graphite.ex...
Graphite
21,331,778
14
I'm trying to get arroud with Graphite. I have problem getting graph render precision lower that minute. I already set refresh time to 1 second, display time to relateive -5 minutes and retention to: retentions = 1s:21d Graph is updated every second, but the precision is still one minute. How can I change this ?
First, I assume the pattern matches appropriately for the retention. For example: [default_1s_for_21days] pattern = .* retentions = 1s:21d Second, make sure you restart carbon after you modify the storage-schemas.conf file. If you have existing metrics (existing .wsp files) that you need to keep and you'd like them ...
Graphite
17,045,549
14
I am sending Graphite the time spent in Garbage Collection (getting this from jvm via jmx). This is a counter that increases. Is their a way to have Graphite graph the change every minute so I can see a graph that shows time spent in GC by minute?
You should be able to turn the counter into a hit-rate with the Derivative function, then use the summarize function to the counter into the time frame that your after. &target=summarize(derivative(java.gc_time), "1min") # time spent per minute derivative(seriesList) This is the opposite of the integral function. This...
Graphite
12,009,481
14
When setting up graphite I accidentally set the retention to 1800 days not 180 days. '10s:6h,10min:1800d' From what I understand changing the retention now won't clean up the old data. I am unsure of how todo this without destroying all the data we have and starting agin.
You have to user the whisper-resize.py command. Note that every metric is saved in a .wsp file, so if you want to change the retention policy of all metrics you will have to use a command along the lines of this gist: find ./ -type f -name '*.wsp' -exec whisper-resize.py --nobackup {} 10s:6h 10min:180d \;
Graphite
30,106,553
12
My current retention rule is like so: [whatever] priority = 110 pattern = ^stats\.whatever\..* retentions = 60:10080,600:262974 If I understand correctly, this will save 2 days of 1 minute data and 5 years of ten minute data. I have been sending data to graphite for the last couple of hours and I can see the a graph o...
I had this same problem. After you change your retention rules, you need to restart carbon-cache.py. If you want to keep the data you have you need to run whisper-resize.py on your whisper files (.wsp). This link should help too: https://answers.launchpad.net/graphite/+question/140289 However in that link, the paramete...
Graphite
10,820,119
12
I'm trying to set up graphite to work with grafana in docker based on this project : https://github.com/kamon-io/docker-grafana-graphite and when I run my dockerfile I get 403 Forbidden error for nginx. my configurations for nginx are almost the same as the project's configurations. I run my dockerfiles on a server an...
That's because you are hitting the first location block and the index file is not found.
Graphite
27,303,967
11
I want to label series by hostname + metric name. I know I can use aliasByNode(1) to do first part and aliasByMetric() to do the second. Any ideas how can I merge those two functions in a single metric?
aliasByNode can take multiple arguments. aliasByNode(apps.fakesite.web_server_01.counters.requests.count, 2,5) returns web_server_01.count. The Grafana query editor for Graphite does not support this but if you toggle edit mode then you can edit the raw query. After editing it, you can toggle back.
Graphite
38,281,290
11
Here's the display for a stat for the past 24 hours (in Graphite Composer): Here's the display for a stat for the "past 14 days": Not much difference there. I cannot convince Graphite to display any data for any period past the past 24 hours. Here are the relavent entries from storage-schemas.conf (I'm using StatsD)...
Well, this is what I get for not pasting the entire configuration. Here's what it actually looked like: [carbon] pattern = ^carbon\. retentions = 60:90d [default_1min_for_1day] pattern = .* retentions = 60s:1d [stats] pattern = ^stats.* retentions = 10:2160,60:10080,600:262974 [stats_counts] pattern = ^stats_counts....
Graphite
15,030,063
11
If I ask for this data: https://graphite.it.daliaresearch.com/render?from=-2hours&until=now&target=my.key&format=json I get, among other datapoints, this one: [ 2867588, 1398790800 ] If I ask for this data: https://graphite.it.daliaresearch.com/render?from=-10hours&until=now&target=my.key&format=json The datapoi...
There are several things happening here, but basically the problem is that you have misconfigured graphite (or at least, configured it in a way that makes it do things that you aren't expecting!) Specifically, you should set xFilesFactor = 0.0 in your storage-aggregation.conf file. Since you are new at this, you proba...
Graphite
23,372,235
10
I am having difficulties understanding integration of Graphite and Kibana 3 to monitor logs and system vitals. I am referring to figure in Log management system described here. Considering the new features in Kibana 3 Milestone 4, can we collect system vitals and store it directly into elastic search instead of graph...
Why statsd-graphite: Statsd and Graphite can help you visualize anything, not just logs and system vitals. It is very straightforward with the statsd-graphite stack, to measure say- number of users that hovered on the left bottom of your site for more than 10 seconds. Because there is no in-between logging involved, t...
Graphite
20,040,373
10
We need to collect timeseries information on multiple server and business processes and consider to use graphite. It seems good if we want to display the raw data. But what if we want to do BI on this data and run custom queries? Does graphite allow that, or alternatively can I instruct graphite to store data on postgr...
Graphite definitely allows you to query your data, both graphically and returning csv or json. The queries in graphite aren't done with a language like sql. They're done with functions that apply to one metric at a time. Each metric is it's own database, which is just a series of time, value pairs. The most common t...
Graphite
13,919,478
10
I have a String, and I would like to reverse it. For example, I am writing an AngularDart filter that reverses a string. It's just for demonstration purposes, but it made me wonder how I would reverse a string. Example: Hello, world should turn into: dlrow ,olleH I should also consider strings with Unicode characters...
The question is not well defined. Reversing arbitrary strings does not make sense and will lead to broken output. The first (surmountable) obstacle is Utf-16. Dart strings are encoded as Utf-16 and reversing just the code-units leads to invalid strings: var input = "Music \u{1d11e} for the win"; // Music 𝄞 for the win...
Split
21,521,729
47
I've got a column people$food that has entries like chocolate or apple-orange-strawberry. I want to split people$food by - and get the first entry from the split. In python, the solution would be food.split('-')[0], but I can't find an equivalent for R.
If you need to extract the first (or nth) entry from each split, use: word <- c('apple-orange-strawberry','chocolate') sapply(strsplit(word,"-"), `[`, 1) #[1] "apple" "chocolate" Or faster and more explictly: vapply(strsplit(word,"-"), `[`, 1, FUN.VALUE=character(1)) #[1] "apple" "chocolate" Both bits of cod...
Split
33,683,862
47
I've been trying to create a waveform image and I'm getting the raw data from the .wav file using song = wave.open() and song.readframes(1), which returns: b'\x00\x00\x00\x00\x00\x00' How can I split this into three separate parts, e.g. b'\x00\x00', b'\x00\x00', b'\x00\x00' because each frame consists of 3 parts (eac...
You can use slicing on byte objects: >>> value = b'\x00\x01\x00\x02\x00\x03' >>> value[:2] b'\x00\x01' >>> value[2:4] b'\x00\x02' >>> value[-2:] b'\x00\x03' When handling these frames, however, you probably also want to know about memoryview() objects; these let you interpret the bytes as C datatypes without any extra...
Split
20,024,490
47
I would like that after splitting the window (C-x 3 or C-x 2) to be able to automatically get to cursor in the new opened buffer (the other than the current). How can I achieve this behavior ?
You can switch between buffers with C-x o. As to do that automatically I don't think there is an existing command for that.
Split
6,464,738
47
I'm trying to write the Haskell function 'splitEvery' in Python. Here is it's definition: splitEvery :: Int -> [e] -> [[e]] @'splitEvery' n@ splits a list into length-n pieces. The last piece will be shorter if @n@ does not evenly divide the length of the list. The basic version of this works fine, but I ...
from itertools import islice def split_every(n, iterable): i = iter(iterable) piece = list(islice(i, n)) while piece: yield piece piece = list(islice(i, n)) Some tests: >>> list(split_every(5, range(9))) [[0, 1, 2, 3, 4], [5, 6, 7, 8]] >>> list(split_every(3, (x**2 for x in range(20)))) [...
Split
1,915,170
47