I am using JBOSS AS7.1, Eclipse Luna for development. My eclipse installation does have a plugin installed for maven. I have created my webapp project using maven command-line. In my current set up, I have to build my maven project using mvn clean install every time for all changes, even for the static files like HTML, CSS. Then, I have to deploy the generated WAR file using JBOSS console running at http://localhost:9990/console. I am quite sure that there must be another way to do this. Surely, it does take a hell...
Sunday, May 8, 2016
How to create a deployment package with SQL scripts in IIS
Using IIS-10, Web Deploy v3.6, Windows 10. It is an ASP.NET Website (not application) using SQL Server 2014 for the back-end. I was able to successfully create and deploy the package, but without SQL scripts. Could not find any info on how to do it for including SQL scripts in the package. Here is what I have tried: In IIS, under 'Default Web Site', select my web application. On the right hand side, click on 'Export Application'....
Scala higher kinded types in implicit def fails with “could not find implicit value”
I'm using implicit def to build a recursive HList type, to match several kind of higher kinded types of HList. I'm heavily inspired by this post. This code is working perfectly : sealed trait HList { type Plus[L <: HList] <: HList } class HNil extends HList { type Plus[L <: HList] = L def ::[T](v: T) = HCons(v, this) } case class Appender[L1 <: HList, L2 <: HList, R <: HList](fn: (L1, L2) => R) { def apply(l1: L1, l2: L2) = fn(l1, l2) } object HNil extends HNil object HList { def ++[L1...
Invalid column deleted while trying to query a column
I am trying to execute the following query in my android app: private static final String[] PROJECTION = { Data.CONTACT_ID, Data.MIMETYPE, Data.DISPLAY_NAME, Phone.NUMBER, Phone.TYPE, StructuredName.GIVEN_NAME, StructuredName.MIDDLE_NAME, StructuredName.FAMILY_NAME, Data.DELETED }; private static final String SELECTION = "(" + Data.MIMETYPE + " = ? AND " + Phone.TYPE...
How to retrieve an image sent from a desktop app to a Rails API
I'm building a desktop app using Electron, which is basically JavaScript. In it, I'm sending an image to my Rails API like this: var myHeaders = new Headers(); myHeaders.append('Authorization', 'Token token=redacted'); myHeaders.append('Content-Type', 'application/json'); myHeaders.append('Accept', 'application/json'); ... var formData = new FormData(); formData.append("img", base64EncodedImage); var myPost = {method: 'POST', headers: myHeaders, body: formData} fetch("url", myPost) (simplified) In my Rails console,...
How do I write a range pipeline that uses temporary containers?
I have a third-party function with this signature: std::vector<T> f(T t); I also have an existing potentially infinite range (of the range-v3 sort) of T named src. I want to create a pipeline that maps f to all elements of that range and flattens all the vectors into a single range with all their elements. Instinctively, I would write the following. auto rng = src | view::transform(f) | view::join; However, this won't work, because we cannot create views of temporary containers. How does range-v3 support...
HTML css Table misaligned Columns
I tried to create a table in AngularJS with sticky header and footer. I've managed to do that; here's a Plunker demo and code: <body ng-controller="MainCtrl as ctrl"> <table class="table table-bordered table-hover"> <thead> <tr> <th> Column1 </th> <th> Column2 </th>...
Scrolling is not working with CoordinatorLayout + parallax image + BottomSheetLayout
Introduction I have an activity, which implements a common pattern with parallax header image and scrolling content using CoordinatorLayout, AppBarLayout and CollapsingToolbarLayout. My xml layout looks like this: <android.support.design.widget.CoordinatorLayout android:fitsSystemWindows="true" android:layout_height="match_parent" android:layout_width="match_parent"> <android.support.design.widget.AppBarLayout...
Swift: UIBezierPath Stroke Animation from Center
I've been making a simple UIBezierPath animation with Swift. This path consists on creating a rounded rectangle with a colored border. The animation must be the drawing of the colored border. To do so, I've created a CAShapeLayer with a UIBezierPath(roundedRect:, cornerRadius: ) let layer = CAShapeLayer() var viewPrueba = UIView() override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading...
Saturday, May 7, 2016
Serve git-lfs files from express' public folder
I'm using node.js (express) on Heroku, where the slug size is limited to 300MB. In order to keep my slug small, I'd like to use git-lfs to track my express' public folder. In that way all my assets (images, videos...) are uploaded to a lfs-store (say AWS S3) and git-lfs leaves a pointer file (with probably the S3 URL in it). I'd like express redirects to the remote S3 file when serving files from the public folder. My problem is I don't kwon how to retrieve the URL from the pointer file's content... app.use('/public/:pointerfile',...
Proximity alert for locations saved at server
I did some search but could not find a suitable answer. My App should compare with multiple locations for proximity. This means I will not be able to save all the locations into my app to confirm the proximity using locationManager. I want the proximity confirmation to be done in the server What would be the best way to implement this? Would it be sensible if the app asks for proximity confirmation every time the devices moves around? 4 AnswersAnswers 1 I would try a different approach, since location updates from...
Displaying null values after first users login inside android
I have 3 fragments inside an app and in one of them I display users name from the SQLite database. What happens is when I register a new user and login first time with it, inside the textview where the users name suppose to appear, it displays NULL value, but when I logout and login again with the same user, name appears as it should. After registering user, all the data is inserted inside a database, I have checked. Any ideas what can cause this problem? I will add some code on request as I have no idea which part of...
Open paradox / borland database as single file
my question is: how to connect java tp paradox / borland database ".DB" single files? Here's what I have: So, it's Paradox 7 database files. I'm trying drivers: http://www.hxtt.com/paradox.html & https://code.google.com/archive/p/paradoxdriver/ as: String url = "jdbc:paradox:/D:/BABAK/powerGold/SongTitle.DB"; Connection con = DriverManager.getConnection(url); But both throws exceptions like: D:/BABAK/powerGold/SongTitle.DB...
Xcode 7.3 crashes when breakpoint set or app crashes
I am having this issue and when I searched it on Stack Overflow I saw that many people have had this before: First of all, you can find the crash report here: http://pastebin.com/c726EUip What I've tried so far: I set the "Enable Clang Module Debugging" in Build Setting to NO I did pod update Tried to change LLDB to GDB but i think xcode no longer has this option This is the list of frameworks: Here are links to questions...
node certificate store, does node read only from hard coded list of certificates?
After struggling for a while, is there any way to add new certificate to the list of certificates node trusts? It seems that node will trust only to certificates stored in hard coded list of certificates: https://github.com/nodejs/node/blob/master/src/node_root_certs.h So for example, node app should communicate with https://foo-bar-baz.com that use self signed certificate, causing request to that domain to return something like: [RequestError: Error: certificate has expired] Apparently how this can be fixed in java...
Get params validation on viewsets.ModelViewSet
I am new to django and building a REST API using django-rest-framework. I have written some code to check whether the user has supplied some parameters or not.But that is very ugly with lot of if conditions, so i want to refactor it.Below is the code that i have written please suggest how to refactor it. I am looking for some django based validations. class AssetsViewSet(viewsets.ModelViewSet): queryset = Assets.objects.using("gpr").all() def create(self, request): assets = [] farming_details = {} bluenumberid...
Strange Jackson Illegal character ((CTRL-CHAR, code 0)) Exception in Map Reduce Combiner
I have a Map-Reduce job with a mapper which takes a record and converts it into an object, an instance of MyObject, which is marshalled to JSON using Jackson. The value is just another Text field in the record. The relevant piece of the mapper is something like the following: ObjectMapper mapper = new ObjectMapper(); MyObject val = new MyObject(); val.setA(stringA); val.setB(stringB); Writer strWriter = new StringWriter(); mapper.writeValue(strWriter, val); key.set(strWriter.toString()); The outputs of the mapper are...
Rails + Jasmine-Ajax: what is the correct way to test code triggered by `ajax:success` (jquery-ujs)
I am trying to test a certain internal library that has some JS behavior triggered on the ajax:success event. The library creates a link that looks like this: <%= link_to 'click here', '/some_path', class: 'special-link', remote: true %> And in the JS part of the library there is event binding code, which is the part I want to black-box test through its effect on the DOM: $(document).on 'ajax:success', '.special-link', (e, data, status, xhr) -> # Code that has some effect on the DOM as a function of the...
Friday, May 6, 2016
Xamarin UWP custom CommandBar
I'd like to create a custom CommandBar for the UWP part of my Xamarin project. I want to make a logo on a background color. The only way to get this, is making a visualbrush or grid, to contain both the background color and the picture. I've read it can be done like so; <Window.Resources> <VisualBrush x:Key="myBrush"> <VisualBrush.Visual> <Grid> <Rectangle Fill="Red" /> <Image Source="troll.png" /> </Grid> ...
Writing Tables in Torch to file
I am trying to save some tables of strings to files in Torch. I have tried using this Torch extension by Deepmind: hdf5. require 'hdf5' label = {'a', 'b','c','d'} local myFile = hdf5.open(features_repo .. 't.h5', 'w') myFile:write('label', label) myFile:close() I am getting the error: /home/user/torch/install/bin/luajit: ...e/user/torch/install/share/lua/5.1/hdf5/group.lua:222: torch-hdf5: writing data of type string is not supported Torch Tensors are written to file as intended. I have also tried using matio...
Android - Getting Contact List with street addresses but no low value ones like Skype where the address is only a city and state
I got a cursor retrieving all the contacts on the app that have a street address. This cursor is then passed into an Adapter. So far so good. Except I also get a bunch of low value contacts (mostly from Skype) that only have a State/Country info. Is there an easy way to modify the URI to skip those? public Cursor getDirectoryList (CharSequence constraint) { String[] selectionArguments = { "%"+constraint.toString()+"%" }; String selection = ContactsContract.CommonDataKinds.StructuredPostal.DISPLAY_NAME...
How to mimic Google Maps' bottom-sheet 3 phases behavior?
Background I'm assigned to make a UI that behaves similar to how Google Maps shows a bottom-sheet for a found result. It has 3 different phases: bottom content. the upper area is still touchable and won't scroll anything at the bottom full screen content, while the upper area has a large header. full screen content, while the upper area has just the toolbar. Here's what I'm talking about on Google Maps : The problem Thing...