Posts

Showing posts from August, 2011

postgresql - Select from table identified by OID -

is possible select table know oid of? like select * 123456::regclass i understand can in function, constructing dynamic query, seems strange cannot directly -- assume postgresql translates table names oids moment starts analyzing query, why cannot save trouble? no. oid global counter can wrap around . meaning there can multiple tables containing objects of same oid. if there hack around, error prone in least

Export Maya scene to Three.js -

is there way export whole scene maya three.js. exported elements should be: mesh, textures, cameras, including lights, shadows etc. so can proper rendered effect been in maya. if read doc maya exporter , doesn't support exporting lights. you'll have create manually in three.js code. i don't know current status of three.js loaders havn't used while collada , fbx exporters shaky. and still seem be. can try exporting maya fbx , convert (fbx file format supports lights). obj file format doesn't support support lights of animation easiest way go. long story short, export models correct materials , create , place lights manually. ps: can't export shadows.

django - "Conflicting models in application..." with external database tables -

i have project number of applications accesses both local mysql database 100s of tables, , several external mysql , ms-sql server databases many more tables. of external tables defined in models using "managed=false" meta data. i upgraded django 1.6 1.7 following instructions in release notes , other hints, etc. stackoveflow. everything seems working again exception of of applications access remote database tables. here example message: runtimeerror: conflicting 'bugview_deferred_description_disposition_divisioaf59cb28117de5eb6ddfea0476dab601' models in application 'nvbugsdw': <class 'bug_metrics.models_bugs.bugview_deferred_description_disposition_divisioaf59cb28117de5eb6ddfea0476dab601'> , <class 'bug_metrics.models_bugs.bugview_deferred_description_disposition_divisioaf59cb28117de5eb6ddfea0476dab601'>. the table bugview defined in file names models_bugs.py follows: class bugview(models.model): bugid = m...

c++ - whats differences between setInformativeText &setText functionaly? -

in qmessagebox class in qt there settext & setinformativetext functions,whats function of second 1 while thing first do? qt documentation says informativetext : on mac, text appears in small system font below text(). on other platforms, appended existing text. so if don't use application on mac can use settext whole text want display user.

javascript - Jquery Plugin for tables that allow accordion like expanding and filtering of rows -

i looking create table of data allows following: click able rows expand accordion display text. a filter function: when user clicks link @ top of page of rows disappear. ideally similar photography portfolio pages animate show categories of pictures. any guidance welcome. accordion functionality can achieved bootstrap's collapse feature: http://getbootstrap.com/javascript/#collapse having filters have accomplished through database-driven application defining characteristics recorded attributes in table. recommendation php/mysql. presents steep learning curve, can start making static pages bootstrap right away, , code multiple pages, 1 each filter "filter" hyperlink page displays rows.

PHP Session Class return values -

