Posts

Showing posts from July, 2012

haskell - Parsec3 blocked by parsec, what ever I do -

using cabal file looking (the relevant library part): build-depends: base >=4.8 && < 4.9, filepath >=1.4 && <1.5, time >=1.5 && <1.6, bytestring >=0.10 && <0.11, unix >=2.7 && <2.8, cryptohash >=0.11 && <0.12, process >=1.2 && <1.3, transformers >= 0.4 && < 0.5, text >= 1.2 && <= 1.3, base16-bytestring >= 0.1.1 && < 1.1.2, utf8-string >= 1 && < 1.1, directory >=1.2 && <1.3, regex-base >= 0.9 && < 1.0, regex-pcre >= 0.94 && < 0.95, regex-base >= 0.93 && < 0.94, direct-sqlite >=2.3 && <2.4, text >=1.2 && <1.3, filemanip >=0.3 && < 0.4, parsec3-numbers >=0.1 && < 0.2, parsec3 >=1.0 && <1.1 i when doing cabal build : ... couldn't match expected type ‘parsect

How do you make images appear to the left of text in bootstrap -

im trying replicate effect seen in this theme so far have got 4 icons text underneath, not want, <div class="gridcontainer"> <!-- sections of page, used smooth scrolling --> <section id="about" class="smooth-scroll"> <!-- 4 column grid system --> <div class="col-sm-3 text-lefts"> <!-- grid content goes here --> <img class="producticon" src="images/closed-door-with-border-silhouette.png" alt="doors" /> <h4>doors</h4> <p>delivered in choice of facing-veneered, laminated or primed internal painting, certified fire rating, factory glazed design , prepared lock fitting.</p> </div> <div class="col-sm-3 text-left"> <!-- grid content goes here --> <img class="producticon" src="images/closed-doors-with-windows.png" alt=&q

python - Write text file into a zip without temp files -

