Posts

Showing posts from February, 2011

android - Adding the effects of a RippleDrawable and a StateListDrawable to a RecyclerView -

i'm working on app uses dual-pane layout on larger devices similar what's detailed here . summary of layout; 1 pane contains list of options while other display detailed information on option selected other pane. right when option selected there ripple effect that's seen when selecting other elements (buttons, check boxes, etc) after animation completes element returns it's previous color. i'd retain highlight ripple after animation completes , i'm having trouble figuring out how accomplish this. this how ripple background looks. focus selector doesn't - couldn't figure out how give elements focus. i've tried using selected selector happens immediately, overriding ripple. <?xml version="1.0" encoding="utf-8"?> <ripple xmlns:android="http://schemas.android.com/apk/res/android" android:color="?android:coloraccent"> <item android:id="@android:id/mask" androi

r - Dataframe manipulation: Convert certain columns of a dataframe into a list based on a key value column -

i have df example created code below. a = data.frame( name = c(rep("tim",5),rep("john",3)),id = c(rep(1,5),rep(2,3)), value = 1:7) and want transform result looks this. b = data.frame( name = c("tim","john"), id = c(1:2), b = na) b$value = list(c(1:5),c(6:8)) how go doing transformation? for actual data frame, have many columns left of id column, want perform calculations on columns of lists created on right side of id field. for example, on df b above, might want perform function call "tim" argument , loop through each individual element in list = {1,2,3,4,5} , output of loop list same number of elements. try aggregate(value~.,a, fun=c) # name id value #1 tim 1 1, 2, 3, 4, 5 #2 john 2 6, 7, 8 data a <- structure(list(name = structure(c(2l, 2l, 2l, 2l, 2l, 1l, 1l, 1l), .label = c("john", "tim"), class = "factor"), id = c(1, 1, 1, 1, 1, 2, 2, 2), value = 1

How to upload extension on magento connect? -

i have created extension , want upload on magento connect when upload on magento connect gives me following error:- unable save version. filename not valid. expected filename without ext... i checked extension working great on versions. please me sort out error. try next: log in magento admin panel from admin panel, select system > magento connect > package extensions. on package info section, add extension name in name field, example my_stackoverflow fill other fields, use guide: http://info.magento.com/rs/magentocommerce/images/packagingmagentoconnectextensions6%200.pdf when extension packed, go /path/to/magento/var/connect/ folder , you'll see my_stackoverflow-1.0.0.tgz file. file should upload on magento connect site.

java - I can't seem to find the right Collection for my case. Thinking about list of hashmap of list, which appears very abstract -

i'm trying write programm challenge: https://www.reddit.com/r/dailyprogrammer/comments/2hcwzn/09242014_challenge_181_intermediate_average_speed/ basically, i've gotte point cars pass 4 cameras, , want save time every car has passed specific camera individually. so far thought process list of hashmap of lists, feel i'm thinking abstract, because not feeling safe collection use @ time (thats why i'm doing exercise mostly). basically, list consist of various hashmaps of lists. "lowest" lists contain 4 time dates specific car ( data camera one, data camera two, , on). attach list hashmap, have specific plate of car key. "highest" collection list include hashmaps, list store car plates store data each camera. i feel made little bit hard follow, painted mindmap you: https://i.imgur.com/sxgltvx.png i hope can point me in right direction. for speed limit, need number... maybe use double ? cameras, need array or list of distance ( int

overriding colors for buttons on a wordpress theme with bootstrap buttons -

