Posts

Showing posts from February, 2012

ios - How to set the current user in cell? Swift, Parse -

day, guys. me.i can not solve problem 3 days i make app instagram. want make sure when create post, in cell of tableview, writing nickname. i try this: findsweeter.findobjectsinbackgroundwithblock{ (objects:[anyobject]?, error:nserror?)->void in if error == nil{ let user:pfuser = (objects nsarray).lastobject pfuser! cell1.usernamelabel.text = user.username } } } but thats issue: [anyobject]? not convertible 'nsarray' & 'nsarray not convertible pfuser' help, pls. im using parse.com i solved problem easly. changed pfuser variable in data on parse clotd string: cell1.usernamelabel.text = sweet.objectforkey("usa") as? string

github pages - Multilple Jekyll blogs running next to each other -

is there way organization uses series of jekyll blogs (ideally running on github pages) related in they'd have same header, style, , footer, manage separate contents work together? blogs separate because idea each should able stand on own, should still work nicely together. concern local development. to see specific use case, check out open source design , , how plays out on actual website . right changing style jobs subdirectory involves copying on css, tweaking it, , moving the website. something i've seen work rails apps , might idea looking setting anvil work jekyll instances power instances? there out there has tried that? organisation.github.io repository manage organization wide styles in organization.github.io/css/main.css . any layout in repository @ github.com/organization/project use central css @ organization.github.io/css/main.css . specific css can in repository itself. this true javascript files no fear of cors . the problem can local de...

c++ - Locking for multi-threaded hot swapping -

in multi-threaded graphics application, have assets images, models, sound files , on. of them loaded files on disk. when files change, want automatically reload them , update corresponding assets may used on application. similar use case lod. when models far away camera, want replace them cheaper less detailed versions. while assets replaced, other parts of application run in different threads , may read assets. need locking. how can provide proper locking replace assets while making easy possible other parts of application use them? for example, provide abstract base class assets. contain shared mutex. then, there loader class, internally stores assets , returns references them. class asset { public: std::shared_mutex access_; }; class loader { public: template <typename t> t &load(std::string filename); private: std::map<std::pair<std::string, std::type_index>, void*> assets_; }; template <typename t> class assetloadertraits; ...

python - Is it possible to maintain a reusable django *project* across apps? -

i'm trying decide whether underneath 'reusable apps' doable maintain reusable bare project setup well. on side note: can destroy of servers , rebuild in barely hours long have (data) backup , blueprint (in case saltstack, might puppet, chef or not). with flexible infra, these deployment steps next: create virtualenv django application check out project (always named project) my project has setup.py included. sets surroundings: render settings files based on yaml data , templates possibly loads fixtures when needed when in production, renders apache config etc after that, git submodules, can plug reusable apps end running webapplication. with quite lot of intelligency built in bare project base structure ended original question. i'm wondering if project baseline maintainable cross (web)application seperate git repo. or project structure have specific moving parts related (web)application whole? e.g: pluggable apps go in installed_apps, etc , en...

java - Spring Boot MockMVC - request scoped bean not autowired properly -

i want have request scoped bean, fill data in filter , access data in controller. works fine when run app, when try test mockmvc, data not set in request scoped bean in controller. here code: pom.xml <?xml version="1.0" encoding="utf-8"?> <project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelversion>4.0.0</modelversion> <parent> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-parent</artifactid> <version>1.2.3.release</version> </parent> <groupid>org.lebo.test</groupid> <artifactid>spring-boot-rsb-test</artifactid> <version>1.0-snapshot</version> <packaging>jar</packag...

java - Code skips if statement even though parameters are correct -

this code supposed take input customer in format "$(amount of money)". if statement check first character in string payment equals '$' doesn't set off if statement it keeps reading invalid payment. double money = 0; string payment = input.next(); string $ = "$"; string test = payment.substring(0); if (test.equals($)) { system.out.println("you entered " + payment); payment = payment.substring(1, payment.length() - 1); money = double.parsedouble(payment); if ( money < sum ) { system.out.println("not enough money. system terminating."); system.exit(0); } system.out.println(payment); } else { system.out.println("invalid coin or note. try again."); payment = input.next(); } payment.substring(0) returns entire string, want compare "$" payment.substring(0,1) , or compare payment.charat(0) '$' . so either : string test = payment.substring(0,1); if (test.equals($)) { ...