in code below, need wright package.inf directly zip file created @ bottom of script. import os import zipfile print("note: theme files need inside of 'theme_files' folder.") themename = input("\ntheme name: ") themeauthor = input("\ntheme author: ") themedescription = input("\ntheme description: ") themecontact = input("\nauthor contact: ") otherinfo = input("\nadd custom information? y/n: ") if otherinfo == "y": os.system("cls" if os.name == "nt" else "clear") print("\nenter theme package information below.\n--------------------\n") themeinfo = input() pakname = themename.replace(" ", "_").lower() pakinf = open("package.inf", "w") pakinf.write("theme name: "+ themename +"\n"+"theme author: "+ themeauthor +"\n"+"theme description: "+ themedescription +"\n

multithreading - submit method of Java concurrent framework -

new submit method of java concurrent framework. wondering whether thread got executed when call submit or when call get? researched oracle official document, cannot find information. thanks. i referring sample below, http://www.vogella.com/tutorials/javaconcurrency/article.html package de.vogella.concurrency.callables; import java.util.arraylist; import java.util.list; import java.util.concurrent.callable; import java.util.concurrent.executionexception; import java.util.concurrent.executorservice; import java.util.concurrent.executors; import java.util.concurrent.future; public class callablefutures { private static final int nthreds = 10; public static void main(string[] args) { executorservice executor = executors.newfixedthreadpool(nthreds); list<future<long>> list = new arraylist<future<long>>(); (int = 0; < 20000; i++) { callable<long> worker = new mycallable(); future<long> submit = executor.submit(w

javascript - Is it possible to hide Google Map but keep Search Bar? -

i'm trying create homepage search bar google places search bar. want display google map results on next page along city searched. i have found examples of how hide search box , ui of google map. is there way use google maps & places api hide map , keep search functionality search box? you don't need google.maps.map object use places searchbox code snippet: function initautocomplete() { // create search box , link ui element. var input = document.getelementbyid('pac-input'); var searchbox = new google.maps.places.searchbox(input); } html, body { height: 100%; margin: 0; padding: 0; } #pac-input { background-color: #fff; font-family: roboto; font-size: 15px; font-weight: 300; margin-left: 12px; padding: 0 11px 0 13px; text-overflow: ellipsis; width: 300px; } #pac-input:focus { border-color: #4d90fe; } .pac-container { font-family: roboto; } #type-selector { color: #fff; backgro

Sessions in Laravel 5.0 keep piling up -

i have set sessions stored in database. 1 user logged in , after couple of minutes 700+ sessions stored. system uses lot of ajax calls, shouldn't causing this. this how session.php looks like: return [ 'driver' => env('session_driver', 'database'), 'lifetime' => 1200, 'expire_on_close' => true, 'encrypt' => false, 'files' => storage_path().'/framework/sessions', 'connection' => null, 'table' => 'sessions', 'lottery' => [2, 100], 'cookie' => 'laravel_session', 'path' => '/', 'domain' => null, 'secure' => false, ]; anybody have clue?

python get day if its in a dates range -

i'm trying check if first date of month , last date of month lies in range of dates (the range 7 days window starting current date) . below example i'm trying achieve: import datetime, calendar today = datetime.date.today() date_list = [today + datetime.timedelta(days=x) x in range(0, 7)] lastdayofmonth = today.replace(day=calendar.monthrange(today.year,today.month)[-1]) if 1 in [ date_list[i].day in range(0, len(date_list))]: print "we have first day of month in range" elif lastdayofmonth in [ date_list[i].day in range(0, len(date_list))]: print " have last date of month in range" i'm wondering if there cleaner way doing that? want print exact date if find in list don't know how without expanding loop in if statement , save print date_list[i] if matches condition. instead of printing message when find first day in range should print actual date. same last date. thanks in advance! the thing can come with, without havin

Symfony3 Form component trying to pass null to a type hinted method in PHP 7 -

in entity class have defined expected argument types setters , return types of getters. later, when have form uses said class, error if of fields in form empty because form component tries pass null setter instead of string. i following exception when submit form: expected argument of type "string", "null" given 500 internal server error - invalidargumentexception the exception thrown vendor/symfony/symfony/src/symfony/component/propertyaccess/propertyaccessor.php @ line 254 is there way convert "null" value empty string before passing object, , let validator argue it? i see 2 options here: quick , dirty - make argument passed setter optional: public function settitle(string $title = null) { $this->title = $title; return $this; } probably better - use data transformer in formtype: data transformers allow modify data before gets used. $builder // ... ->add('title', 'text'

javascript - Scrapy crawling not working on ASPX website -

i'm scraping madrid assembly's website, built in aspx, , have no idea how simulate clicks on links need corresponding politicians from. tried this: import scrapy class asambleamadrid(scrapy.spider): name = "asamblea_madrid" start_urls = ['http://www.asambleamadrid.es/es/queeslaasamblea/composiciondelaasamblea/losdiputados/paginas/relacionalfabeticadiputados.aspx'] def parse(self, response): id in response.css('div#modulobusqueda div.sangria div.sangria ul li a::attr(id)'): target = id.extract() url = "http://www.asambleamadrid.es/es/queeslaasamblea/composiciondelaasamblea/losdiputados/paginas/relacionalfabeticadiputados.aspx" formdata= {'__eventtarget': target, '__viewstate': '/wepdwubma9kfgjmd2qwagibd2qwbaibd2qwagigd2qwamypzbycagmpzbycagmpfgiee1byzxzpb3vzq29udhjvbe1vzgulkygbtwljcm9zb2z0llnoyxjlug9pbnquv2viq29

android - Is it possible to use Tabwidget on 2 rows -

currently use tabwidget 4 tabs on 1 rows. each tab have text description, not icon. want insert 1 or 2 tabs more, it's not possilbe on rows because on small screen text description small. i wonder if can add antoher tab row (just below first row) 1 or 2 tab inside? my code is: <tabhost android:id="@android:id/tabhost" android:layout_width="fill_parent" android:layout_height="fill_parent"> <tabwidget android:id="@android:id/tabs" android:layout_width="fill_parent" android:layout_height="wrap_content" android:dividerpadding="8dp" android:scrollbars="horizontal" /> <framelayout android:id="@android:id/tabcontent" android:layout_width="fill_parent" android:layout_height="fill_parent" android:paddingtop=&q

Android Studio 2.1.1 using tabs, not spaces, even though tabs are not checked in Settings -

Image
when editing java files, if i'm @ end of line , type enter key, starts next line indented 4 columns, match line above. that's ok it's indenting tab , not spaces , though in file>settings>editor>java>tabs , indents checkbox use tab character un checked, , has been. if type tab key tab, not spaces. i never want use tab characters; want use spaces. don't have problem in eclipse or microsoft visual studio it's not system setting pc. there other setting in android studio this? edit: tried suggestion omar al halabi (below) made , didn't work while testing noticed interesting: tab problem seems apply beginning of line, i.e., if type enter on previous line, tabs on first indent position on following line, using real tabs, not spaces. on other hand if i'm typing text on existing line, once i've typed little text, if hit tab, tabs on using spaces. hope helps, check use tab character, give values zero not space on en

Spring mvc not showing correct http status -

in controller class, check if id correct, if not, controller should throw exception: if (!id.matches("blablabla")) { throw new invalididexception(); } then in exception class, add annotation @responsestatus(value= httpstatus.bad_request,reason="invalid id") public class invalididexception extends runtimeexception{ public invalididexception(){} public invalididexception(string message) {super(message);} public invalididexception(throwable cause) {super(cause);} } so if id invalid, should throw http 400 error.(i @ error right clicking on webpage , inspect element , network ) however, not sure why still shows http 404 if id invalid. updated: seems if add 1 line of code inside throw exception, works. : if (!id.matches("blablabla")) { response.senderror(400,"invalid id"); throw new invalididexception(); }

systemjs - angular 2: trying to load a component dynamically, getting: TypeError: Cannot read property 'parentInjector' -

i trying load component dynamically angular2 , it's erroring out with: exception: error: uncaught (in promise): typeerror: cannot read property 'parentinjector' of undefined this code: @component({ selector: 'notes5', template: `<span #extensionanchor></span>` }) export class notes5 extends notesbase { constructor(private dynamiccomponentloader:dynamiccomponentloader, private notesservice:notesservice, protected sliderpanel:sliderpanel, protected commbroker:commbroker) { this.loadcomponentasync("src/comps/app2/notes/notedynamic", "testcomponent", this.extensionanchor); } @viewchild('extensionanchor', {read: viewcontainerref}) extensionanchor:viewcontainerref; public loadcomponentasync(componentpath:string, componentname:string, locationanchor:viewcontainerref) { system.import(componentpath) .then(filecontents => {

Check item membership in set in Python -

hello i've been coding couple of months , know basics, i'm having set membership problem can't find solution. i have list of lists of pairs of integers, , want remove list have "a" integer in them. thought using sets easiest way. bellow code: ## item test against. = set([3]) ## list test. groups = [[3, 2], [3, 4], [1, 2], [5, 4], [4, 3]] ## list contain lists present ## in groups not contain "a" groups_no_a = [] group in groups: group = set(group) if in group: groups_no_a.append(group) ## thought problem had ## clearing variable put in, ## no remedy. group.clear() print groups_no_a i had tried using s.issubset(t) until realized tested if every element in s in t . thank you! you want test if there no intersection : if not & group: or if not a.intersection(group): or, inversely, sets disjoint : if a.isdisjoint(group): the method forms take any iterable,

f# - Impossible to make object with a recursive type constraint? -

this purely academic question, riffing off of this question type constraints. questioner gave example: type something<'a, 'b when 'b :> seq<'b>>() = member __.x = 42 which f# happily compiles. problem how make object?? let z = new something<???, ???>() here's 1 way: open system.collections.generic type node<'a> () = let getemptyenumerator () = seq.empty<node<'a>>.getenumerator () interface ienumerable<node<'a>> member this.getenumerator () = getemptyenumerator () member this.getenumerator () = getemptyenumerator () :> system.collections.ienumerator instead of returning empty sequence, implement class return sequence of child nodes. called type node<'a> , because it's idiomatic way model tree (or graph) in c#. use: > let smth = something<string, node<int>> ();; val smth : something<string,node<i

internationalization - symfony translation for phrase with embedded link_to function -

how perform translation embedded link_to function in template using symfony 1.4? example: please click <php echo link_to('here', sfconfig::get('app_url') ?> additional info. i this: echo __("please click "%placeholder%", array("%placeholder%" => link_to(__("here"), sfconfig::get('app_url'))))

How can I use all of my Amazon EC2 cores to carry out a parallel simulation in R? -

i run 1000 iterations of simulation in r. each iteration takes 20 seconds take ~6 hours in serial. , have several dozen simulations run, each 1000 iterations. want use parallel computing accomplish work in less time. i new @ this. after reading material on web, using amazon’s ec2 service, running ami rstudio server , openblas helpfully provided louis aslett. details of software loaded ami here: http://www.louisaslett.com/rstudio_ami . i experimented several ec2 instances , using c4.8xlarge ubuntu instance 36 cores. or virtual cores, i’m not entirely sure of difference. my problem can’t seem use anywhere near available 36 cores. have used 10 cores, errors when attempt use >10 cores. here minimal code (using cars dataset) reproduce error: library(parallel) detectcores() #36 ptm<-proc.time() cl <- makecluster(getoption("cl.cores", 20)) #specify number of cores clustersetrngstream(cl, 123) sims <- clusterevalq(cl, { cars[sample(1:nrow(cars), 10, repl

javascript - How to load external JSON data from a Web API in d3.js? -

i trying create pie chart result of web api , have poly lines , legends.` i got below code , working fine random data. <!doctype html> <meta charset="utf-8"> <style> body { font-family: "helvetica neue", helvetica, arial, sans-serif; width: 960px; height: 500px; position: relative; } svg { width: 100%; height: 100%; } path.slice { stroke-width: 2px; } polyline { opacity: .3; stroke: black; stroke-width: 2px; fill: none; } </style> <body> duration: 0<input type="range" id="duration" min="0" max="5000">5000 <br> <button class="randomize">randomize</button> <script src="scripts/jquery-1.10.2.js"></script> <script src="scripts/d3.js"></script> <script> var svg = d3

Function decreases static variable step by step, but it should not. PHP -

there function: <?php function test(){ static $count = 0; $count++; echo $count; if ($count < 10) { test(); } $count--; echo $count; } test(); ?> this code produces: 123456789109876543210 when $count increments 10 - understandable, works until if statement evaluates false. why gradually decreases 0? in newbie logic, $count-- in code should decrease 9 1 time , function should stop. there no loop or cycle can reduce value step step. see, here , working. why happens? perhaps things bit clearer when change output emphasis how conditional recursive call works: <?php function test($level=0) { static $count = 0; $count++; echo str_pad('a:', $level+2, ' ', str_pad_left), $count, php_eol; if ($count < 10) { test($level+1); } $count--; echo str_pad('b:', $level+2, ' ', str_pad_left), $count, php_eol; } test(); prints a:1

How to pass Bash variables as Python arguments -

i'm trying figure out if possible pass values stored in variable in bash in argument values in python script. we have python script use create dns records in bind , i've been tasked cleaning our outdated dns database. far have in bash: hostnames=$(</users/test/test.txt) zone="zone name here" ip=$(</users/test/iptest.txt) host in $hostnames python pytest.py --host $hostnames --zone $zone --ip $ip done unfortunately, don't have test environment can test on before run on prod , don't have experience python or bash scripting. i've done powershell scripting, wondering if have above work. i've looked around on forums here have not found make sense of. post seems answer question somewhat, i'm still not sure how works. how pass bash variable python? yes, seems work fine me. to test, threw quick python script called test.py: #!/usr/bin/python import sys print 'number of arguments: ', len(sys.argv) #we know sys.ar

php - Symfony\Component\Form\Form::handleRequest performance raises eyebrows -

Image
my question is, why handlerequest method inordinately slow in relation other operations in request? handlerequest takes long rendering template. there no database or doctrine orm involved in entity, plain php class being used bind user data form. have put reasonable validation on entity, removing validation annotation virtually nothing improve performance of method. i'm using symfony 3.0.6 , php 7.0.7 controller public function postsearchaction(request $request, $page = null) { $this->setrequestpage($request, $page); $formdata = new searchrequest(); $this->starttimeline("building form"); $searchrequestform = $this->createform(searchtype::class, $formdata, array( 'action' => $this->generateurl('api_search_post'), 'method' => 'post', )); $this->stoptimeline("building form"); $this->starttimeline("handle request"); $searchrequestform->ha

import - importing a python lib with an so file -

i new python , have installed opencv library ends cv2.so file installed in /usr/local/lib/python2.7/site-packages . when try import library in code import cv2 , get importerror: no module named cv2 how can manage

python - Django : Calling the authenticate method of a class that inherits from RemoteUserBackend -

i having difficulty customizing djangos authentication system. in scenario there no database , authentication happens through http request. there no tables read or write from. this thread here deals pretty same case dealing not understand how user being created in example. read this django manual regarding remote_user authentication.coming first link user posted code here.it consists of backend , user object backend - inherit remoteuserbackend from django.contrib.auth.backends import remoteuserbackend class myremoteuserbackend (remoteuserbackend): # create user object if not in database? create_unknown_user = false def get_user (self, user_id): user = somehow_create_an_instance_of (myuser, user_id) ---->a return user def authenticate (self, **credentials): check_credentials () user = somehow_create_an_instance_of (myuser, credentials) ---->b return user then user: from django.contrib.auth.models impo

java - How to setup clj-webdriver 0.7.2 with phantomjs -

i keep trying set phantomjs create web scraper, can't driver work. have added lein dependencies so: [org.seleniumhq.selenium/selenium-server "2.47.1"] [com.codeborne/phantomjsdriver "1.2.1" :exclusions [org.seleniumhq.selenium/selenium-java org.seleniumhq.selenium/selenium-server org.seleniumhq.selenium/selenium-remote-driver]] then in script: (ns vendors-api.routes.scrapers.resource (:require [clj-webdriver.core :refer [new-webdriver]]) (:import (org.openqa.selenium.phantomjs phantomjsdriver) (org.openqa.selenium.remote desiredcapabilities))) (def driver (new-webdriver {:browser (phantomjsdriver. (desiredcapabilities. ))})) i keep getting following error: compile

iis - How to run x64 asp.net webpages on windows server -

i'm getting assembly error while loading asp.net page on windows server 2012. it's x64 builded. that's reason, why i'm getting error. i think, there should settings in iis, give webpages x64 support. do have solution me? have looked @ iis compatibility

c++ - calling non-static member function without instantiation using `reinterpret_cast` -

as it's shown in following code, can call non-static member function a::f without instantiating object of class. possible when function not bound other member. example, cannot call a::g in similar fashion. it seems me call a::f shown in code below behaves calling static member function. such conclusion correct? how can behavior justified? #include <iostream> using namespace std; struct { void f() { cout << "hello world!"; } void g() { cout << i; } int = 10; }; int main() { auto fptr = reinterpret_cast<void(*)()>(&a::f); (*fptr)(); // ok // auto gptr = reinterpret_cast<void(*)()>(&a::g); // (*gptr)(); // error! return 0; } is such conclusion correct? how can behavior justified? it's undefined behavior. pretty useless ask how should specifically behave . pick 1 or more list: 2) schroedingers cat found dead when open chest 1 your fridge explodes you see behavior get

audio - What is the sound ID for the "Glass" sound in iOS? -

where comprehensive listing of of system sounds? http://iphonedevwiki.net/index.php/audioservices doesn't have it. , google search didn't help. i'm looking glass sound.

javascript - Can't alter offset/repeat of texture used as alphaMap -

demo: https://dl.dropboxusercontent.com/u/123374/so-pages/20160601/index.html the alphatexture having it's offset altered during each render. "map" property changes, "alphamap" not change. 2nd mesh's alphamap relevant code demo link: var colortexture = new three.textureloader().load('blue.png') , alphatexture = new three.textureloader().load('alpha.png') , offset = 0 , colorfill = new three.mesh( new three.geometry(), new three.meshphongmaterial({ map: colortexture, alphamap: alphatexture, side: three.doubleside, shading: three.flatshading }) ) function render() { requestanimationframe(render) offset += .01 alphatexture.offset.x = math.sin(offset) renderer.render(scene, camera) } render() expected: the transparent part of object shift offset of alphatexture changes. actual: transparent part stays fixed on materia

python - Constructing piecewise function from changepoints in Numpy -

i want construct piecewise function changepoints in python. expect inputs , outputs large, speed important. input: int numpy array: a = [1,7, 1000, 1500] bool numpy array: b = [true, false, true, true, false, true, false, false] length of a equal number of true in b output: int numpy array: c = [1, 1, 7, 1000, 1000, 1500, 1500, 1500] length of c same length of b essentially each element of a repeated until next true in b shows in case next element of a used. in [1]: import numpy in [2]: = numpy.array([1, 7, 1000, 1500]) in [3]: b = numpy.array([true, false, true, true, false, true, false, false]) in [4]: a[b.cumsum() - 1] out[4]: array([ 1, 1, 7, 1000, 1000, 1500, 1500, 1500]) b.cumsum() - 1 computes element of use each element of output, , a[b.cumsum() - 1] extracts elements. work out way use numpy.repeat this.

Local jnlp application blocked by java security -

i have hp proliant remote application card installed in server, , uses java app (jnlp) kvm access. due incorrect way it's configured, no browser run jnlp file provides; download file, , i've manually run file manager. enter java 8, medium security no longer option. when try run jnlp file, tells me it's blocked java security, how can run jnlp file now? i've tried adding localhost , 127.0.0.1 exceptions list, didn't help.

Error build Android in Cordova: Unspecified required by? -

i'm trying build app in cordova 5.4 using cordova run android . i'm getting this: * went wrong: problem occurred configuring root project 'android'. > not resolve dependencies configuration ':_debugcompile'. > not find version matches com.android.support:support-v4:+. searched in following locations: https://repo1.maven.org/maven2/com/android/support/support-v4/maven-metadata.xml https://repo1.maven.org/maven2/com/android/support/support-v4/ required by: :android:unspecified i can't seem track 1 down. familiar? sorry, if should comment don't have enough points yet so. please try install android support repository in android sdk manager . then check whether works cordova build android --verbose if it's successful, cordova run android --verbose source: https://github.com/azuread/azure-activedirectory-library-for-cordova/issues/6

postgresql - Impala FDW for Postgres 9.5 -

i looking impala foreign data wrapper postgres 9.5. have tried figure out internet , can have 1 reference https://github.com/lapug/impala_fdw seems fdw yet completed per readme file. can guide me other impala fdw available can use connect postgres impala? since impala supports jdbc , odbc, you've got options. my jdbc2_fdw fork 9.5 patches - compiles , able retrieve results. not tested yet. incorporates mc-soi's jdbc2_fdw patch postgresql 9.5 , includes additional changes. jdbc2_fdw - works postgresql 9.4 , earlier odbc_fdw i'm using odbc_fdw , heimir-sverrisson's jdbc2_fdw postgresql 9.4. postgresql 9.5 changed api. got jdbc2_fdw working degree, had additional patches on path mentioned. allows retrieving results foreign table , creating materialized view on it. more testing needed. link shared above.

javascript - How to determine if Loopback model access is internal or external? -

i'm using loopback, , i'm trying figure out how can tell in operational hook if model being accessed result of query original end point or through relationship. i have custom filtering doing unrelated acl, , works when querying specific endpoint. however, has been causing issues when querying endpoint, , including related models. thus, i'd able detect when model being accessed via relationship, , disable filtering these instances. any suggestions on how go doing this? thanks in advance!

how to install java8 in ubuntu instance using packer provisioner? -

trying build ami using packer base ami available online (preferably ubuntu 12.04 precise). looking provisioner definition java 8 installation. have coupled multiple installations , executed has went through well. but, java8 using ppa not happening following commands in definition. chef happening without troubles, want packer provisioners. "sudo apt-get install python-software-properties", "sudo apt-add-repository ppa:webupd8team/java", "sudo apt-get install oracle-java8-installer". other alternatives tried : sudo apt-get update sudo apt-get software-properties-common sudo apt-get install software-properties-common sudo add-apt-repository ppa:webupd8team/java sudo apt-get install oracle-java8-installer reference: http://www.webupd8.org/2012/09/install-oracle-java-8-in-ubuntu-via-ppa.html https://askubuntu.com/questions/445536/unable-to-locate-package-add-apt-repository-error please me provisioner definitions if u found successful implementat

javascript - Find children of a certain type -

i have array of forms in page. want iterate through forms, , find buttons in them. how can achieve in javascript alone, without libraries? here's js code : var forms = document.queryselectorall('form'); for(var = 0; < forms.length; i++;){ var form = forms[i]; form.addeventlistener('submit', validateform); } function validateform(e){ e.preventdefault(); var button = ?; // want button child of form } i know can use buttons children of form : var buttons = document.queryselectorall('form button'); but how can 1 button children of this form? i've seen question asked multiple times, find children of parent known, specific id or that. have no idea how many forms there in page, , have no control on wether or not have unique id or else used differentiate them when using queryselectorall() . is possible achieve want? i'm looking pure js alternative in jquery : var $form = $('form'); var $childbutton

java - Issue when deploying application to GlassFish Server - mapping issue? -

i'm trying deploy application glassfish server environment. i've set glassfish creates connection pool postgresql database on server ( not localhost) database located. test connection , try deploy application. fails java.lang.runtimeexception: ejb container initialization error, , error log contains following: http://ideone.com/ulzxut (put here due size). there other warnings above these, referred tables existing. as according this , thought required sun-cmp-mappings.xml file (the 1 assume necessary correct mapping) automatically generated upon deployment, seems wrong. shed light on situation? my apologies if not absolute best part of se post this, related development tools , did see number of related posts. your error log indicates trying create table(s) double datatype. in postgresql, datatype called " double precision ". happens if revise table definition use "double precision" instead?

ios - performSegueWithIdentifier: unexpectedly found nil while unwrapping an Optional value -

i wish allow selecting row whereby, action outlined below occur: override func tableview(tableview: uitableview, didselectrowatindexpath indexpath: nsindexpath) { tableview.deselectrowatindexpath(indexpath, animated: true) // ensure controller knows dataset pull from, // detail view correct var friendchat: friend! friendchat = mappedfriends[indexpath.row] // set conditional cases: if friend chat, if user friend request if not user can invite them: if(friendchat.statussort == 2) { var controller : individualchatcontroller! print(friendchat.name) controller.friendchat? = friendchat controller.senderid? = global.sharedinstance.userid controller.senderdisplayname? = global.sharedinstance.username self.performseguewithidentifier("showindividualchat",sender: controller) } else if (friendchat.statussort == 1) { pr