i'm trying change colors on these buttons on wordpress site http://www.saylor.org/pathways/ , http://www.saylor.org/pathways/earn-college-credit/ the codes buttons on 1 page is <a class=btn-green" href="/pathways/foundational-courses/'>browse courses</a> thanks in advance provide you need put shown below missing content. check missing content have not included <style type="text/css"> .course-wrap .btn-green { background-color: #ff0000; } </style> you can change value of background color #ff0000 other value per requirement.

sql - php code to give the position according to their scores (1st, 2nd, 3rd, 3rd, 5th) -

create table if not exists `jss1_prelim` ( `id` int(11) not null auto_increment, `term` varchar(30) not null, `idnumber` varchar(30) not null, `subject` varchar(30) not null, `score` varchar(30) not null, `teacher` varchar(30) not null, primary key (`id`) ) engine=myisam default charset=latin1 auto_increment=6 ; insert `jss1_prelim` (`id`, `term`, `idnumber`, `subject`, `score`, `teacher`) values (1, 'prelim', 'sbi-js202', 'computer', '82', 'tid273'), (2, 'prelim', 'sbi-js645', 'computer', '63', 'tid273'), (3, 'prelim', 'sbi-js300', 'computer', '65', 'tid273'), (4, 'prelim', 'sbi-js202', 'igbo', '70', 'tid015'), (5, 'prelim', 'sbi-js645', 'igbo', '65', 'tid015'); i need on script, script works fine sorting sql database entries. need php code give position according scores (1st, 2

php - Trying to create a search facility but having issues -

i having issues php code, been trying create search facility , having errors , don't know do. here's code area having issues: <input type="text" required="required" name="name"> <input name="submit" name="submit" value="search"> </form> <?php if(isset($_post['submit'])) { if(isset($_get['go'])){ if(preg_match("^/[a-za-z]+/", $_post['name'])){ //to make sure either capital or small letters $name=$_post['name']; //connection database $db=mysql_connect ("localhost", "<u1375454>", "<25jun94>") or die ('cannot connect database: ' .mysql_error()); //selection of database use $mydb=mysql_select_db("cars"); $sql="select brand i_d, brand_name, headquarters, net_worth cars brand_name '%" . $name . '%" or headquarters '%" . $name ."%'";

javascript - Filtering Results with JQuery.grep in PHP from Json Txt File -

i'm able pull json results table no problem, when comes filtering results based on php $_get variables can't seem return result set. my table simple: <table id="displaythatdata"> <thead> <tr> <th>meter</th> <th>address</th> <th>city</th> <th>date</th> <th>status</th> <th>location</th> </tr> </thead> <tbody> <tr> <td>that</td> <td>that2</td> <td>that3</td> <td>that4</td> <td>that5</td> <td>that6</td> </tr> </tbody> </table> my jquery function looks this. trying append table results $_get variables set using php: json_return = []; jquery(function(){ jquery.getjson('./json/acm2.txt',{},function(data){ json_return = data; jquery('#displayth

Batch Files: recursively check for file attributes -

i've looked @ topic: testing file attribute in batch file the script works specified folder in %input%, if want subfolders, doesn't work. when add suggested /r flag, nothing @ happens. syntax correct? for /r %%f in (%input%) ( ... ) thanks scott you need specify base directory after /r. whatever specified in parentheses appended each subdirectory in tree. can use . directory itself: for /r %input% %%f in (.) ( ... ) also, 1 weird thing discovered if use enabledelayedexpansion syntax, doesn't work; executes body base directory, not subdirectory. following not work, whether have enabledelayedexpansion enabled or not: for /r !input! %%f in (.) ( ... ) another quirk of dosbatch. edit: address comment, becomes relevant ... contains. should work if want attributes on both current iteration directory , files contained within current iteration directory: for /r %input% %%f in (.) (attrib %%f& attrib %%f\*) edit: here's potential solution

javascript - How to transfer session php data from PHP to JS -

i working php session , array data filtering js in laravel 4 view. currently, php ooks in javascript portion. <?php $number_of_posts = 7; ?>; <?php $_session['posts_start'] = isset($_session['posts_start']) ? $_session['posts_start'] : $number_of_posts; ?>; var start = {{ session::get('posts_start', 7) }}; var initialposts = <?php echo fanfollow::follows_json(auth::user()->get()->id,0, $_session['posts_start']); ?>; var desiredposts = <?php echo $number_of_posts; ?>; this works fine, move javascript external js file, opposed mixing php , js. my question is, how take php above , make accessible js without using php directly in js. an example using html hidden input in view so: <input type="hidden" id="num_posts" name="num_posts" value="{{$number_of_posts}}"> and pulling using js: var number_posts = $('#num_posts').val(); c

c - pthread- creating a new thread each time a method is called -

[this heavy improvment previous question asked. question make more sense on i'm trying do] i want create program creates new thread each time specific method called. here working code far: #define number_of_threads 3 pthread_t threads[number_of_threads]; pthread_attr_t attr; void *busywork(void *t) { int i; long tid; tid = (long)t; printf("thread %ld running...\n",tid); // ... printf("thread %ld completed...\n",tid); pthread_exit((void*) t); } void createnewthread(int number){ printf("running createnewthread(%d)\n", number); pthread_t tid; int rc = pthread_create( &tid, &attr, busywork, (void *) (long)number); if (rc) { printf("error; return code pthread_create() %d\n", rc); exit(-1); } } int main(int argc, char *argv[]) { int i, rc; //set thread attributes pthread_attr_init(&attr); pthread_attr_setdetachstate(&attr, pthread_create_join

r - colorRamp returns 0 -

i'm trying plot lines , color lines based on probability of connection. given vector of probabilities, use: colfunc <- colorramp(c("white", "red")) colors <- colfunc(probs) colors nx3 matrix of rgb values. however, colfunc quite returns 0 value, when attempt plot using these colors, r complains error in col2rgb(colors) : numerical color values must positive is there error in way defining color function? your function works fine, think, doesn't return colors can use plot , because plot wants color, not rgb values in matrix. there's better way, can covert matrix: probs <- runif(10) colors <- colfunc(probs) my_col = apply(colors, margin = 1, function(x) rgb(x[1]/255, x[2]/255, x[3]/255)) plot(1:10, 1:10, col = my_col) # should work fine or wrap function better_colfunc <- function(x, ramp = colorramp(c("white", "red"))) { colors <- ramp(x) colors = apply(colors, margin = 1, functi

javascript - Display div content only once in hour -

is possible show div in header of page visitor once in hour? i want show bar shows visitor whether we're open or closed. 'visitor a' should see @ every first page loads , on next page not. in 30 minutes should shown him again. i'm running jquery 1.10.2 @ website. thank ideas you can use cookies, set cookie lasts hour, , code make checks : if cookie not exist, display div , create cookie , make last hour if cooie does exist, nothing i don't think can handle cookies jquery directly, there plugins out there though. or, can use server side programming langage such php. it depends on want show though. if it's ad or reminder (ex: take @ our xmas promotion) display @ every hour. in jquery script, check time, , if it's "round" hour (not sure how this) such 7:00, 8:00 or something, show div , , hide after minute or whatever. example php <?php if(!isset($_cookie['yourcookie'])) { //set cookie

php - Laravel "This webpage has a redirect loop" only on a single route suddenly -

ok thing have laravel 4.2 installed , it's working great. up today when did couple of small changes , website/used path returns incredibly infuriating message "this webpage has redirect loop" forever , ever. using localisation , mcamara plugin installed, until today perfect , use 2 locals en/da without problems website/en/used or website/da/used , of course normal paths website/used etc remember lang choice , show content such. now after trying implement simple feature: creating usedcontroller handler form requests new view should make possible upload picture , title , description. worked couple of tries without posting database, dd, issue redirect starts , 6 hours or on keeps going on , on , on , it's making me totally frustrated, deleted created , still won't work @ all. website/en/used , website/da/used still works though, website/used gets page hell every time :( so question guess is: why can controller "hijack" route that, , refuse it

php - How can I send multiple $_GET["x"] variables using htaccess? -

so far but..... $custom_path= "musical_instruments"; echo '< href='$custom_path' >custom link< /a>' i'm able use $_get["custom_path"] in page i'm redirected rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^(.*)$ localhost/folder/folder/stuff.php?custom_path=$1 how send multiple $_get variables form custom link can use them in page i'm redirected to? i did not quite want know: $custom_path = "category=$category&item_name=$url&item_id=$id"; php $custom_path= "musical_instruments"; $item_name= "guitar"; $item_id= 123; echo '< href='$custom_path&$item_name&$item_id' >custom link< /a>' htaccess rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^(.*)$ localhost/folder/folder/stuff.php?custom_path=$1&item_name=$2&item_id=$3 how can have access variable

asp.net - MVC3 iis6 app giving 404s and 403s -

a running app have has started giving 404s , 403s. have followed in link no avail. thinking security settings have been changed not sure settings or user need check. our production version of website running , afraid if restart server or services stop working. [ mvc3 rc app deployed on iis 6 giving "403 forbidden" error i have figured out. in project had set 'copy local' true several references. how these had been reset false. system.web.http, system.net.http.formatting, system.web.http.webhost

How to map selected fields from JSON to Java Object using gson -

i'm using gson map json on java object. have json looks similar example below { "meta": { "status": 200, "msg": "ok" }, "response": { "blog": { "title": "we have munchies.", "name": "wehavethemunchies", "posts": 10662, "url": "http://wehavethemunchies.tumblr.com/", "updated": 1415895690, "description": "<p>if of have tasty recipes wanna share click submit~ if owner of 1 of images , wish have removed please message , remove quickly. sorry inconvenience. </p>\n\n<p> if tagged <strong>recipe</strong>, can click through photos link recipe. if flickr image, click through flickr image link directly recipe.\n<p><strong>here our popular tags:</strong><p>\n\n<p><a

css - How to make iPad auto-scale large-width element which also has overflow: scroll to full displayed? -

at first, i'm not developing responsive design page. didn't add <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"> here codes: css: <style> section { width: 1250px; height: 800px; background: url(http://placehold.it/1250x800) no-repeat 50% top; } </style> html: <div class="container"> <section></section> <section></section> <section></section> <section></section> </div> when visit these ipad, <section> s auto-scaled fit ipad screen. not need scroll horizontally watch full images. want. however, if add overflow .container , ipad don't auto-scale page anymore: .container { overflow-y: scroll; } i'm going implement scroll effect on ipad. ipad not fire "scroll" event of "window" before scroll action stops, have scroll content of page in large overf

python - How to generate a list from a * rule in ANTLR3? -

i have following grammar: grammar test; options { lang = python; } declaration returns [value] : 'enum' id { statement* } { $value = {'id': $id.text, 'fields': $statement.value} } ; statement returns [value] : id ':' int ';' { $value = {'id': $id.text, 'value': int($int.text)} } ; to parse syntax of type: enum test { foo: 3; bar: 5; } however, struggling getting statement* rule list of statements. want final parsed object like: declaration = { 'id': 'test', 'fields': [ {'id': 'foo', 'value': 3}, {'id': 'bar', 'value': 5}, } i can parse each of statement results correctly, each $statement.value correct. but, given asterisk on statement* in rule declaration , there way can condense list of fields ? hoping have sort of syntax gets me opti

How do I know The attributes of built-in class in python? -

i use tkinter gui library python . when come create root main window write root=tk() want undetstand happens inside tk() , how know attributes , function ? (python3) import tk, call dir or help : >>> import tkinter tk >>> help(tk.tk) <lots of useful information>

Can't use background task in Windows Phone 8.1 (the ID_CAP_NETWORKING required, but it's included in the manifest) -

i need update windows phone application tile downloading , parsing json. i'm using microsoft http client libraries. and i've got exception use of networking apis requires id_cap_networking capability defined in application manifest when i'm trying debug background task. but manifest included id_cap_networking required (screenshot https://fbcdn-sphotos-e-a.akamaihd.net/hphotos-ak-xaf1/t31.0-8/10750111_821340111262044_6461333323674658178_o.jpg ). i don't know do. tried rebuild or recreate app, didn't help. can't find documentation or answer on internet. can please write, can solve problem? this demo project http://1drv.ms/1yjhm49 reproduced problem (project's name 'meduza. windows phone'). i debug application on lumia 720 (if can help). i re-downloaded project , error. thought, must of done before launching project fixed it. it took me while, can project work doing this unzip project directory open project clea

phpmailer - Mandrill smtp failures -

i'm having enormous difficulty getting mandrill smtp send reliably. or more accurately, authenticate every time. when authenticate email works fine i can run send script fine, 2 or 3 times in succession 1 after other. doesn't authenticate. on occasions doesn't authenticate straight away. i thought perhaps it's because thinks i'm abusing , blocked me short period. but can see since started using mandrill smtp website, failure rate authenticate regular. tried spf , dmik text attributed on domain. didn't help looking around can't see other people having issue, @ rate can't use mandrill smtp. can suggest reasons why happening? credentials 100% accurate, , don't think i'm sending many emails @ all. having same problem on server using mandrill account. note: i'm using phpmailer example debug error: 2014-12-06 08:52:59 connection: opening smtp.mandrillapp.com:587, t=300, opt=array ( ) 2014-12-06 08:52:59 connection: opened 2

javascript - IndexedDb transaction auto-commit behavior in edge cases -

tx committed when : request success callback returns - means multiple requests can executed within transaction boundaries when next request executed success callback of previous one when task returns event loop it means if no requests submitted it, not committed until returns event loop. these facts pose 2 problematic states : placing new idb request enqueuing new task event loop queue within success callback of previous request instead of submitting new request synchronously in case first success callback returns idb request has been scheduled are asynchronous requests executed within single initial transaction? quite essential in case want implement result pulling back-pressure consumer gives feedback in form of future ready consume response creating readwrite tx, not placing requests against , creating 1 before returning event loop does creating new 1 implicitly commits previous tx ? if not, serious write lock starvations might occur, because : if mul

jax rs - constructing efficient error code mapper in Django filters or middlewares? -

i in process of migrating code jax-rs rest service django-rest framework . 1 nice feature jax-rs provides exception mapper different exceptions thrown various components mapped generic map one. one example api call authenticate user can fail following reasons: username wrong -- error code 1000 password wrong -- error code 1001 database down - error code 1002 i might want map "1000" , "1001" 1 generic code "5325" front-end/device team can interpret "username , password did not match" in jax-rs mapping done @ rest layer. in fact, can throw 1 kind of exception , map error code sent in response. how can achieve same in django? for example: def process_checkout(request): // if request.user.is_authenticated : //then process checkout else: raise usernotauthenticatederror now, middleware should map "usernotauthenticatederror" error-code, construct json response such {50000 :"user not aut

javascript - returning multiple values from functions -

i have js file (below) each function returns 2 results (step1 , step2). need put these results format like... "mix " + (step1 producttype) + " " + (step1 peroxide) + ". " + (step1 timing) using " + (step2 producttype) + " , mix " + (step2 tonecalc) + ", " + (step2 peroxide) + ". " + (step2 timing) what best way these results formats above? know how single value, not quite sure on multiple functions wrapped in function. thanks function doubleprocess(type) { function producttype() { var step1; var step2; if (type == "light") { step1 = "lightner"; step2 = "demi-color"; } else { step1 = "demi-color"; step2 = "demi-color"; } return step1, step2; } function tonecalc() { var step1; var step2; if (type == "light") { step1 = "light gold"; } else if (ty

ios - Integrating MSDynamicsDrawerViewController and storyboards in SWIFT -

i have been busting head on time. moving parts of ui created programmatically storyboards implement bit of mvc in ios poc. drawer view implemented using library called msdynamicsdrawerviewcontroller. entire drawer implemented programmatically, tried change static table view approach without success. reverted existing code. however, facing problems while trying integrate drawer navigation controller , subsequent view controllers embedded in it. eg: once click on option "my reports" in drawer, has go reports table view controller defined using storyboard. reports table view controller embedded inside navigation controller. code below. case .myreports: newpane = mainstoryboard.instantiateviewcontrollerwithidentifier("myreportsviewid") myreportsviewcontroller (newpane myreportsviewcontroller).drawerviewcontroller = self.drawerviewcontroller println("main_menu: transition myreports pane") if let p

TIFF16 image looks different in windows file viewer and MATLAB -

Image
general problem description i have 33 tiff16 images , want processing on them using matlab. reading them first step. after download image web , try read using matlab's imread (as tiff , read ). display image using imshow . image displayed windows file viewer , matlab totally different. cannot process them since don't trust matlab has read them correctly. give more specifics of problem now. edit: if helps, details of tiff16 images are: tiff (16 bits per channel, prophoto rgb color space, lossless compression) more details: i download image a0008-wp_crw_3959.tif . destination: go this link -> img0008 -> expert b (in case wants try, otherwise have screenshots below). i read image in matlab using: img=imread('imgfilename.tif','tiff'); imshow(img,[]); or t = tiff('imgfilename.tif','r'); imagedata = read(t); imshow(imagedata); now, display snapshots of windows file viewer : next, snapshot of matlab shows me: now, h

erlang - Add Kinetic to ChicagoBoss App -

i looking add kinetic chicago boss app, have added kinetic library deps directory within chicago boss app. when run erlang shell within kinetic directory have development.config in root of kinetic directory looks below: [{kinetic, [{args, [ % of these values optional % kinetic of context instance {region, "us-east-1"}, {aws_access_key_id, "akaaaaaabababa"}, {aws_secret_access_key, "3/fx9987sxc352728181892838bhbjkd"}, {iam_role, "kinetic"}, {lhttpc_opts, [{max_connections, 5000}]} ]}] }]. when start chicago boss app , run kinetic command im getting invalid credentials error seems kinetic library loaded not constants aws keys...any idea how in chicago boss? thanks! solution just paste tuple {kinetic, [...]} development.config boss.config contains list of configurations erlang applications. more general configuration files in each application depends on conf

redirect to profile after registering for website using php -

i want send user there profile after registering no input file not sure i'm doing wrong start session in els statement not sure if that's write can me out maybe <?php // set database connection require("dbconfig.php"); // lets our posts // $email = $_post['email']; $pass = $_post['password']; $bn = $_post['bandname']; $state = $_post['state']; $genre = $_post['genre']; $description = $_post['description']; $image = $_files['image']; /// valid image types /// $image_type = array("image/jpg","image/jpeg","image/bmp","image/gif","image/png"); /// folder hold image $imagepath = "images/"; $imagepath .= $image["name"]; // move file tmp folder image folder if (move_uploaded_file($image['tmp_name'], $imagepath)){ $foo = `mogrify -quality 92 -scale 500x $imagepath`; } // insert data mysq

amazon web services - DynamoDB, AWS, Node.js, newb -

i exploring dynamodb use in node.js project. package.json { "name": "generic-server", "version": "0.0.1", "private": true, "engines": { "node": "0.11.x" }, "dependencies": { "express": "3.3.4", "jade": "1.1.5", "aws-sdk": ">= 2.0.9" } } now logged aws account , created dynamodb table. , have in index.js var aws= require('aws-sdk'); aws.config.update({//1 accesskeyid: 'blabla', secretaccesskey: 'blabla', region: 'us-east-1' }); var db = new aws.dynamodb({apiversion: '2014-12-04'}); db.listtables(function(err, data) { // 2 console.log(data); }); so console.log of data null. can think of 2 areas might issue ( numbered them inline 1 or 2 ). appreciated. i .net, java, , obj c developer playing node.js , aws, fyi. the first parameter listtables "para

html - Javascript ignore empty dropdown value -

i have been trying multiple ways dropdown search function exclude empty values. example have following code blank lines (ie. value="") allow each country group separate. problem no matter page refreshes when click on these empty values. tried exclude them using if statement, didn't work. can't have count content loaded dynamically. appreciated new javascript. thanks! <select id="state"> <option value="">select state/province search</option> <option value=""></option> <option value="http://www.cabcot.com/listings/canada/">canada</option> <option value="http://www.cabcot.com/listings/canada/manitoba/"> - manitoba</option> <option value=""></option> <option value="http://www.cabcot.com/listings/united-states/">united states</option> <option value="http:/

jquery - ajax button to show and change status of a DB field - Laravel 4 -

i trying create simple settings panel. want create several buttons, show , change status of options , switch value between 0 , 1. exacly use here in stackoverflow vote answers. with friendly able create single button, works: view: <div class="box_option flexvert invoke2"> @if(isset($userdata) && $userdata->showtoolbar == 1) <a data-remote="true" data-method="post" href="{{ route('switch.toggle_option') }}" id="experiment_update3" class="csh_07"> activated</a> @else <a data-remote="true" data-method="post" href="{{ route('switch.toggle_option') }}" id="experiment_update3" class="csh_11"> not activated</a> @endif </div> route: route::post( '/usersettings/ajax_buttons3', array( 'as' => 'switch.toggle_option', 'uses' => 'userworkspacescon

uml - Use-case specification of included use-case -

Image
does know how describe (specify) use-case includes usecase in use-case specification table? example, have use-case "change password" includes use-case "login" (this example, know login should in pre-condition of use-case) may specify this? use-case identity: change password actor: user pre-condition: ... normal flow: do use-case "login" .... .... .... what proper way specify use-case includes use-case? it depends on further rules , conventions used "use-case specification table" document. consult company documents rules (and examples). overall yes , approach valid. the "login" use case might invoked implicitly if you'd move "pre-condition: user logged-in" even free text without software requirements management tool consider using "name , unique-number" referencing best practice to wrap head around i'd recommend (among other google-able resources) read alistair cockbur

javascript - How to add event listener to submit button -

i having many troubles html. trying add event listener submit button can change document display form information. problem is, when form filled, button listener nothing! (it works in jsfiddle , other things it, won't work stand alone files, leads me believe set files incorrectly somehow, possibly messed script tag). have tried many things, including moving script tag around, trying event listener submit of form, , input type button still nothing. can here? my html: <!doctype html> <html> <head> <title>form project</title> <style type="text/css" rel="stylesheet"> #but{text-align:center;} td{text-align:right;} span{padding=0; margin=0;float:left;} </style> </head> <body> <form id="formid"> <table border = "1"> <tr> <th>provide contact information</th> <th>provide login access information</th> </tr&

c# - How do I open a specific file in a folder same level as solution? -

i looking help. have created application, , 1 of buttons meant open specific file. i have put specified .txt document folder on program. on same level "solution" file. now, how go writing code open specific .txt file? i started out with: streamreader reader; // class-level reader = new streamreader("../textfilehere.txt"); but, keep getting error message. unhandled exception of type 'system.io.directorynotfoundexception' occurred in mscorlib.dll what mean & doing wrong? can move file, if make easier. with reader = new streamreader("textfilehere.txt") face problems if put shortcut of application somewhere else desktop. in order appliaction working no matter address is, have this: reader = new streamreader(application.startuppath + "\\textfilehere.txt")

rest - how to Customize Link Rendering type with HAL in Grails? -

from customizing link rendering section in grails documentation, can see possible customize href book.link rel:'publisher', href: g.link(resource:"publisher", params:[bookid: book.id]) how customize 'type' field?

android - What does this mean? How do I fix it? Fatal Exception:main -

i try open android studio app in emulator , giving error: 12-06 00:50:30.993 1198-1198/com.coding.nero e/androidruntime﹕ fatal exception: main process: com.coding.nero, pid: 1198 java.lang.nullpointerexception @ android.support.v4.app.backstackrecord.doaddop(backstackrecord.java:394) @ android.support.v4.app.backstackrecord.add(backstackrecord.java:389) @ android.support.v4.app.fragmentpageradapter.instantiateitem(fragmentpageradapter.java:99) @ android.support.v4.view.viewpager.addnewitem(viewpager.java:832) @ android.support.v4.view.viewpager.populate(viewpager.java:982) @ android.support.v4.view.viewpager.populate(viewpager.java:914) @ android.support.v4.view.viewpager.onmeasure(viewpager.java:1436) @ android.view.view.measure(view.java:16497) @ android.view.viewgroup.measurechildwithmargins(viewgroup.java:5125) @ android.widget.framelayout.onmeasure(framelayout.java:310) @ android.view.

swift - Unable to call type method on class conforming to protocol -

my code simple. my protocol: protocol baseentity { class func getinstance(sourceobject: [nsobject : anyobject], context: anyobject!) -> baseentity init() } then in class have method: private func convertjsondictionaryintomodel(jsondictionary : [nsobject : anyobject], mapclass: baseentity.type) -> baseentity { let object = mapclass.getinstance(jsondictionary, context: nil) return object } i got compiler error on first line reads "accessing members of protocol type value baseentity.type unimplemented" as far can tell, possible in swift. i encountered too! means swift programming language doesn't support class methods inside of protocols... yet. workaround seems depend on specific situation , there's no "you should instead". if has better solution, please share! this case class variables, there hacky workaround that.

mysql - zend framework and php, increment only if set of values in both arrays are equal -

i have 2 arrays. first array contains result of database query. database of information. second array contains user defined values selected on screen. goal reconcile elements user has clicked database result set. end result trying achieve following "rule": if group of elements match group each array, id increment counter. not key values need match, ones. example if db result array contains 3 values, , user array contains 2 matching values not increment. if db result array contains 3 values, , user array contains 3 matching values increment. an example of each multidimensional array provided: //db results - $result() array ( [0] => array ( [id] => 115 [q_id] => question-1 [course_id] => 1 [course_section] => unit-2-section-2 [a_id] => question-1-drop-down-answer-1-input [a_body] => august [answer] => yes [timestamp] => 2014-11-30 21:36:02 ) [1] => array ( [id] => 117