Posts

Showing posts from June, 2012

css3 - list elements padding in iOS sencha touch -

Image
i having problem displaying list elements in iphone here in image 'black' overlapped itemdisclosure icon. tried style using text-align: "right" didn't find difference. appreciated here list code itemtpl : [ '<p style="font-family:arial;color:black;font-size:20px;">{description}</p>', '<div style="font-size: 0.75em; color: darkgray">sku:{code}</div>' ].join(''), you should not having problem because sencha adjust itemdisclosure icon based on text. anyway, give width p tag css .description{ font-family:arial; color:black; font-size:20px; width:90%; // reduce wish } .code { font-size: 0.75em; color: darkgray; } list code itemtpl : [ '<p class="code ">{description}</p>', '<div class="description">sku:{code}</div>' ].join(''), well, still want inline style itemtpl : [ '

Mac or Windows OS for server communicating with iOS and Android devices -

i learning server-side programming. server (mac mini) should communicate ios devices, wish add android devices mix in future. i ask in case, can server's os remain mac? or should preferably windows? or not make difference? sorry n00b question, i'm new servers. as long client , server communicating using well-defined protocol, computing platform of either irrelevant. one of simplest , common methods server , client communicate via http protocol. required on server side standards compliant web server , client side, pretty basic apis. you can run popular apache web server on mac (or windows, linux, etc.) server, , use classes nsurlconnection on native ios apps communicate server. you have httpclient class on android. on server side, outside of serving files, can develop rest - api using common languages such php, ruby, python, , perl, integrate apache.

c# - Proper way to load listbox with images -