i have simplet session class (below): class session{ public static function init(){ @session_start(); } public static function set($key, $value){ $_session[$key] = $value; } public static function get($key){ if (isset($_session[$key])) { return $_session[$key]; } else if(empty($key)){ return $_session; } } public static function destroy(){ session_destroy(); } } to set single session value use session::set(name, value); to set multiple session value use session::set(name, array(name, value....)); then retrieve session require use: session::get(name); now problem when can set multi dimension values, cannot them current function above. how can re-structure get($key) not returns single request request session::set('joe', 'bloggs'); session::set('beth', array('age'=>'21','height'=>'5.5ft'...

gradle - Didn't find the class rx.android.schedulers.AndroidSchedulers -

i'm using both rxjava/rxandroid , jackson-databind in application seems 2 libraries can't work together. when try run application returns following error: java.lang.classnotfoundexception: rx.android.schedulers.androidschedulers here gradle file: apply plugin: 'com.android.application' android { compilesdkversion 23 buildtoolsversion "23.0.2" defaultconfig { applicationid "myapp" minsdkversion integer.parseint(project.android_min_sdk_version) targetsdkversion 23 versioncode 1 versionname "1.0" multidexenabled true } buildtypes { release { minifyenabled false proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.pro' } } compileoptions { sourcecompatibility javaversion.version_1_7 targetcompatibility javaversion.version_1_7 } packagingoptions { ...

c# - How to allow space in regex? -

i trying value after new : in double quote. can retrieve value fine when there no space in listname. if put space between list name (eg. newfinancial history:\"xyz\"), throws error below: parsing "newfinancial history:"(?[^"]*)"" - invalid group name: group names must begin word character. it throws error @ below line var matches = regex.matches(contents, regex, regexoptions.singleline); below code. string contents = " testing newfinancial history:\"xyz\" "; var keys = regex.matches(contents, @"new(.+?):", regexoptions.singleline | regexoptions.ignorepatternwhitespace).oftype<match>().select(m => m.groups[0].value.trim().replace(":", "")).distinct().toarray(); foreach (string key in keys) { list<string> valuelist = new list<string>(); string listnamekey = key; string regex = "" + listnamekey + ":" + "\"(?<" + lis...

angularjs - Appending ngBindHtml function using .attr in link function not working -

a attempting attach ngbindhtml directive in application within link function of directive. module in directive located injects ngsanitize such: angular.module('ui.bootstrap.contextmenu', ['ngsanitize']) .directive('contextmenu', cm); where cm directive function. link function looks like: var link = function ($scope, element, attrs) { element.on('contextmenu', function (event) { event.stoppropagation(); $scope.$apply(function () { event.preventdefault(); var options = $scope.$eval(attrs.contextmenu); var model = $scope.$eval(attrs.model); if (options instanceof array) { if (options.length === 0) { return; } rendercontextmenu($scope, event, options, model); } else { throw '"' + attrs.contextmenu + '" no...

(Spring batch) Pollable channel with replies contains ChunkResponses even if JOB is succefully completed -

i have following chunk writer configuration getting replies spring batch remote chunking: <bean id="chunkwriter" class="org.springframework.batch.integration.chunk.chunkmessagechannelitemwriter" scope="step"> <property name="messagingoperations" ref="messaginggateway" /> <property name="replychannel" ref="masterchunkreplies" /> <property name="throttlelimit" value="5" /> <property name="maxwaittimeouts" value="30000" /> </bean> <bean id="messaginggateway" class="org.springframework.integration.core.messagingtemplate"> <property name="defaultchannel" ref="masterchunkrequests" /> <property name="receivetimeout" value="2000" /> </bean> <!-- remote chunking replies slave --> <jms:inbound-channel-adapter id="master...

html - How to either disable scrolling in md-content or have a min-height when on mobile -

i'm using angular material's md-content directives create section flexes fill usable vertical space , scrolls it's content. problem when viewing page small screen, content shrinks point disappears. i'd md-content stop scrolling or have min-height page scrollbar shows , user can still see content. update: here's plunker demonstrate problem: https://plnkr.co/edit/nvbeho0cpxx5zzi4u88u?p=preview <body layout="column"> <div> <h1>header</h1> </div> <md-content layout="row"> <div flex="50">left column</div> <md-content flex="50" layout="column"> <h2>section header</h2> <md-content layout="column" flex> <h3>scroll header</h3> <md-content flex layout="column" style="min-height: 300px"> <md-content flex> scrollable content...

perl - Getopt::Long multiple switches -

i have 3 methods , 2 switches i methoda run if switcha set methodb run if switcha , switchb set methodc run if switcha , switchb set , arguement switchb produced like so ./main --switcha ./main --switcha --switchb ./main --switcha --switchb hello my code my $result = getoptions{ "switcha" => \$opt_a, "switchb:s" => \$opt_b }; methoda if($opt_a); methodb if($opt_a && $opt_b eq ""); methodc if($opt_a && $opt_b ne "") i have tried different things essentially, if want methodb run, method runs, , if want methodb run, methoda runs. haven't got round testing methodc yet. any help? methoda if $opt_a && !defined($opt_b); methodb if $opt_a && defined($opt_b) && $opt_b eq ""; methodc if $opt_a && defined($opt_b) && $opt_b ne ""; or if ($opt_a) { if (defined($opt_b)) { if ($opt_b eq "...

javascript - pop-up dialog box w/ form stays upon Submit -

i page pop-up window contains form. when form filled out , submit clicked, pop-up remain on top of page new data loaded it. whenever try far, when click on submit button in pop-up, pop-up either closes, if have target="_self", or contains of pop-up go new tab browser opens. have yet find solution allows pop-up stay when coming ajax pop-up function (listed below). i standard non-ajax popup, if user clicks on page pop-up came from, pop-up goes underneath main page, isn't want @ all. here page pop-up comes from $(function() { $("#dialog").dialog({ autoopen: false, modal: true, width: 1200, height: 700, buttons: { "dismiss": function() { $(this).dialog("close"); } } }); $(".dialogify").on( "click", function(e) { e.preventdefault(); $("#dialog").html(""); $("#dialog").dialog("option...

c# - Panel DefaultButton doesn't work in Safari -

i have basic login form, , want form submitted when user presses enter <asp:panel id="pnllogin" runat="server" defaultbutton="lblogin"> <asp:textbox id="txtusername" runat="server" /> <asp:textbox id="txtpassword" runat="server" textmode="password" /> <asp:linkbutton id="lblogin" runat="server" onclick="lblogin_click" /> </asp:panel> this works in ie, firefox, , chrome, not in safari. know how can linkbutton clicked when push enter in safari?

ruby - How to output a hash to a CSV line -

i'd map hash csv line. i have couple of objects in hash: person1 = {'first_name' => 'john', 'second_name' => 'doe', 'favorite_color' => 'blue', 'favorite_band' => 'backstreet boys'} person2 = {'first_name' => 'susan', 'favorite_color' => 'green', 'second_name' => 'smith'} i want transform csv file keys columns , values each row. i can create headers creating csv::row this: h = csv::row.new(all_keys_as_array,[],true) i cannot rely on order , more important, not values filled time. but when try add rows table via << , array, mapping of headers ignored. has in right order. to demonstrate this, wrote little script: require 'csv' person1 = {'first_name' => 'john', 'second_name' => 'doe', 'favorite_color' => 'blue', 'favorite_band' => 'backstreet b...

primefaces - Crop image and send it to jsf bean without unnecessary data transfer -

i'd upload image generated jquery cropper bean field. client side ve found this : <p:fileupload id="imginp" mode="simple" allowtypes="/(\.|\/)(gif|jpe?g|png)$/"/> <img id="blah" src="#" alt="your image" /> <p:imagecropper image="" /> <script> var reader = new filereader(); reader.onload = function (e) { $('#blah').attr('src', e.target.result); } function readurl(input) { if (input.files &amp;&amp; input.files[0]) { reader.readasdataurl(input.files[0]); } } $("#imginp").change(function(){ readurl(this); }); </script> it displays image without uploading can't in cropper. use jquery cropper i'm not sure how in bean (without going through servlets, because it's not 1 time use). in other words need send img throu...

installation - Cannot install a wcf service -

i created msi install package failing. message "the installer interrupted before (name) installed. need restart installer try again. the first time try install on machine. machine windows server 2012 r2. i can install windows form application ok. thanks in advance. bob i found answer in forum. need go service manager , add role service "iis6 management compatibility". under web server - management tools.

html - Starting ICQ via hyper link? -

i'm trying attempt start icq (external application) via "icq:message?uin=123456" hyper link, appears it's not doing @ all. have latest icq installed on windows 10 (64bit) , tried this post , url in answer download output of php file. thank you!

Resharper to load StyleCop settings -

i'm using resharper 7.1 , stylecop 4.7 (with visual studio 2012). default resharper loads stylecop rules inspection , off them action taken "warning", though in settings.stylecop file of rules disabled. if stylecop rule disabled resharper "do not show" (because of course, not default rules make sense time). i know can done manually in resharper - options - inspection severity, choosing action take each rule. there way automatically? is, make resharper not warn rule being broken if it's disabled in stylecop.settings? it makes sense automatically, because want define set of mandatory rules team apply, , redundant have each engineer manually fix action taken each existing rule (since lot). thanks in advance, mihai it seems there no way this, although, possible configure rules manually in resharper options , export options (via manage -> export file) , can imported on other machines.

angularjs - Saving and Getting Data / Rows to and from PouchDB -

i new pouchdb, meaning have not yet been able implement app uses it. this issue now, in controller have 2 functions: var init = function() { vm.getinvoicesremote(); // data server , update pouchdb vm.getinvoiceslocal(); // data pouchdb , load in view } init(); basically in app have view shows customer invoices, want customers able still see invoices when they're offline. have seen several examples of pouchdb , couchdb use "todo" example not give information. now i'm confused point in me spending hours understanding couchdb , installing if in end i'm going retrieving data server using api. also when data returned how pouchdb identify records new , records old when appending. well, m working on same kind..!this how m making work..! $scope.lists = function () { if(!$rootscope.connectionflag){ offlineservice.getlocalorderslist(function (locallist) { if(locallist.length > 0) { ...

java - Repaint JPanel from actionlistener -

i know there multiple threats on how repaint jpanel. i've been trying repaint jpanel inside actionlistener applying revalidate() , repaint() methods (as found @ stackoverflow). sadly enough isn't working. when change text of button, it's repainting! public simulationpanel() { //configure panel..... /* actionlistener */ btnstepsintofuture.addactionlistener(new actionlistener() { @override public void actionperformed(actionevent arg0) { //do /* refresh grid panel */ worldpanel.creategrid(); simpanel.revalidate(); //= not working simpanel.repaint(); //= not working //btnendsim.settext("end world simulation "); = working //btnendsim.settext("end world simulation"); = working } }); /* add components simulationpanel */ simpanel.add(buttonsontoppanel, borderlayout.north); si...

python - Create a new column based on values of time-series data in pandas -

i created date range in pandas follows: new_range = pd.date_range(start="2015-1-1", end="2015-12-31") required_df = pd.dataframe(new_range) required_df.head() this results in dataframe: start date 0 2015-01-01 1 2015-01-02 2 2015-01-03 3 2015-01-04 4 2015-01-05 now add new column date range starting value of date field in row ending on last date of year. resulting dataframe should this: start date end date 0 2015-01-01 2015-01-02 1 2015-01-01 2015-01-03 2 2015-01-01 2015-01-04 ................. n 2015-01-01 2015-12-31 n+1 2015-01-02 2015-01-03 n+2 2015-01-02 2015-01-04 ................. n+m 2015-12-30 2015-12-31 i can use loop loop through each value in data_range , create new columns based on that. think there must efficient solution in pandas accomplish this.

c++ - Sending null byte over a socket to a Windows Machine from Linux - Will it be same -

this based on earlier question asked . sending octet of 0 bits linux linux machine such on socket const char null_data(0); send(newsockfd,&null_data,1,0); my question same when sending windows machine (64 bits) ? or have change code ? the trick here use uint*_t data types, insofar feasible: #include <cstdint> /* ... */ #if !defined(__win64) // *nix variant typedef int socket_fd_t; #else // winxx socket descriptor data type. typedef socket socket_fd_t; #endif void send_0_byte(socket_fd_t newsockfd) { uint8_t zero_byte(0); send(newsockfd, &zero_byte, 1, 0); } you want add error checking code, include correct platform socket header. uint8_t 8-bit quantity (octet) definition, meets requirement , avoids potential char size issues. on receiver side, want recv uint8_t buffer.

CSS transitions with the "checked" hack -

this question has answer here: is there “previous sibling” css selector? 12 answers i'm trying similar example using "checked" hack input[type=checkbox]:checked ~ label .box { opacity:0; -webkit-transform :scale(0) rotate(-180deg); -moz-transform :scale(0) rotate(-180deg); transform :scale(0) rotate(-180deg); } http://codepen.io/anon/pen/kvwwjy however, need change html code label tag before input tag. when move input in bottom effects stop working. how can fix this? there no previous sibling selector in css. if there was, css lot slower. there has been lot of debate on subject , won't happen in foreseeable future. as chowey put it: css selectors designed easy (fast) implement browser. document can traversed once, matching elements go, no need ever go backward adjust match simply put, you'll h...

angularjs - How to clear form after post? -

i'm creating app using ionic. after send values of form want clear form can't this. how ? form <form name="empresa"> <div class="list"> <label class="item item-input" ng-class="{'has-errors':empresa.nomeemp.$invalid, 'no-errors':empresa.nomeemp.$valid}"> <input type="text" placeholder="nome" name="nomeemp" ng-model="empresa.nome" ng-required="true"> </label> <div class="error-container" ng-show="(empresa.nomeemp.$dirty || !empresa.nome...

javascript - Dynamic script not loading on history.go() -

i have static html page cannot edit- refer js file though, redirect url request on iis server js file- dynamically inject jquery can use it. here's code use insert jquery: var script = document.createelement( 'script' ); script.src = 'http://code.jquery.com/jquery-1.9.1.js'; script.type = 'text/javascript'; script.onload = jqueryready; //most browsers script.onreadystatechange = function () { //ie if ( this.readystate == 'complete' ) { jqueryready(); } }; this works great except in 1 specific case- if call history.go() on page when browser ie , page being served internal web server. hitting f5 not reload page properly. have put cursor in address bar , hit enter load right. edit: forgot mention obvious- have breakpoint in jqueryready() function- , never gets hit- problem lies... it works fine ie in dev environment if serve page , fire history.go() (with button click). works chrome, haven't tested firef...

linux - Python Serial Read Not Working -

i attempting control projector using rs232 python. link has needed information port settings , expected responses. http://www.audiogeneral.com/optoma/w501_rs232.pdf to summerise baud = 9600, data bits = 8, no parity, 1 stop bit, no flow control. when command "~00124 1\r" sent projector should respond okn n power state. when command "~0000 1\r" sent projector should power on from putty able send power on command , other commands , see projector supposed to. can send read command , appropriate okn response putty. from python can send power on command , see projector power on. when send power state command never see character come read buffer. here code test script wrote trying debug this. import serial ser = serial.serial("/dev/ttyusb0") print ser.baudrate print ser.bytesize print ser.parity print ser.stopbits print ser.xonxoff print ser.rtscts print ser.dsrdtr print ser.name print "power state" ser.write("~00124 1...

javascript - How to hide the URL when hover over a link? -

would possible when hover on image href won't display link raw video? (bottom left of web browser)? also, how can disable right click won't video options. <article> <a class="thumbnail" href="http://vjs.zencdn.net/v/oceans.mp4"> <img src="http://i.livescience.com/images/i/000/026/853/iff/ocean-waves-beach.jpg?1336055104" alt="" /> </a> </article> since no video tags being used, i'm not sure this. my idea maybe href toggle javascript function. function pretty same thing. store raw link in variable. with css only, can set layer on top of link. below example of using pseudo element :before + position tricks. article { position: relative; display: block; } article:before { content: ""; position: absolute; left: 0; right: 0; top: 0; bottom: 0; z-index: 1; } <article> <a class="thumbnail" href="http://...

android - forced close when notification goes to activity -

i'm making project in android , first question in wonderful web, hello everybody! when i'm in activity (groups.class) i'm calling function (declarated inside activity): public void lookforgroups() { int seconds = 20; intent myintent = new intent(groups.this, groupstaskalarmchecker.class); pendingintent = pendingintent.getservice(groups.this, 0, myintent, 0); alarmmanager alarmmanager = (alarmmanager)getsystemservice(alarm_service); calendar calendar = calendar.getinstance(); calendar.settimeinmillis(system.currenttimemillis()); calendar.add(calendar.second, 10); alarmmanager.setrepeating(alarmmanager.rtc_wakeup, calendar.gettimeinmillis(), seconds * 1000, pendingintent); } inside service connect php in web , receive answer , create notification (declarated inside service) sending message handler call function notifynew(). public class groupstaskalarmchecker extends...

c++ - Error Variable is Protected -

#include <iostream> #include <string> #include <cstdlib> #include <ctime> using namespace std; void armyskirmish(); void battleoutcome(); string commander = ""; int numberofhumans = 0; int numberofzombies = 0; class armyvalues { protected: double attackpower; double defensepower; double healthpoints; public: void setattackpower(double a) { attackpower = a; } void setdefensepower(double d) { defensepower = d; } void sethealthpoints(double h) { healthpoints = h * (defensepower * .1); } }; class zombies: public armyvalues { }; class humans: public armyvalues { }; int main(int argc, char ** argv) { cout << "input commander's name: " << endl; cin >> commander; cout << "enter number of human...

Get Android Version -

i want android version, i'am using android studio , android 4.3 sdk. try : string deviceandroidversion =build.version; and error message : error:(58, 40) error: cannot find symbol variable version i try way suggest way android version. thankyou string deviceandroidversion = build.version.release

r - How to add title to column of the xts time series -

i want download stock details using quantmod , have saved files using write.csv : write.csv(df,file="aapl.csv") the problem there no header date in csv file. aapl.open aapl.high aapl.low aapl.close aapl.volume aapl.adjusted 2014-10-01 100.59 100.69 98.70 99.18 51491300 97.09741 2014-10-02 99.27 100.22 98.04 99.90 47757800 97.80230 2014-10-03 99.44 100.21 99.04 99.62 43469600 97.52818 2014-10-06 99.95 100.65 99.42 99.62 37051200 97.52818 2014-10-07 99.43 100.12 98.73 98.75 42094200 96.67644 2014-10-08 98.76 101.11 98.31 100.80 57404700 98.68340 2014-10-09 101.54 102.38 100.61 101.02 77376500 98.89877 i want this date aapl.open aapl.high aapl.low aapl.close aapl.volume aapl.adjusted 2014-10-01 100.59 100.69 98.70 99.18 51491300 97.09741 2014-10-02 99.27 100.22 9...

swift - Height and Width of buttons not the same (ios) -

i have grid made of ios buttons (think sudoku). assigned each button have aspect ratio 1:1. further ensure equality, have made each button have width = height constraint set. however, when @ buttons, of them have 44x45, while others have 44x44 (as expected). is there constraint i'm missing or there workaround can guarantee buttons perfect squares. this happening because have other constraints affecting views too. eg. might have put these in container view , specified container views width or made container view's width equal width of screen. now when these square view fill container view, there space left eg 7 points. autolayout adds these 7 points making of squares wider 1 point. this can fixed providing correct constraints container view.

c - how to correctly wait for execve to finish? -

a c source code (compiled , running linux centos 6.3) has line: execve(cmd, argv, envp); execve not return, want modify code know when finished. this: if (child = fork()) { waitpid(child, null, 0); /*now know execve finished*/ exit(0); } execve(cmd, argv, envp); when this, resulting program works 99% of time, exhibits strange errors. is wrong above?? expect above code run precisely (except little slower) before. correct? if want know background, modified code dash . execve call used run simple command, after dash has figured out string run. when modify precisely above (without running after waiting) , recompile , run programs under modified dash, of time run fine. however, recompilation of 1 particular kernel module called "biosutility" gives me error cc1: error: unrecognized command line option "-mfentry" here's 1 possibility. dash does, in fact, need know when child process terminates. must reap child (by wa...

python - Celery, Django and Scrapy: error importing from django app -

i'm using celery (and django-celery ) allow user launch periodic scrapes through django admin. part of larger project i've boiled issue down minimal example. firstly, celery/celerybeat running daemonized. if instead run them celery -a evofrontend worker -b -l info django project dir i no issues weirdly. when run celery/celerybeat daemons strange import error: [2016-01-06 03:05:12,292: error/mainprocess] task evosched.tasks.scrapingtask[e18450ad-4dc3-47a0-b03d-4381a0e65c31] raised unexpected: importerror('no module named myutils',) traceback (most recent call last): file "/home/lee/desktop/pyco/evo-scraping-min/venv/local/lib/python2.7/site-packages/celery/app/trace.py", line 240, in trace_task r = retval = fun(*args, **kwargs) file "/home/lee/desktop/pyco/evo-scraping-min/venv/local/lib/python2.7/site-packages/celery/app/trace.py", line 438, in __protected_call__ return self.run(*args, **kwargs) file "evosched/tasks.py...

Can I use python to develop Google Chrome extensions? -

this question has answer here: chrome extension in python? 5 answers i have read introduction how create google chrome extensions. possible create extension using pyhton instead of js? a google chrome extension webpage few permissions , on. so, you're looking method use python scripting language inside browser. the problems : not browsers capable of using python scripting language by default javascript scripts enabled in browsers, python may not be. not enough tutorials on how use python here. js way more popular. but returning how it. popular methods: brython - use html5 + text/python scripts directly embed python inside browser. pyjs - here, compile python javascript. more complicated, browser sees js, usable anywhere.