Posts

Showing posts from January, 2010

python - Display search and list filter in Mezzanine Pages admin interface -

is there simple way display search , list filters in mezzanine's admin interface pages? i tried putting following in application's admin.py, search , filters don't appear in admin interface: from django.contrib import admin mezzanine.pages.models import page, richtextpage mezzanine.pages.admin import pageadmin admin.site.unregister(page) class custompageadmin(pageadmin): save_on_top = true list_display = ('title', 'publish_date', 'status') list_filter = ('title', 'publish_date', 'status') search_fields = ('title', 'content') admin.site.register(page, custompageadmin)

android - Idea for an application similar to snapchat -

i have thought idea similar snapchat , know should next. non-tech individual , in advising me how 1 begin creating application similar snapchat? expertise hiring developer? ruby on rails? html5? python? thanks. ruby on rails mobile application? html5 can option multiple platforms dont need develop android, ios , microsoft mobile. otherwise, need can code android, ios or c#.

jquery - Hide a div when page is still, show on scroll movement up -

i want sticky header on chrome (?) on android. ie, scroll down page, there no sticky header, scroll up, (or after 1 second) sticky header appears again. then, when scroll down hides once more. i think far better sticky header solution can find tutorials refer waypoints, , want based on movement, not fixed positions. can give me bare bones example of this? would great, thanks. check working fiddle .i hope need.. var scroll_pos = 50; var scroll_time; if($('.gridcontainer').is(':visible')) $('.gridcontainer').addclass('hidden'); $(window).scroll(function() { cleartimeout(scroll_time); var current_scroll = $(window).scrolltop(); if (current_scroll >= $('#topnav').outerheight()) { if (current_scroll <= scroll_pos + 100) { $('.gridcontainer').removeclass('hidden'); } else { $('.gridcontainer').addclass('hidden'); } } scroll_time = settimeo...

maven override project.version from command line -

i wonder if possible override project.version/version variable in maven via command line? the following doesn't work: mvn deploy -dversion=1.0-test-snapshot mvn deploy -dproject.version=1.0-test-snapshot thanks in advance help! my pom.xml is: <project> <modelversion>4.0.0</modelversion> <groupid>just.another.company.name</groupid> <artifactid>my-pom</artifactid> <version>1.3-snapshot</version> <name>my module</name> <packaging>jar</packaging> <description>pom project module</description> </project> simply can't override project.version . try: mvn versions:set -dnewversion=<version> usually, start updating parentpom mvn versions:set -dnewversion=1.0.3-snapshot this enough if parent pom contained child projects if not need go super project contain child project , execute mvn versions:update-child-modules also ...

eclipse - Error in running GWT project -

after debugging gwt project when open url in browser ,then following error shows in console. using eclipse kepler. [error] unable find 'projectname/nocache/js.gwt.xml' on classpath; typo, or maybe forgot include classpath entry source? the development shell servlet received request generate host page module 'projectname.nocache.js' [error] unable find 'projectname/nocache/js.gwt.xml' on classpath; typo, or maybe forgot include classpath entry source? 'projectname.nocache.js' filr exist in projectname folder . please help. thanks. could check module name "projectname.gwt.xml" (?) , entrypoint classpath correct in there ?

android - How to Identify Particular(specific) view is clicked for Dynamically Created Views -

i new android programming. have created buttons,edittext dynamically , set onclick listener of them. here buttons , edittext have write different logic. if write public void onclick(view v) { if(v instanceof button){ // thing }else if(v instanceof edittext){ // thing } } for buttons , edittext same logic applied. want specific logic buttons , edittext. can setting tag editext/buttons , identify. solution ? in onclick can write switch case based on id of each component (button etc): @override public void onclick(view v) { switch(v.getid()){ case r.id.camera: break; case r.id.camera_focused: break; }

How to make the f.select rails selected -

it's code: <%= f.select :area, options_for_select([['a','a'],['b','b'],['c','c']]), {}, {:class => 'span3 controls controls-row'}, :selected => params[:area] %> and result is: argumenterror in users#edit showing /home/airson/rails_projects/friends_of_local/app/views/users/edit.html.erb line #17 raised: wrong number of arguments (5 4) why.....@@? no need use :selected pass params[:area] alone options_for_select second argument: <%= f.select :area, options_for_select([['a','a'],['b','b'],['c','c']], params[:area]), {}, { :class => 'span3 controls controls-row' } %> the last value of params[:area] selected. hope helps ; )

c - When can such errors on bind() happen? -

errors taken man bind enotsock // sockfd descriptor file, not socket. following errors specific unix domain (af_unix) sockets: efault // addr points outside user's accessible address space. eloop // many symbolic links encountered in resolving addr. enoent // file not exist. enotdir // component of path prefix not directory. erofs// socket inode reside on read-only file system. especially can't understand when eloop, enoent, enotdir, erofs can happen. related special filesystems nfs , on? remember sockets , bind can used more network communication. see example unix domain sockets bound files in file system. it's there in own quoted list of errors: the following errors specific unix domain (af_unix) sockets

https - Error 102 nginx SSL -

i can't ssl work on domain. 102 connection refused. here config: server { listen 443 default_server ssl; ssl_certificate /etc/nginx/ssl/www.foreningsdriv.se.crt; ssl_certificate_key /etc/nginx/ssl/server.key; #if url .php tacked on valid php file, rewrite url .php if (-f $document_root$uri.php) { rewrite ^(.*)$ /$uri.php; } root /var/www/foreningsdriv.se; index index.php index.html index.htm; server_name www.foreningsdriv.se; location / { try_files $uri $uri/ /index.html; } error_page 404 /404.html; # pass php scripts fastcgi server listening on 127.0.0.1:9000 location ~ \.php$ { #fastcgi_pass 127.0.0.1:9000; # php5-fpm: fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; fastcgi_param script_filename $document_root$fastcgi_script_name; include fastcgi_params;...

getting jsonp to work in asp.net api -

having issues getting jsonp work client backbone script,pagenator keep gettgin invalid key error having looked around people to service not return jsonp. for example syntaxerror: invalid label, i've written mvc4 web api service returns right , there need add api support jsonp ? { "odata.metadata":"http://test.test.uk/api/odata/$metadata#lnews","value":[ { "id":1,"title":"this test news artical","maincontent":"&lt;p&gt;\r\n\tthis test article&lt;/p&gt;\r\n","featured":1,"visiblehomepage":1,"thedatetime":"2013-08-05t10:36:05.98","expireon":"2013-08-15t00:00:00","category":17,"embargo":null,"embargotime":"pt0s","embargodate":null,"customthumbnail":null,"news_layout":3,"lnbe":0,"lnbn":0,"lnbs":0,...

c++ - How can I pass pointer-pointers of a derived class as a based class? -

this follow-up the question asked earlier . lib_a i have base class in external library, say, lib_a . class instrument { // ... } lib_b i have derived class in external library, say, lib_b , of course references lib_a . class bond : public instrument { // ... }; in lib_b , have trader class owns pointer bond it's working with. class trader { public: // ... bond* _bond; }; lib_c i cannot touch lib_a or lib_b . in own code, third "library" (i'm using term loosely here), say, lib_c , i'm trying create class points trader 's bond pointer , i.e. class tradehelper { public: tradehelper(bond** bondptr): _bondptr(bondptr) {} bond** _bondptr; }; with being constructed by trader* t; // assume given , not null tradehelper* th = new tradehelper(&(t->_bond)) an aside (no need read) why such convoluted scheme? well, trader::_bond can change, , tradehelper needs know trader 's _bond is, @ ...

javascript - How do I return data from a $http.get() inside a factory in angularjs -

i'm having lot of trouble , can't seem find here on or google helps me spot i'm doing wrong <!doctype html> <html data-ng-app="testapp"> <head> <title></title> </head> <body> <div data-ng-controller="mycontroller"> {{test}}<br/> {{test2}}<br/> {{test3}} <ul> <li data-ng-repeat="member in members">{{ member.firstname}}</li> </ul> </div> <script type="text/javascript" src="angular.min.js"></script> <script type="text/javascript"> angular.module('testapp', ['memberfactory']); angular.module('testapp',[]) .factory('memberfactory', function($http){ var obj = {}; obj.data = "abcd"; obj.getresponse = function()...

asp.net mvc 4 - Passing Model from view to controller with Jquery Ajax -

i'm try pass model values view controller using ajax jquery . in controller model shown null . controller called ajax method, problem object in controller showing null . this simple structure of model: public class invoice { public invoice(invoiceheader invheader, list<invoiceitems> invitmem) { this.invheader = invheader; this.invitmem = invitmem; } public invoiceheader invheader { get; private set; } public list<invoiceitems> invitmem { get; private set; } } this structure of controller: [httppost] public actionresult insertitems(list<invoice> invoice) { //list<invoiceitems> asd = new list<invoiceitems>(); //asd = invoice.(); return json(true, jsonrequestbehavior.allowget); } this view: @model beetatechmodel.invoice @{ viewbag.title = "index"; var val = json.encode(model); } <h2>index</h2> <script type="text/javascript"> ...

android - nullpointer exception while starting another activity -

when called activity using intent gives nullpointer exception. intent public void showevent(view view){ intent intent = new intent(this, getclicker.class); date = (textview)findviewbyid(r.id.textview2); string datevalue = date.gettext().tostring(); userselection=(textview)findviewbyid(r.id.textview1); string userselectvalue = userselection.gettext().tostring(); intent.putextra(extra_message, datevalue); intent.putextra(extra_message1, userselectvalue); startactivity(intent); } getclicker.java package example.events1; import android.app.listactivity; import android.content.intent; import android.database.cursor; import android.os.bundle; import android.support.v4.widget.simplecursoradapter; import android.widget.listview; public class getclicker extends listactivity { classdbopenhelper eventsdata1; cursor cursor1; listview listview ; @override public void oncreate(bundle sav...

facebook - Is there any other fql function like "me()"? -

is me() function can put in fql request? if not, can give facebook doc page can find other functions? you can use several other functions in fql request. from fql technical guide doc other functions available now(), strlen(), substr() , strpos().

asp.net - Draw HTML table border -

Image
i want draw border of table on html page : html : <asp:table> <asp:tablerow cssclass="columnheader"> <asp:tablecell borderwidth="0px" backcolor="white"></asp:tablecell> <asp:tablecell columnspan="3" ><asp:label id="lbl_dimension" runat="server" >dimension in cm</asp:label></asp:tablecell> <asp:tablecell columnspan="2" ><asp:label id="lbl_weight" runat="server" >weight in kg</asp:label></asp:tablecell> <asp:tablecell ><asp:label id="lbl_volume" runat="server" >volume</asp:label></asp:tablecell> </asp:tablerow> <asp:tablerow cssclass="columnheader"> <asp:tablecell borderwidth="0px" backcolor="white"></asp:tablecell> <asp:tablecell ><asp:label /></asp...

Wpf and Hwnd unique name -

we have wpf application should 'piloted' legacy win32 winform application. (we don't own code ;) ) the legacy application should pilot our application (minimize, bring front, shut, etc) via windowsclass name should provide configuration parameter written ini file. the problem cannot make work wpf since if insert classname spy++ gives us, nothing happens. point spi++ returns this hwndwrapper[mywpfprogram.exe;;16978ce2-3b8d-4c46-81ee-e1c6d6de4e6d] where guid randomly generated @ every run. is there way solve issue? thank you. there no way asked. found walkaround. "simply" embedding xaml windows within windows form. these steps followed: 1 - add windows form project. 2 - remove app.xaml , make new form entry point of application. 3 - since need hwnd of main.xaml added prop code behind public intptr hwnd { { return new windowinterophelper(this).handle; } } 4 - constructor of form create instance of wpf window c...

excel vba - VBA - Open form within loop then wait for OK click -

i have script checks new shops in sheet. if finds new shop should open form , prompt user select shop category , click ok. when the user clicks ok value dropdown should selected , form closes , loop continues. the form calles "shopkat" this how works: for = lbound(distshops) ubound(distshops) if not isempty(distshops(i)) curcell = getrows curshop = distshops(i) findout = checkifinsheet(curshop) if findout = false cells(curcell + 1, 1) = curshop 'show form shopkat.show vbmodal 'shop current shop shopkat.shop.caption = curshop 'get value combo cells(curcell + 1, 2) = shopkat.shopkatcombo.value 'if user click ok continue end if end if next could help. lot! //////////////////////////// updated /////////////////////////////// module1: publi...

Obtain results from processes using python multiprocessing -

i trying understand how use multiprocessing module in python. code below spawns 4 processes , outputs results become available. seems me there must better way how results obtained queue; method not rely on counting how many items queue contains returns items become available , gracefully exits once queue empty. docs queue.empty() method not reliable. there better alternative how consume results queue? import multiprocessing mp import time def multby4_wq(x, queue): print "starting!" time.sleep(5.0/x) = x*4 queue.put(a) if __name__ == '__main__': queue1 = mp.queue() in range(1, 5): p = mp.process(target=multbyc_wq, args=(i, queue1)) p.start() in range(1, 5): # referring counting again print queue1.get() instead of using queue, how using pool ? for example, import multiprocessing mp import time def multby4_wq(x): print "starting!" time.sleep(5.0/x) = x*4 return if __na...

How do I use Android SpeechRecognizer as a service? -

i trying run android voice recognition service. can verify oncreate() , onstart() methods of service called, no callbacks speech recognition methods called, despite fact have set speechrecognizer object correctly. speech recognition seems work when done in activity instead of service. how make work service? manifest issue? package net.viralpatel.android.speechtotextdemo; import java.io.bufferedwriter; import java.io.filewriter; import java.io.ioexception; import java.util.arraylist; import android.app.service; import android.content.intent; import android.os.bundle; import android.os.ibinder; import android.speech.recognitionlistener; import android.speech.recognizerintent; import android.speech.speechrecognizer; import android.util.log; import android.widget.toast; public class myservice extends service implements recognitionlistener { private speechrecognizer speechrecognizer; @override public ibinder onbind(intent arg0) { return null; } @override...

reporting services - SSRS multi-value parameter using a stored procedure has too many values -

i working on ssrs report uses stored procedure containing few parameters. 1 of paramaters having problems because have option of selecting more 1 item (guid values) , exceeding 4000+ comma separated values. store procedure: proc_getcompanyrecord ======================================== create procedure [dbo].[proc_getcompanyrecord] ( @year varchar(max) = null, @corecompanyid varchar(max) = null, @companyid varchar(max) = null, @ownerid varchar(max) = null ) --the rest of query here pulls of needed columns corecompany.corecompanyid in (select * ufnsplit (@corecompanyid, ',')) , company.companyid in (select * ufnsplit (@companyid, ',')) ======================================== function: [dbo].[ufnsplit] create function [dbo].[ufnsplit] ( @repparam varchar(max), @delim char(1) ) returns @values table (item uniqueidentifier) begin declare @chrind int declare @piece varchar(max) select @chrind = 1 while @chrind ...

oop - PHP user class with login access -

i've searched login system in google thing i'm trying there myself, , not following guide tells me everything. i have index.php has menu.php included in top, has include login_form.php, calls login.php make login. in login.php uses class user make login. user.php has require_once connection.php i'm failing @ easy fix can't quite see new me. problem error happens: undefined variable: mysql in admin\include\lib\user.php on line 12 connection.php: require_once 'constants.php'; $mysql = new mysqli($db['host'], $db['username'], $db['password'], $db['name']); if ($mysql->connect_error){ die('connection error (' . $mysql->connect_errno.')'. $mysql->connect_error); } user.php -> line 12: $this->password=$mysql->real_escape_string($this->password); as side note index.php require_once connection.php, constants.php (which has $db array host, user, etc..), , class.php. i...

iphone - Cell Imageview with Gesture - Which image was tapped? -

i have uitableview cells displayed image, labeltext , detailtextlabel. cell.imageview configured uitapgesturerecognizer: uitapgesturerecognizer *tap = [[uitapgesturerecognizer alloc] initwithtarget:self action:@selector(infoimagetapped:)]; [tap setnumberoftapsrequired:1]; [cell.imageview setgesturerecognizers:[nsarray arraywithobject:tap]]; the method "infoimagetapped" triggered fine. want know image (to more specific, imagenamed) tapped. i tried following code: uiimageview *thetappedimageview = (uiimageview *)tap.view; nslog(@"gesture tag: %@", thetappedimageview.description); in nslog-window: imagenamed (*.png) displayed don't know how write information nsstring variable. i need imagenamed (or reference original image in cell) open alertview image. thanks in advance florian -(void)infoimagetapped :(uitapgesturerecognizer *)gesture { uiimageview *image = (uiimageview *) gesture.view; nslog(@"gesture tag: %@", image.d...

reporting services - How SSRS deployment works? -

we working on application asked generate reports. our immediate choice use ssrs. after studying tutorials completed designing of reports. however, not clear on how deploy ssrs project displaying them in gui environment. my questions are: where should deploy project? if deploy in iis, server run it? does iis have capability run these? do need run report server run these reports? please any clarification regarding these aspects. i know how create reports, struggling basic concepts of ssrs. i.e. need more information on how setup in production environment. there 3 parts every report let's cover first: a datasource connection string or equivalent talk database, service or flat file. can contained in report or shared. shared matters in shared datasource may used 1 or many reports. a dataset query, procedure or structure of obtaining data used in report. may contained in report or shared. again shared may used 1 or many reports , may cached on server. the...

How to customize submenus isn wordpress theme -

i have wordpress theme , in header.php file displaying menus through line : wp_nav_menu( 'theme_location=menu_2&menu_id=nav&container=&fallback_cb=menu_2_default'); now if hover menu item, displays submenus items. want change layout of submenu items section or div , can't find html of submenus. need in this within css. since don't have link website direct common place it. (use dev tools inspect them) something in css .menu-top-navigation-container {...} // first list item #menu ul li {..} //second list item #menu ul li ul li{...} //second list item linkable text menu ul li ul li a{...} this hypothetical. theme different style them.

sql server 2008 r2 - Get yesterday's rows startign from 10AM -

for previous day used use below expression . date_inserted >=dateadd(day, datediff(day,0,getdate())-1,0) , date_inserted < dateadd(day, datediff(day,0,getdate()),0) how rows yesterday 10am today 10am -- yesterday @ midnight: declare @yesterday datetime = dateadd(day,datediff(day,1,getdate()),0); select ... date_inserted >= dateadd(hour, 10, @yesterday) -- 10 yesterday , date_inserted < dateadd(hour, 34, @yesterday); -- 10 today

android - Notification buttons not showing -

following this guide , other discussions online i've made pice of code should show .addaction method buttons in notification: @suppresslint("newapi") public void generatenotificationsong() { if(android.os.build.version.sdk_int >= 11){ notification.builder builder = new notification.builder(this); builder.setsmallicon(r.drawable.ic_launcher); builder.setcontenttitle(songslist.get(currentsongindex).gettitle()); builder.setcontenttext("next: " + songslist.get(getnextsong()).gettitle()); builder.setongoing(true); //e' in corso builder.setautocancel(true); //intent con activity che devo aprire (la corrente) intent thisintent = getintent(); pendingintent pendingintent = pendingintent.getactivity(this, 0, thisintent, pendingintent.flag_update_current); //aggiungo bottoni alla notifica se android è > 4.1 ...

mysql UNION wrong result? -

i have query this (select s1.m m,ifnull(s2.y,2013) y,ifnull(s2.s,0) planned (select 1 m union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9 union select 10 union select 11 union select 12) s1 left join (select year(p.pdate2) y,month(p.pdate2) m, sum(p.totwdisc) s pro_partial_inv p year(p.pdate2)=2013 group y,m) s2 on s1.m=s2.m) union (select s5.m m,ifnull(s3.y,2013) y,ifnull(s3.s,0) realv (select 1 m union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9 union select 10 union select 11 union select 12) s5 left join (select year(p.paidd) y,month(p.paidd) m, sum(p.totwdisc) s pro_partial_inv p p.status=2 , year(p.paidd)=2013 group y,m) s3 on s5.m=s3.m) union (select s6.m m,ifnull(s4.y,2013) y,ifnull(s4.s,0) proj (select 1 m union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 uni...

how to combine two strings in TCL? -

i have following code in tcl: set string1 "do firstthing" set string2 "do secondthing" how make combine 2 strings have "do firstthing secondthing" you can use append this: % set string1 "do firstthing" % set string2 "do secondthing" % append string1 " " $string2 % puts $string1 firstthing secondthing you can put them next other... % set string1 "do firstthing" % set string2 "do secondthing" % puts "$string1 $string2" firstthing secondthing or if strings in list, can use join , specify connector... % set listofstrings [list "do firstthing" "do secondthing"] % puts [join $listofthings " "] firstthing secondthing

c# - Object reference not set to an instance of an object. DataRow dRow2 = ds2.Tables["own"].Rows[0];?/? -

trying call specific row table , keep getting error, have help? database has 2 rows atm 5 columns values filled ds0 local variable inside btnlogin_click function. quick fix, have navigaterecords accept dataset argument , return dataset.

android - Fragment management with drawer layout -

i have app using slider drawer layout used in applications such youtube. have setup such there 1 main activity in main view cycles through multiple fragments attach onto activity. there 3 main fragments in navigation drawer user can switch to. within each of 3 main fragments more fragments user can go clicking button in main fragment. wondering best way manage these fragments while preserving backstack , minimizing need reload of them if user revists fragment. ex flow: main subfragment 1. contacts -> contact details when contact clicked 2. clientlist -> client details when client selected 3. infopage -> info each developer after reading question, suggest in drawerlayout , can create main list containing selection of contacts , clientlist , , infopage . selection of any, can display related info in lets detailfragment . example, selection contacts drawerlayout , contacts displayed in detailfragment . now, clicking of contact detailfragment ope...

c# - Get file path if file is in another folder -

i have text file inside drive. inside folder in drive. know filename , drive name. searches file occurance through var file = directory.getfiles(ftppath,filename,searchoption.alldirectories); that ok. if file in folder under drive how ne path in ftppath variable? i not find valid solution this. it should like: ftppath = path.getdirectoryname(file[0]); now path in filename found in stored in ftppath . of course should add checks before accessing file ensure found...

function - Set of points with a deviation from the main route javascript -

Image
here have image main route point (lat,lng) point b(lat,lng) also have object(points) , want know posible objects far main road 5km, on image here. or how can calculate using google map api. idea? posible polilines service or ... sorry english

html5 - Redraw select menu in JQuery Mobile -

i trying make jquery mobile select menu button larger changing data-mini property true false on fly. able change property, select menu not redraw. it works button, using .buttonmarkup({mini: false}) (which redraws button instantly), far know there no equivalent select menus. i have tried .selectmenu("refresh") , .change() - neither redraws select menu button. here illustration of problem: http://jsfiddle.net/yyxuz/ does have solution? hey works me - $('#testselectmenu').parent('div').addclass('ui-fullsize'); jsfiddle demo i noticed won't need $('#testselectmenu').selectmenu('refresh'); approach. /update to play safe (it same thing while removing data-mini attribute , ui-mini class) - $('#testselectmenu').parent('div').attr('data-mini', 'false').removeclass('ui-mini').addclass('ui-fullsize'); i think jqm should handle automatically when call .s...

regex - Regular expression to extract text from XML-ish data using GNU sed -

i have file full of lines extracted xml file using "gsed regexp -i filename". lines in file of 1 of either format: <field number='1' name='account' type='string'w/> <field number='2' name='advid' type='string'w> i've inserted 'w' in end represents optional whitespace. order , number of properties not same in lines throughout file although "number" before "type". what i'm searching regular expression "regexp" can give gnu sed command: gsed regexp -i filename gives me file lines looking this: 1 string 2 string i don't care amount of whitespace in result long there after number , newline @ end of each line. i'm sure possible, can't figure out how in reasonable amount of time. can help? thanks lot, jules i'm sure can optimized, works me , answers question: sed "s/^.*number='\([0-9]*\)'.*type='\(.*\)'....

performance - Slow Execution of MySQL Select Query -

Image
i have following query… select distinct * vpas_posts_users (post_user_id =:id , post_type != 4) , post_updated >:updated group post_post_id union select distinct vpas_posts_users.* pas_follow join vpas_posts_users on ( pas_follow.folw_followed_user_id = vpas_posts_users.post_user_id ) (( pas_follow.folw_follower_user_id =:id , pas_follow.folw_deleted = 0 ) or ( post_type = 4 , post_passed_on_by = pas_follow.folw_follower_user_id , post_user_id !=:id )) , post_updated >:updated group post_post_id order post_posted_date desc limit :limit where :id = 7 , :updated = 0.0 , :limit=40 example my issue query taking minute return results. there in query can speed result? i using rds ********edit********* i asked run query explain result below ********edit********** view definitition create algorithm=undefined definer=`mysqluser`@`%` sql security definer view `vpas_posts_users` select `pas_user`.`user_user_id` `user_user_id`, `pas_user`.`user_coun...

php - enum list with pre-selected multiselect form -

ok, new sort of thing , building small site work has profiles employees. working on way edit profiles, , when goes "edit" page, need of used values pre-selected. when have dropdown based on enum list, works fine example <?php $table_name = "agents"; $column_name = "assignedabc"; echo "<select name=\"$column_name\"><option>select one</option>"; $q = "select column_type information_schema.columns table_name = '$table_name' , column_name = '$column_name'"; $r = mysqli_query($con, $q); $row = mysqli_fetch_array($r); $enumlist = explode(",", str_replace("'", "", substr($row['column_type'], 5, (strlen($row['column_type'])-6)))); foreach($enumlist $value) echo '<option value="'.$value.'" '.(($value==$rows[assignedabc])?'selected="selected"':"").'>'.$value....

python - Bingsearch returning 'instancemethod' object has no attribute '__getitem__' -

i have written code; import bingsearch bingsearch.api_key='mykey' r = bingsearch.request("johndalton") r.status_code r[0]['description'] print r[0]['url'] this th bingsearch.py file import requests import urllib2 url = 'https://api.datamarket.azure.com/data.ashx/bing/searchweb/web?query=%(query)s&$top=50&$format=json' api_key = 'mykey' def request(query, **params): r = requests.get(url % {'query': query}, auth=('', api_key)) return r.json['d']['results'] as mentioned in title gives me instancemethod error. how should fix this? @chris barker spot on earlier. you need change line return r.json['d']['results'] return r.json()['d']['results'] . you should proper error checking on requests.get result , on json returned. might not contain items expect , raise keyerror . for request errors might want check request documentation ha...

javascript - easyXDM rpc with HashTransport callback not being fired -

i'm using easyxdm 2.4.17. i've setup rpc remote 'tunnel.html' makes ajax calls using jquery. for modern browsers (those postmessage) working fine. when test on ie7 easyxdm falls hashtransport , still works fine except never see ajax response. can see request coming fine callback never being fired reason. my tunnel.html file looks this: <!doctype html> <html> <!--[if lt ie 9]> <script type="text/javascript" language="javascript" src="https://mydomain.net/json2.min.js"></script> <![endif]--> <script src="https://mydomain.net/easyxdm-2.4.17.js"></script> <script src="https://mydomain.net/jquery-1.10.2.min.js"></script> <script> function apitunnel (endpoint, params, method, callback) { var options = { url: endpoint, data: params, type: method, ...

excel vba - VBA - object required error when setting .DisplayAlerts = False -

background: i sas programmer (a statistical software), i'm using vba make excel play nicely sas. wrote program can execute in sas using following code: *batch convert excel files csv files; %let xlsfile=c:\xlsfile.csv; %let csvfile=c:\csvfile.csv; %let worksheet=1; x 'cd "c:\location_of_vbsfile"'; x "vbsfile.vbs &xlsfile &worksheet &csvfile"; the program opens excel file, selects required sheet, replaces commas, carriage returns, , line feeds, saves file csv file can nicely import file sas. problem: i want to eliminate message boxes may produced. added application.displayalerts = false top of program prevent message boxes being displayed. however, following error, must wrong. error: object required: 'displayalerts' this code: '1 - open excel dim oexcel dim obook set oexcel = createobject("excel.application") 'this added set oexcel.displayalerts = false set obook = oexcel.workbooks.open(wsc...

map - Java TreeMap contains a key but a containsKey call returns false (even the key is exactly the same unchanged object) -

why possible loop keyset of treemap , getting .containskey == false ? for (object thisobject : map.keyset()) { if (!map.containskey(thisobject)) { system.out.println("this line should never reached."); } } after lot, lot of different iterations , calls line gets hit. map.get(thisobject) return null . debug shows key ( same reference, value , hash ) , actual value in map. map small (25 elements) treemap<long, double> update: as guessed @rgettman theres custom sort comparator used @ construction of treemap (didn't see because constructed class). comparator (i guess) copy pasted here changing comparator : public int compare(object a, object b) { if((double)base.get(a) > (double)base.get(b)) { return 1; } else if((double)base.get(a) == (double)base.get(b)) { return 0; } else { return -1; } } to ... } else if(base.get(a).equals(base.get(b))) { return 0; ... fixes problem. reason...

java - ActiveMQ Running on AWS - EC2 instance, Producer Performance Improvement -

i working on assignment requires me benchmark response times between apache activemq , aws-sqs. in finding found that, activemq producer takes 35 sec / 1000 messages [120 bytes each] consumer takes 250 ms / 1000 messages [120 bytes each] i using maven + git + java based project structure. creating session connectionfactory in following way: cfactory.createsession(false, session.auto_acknowledge); connection synchronous, message reliability important. can tell me logic or reason behind behavior? i suspect producer takes time because has not send wait acknowledgement amq service running on ec2 fact has journaled message. please let me know why producer slow , how can improve upon it. your suspicion correct 'it has not send wait acknowledgement amq service running on ec2 fact has journaled message.' try sending multiple messages in transaction. messages in tx sent without having wait acknowledgement. when commit() client block waiting acknowledgement ...

python - Easiest paths from Pygame/PyOpenGL to iOS. -

i have a significant game need port tablets. (android has pygame subset android, i'm still investigating). great take python code , move more cross-platform engine. i'm looking engines pure code api, can wrap intermediate glue graphics , audio around. kivy , others use *ml (or json). hoping missed good. best i've seen futile unity3d, boo !!!!!= python. have @ http://ignifuga.org , it's python based , inspired projects cocos2d , andengine.

css - problems placing submit button in a responsive web page -

i have web page displays 1 dropdown box when page loads, , submit button beside it. depending on option user selects dropdown, make ajax calls , if data returned, display drop down list more options. 2 times, in total, can have 3 drop downs on page side side. while, submit button supposed to right of last drop down box that's displayed. problem: depending on mobile device i'm using navigate site, submit button overlaps first drop down box if there's plenty of room on row. same thing happnes when second drop down appears. how can ensure regardless of device, submit button appears beside first drop down? code: i'm showing html... ajax works. ajax code adds select boxes within each div tag. <div class="row-fluid"> <div class="span12" id="l1locations"> <h2><?php echo $title;?></h2> <div class="span3"> <h4>branch:</h4...

javascript - Overlapping images JS Slider -

could guys recommend me slider works in link bellow?(basically small image gallery images partially overlap each other). slider i sugget spacegallery jquery plugin http://www.eyecon.ro/spacegallery/

phonegap plugins - ErrorType: Argument to path.join must be string -

i working on phonegap application send sms using third party plugin.but facing exception "errortype: argument path.join must string:360:15". please tell me reason of exception! here snapshot of error click here before exception facing missing of plugin.xml file exception. after add of plugin.xml facing error now. let me debug this, thank full of in advance

iphone - Memory not releasing after popToRootViewControllerAnimated -

i using navigationcontroller in app. after push , pop view controller 3 times app crashes because of low memory. code below. - (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { self.window = [[uiwindow alloc] initwithframe:[[uiscreen mainscreen] bounds]]; homepagevc *homepage = [[viewcontroller alloc] homepage = [[viewcontroller alloc] initwithnibname:@"mainview-ipad" bundle:nil]; navigationcontroller = [[uinavigationcontroller alloc] initwithrootviewcontroller:homepage]; self.window.rootviewcontroller = navigationcontroller; [self.window makekeyandvisible]; return yes; } when user pushes button, send him view controller. -(ibaction)showmap:(id)sender { mapviewcontroller *mapviewcontroller = nil; mapviewcontroller = [[mapviewcontroller alloc] initwithnibname:@"mapview-ipad" bundle:nil]; appdelegate *appdelegate = (appdelegate *)[[uiappli...

jquery ui draggable - Slickgrid TreeGrid drag and drop - How to get row id and details of the row, on which another row, was dragged & dropped -

i'm trying implement drag , drop within slickgrid treegrid. structure- electronics > tv > led > sony lg lcd > samsung toshiba eg - http://mleibman.github.io/slickgrid/examples/example5-collapsing.html brands moved 1 category another. got point got row drag enabled, , gets details row i'm dragging. using following can row dragged - $("#teamgrid").bind("drop", function (e, dd) { data[dd.row] } now, how details or id of row dropped drag-row? there example drag drop enabled within grid? i think figured out - var name = e.target.offsetparent.childnodes[1].innerhtml; var temp = document.createelement("div"); temp.innerhtml = name; alert(temp.textcontent || temp.innertext);

html - How widely supported is the iframe attribute "allowfullscreen"? -

i can't seem find websites detailing support iframe attribute "allowfullscreen". caniuse.com doesn't seem have listing it, example. does have support information chrome, safari, ie , firefox? i've started discovering of own answers: firefox : added support in v18 (january 8, 2013) - source chrome : added support in v27 (may 22, 2013) - source safari: added support in v7 (october 22, 2013) - source internet explorer: added support in v11 microsoft edge: supported it seems difficult find detailed release notes other three, unfortunately.

python - Computing Eulers Totient Function -

i trying find efficient way compute euler's totient function . what wrong code? doesn't seem working. def isprime(a): return not ( < 2 or any(a % == 0 in range(2, int(a ** 0.5) + 1))) def phi(n): y = 1 in range(2,n+1): if isprime(i) true , n % == 0 true: y = y * (1 - 1/i) else: continue return int(y) here's faster, working way, based on description on wikipedia: thus if n positive integer, φ(n) number of integers k in range 1 ≤ k ≤ n gcd(n, k) = 1. i'm not saying fastest or cleanest, works. import fractions def phi(n): amount = 0 k in range(1, n + 1): if fractions.gcd(n, k) == 1: amount += 1 return amount