i have scenario have list box images. have loaded images in list box,but list box loading slowly. i want faster way load listbox. again when loading list box second time slows down app. there way store images somewhere in isolated storage or anywhere, when loaded second time can loaded fastly. as whole want faster way load list box images. here code: public mainpage() { initializecomponent(); getimages(); } public void getimages() { try { medialibrary medialibrary = new medialibrary(); var pictures = medialibrary.pictures; foreach (var picture in pictures) { bitmapimage image = new bitmapimage(); image.setsource(picture.getimage());//out of memory exception img mediaimage = new img(); mediaimage.imgs = image; imagelist.items.add(mediaimage); } } catch (exception ex) { } } public class img { public img() { } public bitmapimage img

java - Running Windows-compiled C++ program on Linux machine using Runtime -

i need run executable on command line through java. have seen lot of information , using runtime object execute file. have problem: executable written in c++ , compiled windows, i'm using linux. have no access source code. i read in documentation of runtime environment runtime allows application interface environment in application running the environment running on linux, application not work if application interfacing linux environment. i curious if there other objects other runtime this, mimic runtime of different os. example maybe windowsruntime object or call , have application run without having recompile linux. seems pretty complicated (perhaps virtual machine) thought worth try.

php - How to match spaces and ascii characters in .htaccess file -

i'm trying match special characters in .htaccess file id value can return page matching correct id value. in mysql field text is: thelma & louise before rewrite rule page address looked property data populating page www.site.com/movie.php?id=thelma+%26+louise my rewriterule ^movie/([a-za-z0-9_-\s]+)/?$ /movie.php?id=$1 the url comes out page not found error www.site.com/movie/thelma+%26+louise how can match ascii characters page displayed. thanks help! the uri gets decoded before gets run through of rewrite rules, need match against space , ampersand & . pattern, ([a-za-z0-9_-\s]+) needs account symbols: rewriterule ^movie/([a-za-z0-9_&+-\s]+)/?$ /movie.php?id=$1 [l,b] additionally, need use b flag grouped match $1 gets propery encoded in query string.

Qt Localization with a variable -

i translate weather conditions in code having little trouble. example: english - cloudy french - nuageux weatherstring = hash["weather"]; weatherbytes = weatherstring.tolocal8bit(); weatherchararray = weatherbytes.data(); qdebug() << "current weather: " << qobject::tr(weatherchararray); the weather comes in web service it's different. knew code above not create entries automatically in .ts files known @ runtime, tried manually enter them. <message> <source>cloudy</source> <translation>nuageux</translation> </message> but everytime compile puts in: type="obsolete" in translation tag, should do?? here 1 of ways have implemented solution problem. // setup (in constructor before use of mytr function this->availabletranslations(); in cpp file... qmap <qstring, qstring> settingswidget::trmap; void settingswidget::availabletranslations() { if(trmap.size() != 0

sql server - Select Top n Values Across Columns and Average -

i have table has 13 columns , 1 type varchar(25) , rest type `int (holding values each month of year). for each row, pick top 6 int values 12 columns , calculate average of values. i know how select top n given column, how do across multiple columns? select id, ( select avg(c) ( select top(6) c (values(c1),(c2),(c3),(c4),(c5),(c6),(c7), (c8),(c9),(c10),(c11),(c12)) t(c) order c desc ) t ) c yourtable sql fiddle for sql server 2005 since can't use table value constructor select id, ( select avg(c) ( select top(6) c (select c1 union select c2 union select c3 union select c4 union select c5 union select c6 union select c7 union select c8 union select c9 union

c# - Can a eventhandler delegate remove itself -

how can eventhandler delegate remove ?? code this void timertick(object sender, eventargs e) { if (!isholding){ return; } utilitystoryboardmanager.playerstoryboard("end", (_) =>{ isholding = false; //call function or perform logic timer.stop(); //how can eventhandler delegate remove ?? //timer.tick -= timertick; }, null); } are trying this? void timertick(object sender, eventargs e) { if (!isholding){ return; } utilitystoryboardmanager.playerstoryboard("end", (_) =>{ isholding = false; //call function or perform logic timer.stop(); //how can eventhandler delegate remove ?? //timer.tick -= timertick; }, null); (sender timer).tick-=timertick; // removes event }

c++ - Sharing data between console application and a windows form -

i'm writing program works in console, once in while, need use forms. i created windows form , switched output console. after that, added 1 more form (form2) project, , have code looks this: #include "stdafx.h" #include <iostream> // std::cout , such #include "form1.h" #include "form2.h" using namespace testing_forms; [stathreadattribute] int main(array<system::string ^> ^args) { // enabling windows xp visual effects before controls created application::enablevisualstyles(); application::setcompatibletextrenderingdefault(false); /* instructions block 1 */ application::run(gcnew form1()); /* instructions block 2 */ application::run(gcnew form2()); /* instructions block 3 */ return 0; } so, basically, program runs 1st instruction block, calls form, runs 2nd instruction block, , on. however, not allow me share data between forms , console, which, since 1 program, need, such usernames, in

php - PyroCMS form handling -

i modify required fields registration , edit-profile forms in pyrocms. unfortunately cannot find code form handling (the part required fields passed). can point me it? thanks. assuming using pyrocms 2.2.3 community : the "edit-profile" form handled users module . view : system/cms/modules/users/views/profile/edit.php controller system/cms/modules/users/controllers/users.php , method edit (line 649). at beginning of code, can see validation rules. $this->validation_rules = array( array( 'field' => 'email', 'label' => lang('user:email'), 'rules' => 'required|xss_clean|valid_email' ), array( 'field' => 'display_name', 'label' => lang('profile_display_name'), 'rules' => 'required|xss_clean' ) ); email , display_name "hard coded" profile fields , natively han

javascript - How to dynamically add scripts to webpage from an HTML string? -

say have string named html has in it: <script> document.write("some random stuff here"); </script> <script src="someremotejsfile"></script> i want display within iframe window dynamically. my original solution do: document.open(); document.write(html); document.close(); but causes problems in firefox spinner keeps spinning if loading forever though content has loaded. next attempt to: document.body.innerhtml = html; this adds scripts body, doesn't execute them. lastly tried: div = document.createelement("div"); div.innerhtml = html; document.body.appendchild(div); but doesn't seem execute scripts inside html string. so question is, given string of html, how dynamically add page? instance, can ad tag has number of scripts , other html elements in it. have no control on html string has in it. it's black box me. have able take long string of html , load window (an iframe in case).

java - What's the GWT Developer Plugin Protocol -

on gwt overview page reads: the gwt developer plugin spans gap between java bytecode in debugger , browser's javascript. thanks gwt developer plugin, there's no compiling of code javascript view in browser. can use same edit-refresh-view cycle you're used javascript, while @ same time inspect variables, set breakpoints, , utilize other debugger tools available java. , because gwt's development mode in browser itself, can use tools firebug , inspector code in java. and question , answer how gwt code runs in development code mentions js code extracted , put browser evaluated , result sent java. what's exact protocol of process? documentation (not high level ones)? locations in source code? how track interface in browser or in java vm (firebug, or java debugger)? edit: artem below answered how looks lowest layer on java side. what's higher layers, if know? what's on browser side? everything's documented in wiki actually: http

javascript - MVC4 \ how to add .png & .js etc -

i'm newbie in web development - opened vs2012, new mvc project (their default project started). i don't find way add .png files (shoud locate them under content>themes>bast>image?), same goes .js - tried drag & drop, tried "add" - know really basic - how add files (not regular class , everything) in projects, have content/images/pnghere , scripts/jshere. right click desired folder, hover on "add" , click new item. choose .js file in case of scripts. if don't want work that, use file explorer , literally copy/paste file in desired spot. in vs, refresh solution explorer , click "show files". when pasted file shows (should colorless , faded), right click , select "include in project" @ point become colored , ready use.

debugging - Browsing path in Delphi XE4 doesn't function the way Embarcadero says -

the embarcadero website describes delphi browsing path follows: browsing path specifies directories code browsing feature of code editor looks unit files when cannot find identifier on project search path or source path. http://docwiki.embarcadero.com/radstudio/xe4/en/code_editor i have devexpress components , paths .pas files in browsing path. somehow, code browser doesn't find these files. cannot step these files when debugging. .dcu files in library path. is embarcadero website wrong? people seem adding path .dcu should enough step .pas when debug .dcus set true: organizing search path i don't find true. what's that? the documentation accurate. correctly describes browsing path. however, it's not uncommon ide confused. if project doesn't compile code browsing doesn't work. full re-build enough make code browsing work again. that's not enough. in case attempt solve problem require sscce. but question asked, documentation corr

what is wrong with my jquery ajax form post? -

$("button[name='advocate-create-button']").on("click", function () { $.ajax({ url: '/vendor/advocatecreate', type: 'post', datatype: 'json', data: $('form#advocate-create-form').serialize(), success: function() { $(".modal_overlay").css("opacity", "0"); $(".modal_container").css("display", "none"); } }).done(function (data) { var $target = $("#advocate-list-view"); var $newhtml = $(data); $target.replacewith(data); $newhtml.effect("highlight"); }); return false; }); almost got this, need slight assist done...i'm trying post form data '/vendor/advocatecreate' , once saves, want dialogue go away , list behind updated. the list behind advocatelist view , pulls data advocatelist method in same c

javascript - Weird behaviour while inspecting chrome extension -

i have script running click on extension icon - should grab tab url, post remote server, list response. websites, working fine, other - displays first line, is, "url: blabla.com" (it still posting correctly). now, when try debug - right-click, inspect element , list (it doesnt display line "url:" though). now question - why? code: chrome.tabs.getselected(null,function(tab) { var tablink = tab.url; document.write("<p>"+ "url: "+ tablink +"</p>"); document.write("<p>"+ "lists: </p>"); var mydata = { url: tablink }; $.ajax( { url: 'http://127.0.0.1:8000/addon/', type: "post", data: mydata, success: function(response){ document.write("<p>"+ "response: "+ response.id +"</p>"); ... edit : fixed problem using .append() i

c# - Why won't Fakes properly reference a Fakes dll from a prebuilt Fakes project? -

i have problem in trying reference mscorlib fake dll separate projects, described below. i have numerous vs12 solutions i'm writing unit tests using ms fakes. based on suggestion in following url, i've decided make project fake dlls: code generation, compilation, , naming conventions in microsoft fakes . idea location of fake dlls localized , don't need have numerous faked dlls strewn throughout test projects. (i'll call common fakes library.) in current unit tests, i'm using shims presentationcore , system.management , system . however, system shims i'm using in mscorlib.dll , more convert (a static class) , driveinfo (a sealed class). because need these 2 classes mscorlib (for now) i've created following .fakes file mscorlib: <fakes xmlns="http://schemas.microsoft.com/fakes/2011/"> <assembly name="mscorlib" version="4.0.0.0"/> <stubgeneration> <clear/> </stubgeneration>

C# GeckoFX web browser - Remove http from textbox -

i'm working on web browser. once textbox isn't selected anymore should remove http:// , last /. i'm using leave method of textbox. code works fine normal webbrowser. if (w.documenttitle != "") { q.text = "" + w.url; q.text = q.text.replace("http://www.", ""); q.text = q.text.replace("https://www.", ""); q.text = q.text.replace("http://", ""); q.text = q.text.replace("https://", ""); if (q.text.endswith("/")) { q.text = q.text.substring(0, q.text.length - 1); } } in geckofx textbox still displays http:// , /!?!?! if want take domain name try this q.text = mygeckowebbrowser.url.domain; if want local path try this q.text = mygeckowebbrowser.url.localpath; and if want both try this q.text = mygeckowebbrowser.u

php - Is a foreach array the best choice to change sql column names on my web page? -

okay building website using php , mysql. here issue: some of columns in database such things us, darke, , year2010 . many of these column names placed in drop down boxes users can collect data. however, instead, names united states , darke county (oh) , , 2010 example. using bunch of arrays 1 below change values. $arraylocation = array('darke' => 'darke county (oh)'); then, use foreach ($array $let=>$word) array access names want display on web page. is best way go changing values of column names? can't think of way go this. appreciated. values can vary entity should stored in row, not column: user attribute value 1 country 1 county darke 1 year year2010 this eliminate need rename columns. if want normalize values contained in columns, can use mapping table: old new united states darke darke county (oh) year2010 2010

notepad++ - Wild card search using Notepad -

in notepad++ how can search using wildcards for get_gettimenow(); or get_iscurrent(); then want replace with gettimenow or iscurrent in other words find get_xxxx(); replace with xxxx; i'm trying large file use find. pick replace tab. set search option regex . (bottom left). find what: get_(.*)\(\); replace with: \1 note: work if these tokens on end of line. not unreasonable assumption if have ; @ end. explanation: get_ matches first 4 characters. (.*) matches next characters. saves matched string. \(\); matches end of string. uses \ escape ( . () saves matched string used above. because of match not include section.

How to override Sitecore RichText field -

i want create custom field sitecore project inherits sitecore rich text field (sitecore.shell.applications.contenteditor.richtext). field read-only field , want code run when field loaded/displayed , need override value. seeing code run. when view content item in sitecore nothing displayed in rich text field. if click show editor button or edit html button view html, html content there. , if close little sitecore pop-up , go content item can see html. problem doesn't display first time come screen. feeling not overriding correct method of base control. here code public class mycustomfield : sitecore.shell.applications.contenteditor.richtext { protected override void onload(eventargs e) { ...insert custom code here build html string... base.value = _myhtml; base.onload(e); } } i figured out. overriding wrong method. once switched override onprerender method worked fine. code should this: public class mycustomfield : sitecore.shell.applic

android - onItemClickListener implemented on other rows of custom ListView -

--edited-- what have: 2 listviews of different colors i using customlistviewadapter what want do: 1-on item click of first listview, color of view set same color of second , textview's text color white instead of black. 2-when clicking item, first item return was. problem: everything went great till noticed when click item , scrolling, other views changing background color , text color too.. in getview() in customlistadapater: code: vi = inflater.inflate(r.layout.itemshow, null); vi.setonclicklistener(new onclicklistener(){ @override public void onclick(view v) { log.i("mylist","isclicked"); if(previousview!=null){ previousview.setbackgroundcolor(color.white); holder.nametext.settextcolor(color.black); holder.quantitytext.settextcolor(color.black); holder.pricetext.settextcolor(color.black); } v.setbackgrou

c# - Hiding fields in DetailsView from codebehind -

sorry if elementary, i'm new .net , have looked around, maybe i'm not searching right terms. i have detailsview loaded in design view. i'd of these fields show users. thinking in codebehind, hide other fields. i'd change headertext of these fields in codebehind. however, need detailsview editable. if fields hidden users, wasn't sure how effect anything. update fields, hidden ones? only users should see edit button well. does have tips on how go this? in page class create boolean field represent whether control should visible , set value in page_load. (note: authentication.isauthorized example of how determine field, replace own code) public partial class mypage : system.web.ui.page { protected bool showfield = false; protected void page_load(object sender, eventargs e) { showfield = authentication.isauthorized(user.identity.name); } } now bind field in control. note requires use of template fields rather bound

d3.js - D3 treemap json data format -

i'm new d3js. i've gone through several examples of treemap visualization , noticed data has same hierarchical structure: { "name": "flare", "children": [ ... ] ... } but if have array of objects same set of properties without nesting: [ { "courseid": "15.010b", "subject": "15.01", "section": "b", "department": "managerial economics", "professor": "doyle", ... }, { "courseid": "15.010b", "subject": "15.01", "section": "b", ... }, ... ] should make hierarchical myself? can provide me visual treemap example type of data format. in advance. d3's built-in nest feature can create type of hierarchical data you, example: var nest = d3.nest() .key(function(d) { return d.department; }) .key(func

java - Throws exception and return from finally - Tomcat hangs -

looking @ frequent hangs of tomcat server , came across exceptions thrown in part of code. when examined code, looked public static string dosomething() { string returnvakue = "default value"; try { resultset rs = getmyresultset(); rs.first(); returnvalue = rs.getstring("my_field"); // note exception happens @ times when resultset empty } catch (exception e) { throw new exception(e); } { return returnvalue; } } while aware ok have both throws exception , return, wondering if can cause kind of leaks in tomcat. , there potential risk performance. ? hoowever caller function stops execution @ point. views on this? affect gc? edit : note : i know how correct code. please share views whether can potentially cause tomcat hanging. first check if returned resultset empty. while( rs.next() ) { // resultset processing here // result set not empty } in opinion throwing exceptio

Invalid nested resource added to collection before save in Rails 4 -

this routes.rb resources :posts resources :comments end and post/show.html.haml .post %h1= @post.title %p= @post.content - @post.comments.each |comment| .comment %h3= comment.name %p= comment.text = form_for([@post, @post.comments.build]) |f| = f.label :name = f.text_field :name = f.label :text = f.text_area :text = f.submit the problem when try save invalid comment still gets added @post.comments , printed out. if refresh invalid comment disappears, still want avoid if possible - , wondering best practice is? currently i'm working around issue doing check: - unless comment.invalid? any appreciated! :-) if wants know, solved problem in following way: = form_for([@post, @comment = @comment || @post.comments.build)

How to get the element name in XSLT -

i'm editing xsl file, , having trouble getting name of element. everything here works except ../../name() . i'm trying there name of element. beneath gets attributes of same element, fact ../../@name (etc.) works should make clear i'm trying ../../name() . <tr> <td><xsl:value-of select="../../name()" /></td> <td><xsl:value-of select="../../@name"/></td> <td><xsl:value-of select="../../@alias"/></td> <td><xsl:value-of select="../../@comment"/><xsl:text>...</xsl:text></td> <td><xsl:value-of select="../../dxl:wassignedby" /></td> <td><xsl:apply-templates select="."/></td> </tr> the piece of xml (in case helps visualize i'm talking about) is: <form name="extended content" alias="content" hide="notes" nocompose="true" noquery=&

encoding - QR decoding barcode output symbols meaning -

i have output of decoded qr barcode, code has meaning or can interpret these symbols meaningful output? there algorithm interpret output of decoding qr? output: lwludgvydmlldy5zmy5hbwf6b25hd3muy29tl this string: lwludgvydmlldy5zmy5hbwf6b25hd3muy29tl is base64 representation of: -interview.s3.amazonaws.com however, not related qr codes. person created qr code arbitrarily decided encode content base64. if you're managing base64-encoded qr codes, you'll need decode using same algorithm, keep in mind not part of process of decoding qr codes.

What would happen if two IIS redirect to each other? -

what happen if, put 301 redirect in iis 6 1 web site (a) redirect site (b), same page, having iis 7 site (b), redirect old page in (a). are going cause infinite , forth redirect? or going cancel each other out? for example: (a) iis6: www.example.com/123 redirect www.example.net/abc (b) iis7: www.example.net/abc redirect www.example.com/123 http 301 status code not request . browsers rather web server, web server not "know" you've been redirected back. browsers 1 should detect redirect loop , stop error. 1. know true chrome , relatively recent ff, no idea ie...but i'd imagine detected.

json - make @jsonignore use a setter over a isMethod? -

this class public class housejpaimpl implements house { public roomjpaimpl room; public roomjpaimpl getroom(){ return this.room; } public void setroom(roomjpaimpl room){ this.room = room; } @override public boolean isroom(){ return false; } } my code gets confused getroom , isroom. caused by: java.lang.illegalargumentexception: conflicting getter definitions property "room": com.shared.model.restimpl.jpa.housejpaimpl#getroom(0 params) vs com.shared.model.restimpl.jpa.housejpaimpl#isroom(0 params) i tried putting @jsonignore on isroom method dont room property in json. is there way use getroom on isroom? first of all, jackson 2.3 handle gracefully (see https://github.com/fasterxml/jackson-databind/issues/238 ). but until gets released, there 2 main ways handle this: add @jsonignore on isroom() , keep @jsonproperty on getroom() change visibility settings filter out isxxx() methods: can either set global settings ( objectmapper has setvisibil

Semi-colons in URL changes to %3b via .htaccess -

this .htaccess file - rewritecond %{request_uri} !(/$|\.) rewriterule (.*) %{request_uri}/ [r=301,l] <ifmodule mod_rewrite.c> rewritebase / rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d #rewriterule ^template\.php$ - [l] #rewriterule ^index\.php$ - [l] rewriterule . /template.php [l] </ifmodule> it's designed funnel through /template.php processes rest of url & domains. for whatever reason, when there's semi-colons provided in url (which important piece of url constructing listing queries on real estate websites) semicolons change %3b not want. oddly enough happening on 1 website only... of sites on same server. http://dev.brixwork.com/listings/city-vancouver+west/area-arbutus;cambie;coal+harbour/order_by-create_date/order_direction-desc/page-1 the above test url fine. however take same file here.. http://suzannec.brixwork.com/listings/city-vancouver+west/area-arbutus;cambie;coal+harbour/order_by-create_date/order

How to turn a Linux application in C/C++ into a Desktop Environment for a Linux distro? -

is possible write program in c/c++ , turn linux desktop environment? want take program, , able boot linux distro , see that. say have linux program window containing "hello world" on white background. how can make program linux desktop environment distro, boot , see: hello world , on white background. any ideas? let me know if made no sense. edit: not talking cross-compiling. you don't want modifying rc files. use distro's existing mechanism controlling lightdm/gdm/other , starting x. want create new x session type writing xsession file, de shows de alongside kde , gnome. put script in /usr/share/xsessions (and see existing examples there).

parallel processing - CUDA timing for multi-gpu applications -

Image
this standard way timing in cuda performed: cudaevent_t start, stop; float time; cudaeventcreate(&start); cudaeventcreate(&stop); cudaeventrecord(start, 0); // timed cudaeventrecord(stop, 0); cudaeventsynchronize(stop); cudaeventelapsedtime(&time, start, stop); printf ("time: %f ms\n", time); in cuda simplep2p (peer-to-peer) example, timing performed in way: cudaevent_t start, stop; float time; int eventflags = cudaeventblockingsync; cudaeventcreatewithflags(&start,eventflags); cudaeventcreatewithflags(&stop,eventflags); cudaeventrecord(start,0); // timed cudaeventrecord(stop,0); cudaeventsynchronize(stop); cudaeventelapsedtime(&time,start,stop); my questions are: why, p2p example, timing has been performed cudaeventcreatewithflags cudaeventblockingsync ? is needed in, speaking, multi-gpu applications (including peer-to-peer memcopy timings? thanks. after 3 years, i'm answering own question. to end, i'll c

extjs - Netzke Has many relation and rails fields_for -

i have simple has_many relation can implemented rails fields_for . looking same behavior netzke . here classes: class question < activerecord::base attr_accessible :description, :title validates_presence_of :title, :description has_many :question_options accepts_nested_attributes_for :question_options end class questionoption < activerecord::base attr_accessible :title, :question validates_presence_of :title belongs_to :question end here form building: class questionform < netzke::basepack::form js_configure |c| c.mixin end def configure(c) super record.build_for_editing if record.present? c.model = 'question' c.title = 'question' c.items = [:title, :description] end end upto point form working fine. can't figure out way implement has_many behavior in rails fields_for can 1 guide me how use netzke scenario. are trying implement master-detail/one-to-many editing? if so, ex

Can travis-artifacts be used to upload to S3 from a pull request? -

i have org repo @ github.com/numenta/experiments , , forked version @ github.com/rhyolight/experiments . when trying artifact uploads s3 working as described in blog post , used travis encrypt command -r rhyolight/experiments option, , worked, can see on line 60 in travis output . i created pull request against original repo , , build failed there error: missing required arguments: aws_access_key_id, aws_secret_access_key (argumenterror) that tells me travis unable decrypt secure environment variables, because being executed in different repository hashes created. ok, makes sense. recreated secure variables -r numenta/experiments slug instead of using own github username. so, familiar upload error when build runs on rhyolight/experiments , expected, same upload error when runs against numenta/experiments within pull request. to experiment, merged pull request see if secure values extracted once merged master , no longer running pull request... and worked! is there

php - Search Query don't show results -

i have search engine problem search engine don't show search results, connections database correct here code: php : if (isset($_post['search'])) { $searchq = $_post['search']; $searchq = preg_replace("#[^0-9a-z]#i", "", $searchq); $query = mysql_query("select * treference sreference '%$searchq%' or ssearch '%$searchq%' or ssort '%$searchq%'") or die("la recherche est impossible"); $count = mysql_num_rows($query); if ($count == 0) { $output = "aucun résultat pour cette recherche!"; //english trans : no results have been found! } else { $sreference = $count['sreference']; $output.= '<div><ul><li><a target="_blanc" href="refrences.php?reference=' . $sreference . '" title="' . $sreference . '">' . $sreference . '</a></li></ul></div>'; }

What is the deal with Twilio and International SMS? -

i've been working twilio program sms functionality on app, , seems twilio works best numbers , not international numbers. i've done research , have learned august 16th fiasco resulted inthe sms functionality being shut off twilio. through testing have learned international carriers not supported twilio. of friends abroad aren't receiving twilio sms messages. can provide further insight issue? international sms supported twilio? if not, how many carriers , ones supported? there better sms service provider can guarantee full support if not more prevalent carriers internationally? thanks support , clarification on issue. good questions - information can kind of hard find on our website right now. if i'm picking you're putting down correctly, you're curious kind of availability twilio sms has internationally , deliverability like. the matrix on kind of twilio service available can little complicated (which have here little buried in our faq: ht

python - How to create a range of numbers with a given increment -

i want know whether there equivalent statement in lists following. in matlab following fid = fopen('inc.txt','w') init =1;inc = 5; final=51; = init:inc:final l = length(a) = 1:l fprintf(fid,'%d\n',a(i)); end fclose(fid); in short have initial value, final value , increment. need create array (i read equivalent lists in python) , print file. in python, range(start, stop + 1, step) can used matlab's start:step:stop command. unlike matlab's functionality, however, range works when start , step , , stop integers. if want parallel function works floating-point values, try arange command numpy : import numpy np open('numbers.txt', 'w') handle: n in np.arange(1, 5, 0.1): handle.write('{}\n'.format(n)) keep in mind that, unlike matlab, range , np.arange both expect arguments in order start , stop , step . keep in mind that, unlike matlab syntax, range , np.arange both stop current value greate

java - How FutureTask also acts like a latch? -

a quote jcip : " futuretask acts latch ." how ? futuretask.get() wait completion of task countdownlatch.await() . both blocking methods, have overloaded variant timeout.

Django View Throwing HttpResponseError -

i trying map view path in urls.py , when try throws error: registration didn't return httpresponse object urls.py urlpatterns = patterns('', (r'^register/$', registration), (r'^newuser/$', processregistration), ) views.py def registration(request): regform = registrationform(request.post or none) if request.method == 'post': if regform.is_valid(): clearusername = regform.cleaned_data['usernm'] clearpass = regform.cleaned_data['userpass'] regform.save() try: return httpresponseredirect('/newuser/?usernm=' + clearusername) except: raise validationerror(('invalid request'), code='300') ## [ todo ]: add custom error page here. else: regform = registrationform() return render(request, 'va/reuse/register.html', { 'regform': regform

validation - Issue validating user time zone for Rails app on Heroku -

i'm following ryan bates' tutorial on adding time zones rails app. http://railscasts.com/episodes/106-time-zones-revised (it's tutorial, way) anyway, ryan says it's idea validate submitted time zone ones rails knows about. put rule users' model: validates_inclusion_of :time_zone, in: activesupport::timezone.zones_map(&:name) that works fine in development. however, when run app on heroku, not timezone "melbourne" (and many others - i'm testing au time zones). on heroku, rule in user model, not accept time zone of "melbourne". why be? time_zone_select view helper returns "melbourne" - rails must aware of it.

oracle - Does a reverse key index help if i use an incremental sequence to insert subsequent values -

i understood basic rationale reverse key index reduce index contention. if have 3 numbers in index: 12345, 27999, 30632, can see if reverse these numbers, next number in sequence won't hit same leaf block. but if numbers :12345,12346,12347, next numbers 12348,12349 (incremented 1) hit same leaf block if index reversed: 54321,64321,74321,84321,94321. so how reverse index helping me? supposed particularly while using sequences if we're talking sequence-generated value, can't @ 5 values , draw many conclusions. need think data has been inserted , data inserted in future. assuming sequence started @ 12345, first 5 values inserted sequentially. sixth value 12350. reverse , 05321 go far left of index. you'd generate 12351. reverse 15321 , that's again toward left-hand side of index between first value generated (54321) , recent value (05321). sequence generates new values, they'll go further right until resets every 10 numbers , you're ins

MongoDB Java driver: distinct with sort -

using mongodb console can write native mongodb query using distinct key sort this: db.mycollection.distinct('mykey').sort('mykey', 1) using java driver expect able write same query this: mycollection.distinct("mykey").sort(new basicdbobject("mykey", 1)); however, doesn't work because dbcollection#distinct() returns type list , not type dbcursor dbcollection#find() . how can write distinct query sort using java driver? mongodb doesn't support server-side sorting distinct command. what's happening in console distinct('mykey') call returns array , you're calling javascript sort method on array returns sorted version of array. parameters pass sort ignored. to equivalent in java do: list mykeys = mycollection.distinct("mykey"); java.util.collections.sort(mykeys); to unique keys using server-side sort use aggregate . here's how you'd in shell: db.mycollection.aggregate([

java - BufferedReader gives missing characters -

so trying change format of text file has line numbers every couple of lines make cleaner , easier read. made simple program goes in , replaces of first 3 characters of line spaces, these 3 character spaces numbers can be. actual text doesn't start until few more spaces in. when , have end result printed out comes out diamond question mark in , i'm assuming result of missing characters. seems of missing characters apostrophe symbol. if let me know how fix appreciate :) public class conversion { public static void main(string args[]) throws ioexception { bufferedreader scan = null; try { scan = new bufferedreader(new filereader(new file("c:\\users\\nasir\\desktop\\beowulftesting.txt"))); } catch (filenotfoundexception e) { system.out.println("failed read file"); } string finalversion = ""; string currline; while( (currline = scan.readline()) !=null){ if(currline.length()>3) cur

Python Regex: get everything except for string -

i have following sentence: graft concepts has partnered with\u00a0several sites\u00a0to offer customization options backplates, customers able design own with\u00a0 i'd rid of instances of "\u00a0", whether or not connected other words, e.g. "with\u00a0several" how using regex python? i've tried experimenting re.compile() , re.findall(), couldn't working? thanks. you can use .replace : s = s.replace('\\u00a0', ' ')

ruby on rails - Show an object's rating with letsrate -

i'm creating music album review site, user posts album reviews (pins), , select 1-5 stars display on show page. i'm using letsrate gem , works fine input stars on form when submitting new pin , editing. need display input on show page. when have <%= @pin.rates %> on show page, displays this: [#<rate id: 8, rater_id: 1, rateable_id: 36, rateable_type: "pin", stars: 4.0, dimension: nil, created_at: "2013-08-19 22:28:36", updated_at: "2013-08-19 22:28:36">] i need stars: 4.0 display 4 stars. (and not allow them edited in show view) this rate model: class rate < activerecord::base belongs_to :rater, :class_name => "user" belongs_to :rateable, :polymorphic => true belongs_to :pin attr_accessible :rate, :dimension end i saw question posted, doesn't explain how use helper: displaying individual user ratings (letsrate gem) if use <%= rating_for @pin => , stars show up, can rerate them, not

network programming - How can I call ioctl for interface list, or other ioctl stuff, on Free Pascal? -

i've been googling , down, searching on free pascal wiki , on (obscure) mailing lists , have come empty on how use ioctl() or fpioctl() on free pascal. i have bug report free pascal's bugtrack code enumerates network interfaces. the code not compile since libc unit has been deprecated. lot of similar questions libc point wiki entry talks it's demise. not give indication on sioc*if* stuff has gone. does mean of ioctl functionality has gone? using find , grep , under /usr/share/fpcsrc/<fpc-version>/, i've been able track usage of fpioctl() in relation terminals termios unit. other stuff uses looks it's under other oss. apart i'm unable find of use if want like: if ioctl(sock, siocgifconf, @ifc)= 0 begin {...} end; so, can free pascal community give me pointer what's current situation if 1 wants ioctl calls under linux? does baseunix.fpioctl meet use case? have @ baseunix documentation . found an example of using

javascript - Object doesn't support addEventListener IE8 in jquery -

i using jquery 2.0.2 , have error in ie8: object doesn't support property or method 'addeventlistener' jquery.min.js, line 4 character 6105 somehow codes fine chrome , firefox, except ie8. getting these errors resulted to: the value of property '$' null or undefined, not function object i included query on top of other js files have using: <script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script> i know jquery2+ doesnt support ie8, dont want use lesser version of jquery. jquery 2.x has dropped support ie < 9, if want support ie7 & 8 use latest version of 1.x branch - 1.11.0 from jquery jquery 2.x has same api jquery 1.x, not support internet explorer 6, 7, or 8. notes in jquery 1.9 upgrade guide apply here well. since ie 6/7/8 still relatively common, recommend using 1.x version unless no ie 6/7/8 users visiting site.

Pandas DateOffset, Periods and tslib.period_ordinal -

i trying understand relationship in pandas between dateoffset , periods , tslib.period_ordinal . when create new period using: pd.period("2013-12", freq="q-dec") , see "q-dec" resolved base of 2000, base in addition components of datetime parsed date string passed tslib.period_ordinal returns 175. where if anywhere dateoffset come in? meaning of base? there docs on period_ordinal? i looking add new frequencies, such 52–53-week fiscal year (see: https://github.com/pydata/pandas/issues/4511 ) , wondering start.

r - ggplot2 - Error bars using a custom function -

Image
i wish generate error bar each data point in ggplot2 using generic function extracts column names same using names function. following demo code: plotfn <- function(data, xind, yind, yerr) { yerrbar <- aes_string(ymin=names(data)[yind]-names(data)[yerr], ymin=names(data) [yind]+names(data)[yerr]) p <- ggplot(data, aes_string(x=names(data)[xind], y=names(data)[yind]) + geom_point() + geom_errorbar(yerrbar) p } errdf <- data.frame('x'=rnorm(100, 2, 3), 'y'=rnorm(100, 5, 6), 'ey'=rnorm(100)) plotfn(errdf, 1, 2, 3) running gives following error: error in names(data)[yind] - names(data)[yerr] : non-numeric argument binary operator any suggestions? thanks. you need pass character string containing - ( 'a-b' not 'a' - 'b' ) eg, ggplot(mtcars,aes_string(y = 'mpg-disp',x = 'am')) + geom_point() in example plotfn <- function(data, xind, yind, yerr) { # subset names le

uitableview - Adding last row cell (that is not part of sqlite table) on tableView -

i have issue on adding last cell row tableview. can please tell me what's wrong code last row appears appears elsewhere when table scrolled down. appreciated, thank you. here's code: @interface vieworderviewcontroller : uiviewcontroller < uitableviewdatasource, uitableviewdelegate> { iboutlet uitableview *tabview; } -(nsinteger)numberofsectionsintableview:(uitableview *)tableview { return 1; } -(nsinteger)tableview:(uitableview *)tableview numberofrowsinsection:(nsinteger)section { return [appdelegate.vieworderarray count] + 1; } -(uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { static nsstring *cellidentifier = @"cell"; uitableviewcell *cell = [tableview dequeuereusablecellwithidentifier:cellidentifier]; if (cell == nil) { cell = [[uitableviewcell alloc] initwithstyle:uitableviewcellstylesubtitle reuseidentifier:@"cell"]; } nsuinteger row = [indexpath

android - Install apk file programmatically -

i have downloaded apk file localhost server using download manager api , displaying have downloaded file thing if click .apk file, unable install, give parsing package error. xml page <button android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:onclick="onclick" android:text="start download" > </button> <button android:id="@+id/button2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:onclick="showdownload" android:text="view downloads" > </button> and here code broadcastreceiver broad = new broadcastreceiver() { @override public void onreceive(context context, intent intent) { // todo auto-generated method stub string action = intent.ge

java - Change Vertex massive in Renderer class from MainActivity onTouchEvent -

i newbie in android developement , thi question, how can change vertex massive inside class "mainrenderer" inside class "ship" mainactivity ontouchevent? here code: mainactivity.java: package com.example.galaga2d; import android.opengl.glsurfaceview; import android.os.bundle; import android.app.activity; import android.view.motionevent; import android.view.window; import android.view.windowmanager; import android.widget.toast; public class mainactivity extends activity { //private boolean istouch = false; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); // Убираем тайтл приложения, тобишь делаем его fullscreen requestwindowfeature(window.feature_no_title); getwindow().setflags(windowmanager.layoutparams.flag_fullscreen, windowmanager.layoutparams.flag_fullscreen); // Создаём новый surface и устанавливаем mainrenderer glsu