Posts

download manager - java.lang.NoSuchMethodError: android.app.DownloadManager$Request.setNotificationVisibility -

trying use downloadmanager so downloadmanager.request request = new downloadmanager.request(uri) .setallowednetworktypes(downloadmanager.request.network_mobile) .setallowednetworktypes(downloadmanager.request.network_wifi) .setallowedoverroaming(true) .setdestinationinexternalfilesdir(this, null,string.valueof(mpathandfolder)) .setvisibleindownloadsui(false) .setnotificationvisibility(downloadmanager.request.visibility_hidden); long downloadid = downloadmanager.enqueue(request); added following permission in android manifest <uses-permission android:name="android.permission.download_without_notification"/> getting following error @ runtime java.lang.nosuchmethoderror: android.app.downloadmanager$request.setnotificationvisibility why error? how make downloadmanager work? do need use 2 separate downloadmanager.request 1 api 9 , api 11? no, need use java guard bl...

How can I make multiple jwplayer audio players inside a jquery-ui accordion render and work correctly? -

Image
i'm trying improve , update of page has multiple jwplayers (audio only). "original" page works fine - audio players render correctly , usable (see http://www.pera.state.nm.us/meetingaudio.html ). but i'm trying put audio players in jquery-ui accordion, , not right; first player inside accordion div rendered , works correctly, subsequent players inside same accordion div rendered incorrectly , not play. play button appears rendered underneath progress bar. here sample code illustrates problem: <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en"> <head> <script type="text/javascript" src="/resources/jquery-1.9.1.min.js"></script> <script type="text/javascript" src="/resources/jquery-ui-1.10.2.min.js"...

sql - Rails 3 Sum Product of two fields -

i need calculate sum of product of 2 fields in rails 3 app (i.e. equivalent excel's sumproduct function). there method in rails , if not, rails code using custom sql? for example, hotel has many rooms. room has attributes of sqft (square feet), quantity (of size) , hotel_id. calculate total sqft of rooms in given hotel. in sql, hotel.id = 8, believe following statement work: select sum(rooms.sqft * rooms.quantity) sumsqft rooms inner join hotels on rooms.hotel_id = hotels.id hotels.id = 8; yep : room.where(hotel_id: 8).sum("sqft * quantity")

database design - how to do the relation in this case - items, articles, and locations? -

Image
i have table information of items, articles, can have in many locations. example, can have item in warehouse or in shop. have table shops information , other table information of warehouse. how best way relation itms location in can be? i think option have in table items 2 foreign keys, 1 shop , other warehouse. if have fk in shop, fk of warehouse must null. if in future item can in other locations, can add new field in items table. but when want show information, must check fk not null , show information of concrete location. if use view show information of items , main information of location, have many fields null because not location in item. but best way? there other options or correct way it? thanks. i think option have in table items 2 foreign keys, 1 shop , other warehouse. this legitimate solution should work fine when there few kinds of locations can link to. if there (or may in future) many kinds of locations, consider doing this: the symbol...

importing json file to mongodb -

i student doing undergrad in it. far have done data management using rdbms. have built few stand alone systems using java -jdbc - rdbms..after going through nosql concepts, use mongodb future project work.. have few questions..i reading mongodb documentation , learncrud operations. want choose decent dataset , import mongodb , kind of search operations , analytics..is there link demonstrates importing json data mongodb..? m totally new this? can please me? this doc on how insert data ( http://docs.mongodb.org/manual/core/create/ ), mongodb uses bson (which json more types support binary data). create database , create collection , insert data. there many language based libraries allow connect mongo , programmatic inserts collection.

image loading issue IE javascript -

i have requirement need populate image urls java , send screen list. in screen images not loading properly. i used img tag , src attribute display images. i used streaming through servlet since image repository not available outside intranet. our application internet application. created servlet through hit image , streaming it. in browser specified below in img src tag using java script display slides: https://kanagaraj.com/simpleservlet?imageurl=http://internalserver/repository/contentadmin/images/img1.jpg so, ie not displaying of images properly. it's not happening images. happens few images. i'm sorry sample url. but, cannot share url use. below code: var pic = new array();//from content web service service. <c:foreach items="${newsitemlist}" var="newsitem" varstatus="row"> pic[${row.count-1}] = '${newsitem.image}'; </c:foreach> (i = 0; < totalitems; i++) { preload[i] = new image(); //pre l...

python - Add a datafile type reader to paraview using pvpython -

i'm aware can add readers different datafile types paraview, however, talks doing bunch of vtk stuff in c++ , (maybe worse) re-compiling paraview make aware of datafile format. on other hand, paraview supports scripting in python . maybe lack of familiarity vtk, but, me looks can manipulate vtk objects pvpython. there way dynamically add reader paraview using pvpython? what want "python programmable filter. refer paraview wiki . wiki page shows how write csv reader in python.