Posts

Showing posts from January, 2013

ios7 - In iOS 7, how to extract the values of Receipt Fields from the In-App Purchase receipts? -

i know in ios 7, app's receipt , in-app purchase receipts combined encrypted format structure shown here , automatically written storage. i know receipt(s) have fields, documented here . i know how retrieve receipt combo calling appstorereceipturl . i know how validate receipt passing apple servers either directly or via own server. but how parse receipt extract fields? i need kind of identifier each of possible in-app purchases record user's ownership in way can verify repeatedly later. if send receipt apple validation, json structure receipt fields. asking how parse json structure?

android - PhoneGap: How to make links from iframes open in InAppBrowser -

i using google dfp serve ads in phonegap project , these ads rendered iframes. when user clicks ad, url open in inappbrowser . of now, opens url in webview . the anchor tag within iframe has target="_blank" , believe because it's within iframe, phonegap ignores this. i know inappbrowser working other links have within project, have ruled out. here settings in config.xml: ... <feature name="inappbrowser"> <param name="ios-package" value="cdvinappbrowser" /> </feature> <feature name="inappbrowser"> <param name="android-package" value="org.apache.cordova.inappbrowser" /> </feature> ... <preference name="stay-in-webview" value="false" /> ... <access origin="*" /> this rendered iframe looks like: <div class="adunit display-block" data-adunit="example_app_section_front_footer" data-dim

resize - Calculte new width and height of the video based on the original width, height and ratio -

after searching through - wasn't able find answer i'll give shot here. i need resize desktop video in order feet on mobile screen, let's original width of video 1915 , original height 1075, calculated aspect ratio: aspectratio = (width/height); aspectratio = 1.78; now mobile screen resolution is: height = 1609, width = 1080. how can resize video in order keep same aspect ratio?? thank you aspectratio = (width/height) you want aspectratio 1.78, if want prevent stretching or cropping. and, max new height 1609 , max new width 1080, so: 1.78 = (1080/height) height = 1080/1.78 = 606.74... or 1.78 = (width/1609) width = 1.78*1609 = 2864.02... so, can have 1080x606.74 (which fits on screen), or 2864.02x1609 (which doesn't fit). so, answer 1080x606.74...

Addressing a database as a multi-level associative array -

i'm writing web game, it's convenient think complete game state single arbitrary-level hash. a couple examples of game state being updated: // defining mission card issued player $game['consumables']['missions']['id04536']['name'] = "build galleon blackbeard"; $game['consumables']['missions']['id04536']['requirements']['lumber'] = 20; $game['consumables']['missions']['id04536']['requirements']['iron'] = 10; $game['consumables']['missions']['id04536']['rewards']['blackbeard_standing'] = 5; // when player turns in mission card requirements $game['players']['id3214']['blackbeard_standing'] += 5; this web game, storing information in database makes sense. need features of database: game state can accessed multiple browsers @ same time, it's non-volatile , easy up, etc. essentially,

javascript - How do I get a browser button to display in Internet Explorer using Crossrider? -

we small uk charity , local web design company has built browser extension using crossrider. our problem browser icon not display in ie, fine in firefox , chrome. have been unable find wrong. unfortunately, javascript novice. when looked @ background.js file think has been coded wrong. there reference images chrome , firefox not ie understanding of crossrider need have single reference , not specify individual browsers? appreciate anyone's on simple question. appapi.ready(function($) { if(appapi.browser.name == "firefox") { appapi.browseraction.setresourceicon('tiny_icon_23.png'); } else if(appapi.browser.name == "chrome") { appapi.browseraction.setresourceicon('tiny_icon_24.png'); } else { appapi.browseraction.setresourceicon('tiny_icon_23.png'); } appapi.browseraction.setpopup({ resourcepath:'popup.html', width: 366, height: 207 });

Get key after inserting into array PHP -

i'm looking this: $a = array(); $var1 = 'var1'; $var2 = 'var2'; $i = array_push($a, $var1); $j = array_push($a, $var2); echo $i; echo $j; the expected output be: 0 1 i want know index of object inserted, able find afterwards. think array_push gives me size of resulting array, not index inserted element array_push return new number of elements in array, decrement return value 1 try this: $a = array(); $var1 = 'var1'; $var2 = 'var2'; $i = array_push($a, $var1) - 1; $j = array_push($a, $var2) - 1; echo $i; echo $j;

