Posts

Showing posts from August, 2010

Scheme (DrRacket) - Calling Generalized / Abstracted Function with Another Function -

for reference programming scheme using drracket. for problem making generalized / abstracted function (which aren't using higher-order functions and/or lambda) called tally-by of function tally-by-place-points defined below: (define listofcandidates (list "blake" "ash" "bob" "will" "joey")) ;; signature: tally-by-place-points: ;; list-of-candidates list-of-votes -> list-of-voting-tallies ;; purpose: consumes list of candidate names , list of votes , ;; produces list of voting-tallies. ;; (points-per-place strategy). ;; tests: (check-expect (tally-by-place-points empty empty) empty) (check-expect (tally-by-place-points listofcandidates listofvotes) (cons (make-voting-tally "blake" 7) (cons (make-voting-tally "ash" 3) (cons (make-voting-tally "bob" 5) (cons (make-voting-tally "will" 1

Spark - How to do summary statistics on SchemaRDD? -

i want calculate the summary statistics on log count per user , rdd used from: val filerdd = sc.textfile("s3n://<bucket>/project/20141215/log_type1/log_type1.*.gz") val jsonrdd = sqlcontext.jsonrdd(filerdd) rdd.registertemptable("log_type1") val result = sqlcontext.sql("select user_id, count(*) the_count log_type1 group user_id order the_count desc") how can apply statistics functionalities provided spark mllib on result ? since log count of each user important, have summary of following form: mean: 3.245 (user-id-abcdef) min: 1 (user-id-mmmnnnkkk) median: 15 (user-id-xyzrpg) max: 950 (user-id-123456789) how can can this? looks there's no maprdd in spark's api.

javascript - Issue with Bootstrap Footer -

Image
i using bootstrap app here . i want stick footer till bottom of page shown below above, footer doesn't come @ bottom of page. i have searched stackoverflow , tried number of solutions none resolves problem. please help try add following css .footer-v1{ position: absolute; width: 100%; bottom: 0px;}

c++ - Why function fun is not qualified for ADL? -

i have simple namespace , has 1 variable , 1 function. in main try call function without namespace qualifier, , variable namespace qualifier. namespace sam { int p = 10; void fun(int) { cout<<"fun gets called"; } } int main() { fun(sam::p);//why sam::fun not called? return 0; } i not able call fun, why not qualified adl (argument-dependant name lookup)? i getting following error in visual studio. 'fun': identifier not found if use sam::fun , works. adl adopted type , not variable , e.g. namespace sam { struct p {}; void fun(p) { cout<<"fun gets called"; } } int main() { sam::p p; fun(p); return 0; } in c++ programming language, argument-dependent lookup (adl), or argument-dependent name lookup, applies lookup of unqualified function name depending on types of arguments given function call. reference: argument-dependent name lookup

iphone - iOS taking login id from setting not from app login -

i facing problem while facebook post ios app. in ios there made 2 ways login 1st setting in iphone , other app. when post thing facebook through xcode @ time taking facebook login id settings facebook login not app login. i want facebook login id used in app login not setting. is there solution problem. if ar using uiactivity controller sharing, take setting login id, if need take app login may have implement own custom method sharing on facebook using, facebook sdk, you can refer below link implementing own share https://developers.facebook.com/docs/ios/share

javascript - Jquery not working while process dynamically -

the below code works me function gethotelsbydestination(dest_id) { $.ajax({ url: "controller/gethotels.php", datatype: "json", data: "id=" + dest_id, success: function(data) { $("#divid").html(""); $.each(data, function(index, item) { var val = item.id; var text = item.name; $("#divid").append( $('<option></option>').val(val).html(text) ); }) } }); } but when use below code not returns anything.divv id of dropdown passed php page function gethotelsbydestination(dest_id, divv) { var divdrp = "$('#" + divv + "')"; $.ajax({ url: "controller/gethotels.php", datatype: "json", data: "id=" + dest_id, success: f

gravity forms plugin - Icon should appear when button selected (via HTML) -

Image
currently when button selected, font goes "bold" , dot appears in spot. i'd make small icon (a tick) appear also/instead. or i'm open other ideas. i'm using gravityform. here site click here . i'm talking button next text "icon appear". here screenshot requirement: icon appear next button when has been selected/clicked. is there simple way html achieve this? use below code : label > img {display: none;} input[type=radio]:checked + label > img{display:inline-block;} for prevent global impact, use classes / ids accordingly like... #section label > img {display: none;} #section input[type=radio]:checked + label > img{display:inline-block;}

android - Updating Java and JRE are causing many errors in Eclipse -

i'm using eclipse program android applications, , when opened program yesterday, popped error saying need install jre - i've downloaded jre , installed - when during installation got message saying java version have on computer (version 7) old jre (version 8), , need update java also. did so, , opened eclipse again - , of projects,that before worked great, full errors. tried installing of sdk updates - didn't work, tried uninstalling eclipse , re-install - didn't work. the errors are: "xxx cannot resolved type" - in amost every single line in project. how fix it?? thank you!! android development tool(adt) install.. , update sdk , import old program.. ithink work.

node.js - How to get a date value from angularjs form -

html <div align="center" ng-controller="formctrl"> <form name="form" ng-submit="submitform()" novalidate> <input type="date" name="mydate" ng-model="mydate" value="mydate"/> </form> </div> javascript var app = angular.module('formexample', []); app.controller('formctrl', function ($scope, $http) { $scope.mydate = new date(); }); app.js app.post('/', function (req, res) { var jtime = req.body.mydate; console.log(jtime); }); here result(console.log) shows undefined. how date value angular js form. implement $scope.submitform function making ajax post request using $http.post : app.controller('formctrl', function ($scope, $http) { $scope.submitform = function() { $http.post('/', {mydate: $scope.mydate}); }; });

php - Relate to another table without using prefixes -

so have task of creating mobile version of existing website built different framework didnt started. the client wants use cakephp on it. im using cakephp 2.5.7. question is. there way relate table existing table without using prefixes? to make more clear have on controller public function index(){ $this->loadmodel('bulletin'); $bulletins = $this->bulletin->find('all'); } in model class bulletin extends appmodel{ var $usetable = 'bulletin'; var $hasmany = array( 'bulletincomment' => array( 'classname' => 'bulletincomment', 'foreignkey' => 'bulletinid', ), ); } but bulletincomment table on database has no prefix. , showing error on page error: table bulletincomments model bulletincomment not found in datasource default. i tried creating bulletincomment model this class bulletincomment extends appmodel{ var $uset

python - typeerror 'bytes' object is not callable -

my code: import psycopg2 import requests urllib.request import urlopen import urllib.parse uname = " **** " pwd = " ***** " resp = requests.get("https://api.flipkart.net/sellers/skus/skuid/listings", auth=(uname, pwd)) con_page = resp.content() print (con_page) i getting error: traceback (most recent call last): file "c:\users\prime\documents\netbeansprojects\fp_api\src\fp_api.py", line 18, in <module> con_page = resp.content() typeerror: 'bytes' object not callable based on documentation , return value of requests.get() requests.response , has content field type bytes , rather content() method. try instead: con_page = resp.content

arrays - Java-Write in file -

i want name, last name , spacial code user, , save in 1 array, after write file. code doesn't have compiler error doesn't work. public class writefile { public static void main(string[] args){ try { string array[][] = new string[100][2]; (int = 0; < array.length; i++) { randomaccessfile raf=new randomaccessfile("d://employee.txt","rw"); string inputname=joptionpane.showinputdialog("please insert first name"); array[i][0]=inputname; string inputlname=joptionpane.showinputdialog("please insert last name"); array[i][1]=inputlname; string inputmeliic=joptionpane.showinputdialog("please insert melii code"); array[i][2]=inputmeliic; raf.writeutf(array[i][0]); raf.writeutf(array[i][1]) ; raf.writeutf(array[i][1]); } } catch (filenotfoundexception e) { e.printstack

Using Underscore.js template within Knockout.js doesn't allow me to use "if" binding -

i want use unserscore.js template speed of code. referred following question. using underscore template knockout using interpolate due asp.net here working example link above, http://jsfiddle.net/6pstz/433/ however, once include "if" binding inside template, gives me error saying "this template engine not support 'if' binding within templates ". here example, http://jsfiddle.net/6pstz/488/ <script type="text/html" id="peoplelist"> {{ _.each(people(), function(person) { }} <li> <b data-bind="text: person.name"></b> {{= person.age }} years old </li> {{ }) }} <!-- if binding issue --> <!-- ko if : test --> <div data-bind="text:teststring">test</div> <!-- /ko --> </script> please check console if on chrome, there should error. guess need tweak "if" binding underscoretemplateengine

javascript - How to disable all items in select box when i am selecting 'ALL' item using select2 jquery -

i working in asp.net using select2 jquery. in select box have 10 items including 'all'. requirement when selected item , rest of items must disabled, when remove tag, whole item should enabled. http://ivaynberg.github.io/select2/ jquery written below. $(document).ready(function () { $("#select1").select2({ placeholder: 'find , select books' }).on("change", function (e) { alert(e.val) }); }); pls me???? html markup: <html xmlns="http://www.w3.org/1999/xhtml"> <head id="header1" runat="server"> <title>jquery select2 plug-in</title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script> <script type="text/javascript" src="d:/dotnet/its_google_chart_tabs_listbox/scripts/select2- 3.4.1/select2.js"></script> <link href="d:/do

python - opencv: camera calibration image not being displayed -

Image
so took bunch of pictures camera , have followed tutorial posted here: http://opencv-python-tutroals.readthedocs.org/en/latest/py_tutorials/py_calib3d/py_calibration/py_calibration.html but i've ran problem. i'm getting empty image drawchessboardcorners function , i'm not sure why. note new opencv , may trivial right can't figure out. i'm using opencv 2.4.10. code: import numpy np import cv2 # termination criteria criteria = (cv2.term_criteria_eps + cv2.term_criteria_max_iter, 30, 0.001) # prepare object points, (0,0,0), (1,0,0), (2,0,0) ....,(6,5,0) objp = np.zeros((6*7,3), np.float32) objp[:,:2] = np.mgrid[0:7,0:6].t.reshape(-1,2) # arrays store object points , image points images. objpoints = [] # 3d point in real world space imgpoints = [] # 2d points in image plane. in range (1,13): img = cv2.imread('calibrate/calibrate' + str(i) + '.jpg') gray = cv2.cvtcolor(img,cv2.color_bgr2gray) # find chess board corners ret,

python - Retrieve one month of data based on minutes granurality in MongoDB -

def getpacketlength(self,groupid,lasttime,tapid): pkt_collection = db['tap_pkts'] reqtime= [1417177485,1417177500,........,1414585185] total_sum=0 resultset=[{"$match":{"groupid":int(groupid), "$and":[{"first_time":{"$lte":reqtime}},{"time": {"$gte":reqtime}}], "tapid":int(tapid)}}, {'$group':{'_id':'','packetlength':{'$sum':'$pkt_length'}}}] sum_resultset=pkt_collection.aggregate(pipeline=resultset) return objective: i need retrieve 1 month data each 5 minutes time interval. i have timearray say, 2000 time intervals. timearray=[1417177485,1417177500,........,1414585185] from timearray each time must iterate , compare in db collection time in timearray must greater equal or less equal 'first_time' , 'time' fields in db.if condition statisfied sum 'p

Why isn't range getting exhausted in Python-3? -

if following: a = range(9) in a: print(i) # must exhausted in a: print(i) # starts over! python's generators, after raising stopiteration , stops looping. how range producing pattern - restarts after every iteration. as has been stated others, range not generator, sequence type (like list) makes iterable not same iterator . the differences between iterable , iterator , generator subtle (at least new python). an iterator provides __next__ method , can exhausted, raising stopiteration . an iterable object provides iterator on content. whenever __iter__ method called returns new iterator object, can (indirectly) iterate on multiple times. a generator function returns iterator , of cause can exhausted. also know is, for loop automaticly queries iterator of iterable . why can write for x in iterable: pass instead of for x in iterable.__iter__(): pass or for x in iter(iterable): pass . all of in documentation, imho difficult find. bes

Invalid SVN credentials eclipse -

ever since svn password changed couldn't make work in subclipse. after deleting keyring in home (i'm on ubuntu) can update , commit in console without problem, in eclipse asks me credentials, , when give them error : org.tigris.subversion.javahl.clientexception: svn: negotiate authentication failed: 'no valid credentials provided' how can credentials valid in console not in eclipse? can clean or something? what tried: reimporting projects after deleting them metadata deleting keyring in home deleting , reinstalling plugin switching svnkit

android - ImageView visibility Error with Timer -

package name.cpr; import android.view.view; import android.view.viewgroup; import android.widget.imageview; import java.util.timer; import java.util.timertask; public class exampleactivity extends actionbaractivity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_example); timer timer = new timer(); timer.schedule(new checkconnection(), 0, 3000); imageview iv = (imageview) findviewbyid(r.id.imageview); iv.setvisibility(view.visible); } class checkconnection extends timertask{ public void run(){ imageview iv = (imageview) findviewbyid(r.id.imageview); iv.setvisibility(view.invisible); //<- unfortunatly error here } } } starting app, first time image view visibility work timer not working, if timer started same error unfortunately .... has stopped you may want use android.os

vba - Filename of individual split files in PowerPoint -

there i have problem in ms powerpoint. working dozen files @ least 100 slides in each. need create individual slides individual files uploading purpose. got code split file individual slides. query how rename files automatically using vba code? each slide has title in text box, , shape , size of title text box consistent across decks. how ensure individual files created saved "title of slide" file name? as of now, file saved "original file name. n - n " would appreciate in this. following code found on internet split slide deck multiple individual files (one slide eaach, purpose): sub splitfile() dim lslidesperfile long dim ltotalslides long dim osourcepres presentation dim otargetpres presentation dim sfolder string dim sext string dim sbasename string dim lcounter long dim lpresentationscount long ' how many split dim x long dim lwindowstart long dim lwindowend long dim ssplitpresname str

Puppet install multiple packages using zypper command - packages names got concatenated -

i install multiple packages using command zypper puppet. created own repository , dumped bacula packages in there. manifest follows: #cat manifests/init.pp class bacula() { $baculas = [ "bacula-dir", "bacula-fd", "bacula-bat", "bacula-bconsole", "bacula- catalog-postgresql", "bacula-libs", "bacula-postgresql", "bacula-sd", "bacula-sql", "bacula-tools", "bacula-updatedb" ] package { $baculas: ensure => "installed" } exec { 'install_bacula': provider => shell, path => [ "/bin/", "/usr/bin", "/sbin" ], command => "/usr/bin/zypper -n in $baculas;", logoutput => on_failure, } } while packages got installed fine, there error in output. seems packages' names got concatenated , puppet returned error not being able find such lengthy package name. output below: # puppet agent --test info: caching c

scala - play framework: Modules were resolved with conflicting cross-version suffixes -

i want use elastic search play framework followed this guide here build.sbt file name := """es-with-play""" version := "1.0-snapshot" lazy val root = (project in file(".")).enableplugins(playscala) scalaversion := "2.11.1" librarydependencies ++= seq( jdbc, anorm, cache, ws, "com.clever-age" % "play2-elasticsearch" % "1.4-snapshot" ) resolvers += "sonatype oss snapshots" @ "https://oss.sonatype.org/content/repositories/snapshots" and in play console when compile code gives following errors [error] modules resolved conflicting cross-version suffixes in {file:/media/sara/new%20volume/programs/programs/play/es-with-play/}root: [error] com.jsuereth:scala-arm _2.11, _2.10 [error] com.typesafe.play:play-functional _2.11, _2.10 [error] com.typesafe.akka:akka-actor _2.11, _2.10 [error] com.typesafe.play:play-json _2.11, _2.10 [error] com.type

elasticsearch - Elastic search score discrepancy -

i have single record in elastic search cluster. has text "foo bar". when run following query on cluster, score comes out 0.11506979 : { "size" : 100, "query" : { "query_string" : { "query" : "foo bar" } } } however, when run following query (notice * after foo bar) on cluster, score comes out 0.9798734 { "size" : 100, "query" : { "query_string" : { "query" : "foo bar*" } } } why score more in case add * ? isn't there 1 document match? why score more in case add * ? the above * matches documents have fields matching wildcard expression (not analyzed). matches character sequence (including empty one) isn't there 1 document match? it depends on index analyzer, how indexing fields in given document. if using default analyzer es use standard analyzer. check how indexed

Matches of numbers into another array JAVA -

i have put integer matches in numbers of array , array, not have same position in array. example: have these 2 arrays of numbers: 4578 7539 it means have 1 number in same position (5), , number 7 in first array not in same position, case must increment 1 in integer. if in same position number 5, did this: int introducido = integer.parseint(numero.gettext()); (int = 0; < string.valueof(introducido).length(); i++) { int entero = integer.parseint("" + numero.gettext().charat(i)); string temp = integer.tostring(numaleatorio); int intarrnumeros = integer.parseint("" + temp.charat(i)); if (intarrnumeros == entero) { fijas++; } but don't know how if not in same position. upd working non-unique symbols in input strings try code pattern = "4578 "; string tofind = "7539"; int sameposition = 0; int notsameposition = 0; (int = 0; < tofind.length(); ++i) { char dig

android - Toolbar title full width -

Image
how/is possible make title span whole width of toolbar? text cut off menu items. ive tried playing around different xml attributes such paddingend , contentinsetright , titlemarginend no result. thanks! :) normally, title has fit between toolbar's menu & action items in order move title when toolbar collapsing. an easy way around put textview inside toolbar , set toolbar's background transparent. notice how i've set elevation linearlayout , disabled on toolbar (although shadow isn't visible in screenshot since running on kitkat device). <!-- app bar container --> <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/blue" android:elevation="2dp" android:orientation="vertical"> <!-- app bar --> <android.support.v7.widget.toolbar android:layout_width="match_parent"

sql - Checking conflicting data with SELECT and IF statements in a procedure -

i using select statement select conflicting treatments prescription table have , using if statement check selected data against data entering when running procedure. expect procedure disallow same client book conflicting treatments on same day. when run procedure getting error "exact fetch returns more requested number of rows". if run select statement on own, works explained above. here procedure: create or replace procedure fpresc ( fp_id varchar2, ftreat_id varchar2, fclient_id varchar2, fdoc_id varchar2, fp_date date) v_client_id prescription.client_id%type; v_conflict treatments.conflict%type; v_p_date prescription.p_date%type; v_treat_id treatments.treat_id%type; begin select p.client_id, t.conflict, p.p_date, t.treat_id v_client_id, v_conflict, v_p_date, v_treat_id prescription p, treatments t p.treat_id=t.treat_id , t.conflict not null; if fp_date = v_p_date , fclient_id = v_client_id , ftreat_id = v_treat

ember.js - Ember model find records without server request -

i have ember model category: export default ds.model.extend({ name: ds.attr('string'), img: ds.attr('string'), url: ds.attr('string'), cnt: ds.attr('number'), // parent_id: ds.belongsto('category', { // inverse: 'children', // async: true // }), parent_id: ds.attr('string'), // children: ds.hasmany('category', { // inverse: 'parent_id', // async: true // }), children: ds.attr(), isselected: false, isexpanded: false, haschildren: function() { return this.get('children').get('length') > 0; }.property('children').cacheable(), isleaf: function() { return this.get('children').get('length') == 0; }.property('children').cacheable() }); in index route have: export default ember.route.extend({ model: function() { var store = this.store; return ember.arrayproxy.create({ categories: store.find('

javascript - ReactJS returns parsererror SyntaxError: Unexpected token a after AJAX call to JAVA servlet -

i'm trying finish reactjs tutorial have error "parsererror syntaxerror: unexpected token a". i have java servlet , post methods, send response next json: "[{"author": "pete hunt", "text": "this 1 comment"}, {"author": "jordan walke", "text": "this comment"}]" also tried 1 {"author": "pete hunt", "text": "this 1 comment"}, {"author": "jordan walke", "text": "this comment"} i don't see problem. me looks missed in reactjs upd code servlet response. i'm using gson library. response.setcontenttype("application/json"); response.setcharacterencoding("utf-8"); modelobject obj = new modelobject(); obj.setauthor("pete hunt"); obj.settext("this 1 comment"); modelobject obj2 = new modelobject(); obj2.setauthor("jordan walke"); obj2.sett

oracle11g - Selective data archival and purging in Oracle 11g -

in application, use oracle 11g. have tables holding large amount of financial information grows on daily basis. our data categorized monthly data (basically monthly summary) , daily data (basically, daily holdings). our purge requirements ' in case of daily data, given month, retain current , previous day's data , purge rest '. month end data, retain data of last & last 1 business day of month. the challenge have tables of large size , have not been purged last couple of years due few issues. has slowed down application performance , hence want resume purge of tables. however, in few regions, archive data rather purge due legal restrictions. i guess partitioning might not work in case our purge requirements pretty specific. our purge programs done programatically via plsql procedures. best way efficiently perform purge / archival in case? purge frequency of once week suffice.

angularjs - Integrate Angular JS in Symfony2 -

i try integrate angularjs symfony2 having difficulty below find code of page base.html.twig , code of page app.js <html lang="fr" ng-app="routeapp"> <head> <meta charset="utf-8" /> <title> {% block title %} accueil ! {% endblock %} </title> {% block stylesheets %} <link rel="stylesheet" href="{{ asset('bundles/ardbackend/components/bootstrap/dist/css/base-admin.css') }}" type="text/css" /> <link href="{{ asset('bundles/ardbackend/components/bootstrap/dist/css/bootstrap.min.css') }}" rel="stylesheet" type="text/css"/> <link href="{{ asset('bundles/ardbackend/components/bootstrap/dist/css/bootstrap-responsive.min.css') }}" rel="stylesheet" type="text/css"/> <link rel="icon" type="image/x-icon"

java - How to rewrite absolute paths when using play as proxy server? -

i trying use play (java - 2.3) proxy server publicly expose content internal http server. so far managed of content want show unfortunately of stylesheets , scripts referenced using absolute paths and, of course, 404. is there workaround or should ask other devs change paths these files? my routes file looks this: get /proxy/*path controllers.gateway.testproxy.index(path) and forward content using method: public static promise<result> index(string path) { final promise<result> resultpromise = ws.url("http://10.1.0.10:18406/"+path).get().map( new function<wsresponse, result>() { public result apply(wsresponse response) { response().setcontenttype("text/html"); return ok(response.getbody()); } } ); return resultpromise; } edit: have scripts , stylesheets: <link rel="stylesheet" type=

python - Django MongoEngine/REST Framework ListFields -

i need store list of numbers within mongo db field , present via rest framework. so far (for other fields) working need figure out list there no direct option django orm. serializes class tyre(serializers.serializer): enabled = serializers.listfield() tyre_pressure = serializers.integerfield() models from mongoengine import * class tyre(embeddeddocument): enabled = listfield() <----- issue... tyre_pressure = intfield() any ideas ? the reason couldnt use feild version of rest 2.6. once upgraded 3.0 , used following. worked expected. enabled = serializers.listfield( child=serializers.integerfield(min_value=0, max_value=4096) )

c - In PHP, how to measure the time a request spent utilizing hard disk? -

is there way measure amount/length of time web request spends doing i/o ? by that, mean actual amount of time current thread (or it's delegation) has spent utilizing hardware. as measuring cpu time , there's function getrusage() it: <?php $a = getrusage(); f(); $b = getrusage(); $sec = ($b['ru_utime.tv_sec'] - $a['ru_utime.tv_sec']) + ($b['ru_stime.tv_sec'] - $a['ru_stime.tv_sec']); echo 'it took ~' . $sec . 's of cpu time.'; function f(){ for($x=0;$x<120000000;++$x){ // busy loop } } is there such function measuring i/o? sample usage of said function: <?php $credits_remaining = 8500; $a = time_spent_on_hard_disk_so_far(); get_file_from_hard_disk($credits_remaining); // limit request $credits_remaining number of seconds $b = time_spent_on_hard_disk_so_far(); $time_spent = $b - $a; echo "time spent on hard disk: ", $time_spent; $credits_remaining -= $time_spent; (a c sol

Permutation of string, Haskell -

this question exact duplicate of: permutations 1 symbol back, haskell [closed] 1 answer i have given string: abcdpqrs, output be: badcqpsr. my current code: f :: [a] -> [a] f (a:b:xs) = b:a:xs f xs = xs evaluating f "abcdpqrs" results in "bacdpqrs" . how can used "badcqpsr"? try processing more first 2 characters recursing on remainder of list: f :: [a] -> [a] f (a:b:xs) = b:a:f xs f xs = xs

sql - Is it possible to look up a table-valued function's return columns in SAP HANA's dictionary views? -

i've created table-valued function in sap hana: create function f_tables returns table ( column_value integer ) language sqlscript begin return select 1 column_value sys.dummy; end now i'd able discover function's table type using dictionary views. can run query here: select * function_parameters schema_name = '[xxxxxxxxxx]' , function_name = 'f_tables' order function_name, position; which yield like: parameter_name table_type_schema table_type_name --------------------------------------------------------------------- _sys_ss2_return_var_ [xxxxxxxxxx] _sys_ss_tbl_[yyyyyyy]_ret unfortunately, cannot seem able _sys_ss_tbl_[yyyyyyy]_ret table in sys.tables (and table_columns ), sys.views (and view_columns ), sys.data_types , etc. in order find definitions of individual columns. note explicitly named table types created using create type ... appear in sys.tables ... is there way me formally table-valued fun

How to unzip a file in windows phone (using Visual Studio Apache Cordova Community) -

i need download , unzip file in app, download using file transfer plugin, can not find plugin unzip file, there plugin supports ios , android not windows phone ... is possible achieve this? sorry not available @ time (i've looked!) solution download each file individually instead of wrapping them zip. better solution create own plugin can work windows. for android , ios, plugin works (tested) https://github.com/mobilechromeapps/cordova-plugin-zip if you're using cordova project can go config.xml , via plugins tab -> custom -> paste link. if can't way use command line add. cordova plugin add https://github.com/mobilechromeapps/cordova-plugin-zip

php - Characters in MySQL insert ID -

im kind of new mysql , php here go! at moment $inserted_claim_id returns 1,2,3 etc. want have own personal reference number before numbers; ie; acl0123 what have this; createclaimref($inserted_client_id,$claim_type_code,$claim_type_id); $inserted_claim_id=mysql_insert_id(); any obliged, regards andrew

Android Lollipop: Launcher crashes when adding app widget to Home Screen -

the launcher crashes on android lollipop when adding widget giving following message (it works fine on previous android versions): edit: happens in landscape orientation. 12-16 12:35:10.208: e/androidruntime(960): java.lang.runtimeexception: unable resume activity {com.android.launcher/com.android.launcher2.launcher}: java.lang.runtimeexception: failure delivering result resultinfo{who=null, request=5, result=-1, data=intent { (has extras) }} activity {com.android.launcher/com.android.launcher2.launcher}: java.lang.nullpointerexception: attempt read field 'android.content.pm.activityinfo android.appwidget.appwidgetproviderinfo.providerinfo' on null object reference 12-16 12:35:10.208: e/androidruntime(960): @ android.appwidget.appwidgethostview.getremotecontext(appwidgethostview.java:465) 12-16 12:35:10.208: e/androidruntime(960): @ android.appwidget.appwidgethostview.updateappwidget(appwidgethostview.java:376) 12-16 12:35:10.208: e/androidruntime(960)

properties - list @property decorated methods in a python class -

is possible obtain list of @property decorated methods in class? if how? example: class myclass(object): @property def foo(self): pass @property def bar(self): pass how obtain ['foo', 'bar'] class? anything decorated property leaves dedicated object in class namespace. @ __dict__ of class, or use vars() function obtain same, , value instance of property type match: [name name, value in vars(myclass).items() if isinstance(value, property)] demo: >>> class myclass(object): ... @property ... def foo(self): ... pass ... @property ... def bar(self): ... pass ... >>> vars(myclass) dict_proxy({'__module__': '__main__', 'bar': <property object @ 0x1006620a8>, '__dict__': <attribute '__dict__' of 'myclass' objects>, 'foo': <property object @ 0x100662050>, '__weakref__': <attribute &#

ajax - Drag and drop is not working using correctly using jquery -

i doing stuff using jquery. want drag element id draggable in id drop . at time of drop want append div divs class droppable2 . case drag drop elements in same page working fine. requirement drag element in index.php , drop element in data.php . in situation dragging working, div appending not working. i have pages: index.php , ajaximage.php , , data.php . don't include code ajaximage.php , data.php pages here, php code. work upload excel databse , display it. index.php <script type="text/javascript" src="scripts/jquery.min.js"></script> <script type="text/javascript" src="scripts/jquery.form.js"></script> <script src="//code.jquery.com/ui/1.11.2/jquery-ui.js"></script> <link rel="stylesheet" href="//code.jquery.com/ui/1.11.2/themes/smoothness/jquery-ui.css"> <script type="text/javascript" > $(document).ready(function () { $(

Prevent bootstrap navbar-inverse toggle pushing contents -

possible dublicate i want prevent bootstrap navbar-inverse toggle pushing contents in mobile view. tried several tricks like: $('.navbar-collapse').on('shown.bs.collapse', function() { $('.navbar').addclass("navbar-fixed-top"); }); $('.navbar-collapse').on('hidden.bs.collapse', function() { $('.navbar').removeclass("navbar-fixed-top"); }); or $('.navbar-collapse').on('shown.bs.collapse', function() { $('.navbar').css({'position':'absolute'}); }); $('.navbar-collapse').on('hidden.bs.collapse', function() { $('.navbar').css({'position':'relative'}); }); but either deforming page or navbar itself. don't want use fixed top navbar because of page design. asking workaround suggestions?

c# - In visual studio, how to automatically input the latter half part of an object? -

for example, person p = new person(); have type letter 1 one, or select word 1 one (by intellisense), know can make new person() automatically come after input person p , how it? ps, intellisense on in computer. sorry previous description, can select "new" or "person" intellisense, system doesnot show "new person()" together. curious is, after type "person p" or "person p =", "new person();" can automatically come the functionality mean "intellisense". default should able hit ctrl + space after typing first letters of command or variable name open dropdownmenu possible matches. select correct entry , continue pressing "tab".

wpf - Merging dictionaries into multiple user controls - does this affect memory? -

i have ui project containing (so far) 18 xaml resources, merged app.xaml so:- <application ...> <application.resources> <resourcedictionary> <resourcedictionary.mergeddictionaries> <resourcedictionary source="pack://application:,,,/foo.client.common;component/uistyles/colours.xaml" /> <resourcedictionary source="pack://application:,,,/foo.client.common;component/uistyles/buttons.xaml" /> <resourcedictionary source="pack://application:,,,/foo.client.common;component/uistyles/menus.xaml" /> // etc.. </resourcedictionary.mergeddictionaries> </resourcedictionary> </application.resources> </application> when edit of xaml views in project intellisense (resharper) on style names contained in these resources. now, application implements "plug-in" architecture, , there several cla

android - OpenGL ES 3.0 half float (R16F) textures -

can answer me how come line: gles30.glteximage2d(gles30.gl_texture_2d, 0, gles30.gl_r16f, width, height, 0, gles30.gl_red, gles30.gl_half_float, mybuffer); works on tegra4 doesn't work on arm mali-t628 mp6? i not attaching framebuffer way, using read texture. code returned on arm 1280 tegra 'doesn't complain' @ all. also, know tegra4 got extension half float textures, , specific mali doesn't have extension, since it's opengl es 3.0, shouldn't support such textures? that call looks valid me. error 1280 gl_invalid_enum , suggests 1 of 3 enum type arguments invalid. each 1 itself, combination of them, spec compliant. the explanation driver bug. found several es 3.0 drivers have numerous issues, it's not big surprise discover problems. the section below written under assumption texture used render target (fbo attachment). please ignore if looking direct answer question. gl_r16f not color-renderable in standard es 3.0. if p

javascript - Can we customize facebook likebox? -

Image
i trying customize number of feeds , auto scroll functionality in facebook likebox using below code. <div id="fb-root"></div><script>(function(d, s, id) {var js, fjs = d.getelementsbytagname(s)[0];if (d.getelementbyid(id)) return;js = d.createelement(s); js.id = id;js.src="//connect.facebook.net/en_in/sdk.js#xfbml=1&appid=453991991316939&version=v2.0";fjs.parentnode.insertbefore(js, fjs);}(document, 'script', 'facebook-jssdk'));</script> have tried multiple canvas resize methods given in multiple websites getting stuck. ideas? how can customize or great if have created plugin this? you need copy given below css code facebook box code , paste in page. need changee url in iframe *************** facebook url. <style type="text/css"> .f-bookmain { background-color:#e1e1e1; width:320px; border:1px solid #bcbcbc; padding:15px 0 15px 15px; h

regex - php get all matches string in text after "@" character -

i have function want set text return match string text : function get_matches(){ $string = "@text1 @text2 text here #text3 #text4 @text5 "; // set test string. // set regex. $regex = 'what regex here'; // run regex preg_match_all. preg_match_all($regex, $string, $matches); // dump resulst testing. echo '<pre>'; print_r($matches); echo '</pre>'; } the result : array( [0] => array ( [0] => text1 [1] => text2 [2] => text5 )) how can write appropriate regex right result. this regex should work you: $regex = '/@(\s+)/'; output: array ( [0] => array ( [0] => @text1 [1] => @text2 [2] => @text4 [3] => @text5 ) [1] => array ( [0] => text1 [1] => text2 [2] => text4 [3] => t

javascript - How to Convert Milliseconds to Date in JS? -

my scenario convert data of milliseconds date format. have tried lot here http://jsbin.com/jeququ/1/ working limited milliseconds value, , fails if value high. looking replicate functionality http://www.ruddwire.com/handy-code/date-to-millisecond-calculators/#.vjap9lwue1r milliseconds since : thu jan 01 1970 05:30:00 gmt+0530 this should work: var d = new date(milliseconds);

java - Identify dynamically added views for OnclickListener -

i have problem programming android: i adding textviews layout dynamically reading out data out of arraylist. got different textviews on layout. want set onclicklistener each of them , start different activities onclicklistener depending on textview clicked. problem don't know how identify textviews. add them like: while(i<list.size()) { string name = list.get(i).getname(); textview txtviewname = new textview(this); txtviewname.settext(name); layout.add(txtviewname); i++; } everything works, how can set onclicklistener each txtview , how identify them? thanks help! the easiest way set onclicklistener anonymous inner class inside loop, , whatever's appropriate view: final int viewnum = i; txtviewname.setonclicklistener(new onclicklistener() { @override public void onclick(view view) { toast.maketext(mainactivity.this, "you clicked on view "+viewnum, toast.length_short).show(); } }); this exampl

c++ - Overriding template methods -

i'm trying override template method. here minimal example: #include <iostream> class base { public: template <typename t> void print(t var) { std::cout << "this generic place holder!\n"; } }; class a: public base { public: template <typename t> void print(t var) { std::cout << "this printing " << var << "\n"; } }; class b: public base { public: template <typename t> void print(t var) { std::cout << "this b printing " << var << "\n"; } }; int main() { base * base[2]; base[1] = new a; base[2] = new b; base[1]->print(5); base[2]->print(5); delete base[1]; delete base[2]; return 0; } the output in both cases this generic place holder! how can achieve methods of derived classes called? if method not template, define virtual , work expected (alrea

ios - Objective-C: blocks and ARC -

i have created utility class uialerts. using blocks my code, user should create, looks this: myalertmessage * = [[myalertmessage alloc] initwithtitle:@"hello" withmessage:@"world"]; [a addbutton:button_ok withtitle:@"ok" withaction:^(void *action) { nslog(@"button ok @ index 0 click"); }]; [a addbutton:button_cancel withtitle:@"cancel" withaction:^(void *action) { nslog(@"button cancel @ index 1 click"); }]; [a show] full class can seen here: https://github.com/martinperry/uialert now, if this, after [a show] arc destroys class, blocks no longer working , gives me error. have solved creating singleton class holds reference created myalertmessage (message ads , destroys manager). correct solution or should done better, without singleton manager? manager , appropriate class can found here: https://github.com/martinperry/uialert/blob/master/uialert/myalertmessage.m the example code posted

Spring AMQP publisher confirms in a amqp outbound gateway -

i using spring amqp publishing messages rabbitmq using outbound gateway. have set publisher confirms on connection factory , added custom callback listener. the problem correlationdata null , can't add correlation data on outbound gateway. applicable outbound channel adapter. for outbound gateway publisher confirms work? edit configuration below. looked through si code , yes, publisher confirms, enabled. problem when receive nack? because of outbound gateway don't need correlation id handle response, there thread listening on temporary reply queue response. what point of using publisher confirms outbound gateway? if no response coming or rabbit nodes go down encounter exceptions. there scenario when lose messages? <rabbit:connection-factory id="rabbitconnectionfactory" host="someip" port="5672" username="username" password