Posts

Showing posts from March, 2013

Android layout view id name issue -

i faced issue when named view android:id="@+id/textview1" , code textview tv1 = (textview) findviewbyid(r.id.textview1); was returning wrong view though there no warnings given naming convention. when changed name text_view_1 worked. i know usual naming convention small case android:id="@+id/text_view_1" or camel case android:id="@+id/textview1" is there documented resource explains issue or answer it? want know m stands in variable name see in open source code. e.g. textview mtextview; its noob question couldn't find answer anywhere. try clean , build project. android coding syle guide states: non-public, non-static field names start m. static field names start s. other fields start lower case letter. public static final fields (constants) all_caps_with_underscores. it private imagebutton mbuttonstart; or private static ssingletonthing; that convention way required used if want contribute android sourcecode, c

How to append results as a matrix to a dataframe using functions in R -

i working these 2 dataframes datetime <- c("2016-01-20 08:30:13", "2016-01-20 12:45:00", "2016-01-20 02:53:20", "2016-01-20 03:22:18", "2016-01-20 21:42:10", "2016-01-21 07:55:50", "2016-01-21 13:14:10", "2016-01-21 15:42:16", "2016-01-21 18:31:15", "2016-01-21 19:13:10") measurement <- c(10,120,180,30,240,40,300,380,960,390) outlier <- c("false","true","true","false","true","false","true","true","true","true") type <- c("length","length","height","breadth","length", "breadth","breadth","height","height","length" ) df <- data.frame(datetime,measurement,outlier,type) df$datetime <- as.posixct(df$datetime,format="%y-%m-%d %h:%m:%s"

regex - Regular expression for alphamumeric value and can contain hyphen -

hi have validate input can have alpha numeric value , hyphen. must not start hyphen. example - abc-456,45678999,456-788 valid but -2333hj-jj invalid. this regex can it: ^(\w+[-]?)+$

c# - Autofac : ComponentNotRegisteredException after web site restart -

i have weird error. site works after upload dll bin folder. however after leave while (or trigger web site restart shared host control panel) i following error the requested service 'nop.core.data.datasettings' has not been registered. avoid exception, either register component provide service, check service registration using isregistered(), or use resolveoptional() method resolve optional dependency. [componentnotregisteredexception: requested service 'nop.core.data.datasettings' has not been registered. avoid exception, either register component provide service, check service registration using isregistered(), or use resolveoptional() method resolve optional dependency.] autofac.resolutionextensions.resolveservice(icomponentcontext context, service service, ienumerable`1 parameters) +231 autofac.resolutionextensions.resolve(icomponentcontext context, ienumerable`1 parameters) +118 autofac.resolutionextensions.resolve(icomponentcontext context)

javascript - Wait for loop to finish $.getJSON for each array item before outputting data -

i've got array of names need retrieve data from, , i'm doing $.getjson inside loop. works , can retrieve data, output correct value need use settimeout or similar. i'm wondering if there's more refined way of doing i'm looking achieve. here's i've got. var names = ["riotgames", "example"]; var online = []; (var = 0; < names.length; i++) { $.getjson('https://api.twitch.tv/kraken/streams/' + names[i], function(data) { if (data.stream != null) { online.push(data.stream.channel.display_name); }; }); } console.log(online) // outputs [] settimeout(function() { console.log(online) // outputs correctly }, 1000); <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> when doing $.getjson , triggering asynchronous requests. means run in background. not wait them finish, callbacks trigger (like event) once reques

c# - Why does XNA upgrade VS 2010 from v. 10 to v. 11? -

when download visual studio express 2010 install version 10. if have projects version 11 (still visual studio express 2010) not load. how upgrade version 10 11? i have tried upgrade program itself, takes me defunct microsoft link. p.s. link iso of visual studio express 2010 dead: http://www.microsoft.com/visualstudio/en-us/products/2010-editions/express-iso . links not: http://go.microsoft.com/?linkid=9709969 . use last link download it. i figured out. visual studio express 2010 version 10 , installing xna 4.0 upgrades version 11 (specifically projects created version 11 , visual studio remain version 10). loads version 11 projects!

Python 2.7 error encoding -

i'm having problem, syntaxerror: non-ascii character no idea why i've tried # -*- coding: utf-8 -*- for "//r//n//r” your problem in quotes. if closely you'll see closing quote ” not " replacing line with: "//r//n//r" or '//r//n//r' should work.

php - How to create a folder in site->default->files with write read permissions with Drupal? -

im working on ubuntu , need create folder in drupal's default->files folder write permission able add files folder later on. here code i'm having, please help. drupal_mkdir('public://' . $new_dir . '/'); $file = file_copy($file, 'public://' . $new_dir . '/' . $file_name); drupal_mkdir('public://' . $new_dir , 0777); if need recursive set third argument true. update: $oldumask = umask(0); drupal_mkdir("public://". $new_dir , 0777); umask($oldumask);

c++ - Creating an bitmap atlas with direct2d, what does "current bitmap" refer to? -

so trying bitmaps atlas direct2d. method have maybe want but... current bitmap refer to? if understand well, doesn't copy , area bitmap bitmap right? virtual hresult copyfrombitmap( [in, optional] const d2d1_point_2u *destpoint, [in] id2d1bitmap *bitmap, [in, optional] const d2d1_rect_u *srcrect ) = 0; destpoint [in, optional] type: const d2d1_point_2u* in current bitmap , upper-left corner of area region specified srcrect copied. bitmap [in] type: id2d1bitmap* the bitmap copy from. srcrect [in, optional] type: const d2d1_rect_u* the area of bitmap copy copyfrombitmap() method on id2d1bitmap interface, implies have bitmap already, object calls copy function. ... id2d1bitmap *psourcebitmap = 0; id2d1bitmap *pdestinationbitmap = 0; // initialisation of above bitmaps goes here ... // copy region source destination pdestinationbitmap->copyfrombitmap(/*point want copy to*/, psourcebitmap, /*rect copy from*/);

Javascript replace content and refresh it with new content which new content from outerHTML -

is possible refresh page new content new content outerhtml? i'm having problem want refresh page until 2 seconds, proccess 0-2 seconds new html innerhtml , etc. after new content outerhtml. difficulty refresh content html outerhtml. below example code: <script> // code blablabla new content. has been fix code, , below code start refresh page outerhtml. window.onload = function() { tes(); }; function tes() { var htmlall = document.documentelement.outerhtml; settimeout(function(){howcoderefresh()}, 2000); function howcoderefresh() { // how code refresh page , replace content variable htmlall }; }; </script> my question: possible it? if yes, how it? thanks. you not explain question,you can try ajax in jquery solve question.here basic demo: <div id = "target"></div> <script type="text/javascript" src="jquery.js"></scrip

linux - Can I modify stdin descriptor for particular process? -

Image
here scenario: i opened 3 terminals: term1, term2, term3. pid of term1 6549. ps -fp 6549 gives: bc 6549 3642 0 11:07 pts/8 00:00:00 bash now, on terminal 2 typed tail -f /proc/6549/fd/0 so far nothing happens, ok, in nothing being processed process 6549. on terminal3 execute: echo "any kind of text" | write $user pts/8 which sending text. output on terminal1 ok, nothing appears on tailed descriptor. possible see input of data passed execute process 6549? how 6549 use files inside /proc/6549/fd directory ? edit: same stdout: cannot see output of tail, output on terminal above pid ok. reading terminal reads input terminal's keyboard (real or virtual). writing terminal writes output terminal's screen. what you're doing writing terminal's screen , expecting output loop keyboard input instead of being displayed: the answer no, can not that. if want run program in terminal session multiple processes can provide input

c# - Best way to keep image in memory -

i want keep 1000-2000 images in memory. tried imagetobytearray , store them in key value pair gives memory leak. there other way or i'm lost? reason keeping them in memory fast reading looks bad idea. pretty small images 450, 250 use them in winforms. problem grouped in clips in runtime show 25picture/second thats why need memory thanks in advance, is there situation need 1000 images @ once? if keep them all, depends on image size hit memory caps in long run. need have cache mechanism manage smartly. may can deal db sqlite manage them efficiently or use own smart way of caching based on application preferences.

javascript - Why does returning from other web leave the last hash while showing the content of the first one? -

problem: after input name , hit enter, hash changes 'pag2', showing different content. click red link goes other website and, once on website, go via button in browser. still www.luisalmerich.com#pag2, shows content empty location hash (the 1 see entering directly). if have explained badly: www.luisalmerich.com -> input text , hit enter -> www.luisalmerich.com/#pag2 -> www.siroppe.com (red link on #pag2) -> button on browser -> www.luisalmerich.com/#pag2 content www.luisalmerich.com this web: http://www.luisalmerich.com/ my code isn't weird. here javascript website has (it's causing problem): $(document).ready(function () { $('#input1').keypress(function (e) { if(e.which == 13){ location.hash="pag2"; } }); }); $(window).on('hashchange', function() { if (location.hash == "#pag2") { $('#pag1').css("display", "none");

firefox - Notification when the value in Address Bar changes -

how notified whenever url in address bar (also known location bar) changes. using following code, tried notified when user navigates page (by clicking link, using back/forward button, typing address in location bar, etc.) , when user switches tabs. var myextension = { oldurl: null, init: function() { gbrowser.addprogresslistener(this); }, uninit: function() { gbrowser.removeprogresslistener(this); }, processnewurl: function(auri) { if (auri.spec == this.oldurl) return; // know url new... alert(auri.spec); this.oldurl = auri.spec; }, // nsiwebprogresslistener queryinterface: xpcomutils.generateqi(["nsiwebprogresslistener", "nsisupportsweakreference"]), onlocationchange: function(aprogress, arequest, auri) { this.processnewurl(auri); }, onstatechange: function() {}, onprogresschange: function() {}, onstatuschange: function() {}, onsecuritychange: function() {} }; }; window.addeventlis

c# - How to delete a selected row from datagridview? -

if (dgvproductcatalog.rows.count > 1 && dgvproductcatalog.selectedrows[0].index != dgvproductcatalog.rows.count - 1) { cmd = new sqlcommand("delete products productid= " + dgvproductcatalog.selectedrows[0].cells[0].value.tostring() + " " , connection); try { connection.open(); cmd.executenonquery(); } catch (sqlexception ex) { messagebox.show(ex.message); } { connection.close(); dgvproductcatalog.rows.removeat(dgvproductcatalog.selectedrows[0].index); messagebox.show("record deleted successfully!"); displaydata(); cleardata(); } } i using above piece of code on button click delete selected row getting " system.argumentoutofrangeexcep

c# - Multiple NHibernate Transactions in TransactionScope -

i have legacy dll uses multiple nhibernate transactions in 1 method. task make method act 1 transaction, think transactionscope should me. however, when made this: using (transactionscope tx = new transactionscope()) { #region.. code inside dll using (isession session1 = ...) using (itransaction tx1 = session.begintransaction()) { // ...do work session tx1.commit(); } using (isession session2 = ...) using (itransaction tx2 = session.begintransaction()) { // ...do work session tx2.commit(); } #endregion tx.complete(); } ...method not rolledback if tx2 falls! i appreciate suggestion or hint.. thank in advance

asp.net - Can I configure a controller to reject all Post methods? -

Image
we have few controllers expect process requests. when post arrives returns 500 , rather return 405 (method not allowed). there way set routes on controller return 405 when post received? of controllers need accept post cant in iis config (i.e configure reject verbs). information platform azure web app. i have solution works, has disadvantage of having added every route, seems cumbersome. [route("example/route/{date:datetime}")] [acceptverbs("get", "post")] public periods getexampleroute(datetime date) { if (request.method.method.equals("post")) { throw new httpresponseexception(httpstatuscode.methodnotallowed); } ... processing ... } you could mvc actionfilter (similarly web api , system.web.http ): public class restrictverbsattribute : actionfilterattribute { private string protocol { get; } public restrictverbsattribute(string verb) {

Using Java Generics in Scala -

when integrating java library scala codebase, running following error when uisng 1 of generic objects java scala. val myobject<someotherclass> = myobject.factorymethod() above code gives compilation error because not valid scala statement. how can use java generic objects in scala codebase. val myobject: myobject[t] = myobject.factorymethod () would scala-syntax. note objects written in lower case. type inference might solve issue without giving type explicitly, might idea documentation reasons specify though, , error, if reasoning wrong.

ios - Case Insensitive Compare with Core Data and Swift -

the following code doesn't work: let sortdescriptor = nssortdescriptor(key: "name", ascending: true, selector:"caseinsensitivecompare") and gives following error: 'nsinvalidargumentexception', reason: 'unsupported nssortdescriptor selector: caseinsensitivecompare' seemed work fine in objective-c. ideas on why might be? edit: seems may not possible core data/sqlite. in case, best option array , sort in code afterwards? the selector caseinsensitivecompare: , colon, , can use core data. the colon there because method (which instance method of nsstring ) takes 1 argument (the string compare with). as list of sort selectors can used core data , sqlite store can found in persistent store types , behaviors in core data programming guide .

javascript - Chrome, Firefox deny image in popup; IE11, Edge fine with it -

Image
i have javascript/jquery application dynamically creates catalog of film collection, based upon json file. example, if click titles button, space below button fills titles in collection. each title line includes link uses serial number link context, providing small body of film information appears within new window (=popup). browsers (ie11, edge, firefox, chrome) behave point. ie11 , edge show jpeg image @ bottom of film data, image link javascript application on server shows jpeg image (up to) full screen. chrome not acknowledge jpeg image @ all. firefox shows outline of image not show image nor acknowledge link other js application. i have gone through chrome settings enabling site action chrome specifies. no change. similarly firefox. no effect. the attached photo shows how microsoft browsers display intended effect. any idea browser rule i'm violating here? 4 feb 2016 i'm adding link application discussed running on server, therefore allows access both ja

php - AS3 upload a file to the server without using FileReference.browse() -

updated: developing air app mobile , have file called "database.db" in applicationdirectory included or added via flash cc ide. offering bounty of 150 if can me through issue, is, me upload script on server getting actionscript upload "database.db" file it. what hope script achieve ? i want database time time hoping upload server. how this? the code below not work , gives error. update: here error getting: typeerror: error #1034: type coercion failed: cannot convert "app:/database.db" flash.net.filereference. i don't believe question exact duplicate need upload file , example given not show how data turned datatype upload. do have server? yes, of don't have php script needed handle upload, @ moment trying simple file as3 ready upload , can't do. package { import flash.display.movieclip; import flash.events.mouseevent; import flash.net.urlloader; import flash.net.urlrequest; import flash.net.urlvariables

php - How can I pass a very long string from one page to another? -

i'm making data visualisation tool works using svg, d3.js , jquery. making feature export (and download) svg file: // code on main page var svg = $("#svg-wrap").html(); var win = window.open("export.php?svg=" + svg, '_blank'); // _blank means export.php opens in new tab win.focus; // code in export.php <?php ob_start(); header("content-type: application/octet-stream"); header("content-disposition: attachment; filename=data.svg"); $svg = $_get["svg"]; echo stripslashes($svg); ?> this doesn't work though, because although of svg passed through, full code long query string (or seems). is there way can fix this? use compression, shrink limit , think still long - svg code hundreds of lines :( . most uas put limits on requests. use post instead.

java - getformat for showing week -

how can set datetimeformat show this: "wed.-sun." "mon.-sun." "mon.-sun." "mon.-sun." "mon.-tue" datetimeformat dtfdate = datetimeformat.getformat("dd.mm"); if (rt.detalization.equals("date")) { dtfdate = datetimeformat.getformat("dd.mm"); } if (rt.detalization.equals("week")) { dtfdate = datetimeformat.getformat("eee.dd-eee.dd"); //how can show week choisen day sunday wrote before } if (rt.detalization.equals("month")) { dtfdate = datetimeformat.getformat("mmm"); } the below code prints datetimeformat format2 = datetimeformat.getformat("e"); string format = format2.format(new date()); system.out.println(format); //prints "mon" so if (rt.detalization.equals("week")) { datetimeformat format2 = datetimeformat.getformat("e"); string day= format2.forma

ios - How to determine if each element in an array contains a certain letter by making an array of a wordlist file (swift 2) -

i relatively new swift. attempting make program takes wordlist (in form of array of strings) , removes strings not contain user-chosen letter. so, if wordlist ["apple", "banana", "cherry", "date", "endive"] , user chooses letter "a" (this variable "centerletter"), "apple", "banana" , "date" returned, do contain letter a. code works when array inputted (wordlist) standard array ["apple", "banana"]. however, actual use code sorting through every word in english language, found in file "words.txt" (one of files in swift project). i have assigned every word in words.txt (which separated /n) wordlist follows (this function): func arrayfromcontentsoffilewithname(filename: string) -> [string]? { let path = nsbundle.mainbundle().pathforresource("words", oftype: "txt") var filecontents: string? = nil { filecontent

Reversing sorted dictionary in Python 3 -

i'm sorting dictionary key, i'd reverse order. i'm not getting joy few of examples have seen around web. here sort tempdict = collections.ordereddict(sorted(tempdict.items())) now i'm trying: reverse = collections.ordereddict(tempdict.items()[::-1]) reverse = collections.ordereddict(map(reversed, tempdict.items())) but these not working. smartest , elegant way of sorting dictionary. yes know, dictionaries not used sorting, works us. thanks. to sort in reverse order: collections.ordereddict(sorted(tempdict.items(), reverse=true)) to reverse existing dict: collections.ordereddict(reversed(list(tempdict.items())))

ios - NSString to NSNumber ignores initial zeros -

i converting nsstring nsnumber . problem if nsstring starts zeros converting nsnumber ignores initial zeros. know initial zeros doesn't mean want keep initial zeros because it's phonenumber in case. here code: nslog(@"test1: %@",tempphonenumber); nsnumberformatter *formatter=[[nsnumberformatter alloc] init]; [formatter setnumberstyle:nsnumberformatterdecimalstyle]; nsnumber *temppnonenumbernumber=[formatter numberfromstring:tempphonenumber]; nslog(@"test: %@",temppnonenumbernumber); if test1: 00966123456789 test: 966123456789 i want both same nsnumber cannot keep initial zeros. if want keep zeros, don't convert it nsnumber . phone numbers not numbers, there kept strings. also note phonenumbers can contain other characters: + , * or # . these characters have special meaning (e.g. + @ beginning means same 00 ).

vba - Stuck on 'Case' assignment/wording -

much have received on forum particular code; thought had there must beg assistance 1 again. think best explanation can give below in pseudo-code! once case selection portion done repeat same process through months have change referenced cells. sub popcol() range("d3:d19").formula = "=rc[-1]-rc[-2]" 'd=c-b , delta equal cap minus dem = 3 19 range("d" & i) = clng(range("c" & i) - range("b" & i)) if (range("d" & i) < 0) range("e" & i) = range("e" & i) - range("d" & i) else range("f" & i) = range("f" & i) + range("d" & i) end if next range("g3:g19").formula = "=rc[-1]-rc[-2]" 'g=f-e , delta equal cap minus dem 'if delta (h)= capacity (g) continue, if g<0 go on prior months negative , add capacity 'then recalculate, else g>0 - go on pr

need to join table on based of condition in mysql -

i want integrate functionality in ios/android app. developing service that. question : have table called songs in have song details **like** song song_id station_id song_file so on. have second table called userlike user inforamation stored. **userlike** user_id song_id my main problem want return song details value information particular user.if uer has not may send 'zero' or null in json. how build query? need song data , value if user has liked it. try this select s.song, s.song_id song s , userlike u u.user_id = userid;

string - jQuery, how would i create a random name pulled from a name-list.txt based on user input -

i building phone app using phonegap build limited html5, css , javascript / jquery, achieve following. i take input user "john smith" , based upon input, pull lines file, if user enters same name, same result. googled , found articles using syllables , character count name generate name etc nothing seemed wanted do. i planned on hashing users input , storing in remote db randomly generated name , if hash comes again use same name, local on device great load times etc. do have idea best way generate random name based off users input? appreciated, thanks! my name-list.txt looks this: cup annihilator bobby val halen chupa'clark'bra hawii mushinator release why not save javascript object instead of text? then can make quick ajax call , object. faster using plain file , running regex. depending on how contents of file are, can construct json.

python - IPython scripting - Exit script with status code -

i trying use ipython script git pre-commit hooks since has nice syntax run shell commands , converting stdout result list of strings (which makes easy processing). i need return status code != 0 ipython script git pre-commit hook abort commit. consider example script #! /bin/ipython import sys sys.exit(1) running shell $ ipython test.ipy but checking status code $ echo $? returns 0 is there way make ipython return non-zero status code? open ipython , try running code interactively. in [1]: import sys in [2]: sys.exit(1) exception has occurred, use %tb see full traceback. systemexit: 1 exit: use 'exit', 'quit', or ctrl-d. so, ipython catching systemexit exception. suggest using different interpreter particular job, nice ipython is. alternatively can use: import os os._exit(1) however, skips sorts of important cleanup code (e.g. finally blocks) , bad idea. edit: this seems work. after writing can hear alarm bells in distance , t

javascript - Clean the previous elements after load replacement data with an ajax call -

i have page , using ajax load data database. data contains html code , put code inside div called #container . have paginator system, if click on "next" button, ajax starts again , gets html code response, , replaces code previous code inside #container . i have code this: function loading_show() { $('#loading').html("<img src='images/loading.gif'/>").fadein('fast'); } function loading_hide() { $('#loading').fadeout('fast'); } function loaddata(page) { loading_show(); $.ajax({ type: "post", url: "load_data.php", data: "page=" + page, success: function(msg) { $("#container").ajaxcomplete(function(event, request, settings) { loading_hide(); $("#container").html(msg); }); } }); } the result of ajax function html message. part of message this: <

Error in Parameters of Stored Procedure when Dynamic SQL is used -

i using oracle sql developer write stored proc, accepts list of values separated "," ( dynamic sql ) , use variable in " in " clause fire query table. but ending error @ @p_case_nbr varchar2(100), error(4,5): pls-00103: encountered symbol "@" when expecting 1 of following: current delete exists prior the sp used: create or replace procedure test_proc ( @p_case_nbr varchar2(100), p_out_case_nbr out varchar2 ) cursor test_cur select t.column1 test_table t t.column1 in (@p_case_nbr); test_cur_line test_cur%rowtype; begin p_out_case_nbr := null; open test_cur; loop fetch test_cur test_cur_line; exit when test_cur%notfound; p_out_case_nbr := p_out_case_nbr || ' ' || test_cur_line.column1; dbms_output.put_line(test_cur_line.column1); end loop; close test_cur; dbms_output.put_line('final value ' || p_out_case_nbr); dbms_

Google Chrome search my website from URL Bar -

if open google chrome, click inside url bar , write: google.com , hit tab , you'll a: search google <enter query> . i tried on website , because i'm using javascript process form before sending seo friendly url, search website not working it's redirecting me site.com/?question=test instead of site.com/search/test is there way fix that? it called omnibar. there tutorials if search google them. it's link tag tells chrome url use when user searches site omnibar. specifics detailed in open search description (osd). here stack overflow's osd: <link rel="search" type="application/opensearchdescription+xml" title="stack overflow" href="/opensearch.xml" />

How can I write output of MATLAB to MS Word? -

i reading input of matlab code excel file using xlsread , after calculation exporting word writing out report(writetoword.m). in excel, there string should read in matlab , output in word. in excel file(input.xlsx) written 'shoe'. i read using [num,txt,raw] = xlsread('input.xlsx'); eng = txt(14,19); % word 'shoe' in excel cell in writetoword.m , wrote, test = eng; wordtext(actxword,test,style,[0,1]); function wordtext(actx_word_p,text_p,style_p,enters_p,color_p) if(enters_p(1)) actx_word_p.selection.typeparagraph; end actx_word_p.selection.style = style_p; if(nargin == 5) actx_word_p.selection.font.color=color_p; end actx_word_p.selection.typetext(text_p); actx_word_p.selection.font.color='wdcolorautomatic'; k=1:enters_p(2) actx_word_p.selection.typeparagraph; end return it not printing anything. error in line actx_word_p.selection.typetext(text_p); now if write

C++ lpcwstr to wstring -

i convert lpcwstr wstring in c++ (vs 2010). want use in outputdebugstringw(). thank you. well pass lpcwstr constructor of wstring this: lpcwstr str=l"fun"; wstring str2(str);

sql - Arrange my result in select query of postgresql? -

i have query: select c1,q1,c2,q2,c3,q3,c4,q4 mxm the result is: c1 q1 c2 q2 c3 q3 c4 q4 9103 4 9114 3.3 9197 1.9 b9151 3000 9103 15 9107 8.6 9118 8.3 b9100 130.6 9103 3.6 9114 0.6 9197 1.1 b9151 5000 but want output like: 9103 4 9114 3.3 9197 1.9 b9151 3000 9103 15 9107 8.6 9118 8.3 b9100 130.6 and on .... possible in postgresql? if want them in order, bit tricky. assuming have no appropriate id in mxm identifying rows in order: with t ( select row_number() on (order ??) seqnum, mxm.* mxm ) select c, q ((select c1, q1, seqnum, 1 ordering t) union (select c2, q2, seqnum, 2 t) union (select c3, q3, seqnum, 3 t) union (select c4, q4, seqnum, 4 t) ) cq order seqnum, ordering; the ?? column specifies original ordering records.

sql - Export Huge Volume of Data to flat files from tables in Oracle -

i using oracle 11g. requirement compare data of 2 different db's. there around 350 tables in each db , out of these 350 tables, approx 40 tables have more 1 million records. data comparison, wrote 1 perl script compare using hash , tested few files. also, tried unix awk command check performance , asked forum on unix solution , got excellent help. now problem find out best way extract data tables files. both db's have same number of tables , each table have same number of columns in both db i.e. layout in both db's same. options think , searched are 1) using sqlloader - think performance bad in case 2) using data pump - not sure if can extract few set of columns via sql using data pump , load text file 3) using bulk collect -- same above. possible extract each table , each table set of columns. if yes, how can done. performance. 4) sqlplus or else. cannot download software on machine. basic sql selecting set of columns each table both db's can done easil

python - Plotting a basic vectorized function -

i trying function plot vectorized function on python list interval , having name / title graph. new python packages numpy , matplotlib. hope can shed light on code: import numpy np import matplotlib.pyplot plt %matplotlib inline def test_plot(x,interval,title): x = np.vectorize(x) interval = [0,interval+1] ttl = plt.title(title) plt.plot(x,interval) return plt.plot(x,interval) test_plot([-1,0,1,2,3,4],2,'test') i error: valueerror: x , y must have same first dimension note: need interval list . like kidjournety, don't quite understand you're wanting either, if understand comments correctly might work: def test_plot(x, interval, title): import matplotlib.pyplot plt plt.title(title) plt.plot(x, interval) plt.show() test_plot([1,2,3], [7,6,5], "hello, world!") works well. if doesn't need (what vectorisation) please comment below , i'll best adjust code accordingly. now practical

symfony - InternalServerError while trying to load data from database -

well started fosrestbundle in symfony still have lot of issues , hoping can explain few things me. this routing.yml app: resource: "@appbundle/controller/" type: annotation route_name: pattern: /test defaults: { _controller: appbundle:controller:afsprakencontroller:postafspraken, _format:json } my config.yml imports: - { resource: parameters.yml } - { resource: security.yml } - { resource: services.yml } # put parameters here don't need change on each machine app deployed # http://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration parameters: locale: en framework: serializer: enabled: true #esi: ~ #translator: { fallbacks: ["%locale%"] } secret: "%secret%" router: resource: "%kernel.root_dir%/config/routing.yml" strict_requirements: ~ form: ~

Connecting multiple stages of parallel synths, with array of buses, in superCollider -

when have 2 stages of multiple parallel synths, able connect array of buses. (thanks dan s answer previous question ). when there 3 stage, doesn't seem work. ( synthdef(\siny, { arg freq, outbus=0; out.ar( outbus, sinosc.ar(freq!2,0,0.2) ) } ).send(s); synthdef(\filter, { arg cfreq,q=0.8, inbus, outbus=0; out.ar( outbus, bpf.ar(in.ar(inbus), cfreq!2, 1/q ) ) } ).send(s); ) ( var z = [100,500,1000,1500,200]; ~sourceout = z.collect{ bus.audio(s) }; ~sineout = z.collect{ bus.audio(s) }; ~sine_group = pargroup.new; ~mygroup = pargroup.new; { z.do({ arg val, index; synth( \siny, [\freq: val, \outbus: ~sourceout[index]], ~sine_group ) }); z.do({ arg val, index; synth.after(~sine_group, \filter, [\inbus: ~sourceout[index], \outbus: ~sineout[index],\cfreq: 200, \q: 20 ], ~mygroup) }); z.do({ arg val, index; synth.after(~mygroup, \filter, [\inbus: ~sineout[index], \cfreq: 200, \q: 20]) }); }.play; ) another harm doing here is, everytime stop , run synth, new instances of busse

javascript - Knockout click on checkbox can't define new check box state in IE -

i have next checkbox on page , <input type="checkbox" id="cbselectall" data-bind="click:modeladdrview.selectallonpage"> and have function in model define new checkbox state , make operation method how define state not working in ie ( $(event.toelement).is(':checked') return false ) . self.selectallonpage = function (data, event) { var list = self.pagedataview(); var operationset = $(event.toelement).is(':checked'); self.selectarray(list, operationset); $("#addrlist input:checkbox").attr("checked", $(event.toelement).is(':checked')); //self.selected(list); return true; } how define new check box state in correct way knockout? i have findout issue need use $(event.target)

c - How to intercept and possibly block process creation, system-wide? -

i'm trying make applocker -like service should intercept creation of processes based on restrictions set administrator. (for wondering why can't use microsoft's applocker, answer is available on server, enterprise , ultimate versions of windows 7 , up.) so did research , found createprocessnotifyex routine can called before each process started/ended. i don't have big experience writing windows kernel drivers. , i'm curious if correct approach described above? or maybe there's user-mode winapi i'm not aware of?

computer vision - frame drops in Nvidia jetson Tk1 with IDS camera at 50 fps -

i using tk1 ids camera (model number: ui5241le-m) cat 6 ethernet cable capture frames @ 50 fps 1280x1024. , giving lot of frame drops. not getting why not able capture frames @ 50 fps ? idea ? expecting tk1 work without issue. thanks

c - library not found when compiling with gcc on MacOS El capitan -

i have problem when compiling gcc on macosx el capitan. i've reinstall homebrew , gcc still can't compile simplest program. have got no idea happening in here: koplo$ gcc test.c -o test ld: library not found -lgcc collect2: error: ld returned 1 exit status i able solve same problem following code. add library search paths in build settings , make sure select recursive, delete other library paths might absolute paths. $(project_dir) may you.

model view controller - Simple MVC in android; passing object to activities -

i have started working android development , trying grasp relatively simple concept believe. background question first. i had created java program using mvc design pattern (the view , controller linked though). in project, had created own class model, , in main() function, created single instance of model class, passed on of other classes. allowed every class (and therefore, every view) have same model object, , hence, of updates done model class different controllers. i wondering how work in android's activities? possible each activity have reference same, single model class object? example, lets have android application has home page stuff on it. on home page, there button lets go "settings" page, starts new activity allows user change settings. able pass model object "settings" activity, have user make whatever changes possible on "settings" activity, update model accordingly, when return home page, model object contains these changes. is

javascript - Change all Elements (html) of a div on changing the language? -

i have dropdown menu on page has language selector options. on selecting language want labels , buttons html changed according language? my code var arr = []; // gets ids starting comp_ $('div[id^="comp_"]').each(function(){ arr.push(this.id); labels = $(this).find('label'); buttons = $(this).find('button'); //get labels inside current div $(labels,buttons).each(function(){ $(this).html(""); }); }); console.log(arr); }, * problem * changes label element reference , not button reference.can run function on multiple element references? it works if dont want repeat same code again diffferent references var arr = []; // gets ids starting comp_ $('div[id^="comp_"]').each(function(){ arr.push(this.id); labels = $(this).find('label'); buttons = $(this).find('button'); //get labels

jquery - Loop through all inputs in a div with a certain class -

<script language="javascript" type="text/javascript" src="jquery-1.6.js"></script> <script> $('.disabledform').each(function(i, div) { alert('in here'); $(div).find('input').each(function(j, element){ $(element).attr('disabled','disabled'); }); }); </script> <div id="divdisabled" class="disabledform"> <label>disabled input 1&nbsp;<input type="text" id="disabledinput1" name="disabledinput1" /></label> <br /> <label>disabled input 2&nbsp;<input type="text" id="disabledinput2" name="disabledinput2" /></label> </div> never see "in here" message , inputs never disabled assume i'm doing wrong. can tell me i'm not doing right? you have wrap code in $(func

javascript - Does ECMAScript 6 have a native way to call REST Web Services -

i reading tutorial on web on es6 , pretty sure read there native way call rest web services using es6. now googling on topic , cannot find it. so in es6 still need libraries jquery/lodash etc make web service calls? or can make such calls using new language constructs? sorry if faq. delete question if commonly asked... have tried searching , found nothing. sure read somewhere can call rest endpoint directly without external library. es6 (aka es 2015) not have new api makes consuming rest services easier had been previously. i suspect might looking new dom api aims replace xmlhttprequest called fetch . chrome , firefox implement api @ time of writing: http://caniuse.com/#feat=fetch the fetch api can polyfilled, here's one: https://github.com/github/fetch more info on fetch api: https://developer.mozilla.org/en-us/docs/web/api/fetch_api http://github.github.io/fetch/ basic usage: fetch('https://api.github.com/users') .then(response => respo

java - Unable to email in HTML format. -

i trying send email in html format. working text/plain. when set content type text/html mail not being transported(no exception being thrown don't email well). following code. public void postmail() throws exception { boolean debug = false; properties props = new properties(); props.put("mail.smtp.host", smtpserver); props.put("mail.smtp.port", smtpserverport); props.put("mail.smtp.auth", "false"); props.put("mail.smtp.socketfactory.class","javax.net.ssl.sslsocketfactory"); props.put("mail.smtp.socketfactory.fallback","false"); lgr.debug(lgr.isdebugenabled()?"smtp server --->" + smtpserver : null); session session = session.getinstance(props, null); session.setdebug(debug); message msg = new mimemessage(session); internetaddress addressfrom

.net 4.5 - Information about a State Machine Workflow from inside the workflow -

is there api or library programmatically determine information windows workflow state machine activity inside code? specifically, possible detect 1.) state machine at 2.) transitions scheduled 3.) transition executed , led entry of current state? i'm getting feet wet state machines in workflow foundation (never used them prior 4.5). you can use statemachine instance properties currentstate, states, statehistory , possiblestatetransitions. other useful link here .

javascript - not able to pull data in factory by online json files -

i created factory named service.js myappservices=angular.module('myappservices',['ngresource']); myappservices.factory('profiledata',['$resource', function($resource){ return $resource('http://www.w3schools.com/json/mytutorials.txt', {}, { query: {method: 'get', isarray: false} }); }]); and controller is: myappcontrollers.controller('profilelistctrl',['$scope', 'profiledata', '$timeout', function($scope, profiledata, $timeout) { var promise = profiledata.query(); promise.$promise.then(function(response) { $scope.data= response; console.log($scope.data); }); }]); i not getting console here because of unable fetch data. please me here. note : if using saved file address instead of online url of json file working . controller.js (function () { angular .module('app') .controller('profilelistctrl

javascript - (Multiple Select) Arrange options depends on user selection -

does know how in jquery , selected options order depends on user selection? <select class="form-control" name="cols[]" multiple="multiple" id="cols[]" required="required"> <option value="latest_upd">latest update</option> <option value="status">status</option> <option value="spin">spin</option> <option value="file_location">file location</option> <option value="upl_webgis">uploaded webgis</option> <option value="rem_upl">remarks on upload</option> </select> try : using php , jquery both <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>

Javascript: outside variable used inside closure -

i have simple jquery popup plugin. usage looks this: $("#popupcontainer").popup({ onopen: function () { }, onclose: function () { } }); $("#popupcontainer").popup("open", "/home/popupcontent"); $("#popupcontainer").popup("close"); this works good. however, want pass different onopen callback different url's have. thought making wrapper on plugin, this: var popupplugin = {}; (function () { var onopen = null; var onclose = null; $("#popupcontainer").popup({ onopen: function () { if (onopen) { onopen(); } onopen = null; }, onclose: function () { if (onclose) { onclose(); } onclose = null; } }); popupplugin.open = function (url, callback) { onopen = callback; $("#popupcontainer").popup("open", url); }

jQuery prevent default, form submit twice -

i want prevent form submit twice after changing select box. tried use e.preventdefault(), makes no difference. $(document).ready(function() { $(document).on("change","#select1", function(e){ e.preventdefault(); $("#form1").submit(); }); }); the form won't submit twice code, does'nt prevent form submitting either, prevents change event on select, element , event binding to.

html - Bootstrap classes causing footer contents to not load completely until hovered -

i have element social media icons inside in footer of website. using bootstrap col classes position element. when load page icon , element borders not visible until hover on them. believe has col classes, when remove them, works fine. firefox , edge not seem have problem, chrome. has left me scratching head. here link site http://www.davidsandersdesigns.com/ , here footer html <!--footer--> <div class='container-fluid'> <div class='row'><!--mobile--> <div id='bottom_doublearrow' class='bottom_doublearrow col-xs-6 col-sm-5 hidden-md hidden-lg col-xs-offset-5 col-sm-offset-5'></div> </div> <footer class='row'> <div id='footer_logo' class='footer_logo col-xs-12 col-sm-12 col-md-3 col-lg-3 col-md-offset-1'></div> <!--problem element--><div class='footericon_c

xaml - VisualStateManager Focus state remains after focus -

i have winrt app control template textbox. want background go gray when control in focus. code below this, when control loses focus gray background remains. how make background returns normal when control loses focus? <controltemplate x:key="greyfocustextbox" targettype="textbox"> <grid> <visualstatemanager.visualstategroups> <visualstategroup x:name="commonstates"> <visualstate x:name="normal" /> <visualstate x:name="pointerover" /> <visualstate x:name="pressed" /> <visualstate x:name="disabled" /> </visualstategroup> <visualstategroup x:name="focusedstates"> <visualstate x:name="focused"> <storyboard> <doubleanimation duration="0" to=&qu