Posts

Showing posts from September, 2011

linker - Trouble with xamarin.ios/monotouch , mvvmcross and linking -

i have irritating issue, if use link sdk assemblies in xamarin studio exception, if use dont link exception not happening. have located issue part of third party dll using(api video streaming service). believe linker stripping of methods used dll. possible skip link of libraries , possible see stacktrace. 2013-05-08 14:40:54.688 appsfabrikkentouch[5662:907] mvx: diagnostic: 18,23 exception masked nullreferenceexception: object reference not set instance of object @ system.delegate.combine (system.delegate a, system.delegate b) [0x00018] in /developer/monotouch/source/mono/mcs/class/corlib/system/delegate.cs:473 @ cirrious.mvvmcross.viewmodels.mvxnotifypropertychanged.add_propertychanged (system.componentmodel.propertychangedeventhandler value) [0x00000] in <filename unknown>:0 @ cirrious.mvvmcross.binding.bindings.source.mvxbasepropertyinfosourcebinding..ctor (system.object source, system.string propertyname) [0x00000] in <filename unknown>:0 @ ci

Petapoco issue with nullable SQl Server smallint and int16 in vb.net -

i have sql server table view , smallint field. data in view automatically marked nullable petapoco t4 generator since can't specifiy in view. i'm fine other datatypes far (guid, int, tinyint, string, etc.) seems nullable smallint cause issues. the t4 generator in vb.net creates smallint field: private mpasswordresetdays integer? <column> _ public property passwordresetdays() integer? return mpasswordresetdays end set mpasswordresetdays = value end set end property but receive exception: cast 'system.int16' 'system.nullable`1[[system.int32, mscorlib, version=4.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089]]' at petapoco line 2677: line 2675: else line 2676: { line 2677: converter = src => convert.changetype(src, dsttype, null); line 2678: } line 2679: } the sql command executed petapoco quite simple: sql command: sel

Java's BigDecimal.power(BigDecimal exponent): Is there a Java library that does it? -

java's bigdecimal.pow(int) method accepts integer parameter, no bigdecimal parameter. is there library, apache's commons-lang, supports bigdecimal.pow(bigdecimal) ? should able calculate "1.21".pow("0.5") return "1.1" . there math.bigdecimal implementation of core mathematical functions source code available cornell university library here (also can download library tar.gz ). here sample of library use: import org.nevec.rjm.*; import java.math.bigdecimal; public class test { public static void main(string... args) { bigdecimal = new bigdecimal("1.21"); bigdecimal b = new bigdecimal("0.5"); system.out.println(bigdecimalmath.pow(a, b).tostring()); } } prints out: 1.1 update there no license info neither in info page nor in source code files. abstract of public paper describes work of library contains phrase " the full source code made available .", but

Sencha Touch 2 make call to phone number doesn't work properly on android 4.0.4 -