rest - List of all artifacts from Nexus repository -

within application deploy generated artifacts (hosted) nexus repository. instance of application want know artifacts have been deployed repository. studied nexus rest api couldn't find way information. know how list/set of artifacts of given nexus repository via rest or other api? the best way monitor artifacts deployed nexus repository subscribe rss feed: http://books.sonatype.com/nexus-book/reference/using-sect-feeds.html

multithreading - Kafka high-level consumer: Can partitions have multiple threads consuming it? -

can messages given partition ever divided on multiple threads? let's have single partition , hundred processes hundred threads each - messages single partition given 1 of 10000 threads? multiple threads cannot consume same partition unless threads in different consumer groups. single thread consume messages single partition although have lots of idle consumers. the number of partitions unit of parallelism in kafka. make multiple consumers consume same partition, must increase number of partitions of topic parallelism want achieve or put every single thread separate consumer groups, think latter not desirable.

Matlab P file opening in Octave -

i use octave , have matlab made p file (protected function file). how can open it, use octave? there method convert maybe or content it? p files protected, can't open them, that's whole point of them. should still able run them in matlab, i'm not sure if they'll work in octave.

javascript - jQuery Scrolly plugin - parallax background jumps by preceding element's height -

demo: http://christianbullock.org/jstest/ i'm trying implement basic parallax banner on freelance project. i'm using: https://github.com/victa/scrolly problem though. when there's element placed before parallax banner, when begin scrolling, parallax background's position jump height of preceding element. in case, red banner 218px high. when begin scrolling, green background's position jump 218px. note: isn't problem if parallax element first element on page. it's not problem if red banner removed document flow through fixed positioning. i'm thinking culprit this, wouldn't know begin diagnosing: // fix background position if(this.bgstart){ position = position + this.bgstart; } if(this.options.bgparallax === true) { this.$element.css({backgroundposition: '50% '+position+'px'}); } else { this.$element.css({top: position}); } really appreciate pointers. thanks! :) fixed. had add: data-fit="-218...

android - Can't toggle switch in Custom SwitchPreference -

i try custom switch preference in adroid. here code switch_widget.xml <switch xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/customswitch" android:layout_width="match_parent" android:layout_height="wrap_content" android:focusable="false" android:clickable="false" /> preference xml file : <com.tnavitech.utils.customswitch android:title="hide app icon" android:key="hideicon" android:defaultvalue="false" android:disabledependentsstate="true" android:widgetlayout="@layout/switch_widget" /> then extend "switchpreference", , in "onbindview" class, , handle switch states in onpreferencechangelistener : public class customswitch extends switchpreference { switch swit; public customcheckbox(context context, attributeset attrs) { super(conte...

subprocess - python curl execute command with parameter -

i need execute following command curl -v -h 'x-auth-user: myaccount:me' -h 'x-auth-key: secretpassword' http://localhost:8080/auth/v1.0/ when run terminal works perfectly. , gives me result following * connect() localhost port 8080 (#0) * trying ::1... * connection refused * trying 127.0.0.1... * connected localhost (127.0.0.1) port 8080 (#0) > /auth/v1.0/ http/1.1 > user-agent: curl/7.29.0 > host: localhost:8080 > accept: */* > x-auth-user: myaccount:me > x-auth-key: secretpassword > < http/1.1 200 ok < x-storage-url: http://localhost:8080/v1/auth_myaccount < x-auth-token: auth_tk8bf07349d36041339450f0b46a2adc39 < content-type: text/html; charset=utf-8 < x-storage-token: auth_tk8bf07349d36041339450f0b46a2adc39 < content-length: 0 < x-trans-id: tx99a9e2a129f34ab487ace-00553cb059 < date: sun, 26 apr 2015 09:31:05 gmt < * connection #0 host localhost left intact but need run python. have used subprocess.cal...

haskell - Missing attributes for links and other types of elements in pandoc -

