w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Is it possible to build an rpm package without making a tar.gz archive?
There isn't a whole ton of documentation on this, but yea you can just list the file if you want to. Here is a great discussion on doing this, as well as proper usage straight from Fedora.

Categories : Misc

Can I Override WebDeploy archive paths through TFS Build?
You can edit the path by using the _PackageTempDir argument for MSBuild. Just add _PackageTempDir=D:{desired dir structure} when you're passing in MSBuild arguments. More full explanation of this property can be found here - VS2010 Web Deploy: how to remove absolute paths and automate setAcl?

Categories : Tfs

How to automatically add build number to Xcode ios archive
What are you using to build your archives? Are you using the Xcode GUI via Product -> Archive? Or are you using some kind of build script that calls xcodebuild? If you're using the Xcode GUI, I'm not aware of any way to automate the name--you'll just have to copy in the full build number when you make the build. If you're using a build script, check out PlistBuddy (ships with OSX, but by default isn't in your PATH, usually it's at /usr/libexec/PlistBuddy). You can use PlistBuddy to read the build number from your target's Info.plist and then insert that value into the name/description of the archive you're building.

Categories : IOS

Extract a specific file from a zip archive without maintaining directory structure in python
You can use zipfile.ZipFile.read: import os with zipfile.ZipFile(tDir + mainapk[0]) as z: with open(os.path.join(tDir, os.path.basename(icon[1])), 'wb') as f: f.write(z.read(icon[1])) Or use zipfile.ZipFile.open: import os import shutil with zipfile.ZipFile(tDir + mainapk[0]) as z: with z.open(icon[1]) as zf, open(os.path.join(tDir, os.path.basename(icon[1])), 'wb') as f: shutil.copyfileobj(zf, f)

Categories : Python

Create batch to archive files using main folder name for archive name
I don't have WinRAR, so I can't check the syntax for the rar command, but you could create a batchfile (backup.bat) like: cd %1 "C:Program FilesWinRARWinRAR.exe" a -esh -m5 -mt2 -r -s -t "..\%1.rar" cd .. And invoke it with backup A from the temp folder. That might be a start...

Categories : Batch File

iOS Project runs on simulator, physical device, but can't build or archive anymore for "iOS Device"
After this happening a few times, I figured out the issue. When my iPhone is hooked up to my Mac and tethering is on, this problem occurs. When I turn tethering off, or disconnect the phone, I can archive again. Not sure why this, but I hope it helps someone at some point.

Categories : Iphone

Archive old files only AND re-construct folder tree in archive
I would take this route instead of rsync: Change directories so we can deal with relative path names instead of absolute ones: cd /home/user/documents Run your find command and feed the output to cpio, requesting it to make hard-links (-l) to the files, creating the leading directories (-d) and preserve attributes (-m). The -print0 and -0 options use nulls as record terminators to correctly handle file names with whitespace in them. The -l option to cpio uses links instead of actually copying the files, so very little additional space is used (just what is needed for the new directories). find . -type f -mtime +1000 -print0 | cpio -dumpl0 /home/user/archives Re-run your find command and feed the output to xargs rm to remove the originals: find . -type f -mtime +1000 -print0 | xargs

Categories : Linux