i have simple view info user. when tap on phone number i'm able call number, , it's ok. when tap on user number in titlebar able call number. user number not phone number, it's kind of id, , don't want call number. can call user number (that in title bar) phone number on android 4.0.4. on iphone 4 (ios 6) , android 4.1.2 not happaning i.e. can call phone number. can tell me problem ? , how can solve issue ? ext.define("callphoneapp.view.test", { extend: "ext.form.panel", requires: "ext.form.fieldset", alias: "widget.testview", config: { scrollable: "vertical", items: [ { xtype: "toolbar", docked: "top", title: "<div>user no. 8344396856</div>" }, { xtype: "fieldset", items: [ { xtype: &quo

android - How to count the records in a Sqlite table that match a date restriction? -

i'm using cursorloader return record count content provider, , need count records 7 or fewer days old. attempts make work have far yielded nothing frustration, count always zero. have limited experience sqlite , cursorloaders, , suspect i'm making simple error . here code: string strcriteria = "select julianday('now') - julianday('" + session.date_string + "','gregorian') <8"; return new cursorloader(getsherlockactivity(), session.content_uri, new string[] {"count(" + session.table_name + "." + session._id +") count " }, strcriteria, null,null); can see going wrong? i should add date_string column stores date string in yyyy-mm-dd format. have column storing date long, haven't figured out how sqlite date queries using numeric values either. update question: if replace session.date_string part of strcriteria definition text date, works perfectly. exa

html - OverFlow hidden showing incorrectly in different browsers -

Image
i have div in showing text , div has fixed height , width , overflow hidden. showing different text in firefox, chrome , safari. in chrome , safari 1 line of text visible.if remove: -moz-column-count:2; -webkit-column-count:2; property working fine in all. if add property showing different text in firefox , chrome. i attaching snapshot chrome , firefox. <div style=" width: 710px; height: 70px;position:absolute;overflow:hidden;top=0;left=0;-moz-column-count:2;-webkit-column-count:2;z-index:102;"> <p>lorem ipsum dolor sit amet, consectetur adipiscing elit.</p> <p> vivamus mattis laoreet velit quis malesuada. quisque tincidunt elit sit amet nibh volutpat id pretium nisl consequat. quisque dictum lacus @ mauris scelerisque auctor. nulla adipiscing, sapien sit amet </p> </div> chrome view fire fox view you should cut height or width tag div. further p element needs style showing them column.

php - Can I pass multiple links to fopen, fread and feof? -

i have following function : function doparse($parser_object) { $links=file("./fullsoccer.txt", "r"); $i=0; while(!empty($links[$i])) { set_time_limit(0); if (!($fp = fopen($links[$i], "r"))); { //loop through data while ($data = fread($fp, 4096)) { //parse fragment xml_parse($parser_object, $data, feof($fp)); } } $i++; } } this code save list of 507 links of xml data fullsocce.txt $links read content of each file (link: online links) using fread , pass $data main function xml_parse parse , save data using sax parser . problem is: last file of array $links passed function , parse data , want know why working 1 file? please emergency case !($fp = fopen($links[$i], "r") fopen returns false on error check true @ eof or invild line. maybe changing to if (($fp = fopen($links[$i], "r") != fal

MYSQL MATCH...AGAINST returning no results -

i baffled one. i working on ecommerce website, , have table full of test products. in table field called 'name' of type text , has fulltext index. i inserted few hundred rows of dummy data, every single row inserted "test product" (without quotes) it's value in 'name' field. however, running following command returns 0 results, though word 'product' in name field every row. select name products match (name) against ('product') i have checked server variables, set default values. min characters 4, stopwords default etc. far can tell, product not stopword. if there further information can provide might find resolution problem let me know. many in advance. from mysql documentation on fulltext searches , search query considered triggering stop word relevant string present in rows. the 50% threshold has significant implication when first try full-text searching see how works: if create table , insert 1 or 2 ro

sockets - Choosing Network protocol TCP or UDP for remote desktop appplication? -

i want create teamviewer application in c#. protocol better tcp or udp in terms of performance ? udp sends network messages without enforcing order, e.g. can come in out of order, , without checking messages got through. tcp enforces packet ordering, , has method of checking messages got through. more reliable. in terms of throughput - e.g. amount of data transferred in given time - in practice same. the advantage of udp lower latency. because doesn't check ordering or confirm receipt of packets - program receives packets arrive. no waiting confirmations. you want use udp when low latency critical , messages small, , program tolerant missing packets , out of order packets. i've ever seen used in video games ( shooters ) sending user input. "teamviewer" me implies video - large amounts of data - use tcp.

jQuery-- Populate select from json -

i have map in java sevlet , converting json format works right. when function below creates drop down, puts every character option?? got: $(document).ready(function(){ var temp= '${temp}'; //alert(options); var $select = $('#down'); $select.find('option').remove(); $.each(temp, function(key, value) { $('<option>').val(key).text(value).appendto($select); }); }); map content in json format {"1" : "string","2" : "string"} i this: $.each(temp,function(key, value) { $select.append('<option value=' + key + '>' + value + '</option>'); }); json structure appreciated. @ first can experiment find('element') - depends on json.

mercurial - How to add commit information to file? -

how can automatically add information below files after committing? last commit max, 30.02.2013, revision 123, branch xy (by way, it's index.html -file , and nice use <-- comments --> ) keyword extension added , configured (i.e missing default keyword's definitions added , keywords properly added files)

javascript - Preload form with json data -

i still learning javascript, jquery , comes it. personal test learning developing program pull php server. right pulling hard coded json file , preloading page that. user able click edit button populated , provide popup preloaded form sections data (this part need assistance with). using jquery 1.9.1 migrate , mustache.js , jqmodal handle form popup here code: html: <!doctype html> <html> <head> <title></title> </head> <link href='css.css' rel='stylesheet' type='text/css'> <script id="playertpl" type="text/template"> {{#playerlist}} <li id="player{{player}}"> <h3>player: {{player}}</h3> <p><strong>name:</strong> {{name}}</p> <p><strong>score:</strong> {{score}}</p> <p><strong>rank: </strong>{{rank}}</

html - javascript onclick function to enlarge text -

i'm not sure why, can't seem work. here function enlarge font. <script type="text/javascript"> function growtext() { var text = document.getelementbyid("t_left_text"); text.font-size=22px; </script> and here call it <div id="t_left" onclick="growtext()"> <br /> <p id="t_left_text">mountains beautiful land structures <br /> result of plate tectonics.</p> <br /> </div> try: text.style.fontsize = "22px"; demo: http://jsfiddle.net/c2mwn/ when want change element's css, need use style property. determine name of specific style property, css name converted camel case - "font-size" becomes "fontsize", identifier valid in javascript. while setting style properties works, , although simple example, might easier deal adding , removing class . useful when setting multiple css proper

jquery plugins - DataTables warning: Attempted to initialise DataTables on a node which is not a table: FORM -

i have error message coming after have deployed datatables inside of application. cannot see coming haven't declared in js cause it. tables have got unique names , divs. have found same issue workaround doesn't seem apply problem: http://www.datatables.net/forums/discussion/7668/datatables-warning-attempted-to-initialise-datatables-on-a-node-which-is-not-a-table-div/p1 anyone have pointers? google doesn't seem able looking @ guys assistance. cheers nick update: this still causing me issue. assist or point in right direction? you using id on datatable whereas declaring item in same page same id. i had same problem: i had in code: <div class="modal fade span3 ui-corner-all" id="cheques" style="display: none"> and had <table class="table table-nomargin datatable table-bordered" id="cheques"> i renamed on of element's id , worked ;)

Formatting text in the model with Ruby on Rails -

how can make mvc? class product < activerecord::base validates :price, :presence => true def to_s "#{name} @ #{number_to_currency(price)}" end end i need format price currency, can't use number_to_currency, because in model. pass view this, doesn't feel clean. a solution define producthelper module in app/helpers implements method want, product_name_with_price : module producthelper def product_name_with_price(product) "#{product.name} @ #{number_to_currency(product.price)}" end end and in view <%= product_name_with_price(@product) %>

xml - why can't I have an xs:element using ref as a global element in a XSD? -

i experimenting ref attributes in < xsd:element > , don't following: while < xsd:element > ref attribute can defined in non-global scope (i.e. not directly below < schema >), in: ref1.xsd <?xml version="1.0"?> <xs:schema xmlns:xs="http://www.w3.org/2001/xmlschema" targetnamespace="http://www.dummy-example.com" xmlns:foo="http://www.dummy-example.com"> <xs:element name="a" type ="xs:string"/> <xs:element name="b"> <xs:complextype> <xs:sequence> <xs:element ref="foo:a"/> </xs:sequence> </xs:complextype> </xs:element> </xs:schema> so that, e.g. following validates xmllint : ref1.xml <?xml version="1.0"?> <foo:b xmlns:foo="http://www.dummy-example.com"> <foo:a>whatever ...</foo:a> </foo:b> however, cannot have ref

prototypejs - Getting trouble with jQuery tabs in loading openlayers map -

i've 4 jquery tabs , in second tab i'm showing map using openlayers library i'm getting following errors uncaught typeerror: cannot call method 'clone' of null // onload error uncaught typeerror: cannot read property 'w' of null // getting error when zooming-in , out i thought code went wrong in initializing openlayers map object or somewhere ,but trouble jquery tabs . if i'm placing map div in first tab showing map expected. i tried this not solved issue when placing map div in second tab. update below content: if write jquery tabs code after map object creation working fine in chrome map destructing in firefox . how can call initialize jquery tabs after execution of user defined function? you can initialize map when enter tab . create tabs this: $( "#tabs" ).tabs({ activate: function(event ,ui){ if(ui.newtab.index() == 1)// tab number start 0 { init(); //

c# - Calling ScriptManager from a class -

i'm trying execute javascript function c# class in asp.net application. i'm using scriptmanager . have class updateui , contains following method: public static void runscript() { try { if (httpcontext.current != null) { page currentpage = httpcontext.current.handler system.web.ui.page; scriptmanager.registerclientscriptblock(currentpage, currentpage.gettype(), "disablecontrols", "disablecontrols()", true); } } catch (exception ex) { } } when call updateui.runscript() static class, httpcontent.current null . idea how should go in order able execute scriptmanager class not code-behind? pass httpcontext method within static class. tim schmelter's comment indicates, calling httpcontext.current fail if it's not done in response incoming request. public static void runscript(httpcontext context);

Jquery Hide with two drop down selects -

i have 2 drop down selects. 1 called disciplines, other called menslevels both share same id based on value of first select, how hide second select? here code: $("select[name=disciplines]").change(function() { if ($(this).val() == 'acro') { var pid = $(this).attr('id'); $('td:nth-child(6).attr("id") == "' + pid + '"').hide(); } }); $("select[name=disciplines]").change(function () { if ($(this).val() == 'acro') { $('select[name=menslevels][id="' + this.id + '"]').hide(); } });

unix - I tried various cut commands but unable to get the output I desire -

cat decisionservice.txt /magi/household/magi_edg_flow.erf;/medicaid/magi_edg_flow;4;4 /vcl/vcl_ruleflow_1.erf;/vcl/vcl1_ebdc_flow;4;4 /vcl/vcl_ruleflow_2.erf;/vcl/vcl2_ebdc_flow;4;4 i tried this: cat decisionservice.txt | cut -d ';' -f2 | cut -d '/' -f2 | tr -s ' ' '\n' my output is: $i=medicaid vcl vcl whereas need output be: $a=medicaid $b=vcl well question, it's not clear want, guess don't want repeated vcl in output. try adding sort , uniq @ end. cat decisionservice.txt /magi/household/magi_edg_flow.erf;/medicaid/magi_edg_flow;4;4 /vcl/vcl_ruleflow_1.erf;/vcl/vcl1_ebdc_flow;4;4 /vcl/vcl_ruleflow_2.erf;/vcl/vcl2_ebdc_flow;4;4 cat decisionservice.txt | cut -d ';' -f2 | cut -d '/' -f2 | tr -s ' ' '\n'|sort|uniq medicaid vcl

javascript - Fetching Date of Type DateTime with BreezeJS -

i'm developing spa webapplication breezejs. working fine, have question. in entity have table has type datetime, store creationdate created entity framework. goes fine when fetch data server via breeze (server-> -> client) in javascript: wed may 8 16:23:32 utc+0200 2013 but via fiddler2 see comes in likes in json: created=2013-05-08t16:23:32.038+02:00 why breezejs add day name it? can raw value can format date? thanks in advance! breeze not manipulate day in way except add utz timezone specifier dates returned server not have one. done because different browsers interpret dates without timezone specifier differently , want consistency between browsers.

c# - Why does Scala compiler for .NET ignore the meaning of val? -

i playing around scala. , found 3 interesting things(the title third 1 ). 1 local variable declared val not interpreted final. class howarevarandvalimplementedinscala { var v1 = 123 val v2 = 456 def method1() = { var v3 = 123 val v4 = 456 println(v3 + v4) } } if compile above scala code bytecode , decompile java, looks this: public class howarevarandvalimplementedinscala { private int v1 = 123; private final int v2 = 456; public int v1() { return this.v1; } public void v1_$eq(int x$1) { this.v1 = x$1; } public int v2() { return this.v2; } public void method1() { int v3 = 123; int v4 = 456; predef..module$.println(boxesruntime.boxtointeger(v3 + v4)); } } we can see v2 final, v4 not, why? 2 scala compiler .net adds override keyword lot of(if not all) public instance methods if compile scala code shown above cil , decompile c#, it's this: public class howarevarandvalimplementedinscala : scalaobject { priv

javascript - Garbage collection in Backbone -

* updated - added sample code 1 of view * this has been discussed number of times , have gone through lot of suggestion on topic still don't have luck. my application tab based i.e. user searches entity in global search box , on selection of entity view/model generated , view rendered under new tab.user can open multiple tabs repeating above process. the problem facing every time new tab opened can see browser memory consumption goes approx 6 mb (the data fetched & displayed each tab max 60kb). not when close tab can see custom close function (copied below) being called each view under tab somehow browser memory not go down. me means garbage collection not working or view/models have not been cleaned properly. any appreciated. define([ "hbs!modules/applications/templates/applications", "vent" ], function (tpl, vent) { var view = backbone.marionette.itemview.extend({ classname: 'modapplications', template

Coffeescript maven plugin gone from GitHub? -

i make extensive use of coffeescript maven plugin used live here: https://github.com/iron9light/coffeescript-maven-plugin . (if link no longer 404'ing must have come back; consider question answered!) it seems have disappeared odd it's been there in past. have local copy it's not mega problem sad if chap maintains has deleted / stopped maintaining it! does know happened it? huh, it's now! guess took little holiday. https://github.com/iron9light/coffeescript-maven-plugin

c# - aspx file does not contain a definition for function, definition in connected aspx.cs file -

answer given andrei (part solved me in comments on answer) trying have onclick button, i'm getting 'asp.views_home_index_aspx' not contain definition 'btncreateorder_click' , no extension method 'btncreateorder_click' accepting first argument of type 'asp.views_home_index_aspx' found (are missing using directive or assembly reference?) my code: index.aspx: <%@ page language="c#" masterpagefile="~/views/shared/site.master" inherits="system.web.mvc.viewpage" autoeventwireup="true" codebehind="index.aspx.cs" %> *there comment inherit near end of post* <asp:content id="content1" contentplaceholderid="titlecontent" runat="server"> home page </asp:content> <asp:content id="content2" contentplaceholderid="maincontent" runat="server"> <h2><%: viewdata["message"] %></h2> &l

vb.net - Cannot remove the ReadOnly property from folder -

Image
i'm trying remove read-only property of directory can't it. private _attributes fileattributes = fileattributes.normal private sub removereadonlydirectoryattributes(byval path string) 'check root folder dim di new directoryinfo(path) di.attributes = _attributes 'check sub folders each folder string in directory.getdirectories(path, "*", searchoption.alldirectories) di = new directoryinfo(folder) di.attributes = _attributes next end sub i have thought code updates attributes normal. however, when right click on directory see i have seen posts here on apply method similar dim di new directoryinfo(path) di.attributes = di.attributes , not fileattributes.readonly but doesn't either. i admin of machine.

android - getSharedPreferences() is not recognized in the class extended from BroadcastReceiver -

i use sharedpreferences in class extended broadcastreceiver. method getsharedpreferences(prefname, mode_private); not recognized. how can retrieve sharedpreferences in broadcastreceiver class? thanks you need context retrieve sharedpreferences . onreceive gives context

c# - Cannot access a disposed object. Asynchronous print of messages in second form -

asynchronous print of messages in second form. system.objectdisposedexception in system.windows.forms.dll during close of second form. mainform runs secondform. secondform runs message generator , asynchronous thread of print of messages in text box. message generator creates messages random time delay. time delay in string format message. problem - during close of second form, method secondform_closing, receive exception system.objectdisposedexception in system.windows.forms.dll during cannot access disposed object. public partial class mainform : form { secondform secondform; private void mainform_closing(object o, formclosingeventargs e) { environment.exit(0); } public mainform() { initializecomponent(); secondform = new secondform(); secondform.show(); } } public partial class secondform : form { private messagegenerator messagegenerator; action actprint; //this method calls objectdisposede

macros - How to use defmacro instead of eval? -

i have come below function, works intended uses eval horrible, , not exist in clojurescript intend use it. (defn path [d p] (eval (concat '[-> d] (flatten (map #(conj (repeat (dec %) 'z/right) 'z/down) (path-to-vector p)))))) how convert macro? attempt looks this: (defmacro path [d p] `(concat (-> ~d) (flatten (map #(conj (repeat (dec %) z/right) z/down) (path-to-vector ~p))))) but not work. no need macro or eval, operation reduce : (defn path [d p] (reduce (fn [s v] (reduce #(%2 %1) s (conj (repeat (dec v) z/right) z/down))) d (path-to-vector p))) also note (conj (repeat (dec %) z/right) z/down) means z/down , z/right coz repeate return sequence, in case want z/right first , last item should z/down should use (conj (vec (repeat (dec %)) z/right) z/down)

rest - Issues calling RESTful Glassfish Java web service with jQuery ajax -

xss/cors allowed apache web server , can make calls using query string parameters. the restful service i'm told uses oauth. the call restful web service trivial fiddler via composer , returns valid json data. set 1 authorization header requests totally different when sent in fiddler composer versus setting header in ajax. i've tried , without accept , access-control-allow-origin headers. this request header fiddler after executing request in composer. get {/trailing server url} http/1.1 cookies / login authorization: bearer xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx transport host: {server url} and ajax request $(function () { var token = "bearer xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; $.ajax({ url: url, datatype: "json", headers: { "access-control-allow-origin": "*", accept: "application/json", authorization: token } //, //beforesend: functi

Hibernate : Fetch collection -

i encontered problem while trying collection of elements : set of friend empty. there 3 classes : @entity @table(name="user") public class user { @id @column(name="user_id", nullable=false) private string mail; @column(name="password") private string password; @column(name="surname") private string surname; @column(name="name") private string name = null; @column(name="statut") private statutuser statut; @column(name="phonenumber") private int phonenumber; @onetomany(cascade = cascadetype.persist, mappedby="friendpk.friend") @fetch(fetchmode.join) private set<friend> friends = new hashset<friend>(); ... getters , setters the second 1 : @entity @table(name = "friend") public class friend { @embeddedid public friendpk friendpk; @column(name = "friend_statut") private statutfriend statutfriend; ... } the last 1 : @suppresswarnings("

ruby on rails - Getting a 302/"Page at xx displayed insecure content from xx" when attempting to upload images with carrierwave -

firebug gives 302, , chromes throws other message. basically, i'm trying upload images carrierwave , display thumbnail in rails app. works on demo , staging servers, not on production reason. ideas why may be? <%= form_for image.new, :html => {:multipart => true} |g| %> <%= g.text_field :whence, :id => "postwhence"%> <%= g.file_field :image, :id => "postimage_file_field", multiple: true, name: "image[image]" %> <%= g.file_field :image, :id =>"postlogo_file_field"%> <% end %> are using https in production? if so, pages accessing serve content via http instead of https? this sounds have https site serving content via http instead of https, many modern browsers detect security issue.

java - How do I run a Play Framework 2 app in dev mode on Heroku? -

i created staging app on heroku, , run in dev mode. also, have procfile set use application.production.conf, use application.staging.conf in staging app. how can this? use config variable set this. like: procfile: web: target/start -dconfig.file=${config_file} then set config each environment: heroku config:add --app my-staging config_file=application.staging.conf heroku config:add --app my-prod config_file=application.production.conf

mysql - SQL selecting X random rows within top Y after ordering -

using mysql, wish select 1) 5 random rows among top 20 rows after ordering "price" column 2) 15 random rows among 30 next results (rows 21-50) after ordering "price" column what best way achieve performance-wise sql? please note table contains around 1,000,000 rows. the final purpose update column (set status=1) these randomly selected rows. use nested selects - should quite fast in situation select * ( select .... table order price limit x, y ) order random replace x , y appropriate values note depending on particular rdbms "order random" , "limit" clauses may differ! mysql way. the important thing server inner select first, return 20-30 rows (depending on limit clause) , can sort in random order in outer select. if price column indexed fast enough

search - How to index html, css, and javascript using solr -

users of codepen submit html/css/javascript each time save pen. we're setting solr search , i'd know if work has been done tokenize html/css/js optimal retrieval. for example in javascript, we'd code like window.location = 'http://wufoo.com' to produce search hit on window , location , window.location . also, html, don't wish strip out brackets on elements <form> or <field> . before go down road of writing custom field type, i'd know if has tackled problem. since index each field individually, we'll need separate tokenizer rules specific css, html, , javascript.

php - postgresql: how to SELECT entries that satisfy a condition -

i trying select entries have same text in "email" column of postgresql table. completly new database , first database ever created, sorry if it's silly question. database has 3 columns: key, user_mails , json_adress. tried $existent= "select * (select public.account_recover_users.* keys,emails,jsons public.account_recover_users) emails='$email'"; but guess mistaking somewhere. please help, trying learn , got bit stuck. i writing answer, because accepted answer wrong in several respects. neither of 2 presented queries can work, though op incorrectly accepted answer. original query couldn't work several reasons: as mentioned (and error message states): subquery requires alias. as mentioned, subquery pointless simple task. this construct nonsense: public.account_recover_users.* keys can't apply alias after expanding * list of columns. postgres ignores it. might throw exception in futur

Conditional execution in Ant -

i have target, executed if my_step==true : <target name="pre-compile" if="my_step"> ... </target> but want make pre-compile target available regardless of value of my_step , execute action manually using ant do_my_step : <target name"-do_my_step"> ... </target> question. how can run make pre-compile execute -do_my_step target? is, if property my_step true, pre-compile step execute -do_my_step target. obviously, copy-paste contents of -do_my_step target pre-compile target, want keep target cleanly separated. target names prefix '-' common practice make target 'private' it's impossible call via commandline. ant -f yourbuildfile.xml -yourprivatetarget won't work ant commandline interface uses leading '-' options. strip leading '-' target name call via ant -f yourbuildfile.xml do_my_step consider : "..question. how can run make pre-compile execute -do_my_step target?

inheritance - Batch script to enforce inheritence on 3rd level folders -

this kind of interesting problem, please bear me here: i have 3 levels of nested folders used syncing files end-user devices - on first level administrator has permissions, on second level end-users have (explicit & individual) permissions, , on third level there content (files , more folders). the problem arises when (occasionally) content being moved third level not inherit permissions folder above - our users end content in directories don't have permissions (and so, cannot sync data). to remedy trying write batch script (to run on daily schedule) digs third level folders , resets inheritance flag on acls there. important script not touch permissions on second level folders (since remove explicit rights end-users). here script working (yes it's simple): set base=c:\testprivate set subfolders=.\* /r %base% %%a in (.) ( icacls.exe %subfolders% /reset /t ) exit /b the problem script i'm trying build resets permissions on (includ

linux - python mechanize issue with java application -

we have java application running on tomcat server , wrote simple script login won't allow me login hanging on br.open step. #!/usr/bin/python import mechanize br=mechanize.browser() br.open('https://www.example.com') br.select_form(nr=0) br['user[login]']= user1 br['user[password]']= pass1 br.submit() br.retrieve('https://www.example.com/','page1.html') when running interactively on python shell hanging on br.open >>> br.open('https://www.example.com/') hanging here..... does mechanize work j_security_check ? or java base application? i'm not familiar mechanize, speaking, urllib2 go html in python. possible try http rather https? the java app needs serve html, in standard format. mechanize pulls down html , lets stuff it, note not run javascript, if login screen javascript popup, it's not going work, believe things in standard post format.

osx - Revert to Previous Heroku CLI Version from Incompatible Toolbelt Install? -

had old functional set of heroku cli tools installed on imac 4,1 (intel core duo processor) osx 10.6.8. upgraded new heroku toolbelt without reported error lost previous heroku cli functionality , getting 'zsh: bad cpu type in executable: heroku' error. suspect toolbelt installed 64-bit executable in 32-bit environment. how / can obtain version works in environment short of building own? installing heroku cli tarball http://assets.heroku.com/heroku-client/heroku-client.tgz addressed issue.

ffmpeg - do not show cmd window in qt project -

i'm using ffmpeg command in qt gui application (for merging mp3 files 1 file). , when i'm running application results of merging files showing in cmd window. how can hide cmd window users can not see it. qstring mergemp3filesstr = "ffmpeg -y -i \"concat:"; /*....some part of code*/ mergemp3filesstr+=" \" -c copy d:\\mp3files\\mergedmp3.mp3" system((const char *)mergemp3filesstr.tostdstring().c_str()); , command looking (i'm viewing result qdebug): ffmpeg -y -i "concat:d:\mp3files\a.mp3|d:\mp3files\a.mp3|d:\mp3files\a.mp3 " -c copy d:\mp3files\mergedmp3.mp3 qprocess recommended way external programs, can have better , finer control, , more portable. may check this question , , this more information.

python - Best practice to add authorized users to an app engine project via an HTML form -

i trying figure out best method of adding additional authorized application users through web form accessed/maintained site admin user. i thinking want check get_current_user() against list of authorized users entered user site "admin" privileges (as in not application admin rights dashboard etc). the examples ive seen seem indicate should use email addresses. best practice or there way use email address add entire user property of google accout datastore authorized user? if so, there advantages doing it? a follow on question if entire user property has advantages might find examples of how implement this. generally speaking, web apps use email authentication because need communicate user, , email best/easiest way that, it's given you're going need email address them. email addresses inherently unique, given 1 person can use email account (unless share, shouldn't). i don't believe there way query google google+ records or somesuch.

javascript - Getting a content script to append image on page load -

i've start out learning how make extensions google chrome. have basic understanding far, wanted try small. right trying image append specific div on specific page everytime page loads. extension loads but, javascript code never seems run , image never gets loaded. this manifest.json file have far: { "manifest_version": 2, "name": "icon creator", "description": "creates custom icon page", "version": "1.0", "content_scripts": [ { "matches": ["file:///home/tijko/documents/learning/javascript/test_page.html"], "css": ["sample.css"], "js":["trial.js"] } ], "icons": {"icon": "icon.jpg"}, "web_accessible_resources":["trial.js"] } and javascript: var test = function() { custom_icon = document.createelement("img&qu

javascript - Accessing outer array values from inner array in Mustache.js / ICanHaz -

i have following json, outer array of objects ( outer ), each of may contain inner array of objects ( inner ): { "outer": [{"outername": "outername1", "inner": [{"innername": "innername1"}, {"innername": "innername2"}] }, {"outername": "outername2", "inner": [{"innername": "innername3"}, {"innername": "innername4"}] }] } i have icanhaz template builds unordered list. there must list item each object in each inner array. <script type="text/html" id="tmp"> <ul> {{#outer}} {{#inner}} <li> {{outername}} - {{innername}} </li> {{/inner}} {{/outer}} </ul> </script> the problem is, doesn't seem poss

javascript - dojox.charting.Chart SVG surface issue -

i need export dojo chart image format preferably png. unfortunality there no in-built feature have found way around this. dojo charts based on svg graphics: i first svg string after chart rendered, send string server via ajax , use imagemagick php library convert png. whole process working there issue: the svg string dojo charts not contain full details, chart title , axis values , markers not present in svg string, can possible issue? following code in have re-printed extracted svg string dojo chart div, can see difference visually. var mychart; require(["dojo/ready", "dojox/charting/chart2d", "dojox/gfx/utils", "dojox/charting/action2d/tooltip", "dojox/charting/action2d/highlight", "dojox/charting/themes/claro"], function (ready, chart, utils, tooltip, highlight, clarotheme) { ready(function () { mychart = chart("mychart"); mychart.title = "my chart"; mychart.addplot("colu

compute eigenvectors of big matrix -

i have 6000*16000 matrix d need compute matrix c formed first l eigenvectors smallest eigenvalues d ( don't choose right l until now) what faster way compute c ?

git - Does tag record state of branch or the entire repository? -

i have 2 branches "master" , "develop". have been tagging master branch version numbers (i.e. "v1.2.3") , have started tag beta releases in similar fashion ("v2.3.4-beta-1") whilst working on develop branch. does tag represent state on "develop" branch, or marking state of entire repository? if so, there way list tags associated branches can verify whether have been tagging until now? a tag label specific commit—it points given commit—so marks state of repo @ specific commit.

java - I want to add jcheckbox colum in last for present/absent ,and also how will handle change in database -

in table data come database table student(std_id,std_name,total_class,present_class,att_status); i want show 3 columns in table: std_id, std_name, , present/absent(jcheckbox). how change in data base total_class, present_class according whether or not jcheckbox check or unchecked? please me have complete project.

iOS Facebook Integration Like Instagram -

i have app setup atm using email , password login, i'm wondering how can add facebook connection between user's account , facebook instagram. automatically login facebook everytime? know click facebook when you're uploading new pic , posts fb @ same time. i believe instagram uses facebook sdk ios recommend using facebook open graph api . it's easier use , extremely straight forward on calls photos, posts, likes, etc. here's need do: 1.) import social.framework , accounts.framework 2.) allocate acaccountstore 3.) create acaccounttype of acaccounttypeidentifierfacebook acaccountstore 4.) create ios facebook id key on developer.facebook.com 5.) create nsmutabledictionary initial account permissions , audience types , pass requestaccesstoaccountswithtype: so: nsarray *permissions = @[@"read_stream"]; nsmutabledictionary *dict = [[nsmutabledictionary alloc]initwithobjectsandkeys:@"123456789",acfacebookappidkey,permissio

winapi - C++ Win32API WM_KEYDOWN and buttons -

i'm having problem receiving message in wm_keydown. wm_keydown works fine until click button in app. point no longer receives input keyboard. how fix it? if using win32 controls such createwindowex(null, l"button", ... expected each control child window , capturing of window messages after has focus. once button clicked can capture wm_command - bm_click message call setfocus(hwnd) refocus on window (as giswin mentioned).

windows - Powershell Send-MailMessage cmdlet - Subject parameter won't let me pass a number -

so part of larger script i'm working on have send email results whenever use number in subject field not number not send mailmessage never sent , no error message appears. used try / catch haha's there not errors caught, it's quite perplexing. else ever run problem? if use alphabetical characters functions fine, numbers seem cause issues :-/ send-mailmessage -smtpserver("mailserver.fakecorp.com") -from("nagios.monitor@fakecorp.com") -to("adamk@fakecorp.com") -subject("30") -body("$arrproburls") apparently it's email false alarm. tried pc of cubicle on , worked. email. ok powershell's not problem :) thought have been quite strange! quick responses!

database - Can you read keys not explicitly specified in Redis Lua scripts? -

here example scenario illustrate: suppose have key=>value pairs: hmset thing1 name 'a thing' color red hmset thing2 name 'another thing' color green hmset thing3 name 'also thing' color blue and list values key names: lpush things thing1 lpush things thing2 lpush things thing3 my goal use indirection values range of things: thingsarray = lrange things 0 2 each thing in thingsarray result.push(hmget thing name color) but penalty round trips. realize can mitigated extent pipelining, hoping possible 1 round trip lua script. like: eval superawesomescript 1 things 0 2 the problem is, wouldn't know keys returned lrange call on "things" list @ time calling lua script. accessing data in way in lua script violate rules suggested future-proofing redis cluster? i new redis , total noob lua, if way off base in goals, please tell me so. also, main concern multiple round trips network io, particularly within horizontally scaled clust

Google maps javascript example not working -

i using example google maps website. https://developers.google.com/maps/documentation/javascript/tutorial i posting entire code below. blank screen - nothing seems show either on firefox or chrome. can suggest going on? thank you, -vj <!doctype html> <html> <head> <meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> <style type="text/css"> html { height: 100% } body { height: 100%; margin: 0; padding: 0 } #map-canvas { height: 100% } </style> <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=your_api_key&sensor=set_to_true_or_false"> </script> <script type="text/javascript"> function initialize() { var mapoptions = { center: new google.maps.latlng(-34.397, 150.644), zoom: 8, maptypeid: google.maps.maptypeid.roa

asp.net mvc - jQuery Datatables Cannot read property 'length' with option bProcessing=true -

this works fine: <table id="datatable"> <thead> <tr> <th> title </th> <th> creator </th> <th> subjects </th> <th></th> </tr> </thead> </table> <script type="text/javascript"> $(document).ready(function () { $('#datatable').datatable({ "sdom": 'ft<"bottom clear"ip><"clear">', "bserverside": true, "idisplaylength": 10, //"bprocessing":true, "sajaxsource": '@url.action("getmessages","performance")', "aocolumns": [ { "sname": "title" }, { "sname": "creator" },

how to generate testing report using selenium ide for php -

i record test in selenium ide , generate test report installing test result addons. test report generated in table format did not display succeed or not. test report shows test case pane in table format how generate detail report of test case using selenium ide php selenium ide isn't focused on php. prefer use selenium in combination phpunit, makes selenium's functionality available within php testing. you can export recorded selenium ide tests special php formatter add-on , integrate selenium tests php testing. if have detailed test results, use phpunit's logging features. phpunit can log testing results several formats (e.g. junit xml, tap). but 1 last suggestion: use selenium builder more comfortable , powerful selenium ide ;-)

How to model Several-to-many relationship in database? -

Image
it's not many-to-many relationship. example: have user table , role table. constraint user can have 0-5 roles , role can assigned many users. how model in database? thanks edit: i'm looking standard solution on database side model. there similar scenarios above. example: user password history: 1 user have max 10 previous passwords stored in pwd_history table. it's kind of one-to-(0-10) relationship. but seems me there no standard solution on database side. (@branko's solution (2) below looks though. ) guess best practice model enforce on client side, making these numbers configurable in property file , implementing client logic handle this. there 3 strategies: just model normal many-to-many in database, enforce limit in triggers or (less ideally) client code. model many-to-many, place additional constraints limit number of rows: check (role_no in (1, 2, 3, 4, 5)) the combination of unique constraint u1 on {user_id, role_no} , above che