i trying use pandoc (with hakyll , not important) achieve following: read markdown file. convert html. add target="_blank" attribute every link automatically produced. the problem definition of inline in pandoc seems support attributes types of inline s, e.g., span , code , , not others, e.g., link , image . is arbitrary limitation of pandoc , or made on purpose reason not understand? furthermore, there way achieve want, without resorting low-level string processing or using rawinline constructor? here mwe: import text.pandoc import text.pandoc.walk fixlinks :: pandoc -> pandoc fixlinks = walk fixlink fixlink (link inlines (url, title)) = link inlines (url, "i want add target=_blank link!") fixlink inline = inline main = let md = "this link [stackoverflow](http://stackoverflow.com/)." (putstrln . writehtmlstring def . fixlinks . readmarkdown def) md image , link attributes documented feature...

amazon web services - Root user is denied downloading from s3 bucket -

using s3cmd after configuring root privileges (access key , secret key), whenever try download bucket using sync or get , receive strange error of permission root account: warning: remote file s3error: 403 (forbidden): the owner user have made using iam console, correct expect root user should full , unrestricted access? using aws -cli unknown error a client error (unknown) occurred when calling getobject operation: unknown also thought had add bucket policy allow root access (as strange sounds), first step added annonymous access policy { "version": "2012-10-17", "statement": [ { "effect": "allow", "principal": "*", "action": [ "s3:getobject" ], "resource": [ "arn:aws:s3:::mybucket/*" ] } ] } but still errors same above. owner...

My git controlled files cannot revert -

whenever run git commit or git status , there files never changed before pop showing modified . checkout/revert these files, not work. git diff shows no difference. i notice whenever run git checkout or git revert on file not changes, modify time changes. is there way can revert these unchanged file origin state? below git bash output, remove outputs because many files in incorrect state. can see file 'repositories.config' cannot revert. welcome git (version 1.9.4-preview20140611) run 'git git' display index. run 'git ' display specific commands. [myaccount] /d/git/tour/visa/order/visa.order.main/packages (release) $ git status on branch release branch up-to-date 'origin/release'. changes not staged commit: (use "git add ..." update committed) (use "git checkout -- ..." discard changes in working directory) modified: repositories.config no changes added commit...

javascript - Twitter typeahead default suggestions: how to get the first suggestions in the prefetched array? -

i using twitter typeahead , offer values user when input box gets focus, before typed. there's example on examples page under default suggestions: var nflteams = new bloodhound({ datumtokenizer: bloodhound.tokenizers.obj.whitespace('team'), querytokenizer: bloodhound.tokenizers.whitespace, identify: function(obj) { return obj.team; }, prefetch: '../data/nfl.json' }); function nflteamswithdefaults(q, sync) { if (q === '') { sync(nflteams.get('detroit lions', 'green bay packers', 'chicago bears')); } else { nflteams.search(q, sync); } } $('#default-suggestions .typeahead').typeahead({ minlength: 0, highlight: true }, { name: 'nfl-teams', display: 'team', source: nflteamswithdefaults }); however in example, hard-code values want suggest: sync(nflteams.get('detroit lions', 'green bay packers', 'chicago bears')); in case, use bloodhoun...

java - Android Timer SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length -