How to create 7z archive with no compression using java
Apache Commons Compress (http://commons.apache.org/proper/commons-compress/) added preliminary support for writing 7z files.

Categories : Java

Java edit file inside WAR archive
You can't modify files contained in any ?AR file (WAR, JAR, EAR, AAR, ...). It's basically a zip archive, and the only way to modify it is to unzip it, make the changes, and zip it up again. If you're trying to have a running application modify itself, then recognize that 1) many containers run from an exploded copy of an ?AR file for various reasons, and 2) it's unlikely to do you any good to modify files on the fly anyway unless you plan to restart the application after the change or write lots of code to monitor for changes and refresh your app in some way afterward. Either way, you're probably better off figuring out how to make your desired change programmatically than trying to rewrite a running application. On the other hand, if you're not talking about having an application modif

Categories : Java

Getting an error when try to connect to Oracle java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
Add your Oracle JDBC Driver jar to the classpath Can download the driver for your Oracle Database Version from here

Categories : Oracle

Insert custom build code / invoke java programm with Maven during build
Use maven-exec-plugin: <build> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <executions> <execution> <id>exec-one</id> <phase>verify</phase> <configuration> <executable>echo</executable> <arguments> <argument>exec one</argument> </arguments> </configuration> <goals> <goal>exec</goal>

Categories : Java

How to create a zip archive containing google cloud storage objects within appengine java app?
I wrote the method below which seems to be working fine. public static void zipFiles(final GcsFilename targetZipFile, final GcsFilename... filesToZip) throws IOException { Preconditions.checkArgument(targetZipFile != null); Preconditions.checkArgument(filesToZip != null); Preconditions.checkArgument(filesToZip.length > 0); final int fetchSize = 4 * 1024 * 1024; final int readSize = 2 * 1024 * 1024; GcsOutputChannel outputChannel = null; ZipOutputStream zip = null; try { GcsFileOptions options = new GcsFileOptions.Builder().mimeType(MediaType.ZIP.toString()).build(); outputChannel = GCS_SERVICE.createOrReplace(targetZipFile, options); zip = new ZipOutputStream(Channels.newOutputStream(outputChannel)); GcsInputChan

Categories : Java

Is Sun/Oracle JDK required to build WSO2 4.1.x?
Yes, Oracle JDK is required to build Carbon. Currently Open JDK is not recommended. Please make sure to use Oracle JDK 1.6 for building Carbon. You can use Oracle JRE 1.7 for running WSO2 products, but there are known issues with compiling the source code with Java 7. See http://docs.wso2.org/wiki/display/Carbon410/Installation+Prerequisites for additional info.

Categories : Wso2

How to use Maven to build a Java EE project with Java class references to several dependent Java projects?
You are getting this error because you are trying to join everything with maven pom file where packaging node is set to war: war/ +--- project 1 - jar/ | +--- project 2 - jar/ instead you have to reorganize your project and join everything in project with packaging type set to "pom" pom/ +--- war/ | +--- project 1 - jar/ | +--- project 2 - jar/ Maven requires parent pom to be of type "pom".

Categories : Java

How to build Qt QOCI (Oracle Database driver) on Windows with MinGW?
So this is how to do it: Preliminar notes: I had QtSDK/QtCreator/Qt 4.8.1 32 lib installed, so I had both QtSources folder in my directory system as well as "Qt 4.8.1 for Desktop (MinGW)" - the command prompt prepared for usage with Qt. A also had Oracle database 32 installed with the folder C:Oracle with "include" and "lib" folders inside. In "include" there are the .h such as oci.h and in "lib" there are the .dlls and .lib such as oci.dll, all of them required for the compilation. Following the Qt Project documentation, I add "c:oraclein" to the PATH environment variable (Computer properties -> Advanced system settings -> Tab "Advance" -> Environment Variables -> System variables section). First try: The default code (actually one for debug lib) for the compilation as shown in Qt P

Categories : Windows

Can't archive iOS Application (iOS App Archive)
I solved the question by myself. The decision is: in Build Settings - INSTALL_PATH set "$(LOCAL_APPS_DIR)" - this code will generate /Applications. INSTALL_PATH install place where XCode will store archive for you. As I right understand to solve the task about archiving you need to do: in your PROJECT-SKIP_INSTALL - set to NO, and in your LIBRARIES-SKIP_INSTALL - set to YES; in your Project set Build Settings - INSTALL_PATH set "$(LOCAL_APPS_DIR)" in Build Phases-Copy headers transfer headers from Public/Private to Project section. I did these three steps and they are helped me, and I hope they will help you too.

Categories : IOS

java.lang.ClassCastException: oracle.sql.CLOB cannot be cast to oracle.sql.CLOB
I fixed the problem. Posting this answer, hoping it might be useful to someone. When I was checking the instance type of the CLOB retrieved by the query, it came up as oracle.sql.CLOB. So I assumed it must have been a version mismatch of ojdbc.jar. I checked my project a gazillion times for multiple copies of the ojdb.jar. There were none. Finally it turned out to be a clash between hibernate and ojdbc. I changed the reference to java.sql.Clob. Hibernate uses java.sql.Clob. This resolved the problem.

Categories : Java

not able to build a specific Dockerfile
The last parameter to docker build is the build path, when you put . it means this is the path where you will find the Dockerfile. When you change it to Dockerfile.app it will then try and look for Dockerfile.app/Dockerfile, which isn't correct. I'm not sure if it will still work, but you used to be able to do this. $ docker build -t deepak/app - < Dockerfile.app Try that and see if it helps, if not, maybe open a docker issue to add this feature back in, or update the documentation on how to use a Dockerfile with a different name. More info here: http://docs.docker.io/en/latest/commandline/command/build/

Categories : Docker

ORACLE SQL: only show specific value if appears more than once
You can group by SRCREF. This means that you only have each value SRCREF once in your results. Then, you can use an aggregate function to get one specific value from LN to go with that SRCREF value. In this case, I'm using min which returns the lowest value. So you get the lowest LN value that goes with each SRCREF value. Finally, I'm using order by to sort by that lowest value. select min(LN) as first, SRCREF from YourTable t group by SRCREF order by min(LN) Note that in this case you might get odd results, because the first column is a character field. That means that its contents are compared alphabetically. This means that L-10 will come before L-2. There are other ways to solve that, but I don't know if it's going to be an issue for you.

Categories : SQL

How to Group specific Colomn in Oracle 9i
Here's one way of doing it. SELECT CASE WHEN r = 1 THEN w ELSE NULL END as s_no, column1, column2 FROM (SELECT column1, column2, ROW_NUMBER () OVER (PARTITION BY column1 ORDER BY column2) AS r, DENSE_RANK () OVER (ORDER BY column1) AS d FROM SAMPLE); Here ROW_NUMBER function returns unique number for each row within a group of column1. DENSE_RANK function returns unique rank to to each group of column1. Using this, you can chose to display the dense_rank column only for 1st row. SQL Fiddle here

Categories : Oracle

Can Oracle DBMS return a Java object from a Java stored procedure call?
What you need to do is, serialize and de-serialize java objects to and from Oracle database table. You can store the serialized object bytes in Oracle table using BLOB column type. Here is a link describing how you can store and retrieve java objects from a table. http://asktom.oracle.com/pls/apex/f?p=100:11:0::::p11_question_id:1285601748584

Categories : Java

How to add some specific file into the build process?
Yes this possible. You can keep configuration files in different mode for eg: You can have configuration files in Release mode debug mode, release mode and the common configuration file used by all. So when you build your solution in Debug mode then the debug mode configuration file will be used and when in release mode then release mode configuration file will be used. For further clarity take example of web config when you will expand the web config tab you will see the two configuration file in different modes.

Categories : Visual Studio 2010

How to get the list of tables that has specific columns from Oracle server.?
If you have the privileges and assuming that the actual name of the column is BUSINESS_ADDRESS, not a case-sensitive column name that includes a space. SELECT owner, table_name, column_name FROM dba_tab_columns WHERE column_name = 'BUSINESS_ADDRESS' If not, you can use ALL_TAB_COLUMNS if you only care about tables that the Oracle user you are connecting as can query or USER_TAB_COLUMNS if you only care about tables the Oracle user you are connecting as owns.

Categories : SQL

Query for getting previous date in oracle in specific scenario
Here's a way to achive this using analytical functions. INSERT INTO tableb WITH tablea_grouped1 AS (SELECT account_no, balance, as_on_date, SUM (CASE WHEN balance >= 0 THEN 1 ELSE 0 END) OVER (PARTITION BY account_no ORDER BY as_on_date) grp FROM tablea), tablea_grouped2 AS (SELECT account_no, balance, as_on_date, grp, LAST_VALUE ( balance) OVER ( PARTITION BY account_no, grp ORDER BY as_on_date ROWS BETWEEN UNBOUNDED PRECEDING AND UNBO

Categories : SQL

oracle how to write in stored procedure to get specific values
A procedure to do this would require two input parameters (PaymentType and bank) and two output parameters (param1 and param2). Note that Oracle parameters, unlike SQL Server and MySQL, are set off with a colon (:) rather than an "at" sign (@), so in your C# code you'll need to name them :PaymentType, :bank, :param1, and :param2. Also note that when you write the C# code you must name the parameters exactly as they're named in Oracle (except for the colon in front). If you don't, the C# code will compile fine but it will fail at runtime. If your first parameter is PaymentType in Oracle, it should be called :PaymentType in C#. One more note: I'm not sure how your Config and Config_Value tables are related. Based on the test data, it could be through Config_Value.Config_Value_Id or Config

Categories : Oracle

Delegate specific part of build to slave
Delegating part of a job to a slave is something that would have to be done external to Jenkins, for example, using ssh. However, as @kan indicates, you most likely want to extract the native library build as a separate job and then have that job execute on a particular slave, or any slave that meets a specific criteria. To do this, my suggestion would be to use Labels in the node configurations to determine which slaves can be used for building that particular job. In Jenkins > nodes > <slave node>, use the Labels property to set one-word labels that indicate your specific requirements, such as the OS or processor type. Then, in the jobs that are node-specific, check Restrict where this project can be run and set the Label Expression to something that meets your criteria.

Categories : Jenkins

TFS 2010 C# to Queue build using specific agent
In your build definition, add a new Argument (with name say customagent) of type "AgentSettings", Direction "IN". Then in your MetaData add this argument "customagent", and add the related attributes like: Parameter name = customagent Display name = "Build Agent" Category = "Build" (under what category should it display in your build definition" Description etc Once you add this, when you edit your build definition, you should have a new set of variables to select the build agent where you want the particular build to happen. It can be set from UI. If you just want to edit this from code, you should be able to change the "BuildAgent" property way early in the build definition and that should help you.

Categories : Tfs

Is it possible to run a specific java method after all of the @Given statements have completed for a specific scenario?
One alternative is you to use tabular parameters this way: Given an user logs into application with: |Id|Taste|Belongings| |Bob|computers|car| and this step method: @Given("an user logs into application with: $loginInfo") public void theTraders(ExamplesTable loginInfo) { callLoginProcedure(loginInfo); } you could see more details here.

Categories : Misc

How to find next dates of some specific day occured after specific date using java?
Calendar now = Calendar.getInstance(); SimpleDateFormat sdf = new SimpleDateFormat(formatString); now.setTime(sdf.parse(dateString)); int weekday = now.get(Calendar.DAY_OF_WEEK); if (weekday != Calendar.MONDAY) { int days = (Calendar.SATURDAY - weekday + 2) % 7; now.add(Calendar.DAY_OF_YEAR, days); } Date monday = now.getTime();

Categories : Java

Oracle Java 7 Installation in Ubuntu 12.04 - JB-java.desktop
this is how i installed sudo add-apt-repository ppa:webupd8team/java sudo apt-get update sudo apt-get install oracle-java7-installer sudo apt-get install openjdk-6-jdk

Categories : Java

How to disable flashback query logging for a specific table (Oracle)?
You can disable flashback archiving with alter table clause: alter table YOUR_TABLE_NAME no flashback archive; It's possible also to limit archive to specified size. To do that you need to create flashback archive designated to this table with desired retention and optionally size quota: create flashback archive YOUR_TABLE_ARCHIVE tablespace SOME_TABLESPACE quota 512M retention 1 DAY; Then assign new archive to table: alter table YOUR_TABLE_NAME flashback archive YOUR_TABLE_ARCHIVE; Examine Oracle documentation to check additional requirements. E.g. you need FLASHBACK ARCHIVE ADMINSTER privilege to execute statement above.

Categories : Database

ORACLE 11g SET COLUMN NULL for specific Partition of large table
You've ruled out updating through DDL (switch partitions), so this lets us with only DML to consider. I don't think that it's actually that bad an update with a table so heavily partitioned. You can easily split the update in 8k mini updates (each a single tiny partition): UPDATE BLABLA_TABLE SUBPARTITION (partition1) SET COLUMN_18 = NULL... Each subpartition would contain 15k rows to be updated on average so the update would be relatively tiny. While it still represents a very big amount of work, it should be easy to set to run in parallel, hopefully during hours where database activity is very light. Also the individual updates are easy to restart if one of them fails (rows locked?) whereas a 120M update would take such a long time to rollback in case of error.

Categories : SQL

How to exclude a specific string/pattern from a regular expression in oracle?
try to replace the string you want to exclude with a string that would not be found by your regexp. e.g with str as ( select '1013;' as s from dual union select '1013' from dual union select '1013:' from dual union select '10133;' from dual ) select s , regexp_substr(s, '1([^34][:;]|[0-9][^:;].*)') --> regexp , regexp_replace(s,'^1013($|:|;)','x') --> replaced string , regexp_substr(regexp_replace(s,'^1013($|:|;)','x') , '1([^34][:;]|[0-9][^:;].*)') --> regexp with replaced string from str ;

Categories : Regex

Force Bamboo to use specific Build Agent for Deployment
The closest thing that we've been doing is adding a required capability to particular agents that other agents don't have. So on the linux agent, define a custom capability for that agent. Then in the Requirements for the deploy, include that custom capability. This should prevent the Windows remote agent from picking up that job.

Categories : Linux

Configure specific package for generated classes in ADT / ant build
For those who face the same issue, I solved this problem as follows (allthough it's not the best solution, but it worked for me): I created the ant target moveGeneratedFiles, where I copy the generated package to the correct one, replace the package name and delete the generated one (which will not really work in eclipse because the classes will be generated again). <target name="moveGeneratedFiles"> <loadproperties> <file file="assets/customer.properties"/> </loadproperties> <copy todir="gen/ch/newsnet/app" overwrite="true"> <fileset dir="gen/ch/${customer.name}/app" /> </copy> <replace dir="gen/ch/newsnet/app" token="package ch.${customer.name}.app;" value="package ch.newsnet.app;" /> <delete>

Categories : Java

Scheduling a build script at a specific time from cruise control
It looks like the clock on the server I was using was really off, this worked: <schedule> <ant day = "Thursday" time = "1552" buildfile = "call-Auto-Deploy.xml" useLogger = "true"/> </schedule>

Categories : Misc

Xcode - Run Post-Actions Script in Specific Build Configuration
Yes; in your script the $CONFIGURATION variable will be set: #!/bin/sh if [ "$CONFIGURATON" != "Release" ]; then exit 0 fi # Does stuff only in Release build See this SO question to get a list of other Xcode variables that might interest you.

Categories : Xcode

Eclipse | Build Automatically for specific project currently open in workspace
You could generate jar's from the other projects, and just depend on them. That should stop it from building the other projects. You'd just have to regenerate the jar's when you change something.

Categories : Eclipse

Trigger a build only when check in to specific folder and subs - Continuous Integration TFS
Unfortunately TFS uses the Workspace Mapping defined in the Build Definition for two purposes: Define what files get downloaded to the build server, and define which files/folders trigger CI/Gated builds. For the vast majority of cases these are the same thing, so it works fine. If that doesn't work for you, there is a way to workaround it, but it's not pretty. You can setup the Workspace Mapping to specify which files/folders should trigger the CI build. Then customize the build workflow to not use the Workspace Mapping when downloading code, but instead you can either hardcode the path(s) to download into the workflow, or you can expose some custom Build Parameters that get set in the Build Def to specify the folders to download.

Categories : Tfs

How to create a two or three different build using Gradle build system, each build pointing to different server?
(If I understand) I would use an external executable that prepare a batch file for each build. The .bat file calls gradle passing a variable (conaining the key) to it: gradle assemble -Pkey=%key% Now, inside the gradle script you can get the value of the variable: def varKey = "$key" and you can use it to sign the apk: signingConfigs { release { storeFile = file('../key.keystroke') storePassword = varKey keyAlias = "My key" keyPassword = varKey } } EDIT: Ok, the previous text is useful to sign the apk file with different keys. To edit the server url using gradle, first you need to store the url and api key into a resource string and use from inside the java class instead of the hard coded strings: <resources> <str

Categories : Android



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.