Posts

Showing posts from June, 2013

android - How to stop layout from taking all width -

Image
i have activity , need stop filling width of textview , button. these shown in centre filling width. how stop , make width fixed? please see layout below. <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="1280dp" android:layout_height="match_parent" android:gravity="center_vertical|center_horizontal" android:paddingbottom="@dimen/activity_vertical_margin" android:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margin" android:paddingtop="@dimen/activity_vertical_margin" tools:context=".login" > <textview android:id="@+id/lblusername" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparent...

vb.net - randomising operators visual basic -

i want program (visual basic) randomly select times (*) or divide (/) , used operator in equation later in program. haven't started declaration of variables. thanks. you didn't provide code there can many solutions. have 2 operators, think best way go use conditions. basics use random class, , if or case . the code can this: function dosomeoperation(byval double, byval b double, optional byref op string = "") double dim rnd new random() select case rnd.next(0, 2) case 1 op = "/" return / b case else op = "*" return * b end select end function this code return operation result, , optionally operation used in op parameter. rnd.next(0, 2) statement returns either 0 or 1 (because maxvalue 2 , exclusive upper bound). *in real life should check result doesn't exceed double limits, , try..catch . example of function use in console app: dim d...

php - Most efficient way of getting first payment method used by all users -

lets have table in mssql database called "customers". have table called "orders", each of contains "customerid". want do, generate summary of payment method (let's call "paymentmethod") used first "order" of every "customer". the method have been using conduct customer selection query... select <columns> customers <where> ...and each result, conduct separate query obtain customer's first order's payment method: select top 1 paymentmethod orders order timestamp asc this process has benefit of obtaining data want in simple way that's easy modify, huge disadvantage of meaning query carried out every customer, mean tens-of-thousands of queries every single time! is there more efficient way of doing i'm not thinking of? i'm racking brain think of way of selecting directly "orders" table begin with, requirement query not group "customerid" fetch min() of ...

objective c - Not editable NSTextfiled, to make it auto resize when string is too long, like english word to French -

as question being posted, in textfield, when open app in english, works well, when switching french, know french word quite long , in case, words showing in textfield cut off. i tried customised way textfield on stack overflow, works editable textfield, when made none-editable, behaviour wired. it's when word long, make textfield longer, meaning increase width, not height. i'm expecting keeping width fix while changing height when word long. intrinsicsize = [super intrinsiccontentsize]; nstextview *textview = (nstextview *)fieldeditor; nsrect usedrect = [textview.textcontainer.layoutmanager usedrectfortextcontainer:textview.textcontainer]; kind of 2 main func used, when it's editable, went , height changes while width fix, when it's none editable, width changes. any advice? in nstextfield subclass override following methods. make sure nstextfield set wrap in ib. add constraints it. -(nssize)intrinsiccontentsize { // if wrap not e...

c++ - Including calib3d gives many compilation errors -

i trying use cv::rodrigues function in order rotation matrix given vector of angles. i have these includes in program: #include "opencv2/video/tracking.hpp" #include "opencv2/imgproc/imgproc.hpp" #include "opencv2/videoio/videoio.hpp" #include "opencv2/highgui/highgui.hpp" #include "opencv2/core.hpp" without adding #include "opencv2/calib3d.hpp" compiles fine. when add in order able use cv::rodrigues compilation fails many errors. i won't add whole error log because long , useless. starts this: <command-line>:0:9: error: expected identifier before numeric constant <command-line>:0:9: error: expected '}' before numeric constant <command-line>:0:9: error: expected unqualified-id before numeric constant and after have many error such : /usr/local/include/opencv2/features2d.hpp:1106:69: error: expected primary-expression before 'int' const s...

lisp - with hunchentoot I cannot generate web pages -

i learning common lisp , trying use hunchentoot develop web apps. with code below cannot manage see page defined in retro-games function definition on browser. expect generated function. i write address as: http://localhost:8080/retro-games.htm. what displayed on browser resource /retro-games.htm not found , message , lisp logo @ default page, display. can display hunchentoot's default page. (ql:quickload "hunchentoot") (ql:quickload "cl-who") (defpackage :retro-games (:use :cl :cl-who :hunchentoot)) (in-package :retro-games);i evaluate toplevel otherwise not change package. (start (make-instance 'hunchentoot:acceptor :port 8080)) (defun retro-games () (with-html-output (*standard-output* nil :prologue t) (:html (:body "not there")) (values))) (push (create-prefix-dispatcher "/retro-games.htm" 'retro-games) *dispatch-table*) the 2 loadings @ beginning successful. what missing? hunchento...

python - Syntax error on line containing if statement -

i keep trying make simple guess number game python keeps saying code has syntax error. doing wrong? import random takeone = input("guess number between 1 & 5") numberinit = random.randint(1,5) if "takeone" == "numberinit" print("your right") else: print("your wrong") the syntax error you're getting following: file "test.py", line 4 if "takeone" == "numberinit" ^ syntaxerror: invalid syntax this means you're missing colon @ end of if line. line should instead read: if "takeone" == "numberinit":

c# - Compute Superset of Sequences -

given number of sequences need compute superset "containing input sequences". the result must minimum in length , order of input elements must not changed. items of input must not kept together. a comparison provided determine precedence of symbol / element when needed during computation. curious particular problem called in number theory. preferably i'd solve making use of .net types , ienumerable extensions. example comparison based on alphabet: abc, abc -> abc abc, abd -> abcd abcd, bcd, acd, acb -> abcdb abcd, ebcd -> aebcd my approach far, not slving last 1 (abcd, ebcd) namespace ra.essentials { using system; using system.collections.generic; using system.linq; public static class sequencereductionextensions { public static ienumerable<t> reduce<t>(this ienumerable<ienumerable<t>> input) { return input.reduce(comparer<t>.default.compare); } public static...

promise - Preventing Multiple http calls -

i have function calls backend service , data , display in ui. using angular, , function in controller calling html. everytime html gets updated making network call. i tried add controller level variable check if call in progress if yes return promise or otherwise call again. prevent same calls repeating before first call not finished. is there other way can handle across project.becuase method have, have write individual functions my current code follows var getdatapromise; function getdata() { if (getdatapromise) return getdatapromise; getdatapromise = $http.get('url').then((response) => { return response; }).finally(() => { getdatapromise = null; }) return getdatapromise; } i want prevent overlapping network calls. becuase data in server can change time time. one way of preventing multiple http calls cancel previous http call , can this: test.service('testservice', function ($http,$q) { var can...

Get server status with PHP or Javascript? -

i have been trying working server status script work without success. there's community runs 1 themself looks cool , wondering if me out? https://lemonpunch.net/servers/ i've looked on stackoverflow website seems of them doesn't work. my current code: <!doctype html> <html> <head> <title>server status</title> <link type="text/css" rel="stylesheet" href="assets/styles/odometer-theme-default.css"/> <link type="text/css" rel="stylesheet" href="assets/styles/app.css"/> <script type="text/javascript"> var initial = true; var servers = []; servers.push({ id: 1, status: "down", loaded: false, maxplayers: 0, playerlist: [] }); servers.push({ ...

c# - search csv file in a folder and insert in mysql database -

i'm trying parse files in directory/insert in mysql database based on post , pretty working except csv values each column being rounded , become int values in database. assume need change decimal else, couldn't figure out. (ex: 1.11 becomes 1, 45.5 becomes 46) csv file: test1,test2,test3,test4 1.11,1.23,67.4,4.5 1.12,5.42,45.5,6.45 my code: public void sqltest() { string connectionstring = "server=localhost;database=test;userid=root;password=test;"; using (mysqlconnection connection = new mysqlconnection(connectionstring)) { connection.open(); using (mysqlcommand cmd = connection.createcommand()) { cmd.commandtext = @"drop table test if exists"; cmd.commandtext = @"create table test ( id int unsigned not null auto_increment primary key, test1 decimal, ...

javascript - How to generate a input tag above a button -

i have input tag , link button. want click in button , generate input tag , other link button delete , click in delete button delete input tag. when click on button generate input tag under button. want generate input tag above button. how can that? $(document).ready(function() { var max_fields = 10; //maximum input boxes allowed var wrapper = $(".input_fields_wrap"); //fields wrapper var add_button = $(".add_field_button"); //add button id var x = 1; //initlal text box count $(add_button).click(function(e) { //on add input button click e.preventdefault(); if (x < max_fields) { //max input box allowed x++; //text box increment $(wrapper).append('<div><input type="text" name="mytext[]"/><a href="#" class="remove_field">remove</a></div>'); //add input box } }); $(wrapper).on("click", ".remove_field", funct...

How to change the background of Android Alert Dialog Title -

Image
i want change background of alert dialog. have tried following code piece so: <style name="theme.alertdialog" parent="@android:style/theme.holo.light.dialog"> <item name="android:background">@android:color/transparent</item> <item name="android:textcolor">#659f26</item> <item name="android:windowtitlestyle">@style/theme.alertdialog.title</item> </style> <style name="theme.alertdialog.title" parent="@android:style/textappearance.dialogwindowtitle"> <item name="android:background">@drawable/cab_background_top_example</item> </style> java code: contextthemewrapper ctw = new contextthemewrapper( this, r.style.theme_alertdialog); final alertdialog.builder alertdialogbuilder = new alertdialog.builder(ctw); alertdialogbuilder.settitle(getresources().getstring(r.string.confirmation)); ...

wso2 - Can we get Class return Property in Proxy sequence -

i written custom mediator , working fine passing values class mediator using insequence this <?xml version="1.0" encoding="utf-8"?> <proxy xmlns="http://ws.apache.org/ns/synapse" name="treadingmobile_5" transports="https http" startonload="true" trace="disable"> <description/> <target> <insequence onerror="fault"> <property name="force_error_on_soap_fault" value="true"/> <property name="reading" expression="//readings" scope="default" type="string"/> <property name="actiondetailid" expression="//actiondetailid/text()" scope="default" type="string"/> <property name=...

How to Install mongodb on fedora 23 -

Image
my system configuration based on attached image file.please me out install orelse need write entire configuration ?? create /etc/yum.repos.d/mongodb-org-3.2.repo file can install mongodb directly, using yum. use following repository file: [mongodb-org-3.2] name=mongodb repository baseurl= https://repo.mongodb.org/yum/redhat/ $releasever/mongodb-org/3.2/x86_64/ gpgcheck=1 enabled=1 gpgkey= https://www.mongodb.org/static/pgp/server-3.2.asc sudo yum install -y mongodb-org reference: mongodb docs installing mongodb

mysql5 - Moving MySQL data to another drive -

i want move data in c:\programdata\mysql\mysql server 5.5\data e:\mysql5data stopped mysql5 service changed "datadir" value in my.ini file e:/mysql5data started mysql5 service i got 1067 process terminated unexpectedly error while starting mysql. update: logs 160509 13:18:56 [warning] can't create test file c:\program files\mysql\mysql server 5.5\data\dgnlwebbip01.lower-test 160509 13:18:56 [warning] can't create test file c:\program files\mysql\mysql server 5.5\data\dgnlwebbip01.lower-test 160509 13:18:56 [note] plugin 'federated' disabled. 160509 13:18:56 innodb: innodb memory heap disabled 160509 13:18:56 innodb: mutexes , rw_locks use windows interlocked functions 160509 13:18:56 innodb: compressed tables use zlib 1.2.3 160509 13:18:56 innodb: initializing buffer pool, size = 128.0m 160509 13:18:56 innodb: completed initialization of buffer pool 160509 13:18:56 innodb: operating system error number 5 in file operation. innodb: error ...

node.js - Amazon SQS with aws-sdk receiveMessage Stall -

i'm using aws-sdk node module (as far can tell) approved way poll messages. which sums to: sqs.receivemessage({ queueurl: queueurl, maxnumberofmessages: 10, waittimeseconds: 20 }, function(err, data) { if (err) { logger.fatal('error on message recieve'); logger.fatal(err); } else { // if (undefined === data.messages) { logger.info('no messages object'); } else if (data.messages.length > 0) { logger.info('messages count: ' + data.messages.length); var delete_batch = new array(); (var x=0;x<data.messages.length;x++) { // process receivemessage(data.messages[x]); // flag delete var pck = new array(); ...

android - Fragment.getView() always return null -

i add 2 fragments viewpager in mainactivity dynamically,while i'm trying sub view of fragments, fragment.getview() return null, how can solve problem? in advance. mlinearlayout= (linearlayout)fragments.get(0).getview().findviewbyid(r.id.linear_layout); mrelativelayout= (relativelayout) fragments.get(1).getview().findviewbyid(r.id.relative_layout); if you, use fragments' oncreateview() bind views, let parent activity know views through interface in onactivitycreated() . your interface like public interface viewinterface { void onlinearlayoutcreated(linearlayout layout); void onrelativelayoutcreated(relativelayout layout); } and in each fragment public view oncreateview (layoutinflater inflater, viewgroup container, bundle savedinstancestate) { viewgroup layout = (viewgroup) inflater.inflate(r.layout.fragment_layout, inflater, false); mlinearlayout = layout.findviewbyid(r.id.linear_layout); ... return layout; } ... public void onactivity...

node.js - Node JS Dust wont render new line -

i have file config.js contains key - value pairs of text. file inserted html key. example: somekey : 'this text' this dust helper inserts text html: dust.helpers.translate = function(chunk, context, bodies, params) { chunk = config[params.key]; return chunk; }; i want able insert new line not working. example: somekey: 'this \ntext' any ideas? you can either set config flag stop dust suppressing whitespace: dust.config.whitespace = true or, can insert newline pragma in template: {~n} since using helper , inserting raw text, want first one.

javascript - How to Change color of KML polygon on mouse click -

i have kml file lots of polygon drawn , want change color of polygon on mouse click looking polygon selected. problem: loaded kml file not able polygon can implemented click listener. you can use afterparse attribute give callback , assign event handler there <body onload="initialize()"> <div id="map_canvas" ></div> </body> <script> function initialize(){ mylatlng = new google.maps.latlng(-34.397, 150.644); var myoptions = { zoom: 18, center: new google.maps.latlng(-34.397, 150.644), // zoom: 5, // center: mylatlng, maptypeid: google.maps.maptypeid.hybrid }; map = new google.maps.map(document.getelementbyid("map_canvas"), myoptions); geoxml = new geoxml3.parser({ map: map, singleinfowindow: true, afterparse: myfunction }); geoxml.parse('bs-stadium.kml'); } function myfunction...

python - time.clock() doesn't return time properly -

this code: import time = time.clock() while + 5 > time.clock(): print time.clock() time.sleep(1) print "woke up" returns: 0.015718 woke 0.015814 woke 0.015942 woke 0.016107 woke 0.01625 woke 0.016363 as can see, time returned not seem return elapsed time seconds represented integers, though documentation says should do. wrong here? edit: i'm on mac os x el capitan you should read manual: on unix, return current processor time floating point number expressed in seconds. precision, , in fact definition of meaning of “processor time”, depends on of c function of same name, in case, function use benchmarking python or timing algorithms. on windows, function returns wall-clock seconds elapsed since first call function, floating point number, based on win32 function queryperformancecounter(). resolution typically better 1 microsecond. that assuming you're using unix (fx linux or ios) behaviour correct. time.clock returns amo...

javascript - CSS conflict Liferay -

i have css conflict when load 2 portlets in same liferay page. conflict appears when 2 portlets cointain same namespace in css files. for example if: mycss.css of portlet is: #legend { width: 150px; height: 150px; bottom: 160px; position: relative; } and mycss.css of portlet b is: #legend { width: 150px; height: 150px; bottom: 30px right: 5px; position: absolute; } if portlet alone in page loads mycss.css instead if there portlet b reads css of second portlet. happenes portlet has element without css , portlet b have element same namespace of portlet css. in case portlet read css file of portlet b. i load css in view.jsp of 2 portlets with: <script src="<%=request.getcontextpath()%>/css/mycss.css"></script> or in 2 different liferay-portlet.xml: <header-portlet-css>/css/mycss.css</header-portlet-css> i have same problem js file. p.s. 2 portlets imported netbeans thank you ...

Removing url params using regex -

i have problem removing params url starting on ":". have example path like: /foo/:some_id/bar/:id i archive following result: /foo/bar i tried create regex. figured out this: \/:.*?\/ but 1 removes :some_id still leaves :id part. can tell me how can modify regex remove params? your regex requires / present @ end. cannot remove / regex since .*? won't match then. use negated character class : \/:[^\/]+ see regex demo pattern details : \/: - matches literal /: [^\/]+ - matches 1+ characters other / [^...] defines negated character class matching characters defined in class.

How to use webrtc-adapter (adapter.js) shim in Webpack? -

i have commonjs browser application (typescript) use webpack bundle. uses webrtc want use webrtc-adapter package npm . package adapter.js makes working webrtc between firefox & chrome easier. inside modules want able access modified navigator item. example, can call: navigator.mediadevices.getusermedia i can work if require package , use variable somewhere in module so: var webrtc = require("webrtc-adapter"); // somewhere in module console.log(webrtc.browserdetails); however, don't need access browserdetails or of exposed items webrtc-adapter, want use shimmed calls on navigator object. i've tried using webpack.provideplugin , externals both still require use object somewhere. is there way can load shimmed navigator each module without having require , use variable somewhere in modules? know can use external in config , load via separate script tag i'd prefer have webpack bundle together. have tried requiring this? require('webr...

java - How to display file in Spring-Controller -

i having issue. first time doing this. have generated random number program using spring rest controller , display in jsp. now tried mapped html file showing getting in jsp. face error no mapping found http request uri and have tried various sites not understanding wrong in that here have highchart in html , refreshing page after every 5 seconds. so, taking value server y-axis , time plotted on x-axis. stuck in ajax call html file. not able figure out how take 1 axis value server , other axis value time. i pasting code here--- my controller- package com.xyz.rest.temperature.controller; import org.springframework.web.bind.annotation.requestmapping; import org.springframework.web.bind.annotation.requestmethod; import org.springframework.web.bind.annotation.restcontroller; import com.lucid.rest.temperature.exception.invalidrangeexception; import com.lucid.rest.temperature.exception.negativenumberexception; import com.lucid.rest.temperature.util.randomnumbergenerator; @r...

asp.net - Safari on Windows cannot open aspx page -

i have aspx login page opens fine on localhost . same page doesn't open when on internet, using safari browser on windows , getting below message: safari can't open page. error is: "" (kcferrordomainwinsock:10054) any hints problem?

math - 2D spcae: How to do vector prediction for intersect point of one circular motion & one linear motion object? -

in 2d space, object in uniform circular motion around fixed point.. object b in linear motion, trying target & hit object a.. (eg: bullet (object b) trying hit pole on marry-go-round (object a) in top-down prespective) assuming both of speeds constant, how can calculate intersection point, i.e. target object b? know direction of object b has take from initial position collide object a.. i have looked around solutions vector predictions 2 linearly moving objects.. appericate tips or advices!! when object (in case a) moving along circular path, it's position on time t can described as: x1 = r x cos (w . t) y1 = r x cos (w . t) w uniform angular speed in radians/second on other hand, linear speed x2 = velocity x time x cos (theta) y2 = velocity x time x sin (theta) now collision/hitting means: x1 = x2 y1 = y2 just solve above linear equations t , theta. direction starting point of bullet , point (x, y).

Android Studio - Incompatible Selected Device -

Image
i want deploy apps real device. show selected device incompatible. butt when try in emulator works. can me solve problem? enable developer options , enable usb debugging

php - How to Properly use HTML2PDF and Yii-PDF in Yii? -

hello i'm new yii don't know how use html2pdf & yii-pdf extension in yii pdf.. what want.. have page called http://localhost/site/users/results .. showing list of users..so if click on user one, open new page called http://localhost/site/applicant/1 & user two, http://localhost/site/applicant/2 on these pages there information of users. want put download pdf button on page, if user clicks on it, able download information in pdf. there can many users. everyuser able download information in pdf. i got html2pdf & yii-pdf .. got settings searching on google, unable find proper example use according requirements above. config/main.php 'epdf' => array( 'class' => 'ext.yii-pdf.eyiipdf', 'params' => array( 'html2pdf' => array( 'librarysourcepath' => 'application.extensions.html2pdf.*', 'classfile' => 'ht...

python - How to create pie chart with pyqtgraph.GraphicsWindow and create custom scale in x axis -

i doing project needs create piecharts pyqtgraph library. can make column charts , line charts using pyqtgraph.graphicswindow,but can't find out how create piechart. there methods can me accomplish that? another problem, don't know how change x axis scale discrete settings. example, when make column chart, want set number '5' first column, '7' second column,'16' third column.....how can implement this? for first problem, pyqtgraph has no built-in pie chart graphics. however, these should simple construct creating 1 qgraphicsellipseitem each wedge. for second, use following: majortickvalues = [(0,"5"),(1,"7"),(2,"16")] plotitem.getaxis('bottom').setticks([majortickvalues])

java - Android "Cannot resolve symbol '@id/myLabel" -

i getting error saying " cannot resolve symbol '@id/mylabel '". same error following elements: "cannot resolve symbol '@id/numberstudents'" "cannot resolve symbol '@id/accept'" please me resolve issue. sample of xml being pasted below. thanks, abhilash kadala. <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <textview android:id="@+id/mylabel" android:text="name of student:" android:layout_width="fill_parent" android:layout_height="wrap_content" /> <edittext android:id="@+id/numberstudents" android:layout_width="fill_parent" android:layout_height="wrap_content" ...

sql - Fetch error list with integer to binary conversion -

i have table_of_errors id's 2^n values: id,value ----------------- 1,'error 1' 2,'error 2' 4,'error 3' 8,'error 4' etc... in other table let's call products, each row have error code sum of errors table_of_errors: prod_id,erors_code -------------------- prod1, 2 prod2, 5 prod3, 12 what need join converts afrificial one_to_many relation : prod1,'error 2' prod2,'error 1' prod2,'error 3' prod3,'error 3' prod3,'error 4' can please suggest hint? have no idea how start... regards pawel you can use bitand() : select p.*, toe.value products p left join table_of_errors toe on bitand(p.errorscode, toe.id) > 0; i recommend change data structure. bit-packing may make sense in computer languages, not particularly useful oracle. there many other facilities, such junction tables, nested tables, , json fields more appropriate type of data structure.

java - Spring Boot : Getting @Scheduled cron value from database -

i'm using spring boot , have issues scheduling cron task using values existing in database. for time being, i'm reading values properties file below : @scheduled(cron= "${time.export.cron}") public void performjob() throws exception { // } this works nicely, instead of getting values properties file, want them database table. possible , how ? to achieve goals must configure scheduler @ runtime. means need use more low-level scheduler api. precisely when have prepared connect database can configure scheduler. think need rid of using @scheduled annotation , manully manage scheduler. i think these topics can describe mean: how change spring's @scheduled fixeddelay @ runtime scheduling job spring programmatically (with fixedrate set dynamically) however can use wild approaches intercept bean creation , replace original annotation on annotation custom metadata in order implement must know many framework details , how @scheduled annatati...

string - C++ Function that uses BinarySearch algorithm (.bin file) -

i've make function checks if specific word exists in .bin file. want use binary search algorithm. thing is, i've read .bin file, got confused (as there's no lines, right?). function doesn't work me. says 'specific word' (entered user) doesn't exist, though does. nice. #include <iostream> #include <string> #include <fstream> #include <cstring> #include <algorithm> using namespace std; const int buffer_size = 30; void create_bin_file () { ifstream fin ("example.txt"); ofstream fout ("binary.bin", ios::binary); const unsigned int record_size = 30; // buffer_size char buffer[record_size] = {0}; // 0 init buffer while (fin.getline (buffer, record_size)) { fout.write (buffer, record_size); // refill buffer zeroes next time round fill_n (buffer, record_size, 0); } fin.close (); fout.close (); } void binary_search (const string& filename, string searchval) { ifstream file (filename.c_str(), ios::bina...

html - Jquery keypress event ignore arrow keys -

i have input box acts search (similar facebook). using jquery on key-press event works fine. problem can't scroll down on set of results using arrow keys, every time 1 of them pressed search results being regenerated. possible ignore arrow keys / shift / tab etc. http://jsfiddle.net/uu6kg/ $("#search-form .search-terms").on("keypress", function(){ $("#search-items #autocom").fadein(); }); thanks you need filter out arrow key codes (37,38,39,40), try this: note function(e) in place of function() - allows grab event , therefore key code. $('#search-form .search-terms').on('keydown', function(e){ // keycode of current keypress event var code = (e.keycode || e.which); // nothing if it's arrow key if(code == 37 || code == 38 || code == 39 || code == 40) { return; } // normal behaviour other key $('#search-items #autocom').fadein(); }); click list of key ...

c# - TypeConverterMarkupExtension error on setting ImageSource of UserControl -

i'm trying embed image user control. see many posts topic, , tried lot of combination, cannot work. <usercontrol x:class="audioboxcontroller.audioboxitem" x:name="audioboxitemcontrol" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" mc:ignorable="d" width="200" height="250"> <grid> <image name="image" margin="10" verticalalignment="center" source="{binding path=imagesource, mode=oneway}"/> </grid> </usercontrol> in code behind have create dp image: public partial class audioboxitem : usercontrol { public audiobox...

javascript - How to use IScroll even though content is not overflowing? -

Image
i wonder if possible use iscroll, more specific angular version (github.com/mtr/angular-iscroll) though content not overflowing? possible drag non-overflowing list (see image below) , refresh list new content, instance list live demo version of iscroll ( http://lab.cubiq.org/iscroll5/demos/simple/ ). i can't seem find options @ documentation, , not find solutions of how this? note: content of course dynamic height dynamic well. non-overflowing list: setting height 100vh wrappers child did trick, breaks normal scrolling, 100vh iscroll sees no additional content scroll to. cant scroll down list overflowing. you can add item full height holding target items. way list 'overflowing'

Mailchimp add subscriber to all groups -

i've been trying find information on how , i'm beginning think impossible. i'd input others before give idea completely. i have dropdown select on form allows user select group want sign for. <select name="group[3893]" class="form-control" id="mce-group[3893]"> <option value="">what hear about?</option> <option value="1">zumba</option> <option value="2">pilates</option> <option value="">all classes</option> </select> i have no idea value assign classes option. possible sign user both groups? i think way around create third group called classes , subscribe them that. there 2 approaches work, , 1 best depends on use case. differentiating point happens chooses "all classes" when new type of class offered? let's john subscribes , clicks "all classes". few months later add barre classes selection. should jo...

ios - How to Add the geofence of a region to monitoring. -

- (void)locationmanager:(cllocationmanager *)manager didupdatelocations:(nsarray *)locations { // if it's relatively recent event, turn off updates save power nslog(@"%@ locations",locations); float lat = _locationmanager.location.coordinate.latitude; float long = _locationmanager.location.coordinate.longitude; nslog(@"lat : %f long : %f",lat,long); cllocationcoordinate2d center = cllocationcoordinate2dmake(28.52171,77.2015457); nslog(@"center check %@",center); clcircularregion *region = [[clcircularregion alloc] initwithcenter:center radius:500 identifier:@"new region"]; bool doesitcontainmypoint = [region containscoordinate:cllocationcoordinate2dmake(lat,long)]; nslog(@"success %hhd", doesitcontainmypoint); } the issue ,here m providing static reg...

c - Get the Monitor sink of the current active output in PulseAudio -

i trying record desktop audio using simple api libpulse. audio playback works fine simple api, need is: find correct monitor sink current active output use pa_simple_new dev . anyone points check? e.g. enumerating devices? the monitor of device "device.monitor" (e.g. "nullmodule01" -> "nullmodule01.monitor"). append ".monitor" device name.

javascript - datatable is displaying old value when i click next or previous button. -

im using jquery datatable displaying data based on user search using ajax. datatable not refreshing. displaying first time loaded value when click next or previous button. function searchcustomer() { var frm = $("#customerdetailsearchform").serializeobject(); $("#tbl_contact_search_result").hide(); $.ajax({ type: 'post', url: restcontextpath + '/ionsweb/rest/order/searchcontact', data: json.stringify(frm), datatype: 'json', contenttype: "application/json; charset=utf-8", success: function(data, status, xhr) { $("#tbl_contact_search_result tbody").empty(); $.each(data.body, function(i, item) { var checkbox = item.actionstring; var datatablebodyhtml = '<tr><td>'+ checkbox + '</td><td>'+ item.name + '</td><td>'+ item.street +'</td><td>' + item.city + '</td>...

javascript - Submenu - Fade in and Fade out submenu in menu bar -

i want create menu bar in on hover, related menu should appears beside item, , when mouse pointer goes out, should disappears. for example when place mouse pointer on username @ top of page, you'll see menu contains activity, privileges, logout etc. i want implement such menu. toggling visibility(or changing display) attribute of menu element(such div) obvious. but problem is how detect mouse pointer hovering on menu, , should not disappear till mouse pointer goes out! i don't want use jquery. pure css method fiddle: http://jsfiddle.net/gvee/jrfse/ html <ul> <li>item 1 <ul> <li>subitem 1</li> <li>subitem 2</li> </ul> </li> <li>item2</li> <li>item 3 <ul> <li>subitem 1</li> </ul> </li> </ul> css ul { list-style-type: none; } ul li { padding: 5p...