after looking fo ther error @ least @ fourm , found answers speak 3rd party device keyborad or somthing caused it(samsung devices @ least)(iam using 1 plus one). ive setted timer 10 seconds , every time reached 3rd time of runnig (i refresh activity) got error span_exclusive_exclusive spans cannot have 0 length. timerattack class code: @suppresslint("newapi") public class timeattack extends activity implements animationlistener { string pic;//תמונה של הדגל button answer1;//תשובות button answer2; button answer3; button answer4; button hint; textview guess; textview numofguess; textview score; textview scorenum; textview textviewtime; mediaplayer mphint; mediaplayer mpnext; mediaplayer mpwrong; animation animationfadein; animation animationfadeout; string fn; guesses g; score s; timer t; button [] b = new button[4]; databasehandler db = new databasehandler(this); list<string>wronganswers=new arraylist<string>(); int countg=0;//count guesses int counta=0;/...

How to up-scale an image {PHP} -

i used code below image: $url = "http://maps.googleapis.com/maps/api/staticmap?size=800x600&zoom=12&center=(10.763705518561297,106.64444580078126)"; $content = file_get_contents($url); i received 640px x 640px image meanwhile expected 800px x 600px one. how scale image 800px x 600px? try doing this: <?php // file , new size $filename = 'test.jpg'; $percent = 0.5; // content type header('content-type: image/jpeg'); // new sizes list($width, $height) = getimagesize($filename); $newwidth = $width * $percent; $newheight = $height * $percent; // load $thumb = imagecreatetruecolor($newwidth, $newheight); $source = imagecreatefromjpeg($filename); // resize imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); // output imagejpeg($thumb); ?> here, rescaling done 50%, can change parameter per requirement. can use imagick image manipulation. see, if helps. referred: php manual

Matlab equivalent of Python's 'reduce' function -

i have bunch of matrices of same size m*n: a, b, c, d , , i'd find maximum of them elementwise, like: mx = max(a, max(b, max(c, d))); apparently code above not concise enough, i've googled , didn't find max on n matrices, or matlab function python's reduce . haven't learned matlab, there one? make n*m*4 matrix of input, can use max : m=cat(3,a,b,c,d) max(m,[],3) the cat parameter 3 concatenates matrices along third dimension, , max finds maximum along dimension. compatible arbitrary matrix dimensions: d=ndims(a) m=cat(d+1,a,b,c,d) max(m,[],d+1) reduce not exist, , typically don't need because multi dimensional inputs or varargin trick, if need it, it's simple implement: function r=reduce(f,varargin) %example reduce(@max,2,3,4,5) while numel(varargin)>1 varargin{end-1}=f(varargin{end-1},varargin{end}); varargin(end)=[]; end r=varargin{1}; end

.net - What does "Stateful" means in Stateful ViewModel in MVVM -

i reading xaml patterns, , there stateful viewmodel, according read has nothing different " viewmodel ". here's description example : stateful view model : to create isolation between business logic , presentation, data should removed view. stateful view model pattern moves data view model using xaml data binding. allows view model tested without constructing view, , allows view change minimal impact on business logic. what special called stateful viewmodel ? why isn't called viewmodel link : http://www.xamlpatterns.com/stateful-view-model in opinion stateful vm represents "stateful" object can change during view lifetime , outlive next instance of view use same vm. also, have various view-switches, cases depending on present data facts , etc. while basic vm repesent data carier short time, displaying list of db results or serving form field container, bound view. whenever operation view finished viewmodel no longer n...

c - x86 Procedure Call Memory Allocation -

so have problem textbook (computer systems: programmer's perspective problem 3.64): it gives code this: typedef struct { int a; int *p; } str1; typedef struct { int sum; int diff; } str2; str2 word_sum(str1 s1) { str2 result; result.sum = s1.a + *s1.p; result.diff = s1.a - *s1.p; return result; } int prod(int x, int y) { str1 s1; str2 s2; s1.a = x; s1.p = &y; s2 = word_sum(s1); return s2.sum * s2.diff; } and assembly code prod & word_sum functions: 1 word_sum: 2 pushl %ebp 3 movl %esp, %ebp 4 pushl %ebx 5 movl 8(%ebp), %eax 6 movl 12(%ebp), %ebx 7 movl 16(%ebp), %edx 8 movl (%edx), %edx 9 movl %ebx, %ecx 10 subl %edx, %ecx 11 movl %ecx, 4(%eax) 12 addl %ebx, %edx 13 movl %edx, (%eax) 14 popl %ebx 15 popl %ebp 1 prod: 2 pushl %ebp 3 movl %esp, %ebp 4 subl $20, %esp 5 leal 12(%ebp), %edx 6 leal -8(%ebp), %ecx 7 movl 8(%ebp), %eax 8 movl %eax, 4(%esp) 9 movl %edx, 8(%esp) 10 movl %ecx, (%esp) 11 call word_sum 12 subl $4, %esp 13 mo...

office365 - sharePoint 365 Iframe issue -

i have issue office 365 html page , when add js file cdn or external url not work, adding ifram it's not working. here sample of code : <!-- instansive widget --> <script src="assets/js/instansive.js"></script> <iframe src="//instansive.com/widgets/cdf503d7211fb7e7034b029afb67aacf75c3087b.html" id="instansive_cdf503d721" name="instansive_cdf503d721" scrolling="no" allowtransparency="true" class="instansive-widget" style="width: 100%; border: 0; overflow: hidden;"></iframe> please if solution let me know. thanks the reason iframe not working because missing http: in source path. change: src="//instansive.com/widgets/cdf503d7211fb7e7034b029afb67aacf75c3087b.html" change to: src="http://instansive.com/widgets/cdf503d7211fb7e7034b029afb67aacf75c3087b.html" i tested change , works correctly o...

java - Arabic Characters in PDF -

using docx4j(3.2.0), tried generate pdf docx using 'docx4j.tofo'. arabic characters missing in pdf. private static void createtestpdf() throws exception{ fosettings fosettings = docx4j.createfosettings(); inputstream = new fileinputstream(new file("testarabic.docx")); wordprocessingmlpackage wordmlpackage = wordprocessingmlpackage.load(is); //print available physical fonts physicalfonts.discoverphysicalfonts(); map<string, physicalfont> physicalfonts = physicalfonts.getphysicalfonts(); iterator<entry<string, physicalfont>> availablefonts = physicalfonts.entryset().iterator(); while(availablefonts.hasnext()) { entry<string, physicalfont> font = availablefonts.next(); string key = font.getkey(); physicalfont pfont = font.getvalue(); system.out.println("key " + key + ";; name " + pfont.getname()); } mapper fontmapper = new identityplusmapper(); physicalfont font = physicalfont...

Date conversion with Delphi 5 not working on 64 bit ma -

i have delphi 5 program wrote , compiled on windows 8.1 32 bit machine. reads date text file , converts strtodate(). works on 32 bit pc have copied .exe 64 bit laptop (windows 7)and error '24/4/2015' not valid date. region, language, date settings same on both machines , difference can think of laptop 64 bit. affect date conversion? this might " shortdateformat in win7 64-bit returning default " bug. solution seems to add somewhere in program init code following snippet: setthreadlocale(getuserdefaultlcid); getformatsettings;

javascript - How to open select box when pressing tab key? -

when pressing tab key, focus changes field. want that, when focus comes <select> , option list shown. this working: <div ng-controller="typeaheadctrl"> <input type="text" /><br> <input type="text" /><br> <input type="text" ng-model="selected" typeahead="state state in states " /> </div> this not working: <div ng-controller="typeaheadctrl"> <input type="text" /><br> <input type="text" /><br> <!-- not working --> <select ng-model="selected" > <option value="aa">aa</option> <option value="bb">bb</option> </select> </div> my plunker code here . you take use of directive open select box on focus directive .directive...

c# - Async Task to Youtube -

i'm new actually. have short application check whether application can authentication asynchronously youtube , return application it's track. here snippet of code private async void button1_click(object sender, routedeventargs e) { await youtubeauth(); messagebox.show(token); } private async task youtubeauth() { oauth2credential = await googlewebauthorizationbroker.authorizeasync( new clientsecrets { clientid = youtubeclientid, clientsecret = youtubeclientsecret }, // oauth 2.0 access scope allows application upload files // authenticated user's youtube channel, doesn't allow other types of access. new[] { youtubeservice.scope.youtubeupload }, "user", cancellationtoken.none ); token = oauth2credential.token.tokentype; } the code messagebox.show(token); never been executed. edit: i have tried other simpler code below , still messagebox never triggered private async void butt...

curl download file only with extra header in the request -

the title pretty says all. want data when calling of file e.g. curl -i -x -h "x-auth-token: auth_tk8bf07349d36041339450f0b46a2adc39" "http://localhost:8080/v1/auth_myaccount/my_docs/test3" this gives me result following http/1.1 200 ok content-length: 16 accept-ranges: bytes last-modified: thu, 23 apr 2015 08:20:53 gmt etag: f6af11f7f25860eeffa07df03349036f x-timestamp: 1429777252.80583 content-type: application/octet-stream x-trans-id: txcf35631cdad94b71812f9-00553c792b date: sun, 26 apr 2015 05:35:39 gmt taste 3 but want file output should show this taste 3 i know have put -o intact file name sure how put in above request , file only how can this??

JQuery Ajax stops working after adding .submit(function() { } -

the original issue jquery ajax won't call succuess after hitting c# method. looking @ similar issue here: jquery ajax not returning success see solution add: $(parentform).submit(function(event) { event.preventdefault();` however, after doing this, ajax code doesn't seem execute. hit js function though, stops before executes ajax code. my html code looks this: @{ const string formid = "parentform"; } @using (html.beginform("editchannel", "channel", formmethod.post, new { id = formid })) { html.renderpartial("editchannelform", model); <br /><br /> <input type="button" value="save" onclick="editchannel('@model.channelviewmodel.id', @formid)" /> } i submit form in js code (when button above clicked) looks this: function editchannel(channelid, parentform) { $(parentform).submit(function(event) { event.preventdefault(); ...

apache - htaccess rewrite remove php extension on subdirectory -

my htaccess file under folder: http://localhost/project/folder/ | |--- change this: | |_ http://localhost/project/folder/about.php |____ http://localhost/project/folder/about |____ http://localhost/project/folder/about/ | |_ http://localhost/project/folder/anything.php |____ http://localhost/project/folder/anything |____ http://localhost/project/folder/anything/ | |_ http://localhost/project/folder/file.php?id=8888 |____ http://localhost/project/folder/file/id/8888 |____ http://localhost/project/folder/file/id/8888/ | |_ http://localhost/project/folder/file.php?edit=8888 |____ http://localhost/project/folder/file/edit/8888 |____ http://localhost/project/folder/file/edit/8888/ what code found until now: options +followsymlinks -multiviews rewriteengine on rewriterule file/edit/(.*)/ file.php?edit=$1 rewriterule file/edit/(.*) file.php?edit=$1 rewriterule file/id/(.*)/ file.php?id=$1 rewriterule file/id/(.*) file.php?id=$1 # remove file extension rewritec...

postgresql - postgres issues with role trying to create a new database -

being newbie postgres. i'm little confused on roles , why unable create database under role shows role has "create db" attribute. for example there existing role name "mas" in system can create db. postgres=> \du list of roles role name | attributes | member of ------------------------+------------------------------------------------+----------------------------------------------- mas | create role, create db +| {rds_superuser,abc_user,def_user,biuser} | password valid until infinity | using psql, able login database command line so: psql -h mas.myserver.com -p 5432 -u mas postgres now, want create database using this: "createdb.sql' create database mas_dev_123 owner = mas encoding = 'utf8' tablespace = pg_de...

datetime - Changing mysql date from an invalid date format -

i had date data in excel dd-mm-yy h:i:s format, mistakenly imported mysql default format %y-%m-%d %h:%i:%s date wrong now, 31-01-13 00:00:00 became 2031-01-13 00:00:00 can't import again excel need mysql query change date within column. thanks farness concatenating substrings date should work 2000s. 1900s, need if. first verify dates select: select concat( '20', substr(date, 9, 2), '-', substr(date, 6, 2), '-', substr(date, 3, 2), ' ', time(date) ) table then can update columns in place: update table set date=concat( '20', substr(date, 9, 2), '-', substr(date, 6, 2), '-', substr(date, 3, 2), ' ', time(date) )

PHP Compact() function returning a empty array -

i have array containing have created local variables using extract() function extr_prefix_all flag set. afterwards, called compact() on new prefixed variables created extract() displaying array created compact() using print_r() gives empty array(). sample code follows: <?php $cities = array('city1' => "chicago", 'city2' => "boston"); extract($cities, extr_prefix_all, "new"); echo "city 1: {$new_city1} city 2: {$new_city2}" . "<br><br>"; $new_cities = compact($new_city1, $new_city2); print_r($new_cities); ?> i using php version 5.6. what doing wrong here? in current code, you're providing values of each variables you're trying compact , not name of variables. acts variable variables behavior. in order make work properly, provide variable names strings or in array form: $new_cities = compact(array('new_city1', 'new_city2')); // or $new_cities = compact(...

sql - How to select data from several rows in a single table in one result row? -

how select multiple entries in single query. the db table structure represents excel spreadsheet. each observation workbook. work book 1 1 2 3 4 work book 2 5 6 7 8 with each db row representing single cell , observations in separate workbooks. table definition is: observation integer row_number integer col_number integer value integer the database looks this: observation row_number col_number value 1 1 1 1 1 1 2 2 1 2 1 3 1 2 2 4 2 1 1 5 2 1 2 6 2 2 1 7 2 2 2 8 the question how create single query to: select observation, value value1 database row_number = 1 , col_number = 2, select value value2 database row_number = 2 , col_number = 1; to create: observation value1 value2 1...

Press enter to continue oddities (Java) -

i'm using code output text , have user press enter show next line of dialog. however, 1 press of enter shows 2 lines of text. why this? public void pressentertocontinue() { try { system.in.read(); } catch(exception e) { } } for reference, method called this: pressentertocontinue(); system.out.println("this line of text."); pressentertocontinue(); system.out.println("so this."); pressentertocontinue(); system.out.println("and this."); //etc. the first line displays alone "this line of text." method waits until user presses enter, displays next 2 lines ("so this." , "and this.") when should display one. i did try implementing short delay didn't solve issue. system.in.read() reads 1 byte. guess running code on platform newline represented 2 byte cr lf sequence, pressing enter key satisfies first system.in.read() call cr, , second system.in.read( ) call lf. changing code use syste...

c# - vnext (asp .net 5.0) and oracle -

i created vnext solution in visual studio ultimate 2015 ctp version 14.0.22609.0 d14rel , in package manager added oracle managed driver. install-package odp.net.managed then in config.json "data": { "defaultconnection": { "connectionstring": "server=(localdb)\\mssqllocaldb;database=aspnet5-vnext-237fb18c-c414-44a8-8771-e02d4719d1dc;trusted_connection=true;multipleactiveresultsets=true" }, "hr": { "connectionstring": "data source=(description=(address=(protocol=tcp)(host=localhost)(port=1521))(connect_data=(sid=mydatabase))); user id=hr; password=xxxxxxx;", "providername":"oracle.manaagedatacess.client" } }, when attempted use in class using system; using oracle.manageddataaccess.client; using system.configuration; namespace vnext.models { internal class datahelper { oracleconnection cn = new oracleconnecti...

ios - SpriteKit - Why my bouncing ball passes through the ground? -

i'm working small bouncing ball game using spritekit physics engine. problem is: when apply huge impulse on bouncing ball have fall on ground fast, may pass through ground (very thin, height=2). i find in apple document, doesn't work. specify high precision collisions small or fast-moving objects when sprite kit performs collision detection, first determines locations of of physics bodies in scene. determines whether collisions or contacts occurred. computational method fast, can result in missed collisions. small body might move fast passes through physics body without ever having frame of animation 2 touch each other. if have physics bodies must collide, can hint sprite kit use more precise collision model check interactions. model more expensive, should used sparingly. when either body uses precise collisions, multiple movement positions contacted , tested ensure contacts detected. ship.physicsbody.usesprecisecollisiondetection = yes; you...

arrays - How to update matches on Challonge with PHP? -

i'm trying update match score on challonge php. i'm not sure on how send scores , winner id. here api page : do need make array csv scores , winner id? this current url trying use: https://api.challonge.com/v1/tournaments/3k8drpj2/matches/36463543.json?api_key=&scores_csv=3-1&winner_id=24899488 thanks

javascript - How can I load multiple html files from a folder into a div -

say i've got folder "../cars/" holds multiple html files, , want load of these files html file. i go doing like: $(document).ready(function (){ $("#all_cars").load("../cars/civic.html"); $("#all_cars").load("../cars/durango.html"); $("#all_cars").load("../cars/mustang.html"); $("#all_cars").load("../cars/r8.html"); ... , on }); but i'd in more sophisticated manner. don't want have code file names js file. i'd rather able remove file folder , have load anymore. there way filenames in cars folder , loop on them load? kind of this: foreach(cfn in carsfilesnames){ $("#all_cars").load("../cars/" + carsfilenames); } hopefully want: $.each([ 'civic.html', 'durango.html', 'mustang.html', 'r8.html' ], function(i,a){ $("#all_cars").load("../cars/"...

java - JPA shared column on composite foreign key with null values -

i working eclipselink 2.6 , have entity: @entity @table(name="espacioacademico") @namedquery(name="entityespacioacademico.findall", query="select e entityespacioacademico e") public class entityespacioacademico implements serializable { @id @sequencegenerator(name="espacioacademico_kidespacioacademico_generator", sequencename = "sec_espacioacademico", allocationsize = 1 ) @generatedvalue(strategy=generationtype.sequence, generator="espacioacademico_kidespacioacademico_generator") @column(name="k_idespacioacademico") private long kidespacioacademico; //bi-directional one-to-one association entityfranjadocente @onetoone @joincolumns({ @joincolumn(name="k_iddocente", referencedcolumnname="k_iddocente"), @joincolumn(name="k_idfranja", referencedcolumnname="k_idfranja", updatable = false, insertable = false) }) priv...