Access query to pull records that are max of one record but unique of another -

i tried adapting sql here must doing wrong (i know because i'm lost when comes sql) here's sample table: want max id unique trailer |--id--|trailer|--to--|load qty a|load type/config a| | 1 | a100 | b6 | 2 | a1 | | 2 | a100 | a4 | 1 | a1 | <-show | 3 | b099 | b2 | 6 | c23 | <-show | 4 | a027 | n10 | 3 | o1 | | 5 | j400 | a4 | 8 | a1 | <-show | 6 | a027 | a4 | 4 | b24 | <-show i understand same structure post linked above, cannot work. thought had working having in query "last" except trailer had "group by" started outputting incorrect records. i figured out. created query id , trailer, set id max , trailer groupby. created query rest of fields , created relationship between id fields.

search a column word in csv file and replace it by another value java -

i have 2 csv file, main , look. main file contains list of word this: a,c,e,f b,d,o,f and look.csv contain 2 rows this: a,f,j 1,0,1 i want search each word of main.csv , find match in look.csv. if there match, replace word in main.csv value in row 2 look.csv i write code public class lookup { public static void main(string args[]) throws filenotfoundexception { string word; scanner main = new scanner(new file("c:\\users\\sa\\desktop\\hotel2\\all.csv")); main.usedelimiter(","); scanner look=new scanner (new file("c:\\users\\sa\\desktop\\comtedad.csv")); while (main.hasnext()) { word=main.next() ; while (look.hasnext()){ if (main.next().equals(look.next())) {//code replacing} } } main.close(); }} how can access second row of look.scv when 2 entry matched? a few things note before posting sol

css3 - Modifying the CSS steps() function -

Image
so steps() animation looks (apologies hand-drawn graph): it kind of looks staircase, sudden shifts in displacement. if wanted transitions between steps bit more... gradual ? this: so though it's still staircase, it's less sudden in shift in displacement. is possible create animation based on steps looks second image? ideally i'd have based off steps don't have hardcode in percentages manually. yes, potentially can use css cubic bezier in order customize timing function. please bare in mind experimental technology. http://roblaplaca.com/blog/2011/03/11/understanding-css-cubic-bezier/ https://developer.mozilla.org/en-us/docs/web/css/animation-timing-function

javascript - Remove first occurrence of comma in a string -

i looking way remove first occurrence of comma in string, example "some text1, tex2, text3" should return instead: "some text1 text2, tex3" so, function should if there's more 1 comma, , if there is, should remove first occurrence. solved regex don't know how write it, ideas ? this it: if (str.match(/,.*,/)) { // check if there 2 commas str = str.replace(',', ''); // remove first 1 } when use replace method string rather re, replaces first match.

PHP Proxy for big files (Relaying) -

i looking php function, gets file web server, while outputting it. big file should output chunk eg 1kb once it's loaded , not load whole file , output it. possible? from understood question want offer file download doesn't eat ram, large files? if so, possible standard php file reading functions; this: $chunk_size=1024; $file_name='read.txt'; //open file $file=fopen($file_name,'r'); if($file!=false){ //while haven't reached end while(!feof($file)){ //read chunk , output $line=fread($file,$chunk_size); echo $line; } fclose($file); } else{ //error reading file } you can wrap in php function if like. should noted literally wrote code stack overflow untested. should give idea on theory. hope helps, ryan /** edit **/ p.s code not include code force download - if require this, please let me know. also, should work remote files however, there setting in php.ini file allows or prevents action (al

linker - difference between dynamic loading and dynamic linking? -

routine not loaded until called. routines kept on disk in re-locatable load format. main program loaded memory & executed. called dynamic linking. why called dynamic linking? shouldn't dynamic loading because routine not loaded until called in dynamic loading in dynamic linking, linking postponed until execution time. dynamic loading means loading library (or other binary matter) memory during load or run-time. dynamic loading can imagined similar plugins , exe can execute before dynamic loading happens(the dynamic loading example can created using loadlibrary call in c or c++) dynamic linking refers linking done during load or run-time , not when exe created. in case of dynamic linking linker while creating exe minimal work.for dynamic linker work has load libraries too.hence it's called linking loader. hence sentences refer may make sense still quite ambiguous cannot infer context in referring in.can inform did find these lines , @ context au

how to set a backgroundColor from a js in appcelerator Titanium Alloy MVC -

i have small question setting tab names dynamically. i thinking create options.js , want tab names gather data options.js <alloy> <tabgroup> <tab title="tab 1" icon="ks_nav_ui.png"> <window class="tab1" title="tab 1"> <label>i window 1</label> <button class="examplebut">button </button> </window> </tab> </tabgroup> </alloy> i set tab 1 title js file. how solve ? regards you have identify tab unique id <tab title="tab 1" id='tab1' icon="ks_nav_ui.png"> in same js file exemple index.js (the tab defined in index.xml) can use : $.tab1.title="my title" if set title js file can use application events: in index file define application event listener : ti.app.addeventlistener("app:changetabtitlle",function(e){

python: list lookup vs dict lookup -

i wrote piece of code list size increases each iteration , iterations can reach 100000 times. sample : def do_something(): lst.append(k) while n < 100000: if k not in lst: do_something() now, noticed method took ages finish . please note, did set setrecursionlimit() . infact embarrassing enough, program kept running hrs. later, while trying find methods optimise code, converted lst dct. code looked like: def do_something(): dct[k] = true while n < 100000: if dct[k] == false: do_something() the code ran drastically faster. after reading few conversations on sof( repeatedly appending large list (python 2.6.6) ) , realised not list slow, rather how memory handled larger list data. website https://wiki.python.org/moin/timecomplexity , sheds light on list , dict look-up time complexity. list o(n) dct lookup o(1). why dct performs better ? how exaclty list lookup , dict lookup performed? yes, dictionary lookups take constant

doctrine2 - How do I configure apigility to use Doctrine's MongoDB ODM? -

i’m trying use apigility doctrine’s mongodb odm. i’ve set documents , configured doctrine module should. i’ve inserted (manually) 1 document mongo, , defined code-based rest service, “fetch” method (in resource class) return document's repository "find" return value. when call endpoint (without id) array of single document i’ve inserted, it’s not shown correctly: { "_links": { "self": { "href": "http://localhost:8888/posts" } }, "_embedded": { "posts": [ { "\u0000myapp\\document\\post\u0000id": "5389db47075000812e55bd7d", "\u0000myapp\\document\\post\u0000title": "my post", "\u0000myapp\\document\\post\u0000description": "this post", "_links": { "self": { "href": "http://localhost:8888/posts/1" } }

sorting - scala parameterised merge sort - confusing error message -

i getting compilation error when calling (lt: (t,t) => boolean) function error code "type mismatch; found : x.type (with underlying type t) required: t" , x parameter in lt( x ,y) underlined. object sort { def msort[t](xs: list[t])(lt: (t, t) => boolean): list[t] = { def merge[t](xs: list[t], ys: list[t]): list[t] = (xs, ys) match { case (nil, ys) => ys case (xs, nil) => xs case (x :: xs1, y :: ys1) => { if (lt(x, y)) x :: merge(xs1, ys) else y :: merge(xs, ys1) } } val n = xs.length / 2 if (n == 0) xs else { val (left, right) = xs splitat n merge(msort(left)(lt), msort(right)(lt)) } } } msort , merge have different type parameters. remove t type parameter merge : def merge(xs: list[t], ys: list[t]): list[t] = (xs, ys) match { the [t] declares new parameter unrelated first. same error if declare as: def merge[u](xs: list[u], ys: list[u]): list[u] = (xs,

How to call a recursive linked list traversal function in C++ -

i have function: void traverserecursive ( node * head, void (*visit) (node *) ) { if ( head != nullptr ) { visit( head ) ; traverserecursive( head->next, visit ) ; } } and i'm trying call in main.cpp with traverserecursive ( head, traverserecursive ) ; which gives me error "argument of type "void (*)(node *head, void (*visit)(node ))" incompatible parameter of type "void ( )(node *)" " so how correctly call it? learning linked lists , don't understand what void (*visit) (node *) means @ all. void (*visit) (node *) means "pointer function taking 1 argument of type node* , returning void". traverserecurive takes 2 argumenst , therefore of different type. need define function like void dosomething(node* n) { } and pass traverserecursive

java - How to create a array of an object that requires parameters -

i have code here final ship[] ships = new ship[3]; for(int x = 0; x < 3; x++) { ships[x].settext("set ship length: " + (x+1)); // line in particular } i getting null pointer exception, think because ships object requires string , int in parameters constructors contains, how supposed create , array of objects each object requires parameters? change code below.. final ship[] ships = new ship[3]; for(int x = 0; x < 3; x++) { ships[x].settext("set ship length: " + (x+1)); // line in particular } to... final ship[] ships = new ship[3]; for(int x = 0; x < 3; x++) { string stringvalue = "set ship length: " + (x+1); //string want in ship object int intvalue = 0; //int want in ship object.. ship ship = new ship(stringvalue, intvalue); ships[x] = ship; ships[x].settext("whatever string heart desires"); // line in particular } you making array of type ship, but never assign contents array

Regex, PHP - finding words that need correction -

i have long string words. of words have special letters. for example string "have rea$l problem with$ dolar inp$t" , have special letter "$". i need find , return words special letters in quickest way possible. what did function parse string space , using “for” going on words , searching special character in each word. when finds it—it saves in array. have been told using regexes can have better performance , don’t know how implement using them. what best approach it? i new regex understand can me task? my code: (forbiden const) code works now, 1 forbidden char. function findspecialchar($x){ $special = ""; $exploded = explode(" ", $x); foreach ($exploded $word){ if (strpos($word,$forbidden) !== false) $special .= $word; } return $special; } you use preg_match this: // set special word here. $special_word = "café"; // set sentence here. $string = "i eat food @ café , read magazine."; //

cordova - Crosswalk for Android splash screens -

how can add splash screens when using crosswalk create apk? a side question, crosswalk equivalent of config.xml , put it? in manifest: "launch_screen": { "ready_when": "custom", "portrait": { "background_color": "#ff0000", "background_image": "bgfoo.png 1x, bgfoo-2x.png 2x", } } see: https://crosswalk-project.org/#documentation/manifest/launch_screen

Django commands cron ImportError: cannot import name -

i want add models commands. /home/max/askmoiseev/ask/management/commands/cron.py # -*- coding: utf-8 -*- django.core.management.base import basecommand, commanderror ask.models import tag class command(basecommand): def handle(self, *args, **options): print args $ python manage.py cron traceback (most recent call last): file "manage.py", line 10, in <module> execute_from_command_line(sys.argv) file "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 399, in execute_from_command_line utility.execute() file "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 392, in execute self.fetch_command(subcommand).run_from_argv(self.argv) file "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 272, in fetch_command klass = load_command_class(app_name, subcommand) file "/usr/local/lib/python2.7/dist-packages/django/core/mana

oracle - Create trigger for view to edit table's data -

i ask wrong trigger view. view: create view produkt_view select * produkt; trigger: create or replace trigger dawka_zeruj instead of update on produkt_view declare begin if(:old.dawka = :new.dawka) update produkt_view set dawka_l_p = null, dawka_j_p = null bloz12=:old.bloz12; end if; end; after executing sql developer asks paramters.. tought :old, :new paramters update seems not.. wrong? ps. want set 2 columns: "dawka_l_p" , "dawka_j_p" null if change column "dawka" on update. thats all. bloz12 primary key. ps2. dawka varchar2 column should if(:old.dawka :new.dawka) still not work. definition of table: create table produkt ( bloz7 number , bloz12 number , nazwa varchar2(100 byte) , nazwa_miedz varchar2(100 byte) , dawka varchar2(70 byte) , dawka_zloz varchar2(1 byte) , dawka_l_p float(126) , dawka_j_p varchar2(50 byte) , dawka_l_r float(126) , dawka_j_r varchar2(50 byte) , dawka_l_n float(126) , dawka_j_n

Regex count number of digits excluding space -

i want create regular expression validate following condition: contains numbers only single space between numbers allowed total digits excluding spaces must between 16 19 here regular expression have far : ^[0-9]+( [0-9]+)*$ basically got condition (1) , (2) really need (3). thank time. piece of cake. ^\d( ?\d){15,18}$ only thing worth remarking on {15,18} needs 1 less -- first \d ate digit.

domain driven design - Example of a AggregateRoot and single responsibility principle -

i doing bit of research ddd, cqrs , es. looking @ source code of aggregate root, curious whether not violate single responsibility principle? or expected aggregate root/ddd? feedback appreciated. lot. another way think of srp "there must single reason code change". if there more 1 reason can it's srp violation. so looking @ code can see few reasons might change: additional account information required stored, more account name. customer services need information contact account holder, address, email, phone number. the memento object deserialization needs become more complex. @ moment it's single pipe | separating amount , account: var split = ledger.value.split(new[] { '|' }); there's number of events, accountopenedevent accountclosedevent etc. class change if there more events required in future, e.g. accountsuspendedevent . i go on, yes class violates srp in opinion. need changed now? no, not, hope there decent test suite (

Java/Android Calendar, add 1 week on Sundays -

ok, code has worked until day became sunday. i'm working on app uses calendar util allot, functioning way think important me! problem: import java.util.calendar; ... calendar test = calendar.getinstance(); test.setfirstdayofweek(calendar.monday); log.e("weeek test:", ""+ test.get(calendar.week_of_year)); test.add(calendar.week_of_year, 1); log.e("weeek test:", ""+ test.get(calendar.week_of_year)); outputs this: 06-01 14:04:07.636 12005-12005/test.app e/weeek test:﹕ 23 06-01 14:04:07.636 12005-12005/test.app e/weeek test:﹕ 23 how can happen, , how fix it? calendar test = calendar.getinstance(); test.add(calendar.week_of_year, -1); test.add(calendar.week_of_year, 1); test.setfirstdayofweek(calendar.monday); now "test" should work correctly

javascript - dialog body center pains -

i have dialog box im going turn manual entry dialog select box. having issues getting text/input box align vertically in center. here url if want view. select in select box , see, have made taller testing only. below dialog code. http://moconsultant.net , below css css used dialog alert system built mo $('.selectbox').change(function(){ mydialogbox=" <div title='im manual entry box' class='dialogdiv'> manual entry:<input type='text' name='dialogname' id='dialogname' maxlength='40' class='dialoginput' ></div>" $(mydialogbox).dialog({ autoopen: true, width: 'auto', height: '500', modal: true, fluid: true, //new option buttons:[ { text: 'retun', 'class': 'return', click: function() {

javascript - Why cant use provider inside the angular config? -

i developing angular app.in app need add route handler following 1.listen /app/:appid route depending on appid parameter download files server server. files looks this appid | |-html | | | ->index.html | |-javascript | ->app.js html folder , java script folder may have several files.but index.html file there. 2.after downloading files, should create route handler following /appview/appid which points index.html file downloaded. i created request handler download files. require parameters following localhost:port/requesthandler.ashx?appid=myappid request handler tested , confirmed functioning properly.files downloading app/apps/appid folder. then created route.config.js following var app = angular.module('app'); app.constant('routes', getroutes()); app.config(function ($provide) { $provide.provider("dataprovider", function () { return { $get: function ($http,$q) { ret

c++ - undefined reference error, using templates and classes -

this question has answer here: why can templates implemented in header file? 13 answers i practicing coding exam tomorrow, reason cannot program run. keep getting error: undefined reference ..pract\arraylisttype\main.cpp:47: error: undefined reference 'arraylisttype<std::string>::print() const' here code have far, see looks pretty alright. tried commenting out lines of code no avail. don't know can wrong. //header file: #ifndef arraylisttype_h #define arraylisttype_h using namespace std; template <class elemtype> class arraylisttype { public: const arraylisttype<elemtype>& operator= (const arraylisttype<elemtype>&); //overloads assignment operator bool isempty() const; //determines if list empty bool isfull() const; //determines if list full int listsize() const; //function determ

python - DoesNotExist at /admin -

i'm getting error: doesnotexist @ /admin quiz matching query not exist. lookup parameters {'url': u'admin'} but, checked other solution in so, removing #'django.contrib.sites', doesn't work me. these installed apps: installed_apps = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', #'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', 'simulado', 'multichoice', 'django.contrib.admin', ) this urls.py from django.conf.urls import patterns, include, url # uncomment next 2 lines enable admin: django.contrib import admin admin.autodiscover() urlpatterns = patterns('', # examples: # url(r'^$', 'quiz.views.home', name='home'), # url(r'^quiz/', include('quiz.foo.urls')), # uncomment next line enable admin: u

javascript - Directive Parameters Nested Controller Simple Example -

here code app.directive('hello', function() { return { restrict: "e", templateurl: "/angular/modules/selector.html", controller: function () { this.message = [want attribute message here] } }; }); and markup <hello message="hello world instance 1"></hello> <hello message="hello world instance 2"></hello> finally, question how can attribute controller instance each hello element? binding datasource attribute <hello ... datasource="/jsondata.json"></hello> <hello ... datasource="/otherjsondata.json"></hello> more controller code $http.get($attrs.datasource).success(function (data) { ... });\ the datasource shared need 2 separate instances. thanks, blackhole advice! working code i can attributes explained. did notice attributes strangely change lower case fine me. scope: { } trick creat

python - How do you get the phone number of the current call in progress from Twilio? -

i trying allow current caller leave callback number after specifying gather function. i imagine need use calls = client.calls.list(status="in-progress") i'm not sure go here. there way sid of current call can phone number? the calls.list() method returns list of call resources can iterate through or retrieve index. from twilio.rest import twiliorestclient account_sid = acxxxxxxxxxx auth_token = yyyyyyyyyyyyy client = twiliorestclient(account_sid, auth_token) calls = client.calls.list(status='in-progress') call in calls: print(call.sid) first_call = calls[0] the phone numbers related call in-progress available via to , from_ attributes. use case, suspect phone number looking available here: from twilio.rest import twiliorestclient account_sid = acxxxxxxxxxx auth_token = yyyyyyyyyyyyy client = twiliorestclient(account_sid, auth_token) calls = client.calls.list(status='in-progress') first_call = calls[0] to_number = fir

merge - fill in missing values based on available data when merging datasets in R -

here question. want merge df1 , df2 datasets. >df1 id sub time number base note 01 a01 100 20 20 y 01 a01 110 35 20 na 02 a02 100 15 15 y 02 a02 150 35 15 na 03 a04 120 10 10 y 03 a04 130 25 10 na 04 a05 90 19 19 y 04 a05 130 50 19 na .... >df2 sub time number a01 150 55 a04 200 60 a05 200 80 a02 200 55 .... the merged dataset should this: >merged id sub time number base note 01 a01 100 20 20 y 01 a01 110 35 20 na 01 a01 150 55 20 na 02 a02 100 15 15 y 02 a02 150 35 15 na 02 a02 200 55 15 na 03 a04 120 10 10 y 03 a04 130 25 10 na 03 a04 200 60 10 na 04 a05 90 19 19 y 04 a05 130 50 19 na 04 a05 200 80 19 na if have solutions in r, please let me know. thanks! you can rbind 2 after addin

auto increment a property google app engine except sharding counters -

i looking way auto increment of property in google app engine . looking comes database , not logical manipulations sharding counters you can query before insert find out highest id. read , write should in transaction there won't race condition. of course, needless say, can inefficient @ point

ember.js - hasMany/belongsTo: how do i change the ownership of an item (move from one parent to another)? -

i've got model both hasmany , belongsto related todos.todo = ds.model.extend({ title: ds.attr('string'), iscompleted: ds.attr('boolean'), parent: ds.belongsto('todo', {inverse: 'children'}), children: ds.hasmany('todo', {inverse: 'parent'}) }); i going let user drag-n-drop todos on each other let him rearrange hierarchy. that's difficult task person not familiar ember, decided start simpler: each todo contains dropdown list of possible parents. user can select parent list , todo gets updated parent. there's "no parent" item in dropdown list. when selected todo, todo updated contain no parent. the way perform modification of parent of todo pretty straightforward: grab collection of models todos arraycontroller ( controllers.todos.model ). filter collection contains record id equal requested id (from user's choice on dropdown list). grab first , record filtered collection. set current

html - Can't hide border of image in CSS -

Image
this question has answer here: img tag remove border 4 answers there problem hiding border of image in css : logo <img> - tag, inside main <div> , i'm setting border value so: #map-logo { border: none; ... } to <img> object, border visible, how fix in css ? code , live sample: http://jsfiddle.net/xcdbc/ <html> <head> <title></title> <style type="text/css"> body { background-color: #ff0000; } #map-control { width: 177px; height: 178px; background-image: url( 'http://s30.postimg.org/96b366cxp/image.png' ); } #map-logo { border: none; margin: 0px; padding: 0px; width: 85px; height: 85px; background-image: url( 'http://s30.postimg.org/is4nmh43h/image.png' );

android - How to customize the Spinner dropdown view -

is possible customize spinner drop-down view . default spinner drop-down view has adapter view . want change view have own text view or thing this. you can customize drop-down view overriding getdropdownview method arrayadapter . @override public view getdropdownview(int position, view convertview, viewgroup parent){ ... }

android - Xamarin Shared Projects vs Portable class libraries -

i trying figure out better way go our project. pcl library or shared project xamarin. in xamarin documentation link here says rule of thumb choose shared project when not share library. shared project can written #if's make sure works multiple platforms - causes issues refactoring #ifs not active. yet have gut feeling not right put code shared class. if code available windows, android , ios mobile platforms using shared project instead of pcl - means using #ifs inside shared project instead of writing platform specific code in platform specific project. this trying make support of non pcl items via #ifs , making shared code more complex , harder maintain. shouldn't work done xamarin improving .net pcl codebase? and means putting platform specific features in shared project , not platform specific project - i.e. hiding complexity specific platform platform project - feels wrong in terms of architecture. am right (in case conflicting xamarin documentation) or mis

html - CouchDB templating system: extend with separate footer & header -

i'm using couchdb\couchapp host web application. comes django, , jinja2 i'm able extend templates in 2 ways: {% include "header.html" %} or {% extends "base.html" %} <<<---- preferred i'm looking way same couchdb, have header , footer code written in every single page and, obv, doesn't best practice. thank in advance. couch db supports common js modules means can export mustache/or other templating library string , require in show function. more explanation on mail archive if want use javascript on server side, you'll need store property on design doc. in "lib" folder (outside of _attachments) 'couchapp' included like: couchapp folder _id file |_ _attachments folder |_ ...clientside media... |_ lib folder |_ mustache.js <----> {_id:"", _attachments: {...}, lib:{mustache:""}} then use in _show/_list/_update f

Bad Request Error OpenStack -

i trying create instance command line using command, nova boot --config-drive=true --flavor 2 --key-name key1 --image c28bc1e8-a25f-413c-9e13-fecdd5d6f522 instance1 but got error, error (badrequest): network 00000000-0000-0000-0000-000000000000, 11111111-1111-1111-1111-111111111111 not found. (http 400) (request-id: req-6dd0352e-008a-40c4-91e2-454529712ba9) guide me how resolve problem. i’m guessing may have rax_default_network_flags_python_novaclient_ext python package installed, automatically adds networks request, not booting instance in rackspace public cloud. this can resolved using --no-service-ne t , --no-public arguments , or uninstalling above mentioned python module.

linux - modifying a time lapse bash script for raspberry pi - crashes before 10 Am -

i got bash script online uses raspberry pi's camera module take photos @ specified rate specified timeframe. can't seem run script before 10 because can't add timeframe time (in 24 hour) because has 0 in front of number. tried adding # in front of variable other posts said pi spits out syntax error. i'm new bash. code: #!/bin/sh if [ ! -n "$3" ] echo "" echo "\033[1;31musage: tl <interval (in seconds)> <duration (in hours)> <duration (in minutes)>" echo "" echo "\033[1;32mexample: tl 10 5 30" echo "(takes picture every 10 seconds next 5 hours , 30 minutes)" echo "\033[0m" elif [ ! -d /mnt/usb/tl_storage/pics_$(date +%f) ] sudo mkdir -p /mnt/usb/tl_storage/pics_$(date +%f) interval=$(($1 * 1000)) duration=$((($2 * 60 + $3) * 60000)) hour_act=$(date +%h) minute_act=$(date +%m) hour_tmp=$(($hour_act + $2)) minute_tmp=$(($min

Using Sass sourcemaps with multiple files included -

i'm moving workflow use sourcemaps sass, , going well, i'm having trouble overwriting main.scss every time make change in chrome devtools. my file structure this: scss - main.scss |- inc |-_mixins.scss |-_typo.scss |- etc... and main.scss contains multiple @import "inc/mixins"; lines, each different filenames. i created sourcemap, using sass --sourcemap scss/main.scss css/main.css , started watching files using sass --sourcemap --watch scss:css , (all found in tut ). i've mapped working files in chrome devtools. it works initially, in if examine elements in devtools, see code in scss. if edit value, overwrites scss/main.scss contents of css/main.css , massively weird. anyone shed light on this? so, figured out. i followed tut working, had mapped local files incorrectly. if manually setting sass sourcemapping, must careful map included files correct locations. somehow had 1 mapped main.scss, , overwriting on

android - Changing Imageviewresource in remoteview notification -

i displaying notification music player inside service class buttons , textview. text getting updated whenever song changes need change imageviewresource on click of play button should change pause once music stopped. issue facing when textview text changes whole notification view refreshes 1 sec , text changes. how stop refresh of whole view?this code tried far: service class: @override public int onstartcommand(intent intent,int flags,int startid) { if(intent!=null) { string action = intent.getaction(); if(!textutils.isempty(action)) { if(action.equals(action_pause)) { remoteview.setimageviewresource(r.id.btnplay_notif,r.drawable.btn_pause); //changing imageview frm play pause appwidgetmanager manager = appwidgetmanager.getinstance(getapplicationcontext()); manager.updateappwidget(r.id.btnplay_notif, remoteview); // app widget id given correct? pauseplayer(); }} return 1;

mysql - insert data from one table to another php sql -

i'm making private messages application , trying create 'deleted messages' folder messages user wants delete inbox or sent folder go 'deleted'. managed write code delete them not want. created table in database, named 'deleted' i'm trying delete them inbox , insert them there. this have until now: if ( isset($_get['delete'])) { $multiple = $_get['multiple']; $i=0; $q = "insert deleted (select * email to_user = '$user')"; foreach($multiple $msg_id) { $i++; if ($i==1) { $q .= " id = ". mysql_real_escape_string($msg_id).""; } else { $q .= "or id = ". mysql_real_escape_string($msg_id).""; } } mysql_query($q) or die (mysql_error()); header("location: " .$_server['php_self']); exit(); } it giving me error: you have error in sql syntax; check manual corresponds mysql server version right syntax use near 'wher

jetbrains - Unrecognized FaultException when Connecting to RemoteAgent -

how can troubleshoot following error message in dottrace profiler configuration dialog? unrecognized faultexception: code receiver, prefix server unable process request. ---> unable open f i have remoteagent configured , running on server, firewall port 9000 open. attempting connect it, specify ip address, port, , endpoint , message above. it...it ends letter "f" , i'm not sure referring to. checked logs, unfortunately, i'm getting: 12:51:09 pm.060: thread:1: [configremove] #13 hostparameters: <?xml version="1.0" encoding="utf-8"?> <hostparameters type="remotehostparameters"> <domain isnull="false"> </domain> <password isnull="false"> </password> <url>http://192.168.1.177:9000/remoteagent/agentservice.asmx</url> <username isnull="false"> </username> </hostparameters> 12:51:09 pm.060: thread:1: [con

python - issue with formatting characters -

having bit of issue displaying characters i have payload recieved protocol request : 538cb9350404521a6c44020404563b152606102001085800020002aabb0000563b1526000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

Invite Facebook friends thorogh android app -

when invite friends facebook displays toast invitation send not display in friends notification. i use simple facebook sdk android in app. invite sent, isn`t displayed in friends wall. asked same question here: https://github.com/sromku/android-simple-facebook/issues/13 can tell me why need canvas? can explain canvas , why need make invites work? i read facebook canvas explanation. written that: "a canvas page quite literally blank canvas within facebook on run app. populate canvas page providing canvas url contains html, javascript , css make app. when user requests canvas page, load canvas url within iframe on page. results in app being displayed within standard facebook chrome." i don`t want app run page, or have link playstore? what permissions should ask? today ask for: "user_friends","publish_actions". can give me example of invite friends work people don`t have app installed? public void invite(string message, final oninvitelist