Posts

Showing posts from August, 2014

python - Blasting remotely from biopython -

i'm trying remotely blast 70 200-nt sequences using biopython. i've been trying hours figure out why following python script won't work. i can work read file contains 1 fasta using seqio.read, when try switch seqio.parse, don't in .xml save file create. any ideas? as side note, if knows option syntax excluding organisms results (as possible when using ncbi website, please let me know). thanks help. matt from bio.blast import ncbiwww bio import seqio import tkinter.filedialog tkfd in_file=tkfd.askopenfilename() record = seqio.parse(in_file, format="fasta") out_file = tkfd.asksaveasfilename() save_file = open(out_file, "w") rec in record: print(rec) result_handle = ncbiwww.qblast("blastn", "nt", rec.format("fasta")) save_file.write(result_handle.read()) result_handle.close() else: save_file.close() this content of in_file i'm using test file (the line formatting of file set @ 80 char, might

tablesorter - Jquery tablesort -

i using tablesorter jquery , using page example http://mottie.github.io/tablesorter/docs/example-parsers.html and using plugin: http://mottie.github.io/tablesorter/js/jquery.tablesorter.js this code sort "status" $.tablesorter.addparser({ id: 'status', is: function(s) { // return false parser not auto detected return false; }, format: function(s, table, cell, cellindex) { // format data normalization //console.log(cellindex); return s.tolowercase() .replace(/deleted/,4) .replace(/finished/,3) .replace(/cancelled/,2) .replace(/in progress/,1) .replace(/new/,0); }, // set type, either numeric or text type: 'numeric' }); $('#request').tablesorter( { debug:false, widthfixed: false, headers: { 0: { sorter: false }, 3: { sorter: false

java - ArrayList of Array which contains TreeNode -

i want create arraylist of array consist of treenodes. trial was arraylist<arrays<treenode>> alist = new arraylist<arrays<treenode>>(); arrays<treenode> anodes = new arraylist<treenode>(); but gives error. (utils included) what right way of writing this? aim find minimum depth of node in binary tree(just find minimum not find node itself, ll put levels arraylist, once size not 2^j, min level j-1). thanks in advance, help/hint/solutions... the arrays class util class, not type you'd use array. arrays class never takes generic argument, error telling you. if want arraylist contains arrays, you're looking this: arraylist<treenode[]> alist = new arraylist<>();

c# - twilio list filter options -

i using example on twilio api docs messages available account , saving them locally, using sid pk. need new messages (greater sendate timestamp?) see on page there options filter incoming messages, see no examples of how "limit list providing query string parameters listing resource" posted under "list filters". using system; using twilio; class example { static void main(string[] args) { // find account sid , auth token @ twilio.com/user/account string accountsid = "ac5ef8732a3c49700934481addd5ce1659"; string authtoken = "{{ auth_token }}"; var twilio = new twiliorestclient(accountsid, authtoken); var request = new messagelistrequest(); var messages = twilio.listmessages(request); foreach (var message in messages.messages) { console.writeline(message.body); } } } dont know if separate question, need last interaction i've had each sentto number in message list. i've scoure

shell - Get Ports grep using netstat -v -

i want list of ports of established connections using netstat -v grep . i trying this: sudo netstat -v | grep "established" | cut -d: -f5 any help? please try netstat -v| grep "established"| awk '{print $5}' | cut -d ":" -f2

c++ - Manually colouring of boost's graphs -

i'm struggling trying manually colouring graph's vertices using boost. wrote code below can't figure out why generated file not have colour. int main(int,char*[]) { typedef property<edge_name_t, string> edgeproperties; typedef property<vertex_name_t, string, property<vertex_color_t, default_color_type>> vertexproperties; typedef adjacency_list<vecs, vecs, directeds, vertexproperties, edgeproperties> graph; typedef graph_traits<graph>::vertex_descriptor vertex; typedef graph_traits<graph>::edge_descriptor edge; graph g; property_map<graph, vertex_name_t>::type vertex_label = get(vertex_name, g); property_map<graph, vertex_color_t>::type color_map = get(vertex_color, g); property_map<graph, edge_name_t>::type edge_label = get(edge_name, g); vertex v1 = add_vertex(g); vertex_label[v1] = "v1"; put(color_map, v1, boost::red_color); std::ofstream outf(&quo

java - Spring mvc Ambiguous mapping found. Cannot map controller bean method -

i trying build app can list values database , modify, add, delete if necessary using spring 4 , receive following error(only if "@controller" annotation present in both of controller files, if delete annotation 1 of files works message in console "no mapping found ... in dispatcherservlet name ...): info : org.springframework.web.servlet.mvc.method.annotation.requestmappinghandlermapping - mapped "{[/edit/{id}],methods=[],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.string com.bookreview.app.bookcontroller.editbook(int,org.springframework.ui.model) warn : org.springframework.web.context.support.xmlwebapplicationcontext - exception encountered during context initialization - cancelling refresh attempt org.springframework.beans.factory.beancreationexception: error creating bean name 'org.springframework.web.servlet.mvc.method.annotation.requestmappinghandlermapping#0': invocation of init method failed; nested ex

scroll - How to allow horizontal overflow in CSS? -

i built rather minimal personal webpage design work , want each project shown long horizontal scroll. i'd been controlling width of each page pixel , works browsers, noticed when open page on phone, last image jumps next line. wondering how compensate this, if there easy fix. sample link : http://gh-he.com/projects/sutro.html if open browser, fine. open phone, jumps. no means programmer sort of fumbled way through got, code quite messy compared used to. set overflow-x property scroll on container of images. .images-container{ overflow-x: scroll; } if want text stay in place , have images scroll, put img in container , set overflow-x property on images container only.

web storage - Google Script PropertiesService storing data in unreadable format -

i'm trying use propertiesservice store data each user's settings appear next time load app. i'm using these properties build , run trigger. problem when try call userproperties functions following 1 set, array shows ljava.lang.object instead of actual values. i've tried things json, no avail. form.html <?!= include('style'); ?> <div id="formdiv"> <form id="myform"> <table class="table table-hover"> <thead> <tr> <th scope="col"> <h3 span style="font-family:arial,helvetica,sans-serif;">select</span></th> <th scope="col"> <h3 span style="font-family:arial,helvetica,sans-serif;">label</span></th> <th scope="col"> <h

ios - UIActivityIndicatorView hidden property is set to YES by default -

i had issue uiactivityindicatorview object not appear on view. in docs, found set no/false default. however, try print uiactivityindicatorview object, , see set yes, reason not visible. is bug, or small change in ios 8 sdk, , previous versions? as per documentation, uiactivityindicatorview has property hideswhenstopped . set yes/true default. true when animation stopped or animation not started. when adding uiactivityindicatorview , have start animation.also if set hidden property false.

.htaccess - Redirect to a locale based on cookie -

our site uses custom locales. save locale user selects in cookie. how add htaccess file accomplish redirecting proper locale based on cookie? our locales end pre-pending /dallas, /fort-worth , /plano urls. <ifmodule mod_rewrite.c> rewriteengine on rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule (.+) index.php?p=$1 [qsa,l] </ifmodule> suppose, set cookie locale=value write .htaccess rewriteengine on rewritebase / rewritecond %{http_cookie} locale=([^;]+) [nc] rewriterule ^(.*)$ /%1/index.php?p=$1 [nc,l,qsa] i.e. www.examle.com/smtng.html => www.examle.com/value/index.php?p=smtng.html

sql - Select Distinct records (with a total count) that also may have similarities -

not sure if possible have table has 2 columns: id , category. sample records this: 1 accounting 2 accounting 3 accounting & tax preparation 4 banks 5 banks & financial services 6 real estate 7 real estate - commercial 8 real estate - commercial & residential 9 real estate what want produce list selects category once counts how many occurrences of each 1 , can eliminate duplicates similar. result should like: real estate - 4 accounting - 3 banks - 2 what have is: sql = "select distinct(category), count(*) c " & _ "from mytable " & _ "group category" & _ "order c desc, category" so has of similar ones listed instead of grouped in other similar ones. know can use "like" keyword wildcards when dont know possible categories be, how write it? any advice appreciated, thanks! except real estate how many groups have space? use charindex locate space (assuming ms sql)

php - Why is my variable empty? -

why $book variable empty? i've checked before , until point correct. i've tried renaming didn't work :( <?php $postcontacturl = 'https://apiconnector.com/v2/contacts/'; $data = array( 'email' => $_get['email'], 'emailtype' => 'html', 'datafields' => array( array( 'key' => 'fullname', 'value' => $_get['name_first']." ".$_get['name_last'] ), ) ); $contact = execute_post($postcontacturl, $data); $addcontacttoaddressbookurl = 'https://apiconnector.com/v2/address-books/' . '123456' . '/contacts'; $book =  execute_post($addcontacttoaddressbookurl, $contact); echo "<pre>" . print_r($book, true) . "</pre>"; ?> i didn't write myself execute_post is: <?php //function initiate curl, set curl options, execute , return response function execute_post($url, $data){ //encode data json string $

html - keep search input at the top of list view in ionic framework -

Image
i new ionic framework, experimenting now. on 1 of page, have search input followed list, looks this: when scroll up, search field scrolling list view. possible keep search field fixed @ top whilst scrolling? this html markup far: <ion-view view-title="force"> <ion-content> <label class="item item-input"> <i class="icon ion-search placeholder-icon"></i> <input type="text" placeholder="search force" data-ng-model="searchforce"> </label> <div class="list"> <ion-item class="item-icon-right" ng-repeat="force in forces | filter:searchforce" type="item-text-wrap" href="#/tab/force/{{force.id}}"> {{force.name}} <i class="icon ion-chevron-right icon-accessory"></i> </ion-item> </div> </ion-content> </ion-view>

c# - Task Scheduling seems different when debugger is attached -

we have wpf software makes use quite lot of “async await” pattern in order not block ui thread. for instance, use pattern when opening file: ui shows spinner while in background io loading operation , start tasks long calculations (which should not stop loading) what seems happen loading task launched on thread, not blocking ui. works. however, loading task seems run synchronously other tasks create, such long calculation loading not need. i pinpoint debugger because: i noticed big files, when debugger attached, spinner runs longer 10-20 times. running release or debug version not affect behavior. as long debugger attached, way slower. detaching debugger in middle of loading run super fast right afterwards. i know because when breaking debugger, see: on current thread, top of call stack “loadprojectasync”, that thread in code of long calculations, have been triggered “async void” (since don't care them , shouldn't run synchronously) the “tasks” window

php - Adapting a wordpress search to search multiple fields -

i trying adapt existing search allow searches not staff names titles (job roles). currently following form method: <form method="get" action="<?php echo get_post_type_archive_link('staff'); ?>" class="search" data-behavior="search"> and get_post_type_archive_link function function get_post_type_archive_link( $post_type ) { global $wp_rewrite; if ( ! $post_type_obj = get_post_type_object( $post_type ) ) return false; if ( ! $post_type_obj->has_archive ) return false; if ( get_option( 'permalink_structure' ) && is_array( $post_type_obj->rewrite ) ) { $struct = ( true === $post_type_obj->has_archive ) ? $post_type_obj->rewrite['slug'] : $post_type_obj->has_archive; if ( $post_type_obj->rewrite['with_front'] ) $struct = $wp_rewrite->front . $struct; else $struct = $wp_rewrite->root

watchkit - How to add UIGestureRecognizer to WKInterfaceImage? -

currently working apple watch kit app. want add uigesturerecognizer wkinterfaceimage . possible add uigesturerecognizer watchkit app control? thanks you cannot that. watchkit not support ui kit , therefore not support ui gesturerecognizer .

Define factory class in C++ -

i have "like factory" class: class specialreader { private: handle specialfile; specialreader(handle specialfile); public: static specialreader create(tchar* filename); ~specialreader(); } //where specialreader::create(tchar* filename) { // ... // ... return specialreader(inputfile); } i want define object in program body this: specialreader myreader; but not: specialreader myreader = specialreader::create(anyfile); if try define object in first case i've got compiler error: error c2512: 'specialreader' : no appropriate default constructor available. how define class right? you can use smart pointer so, simplest choice using std::unique_ptr<specialreader> , transfer ownership of instance caller: class specialreader { private: handle specialfile; specialreader(handle specialfile); public: static std::unique_ptr<specialreader> create(tchar* filename); // ^^^^^^^^^^^^^^^^^^^

python - Django 1.6 class-based views: How to get the right path/to/view/ in url template tags -

i have 2 listview -based views inside app called ‘events’. 1 'events_index' lives @ /events/ , other 'past_events_index' lives @ /events/past/. navigating directly both urls loads desired pages a-ok. problem trying {% url %} template tag link 'past_events_index'. apps/events/urls.py: from django.conf.urls import patterns, url .views import eventdetailview, eventlistview, pasteventlistview urlpatterns = patterns( 'apps.events.views', url(r'^$', eventlistview.as_view(), name='events_index'), url(r'^past/$', pasteventlistview.as_view(), name='past_events_index'), url(r'^(?p<slug>[-\w]+)/$', eventdetailview.as_view(), name="events_show"), ) apps/events/templates/events/index.html: <a href="{% url 'events:past_events_index' %}">past events</a> instead of pointing me /events/past/ above points me /past/, yields 404. , when user @ /even

excel - Adding one hour to string date -

i have schedule appears in cells (string date) 7/31/2012 11:09:00 pm , want place corresponding in 2 separate cells showing date , time 1 hour time difference might set date off next day. how add 1 hour well? if string date in a1, in b2 can =hour(a1)+1 should return 12 (or 00 if use 24 hr). same date, =day(a1)+1

xpath - How to select similar data using SQL in JCR/jackrabbit? -

how write query in jcr/jackrabbit select data using: "where title '%news%". here structure in repository /rootnode , under root node have many child nodes , under child nodes have data in want search if string matches name or similar name. please pardon me if not able explain. m new jcr/jackrabbit. know how in database example (select * customers city 'anystring%';) i want accomplish similar thing in jcr. thanks if planning use xpath query syntax, jcr:like function can used achieve requirements. /jcr:root//*[jcr:like(@jcr:title, '%news%')] for sql grammar, like operator can used same. select * nt:base jcr:title '%news%' for sql2, like operator can used again. select * [nt:base] s s.[jcr:title] '%news%' all above queries reference only, run on entire repository. when using them achieving desired functionality, kindly restrict them query within required subtree , not entire repo.

Error "Mixing specified and unspecified group belongings in a single import isn't supported" when using neo4j-import command -

i'm trying import fair amount of data neo4j, takes long imported using load csv way. for reason i'm trying neo4j-import command got following error , haven't found information or means exactly. error is: 2015-04-29 14:34:06.225+0000 error [org.neo4j]: error during import mixing specified , unspecified group belongings in single import isn't supported java.lang.runtimeexception: mixing specified , unspecified group belongings in single import isn't supported @ org.neo4j.unsafe.impl.batchimport.staging.stageexecution.stillexecuting(stageexecution.java:62) @ org.neo4j.unsafe.impl.batchimport.staging.executionsupervisor.anystillexecuting(executionsupervisor.java:79) @ org.neo4j.unsafe.impl.batchimport.staging.executionsupervisor.finishawaresleep(executionsupervisor.java:102) @ org.neo4j.unsafe.impl.batchimport.staging.executionsupervisor.supervise(executionsupervisor.java:64) @ org.neo4j.unsafe.impl.batchimport.staging.executionsupervisors.s

c++ - How to get the coefficient from a std::decimal? -

background i want write is_even( decimal::decimal64 d ) function returns true if least-significant digit even. unfortunately, can't seem find methods extract coefficient decimal64 . code #include <iostream> #include <decimal/decimal> using namespace std; static bool is_even( decimal::decimal64 d ) { return true; // fix - want to: return coefficient(d)%2==0; } int main() { auto d1 = decimal::make_decimal64( 60817ull, -4 ); // not auto d2 = decimal::make_decimal64( 60816ull, -4 ); // cout << decimal64_to_float( d1 ) << " " << is_even( d1 ) << endl; cout << decimal64_to_float( d2 ) << " " << is_even( d2 ) << endl; return 0; } it's little odd there's no provided function recover coefficient of decimal; can multiply 10 raised negative exponent: bool is_even(decimal::decimal64 d) { auto q = quantexpd64(d); auto coeff = static_cast<l

.net - Custom build process load error -

i used able double-click build process xaml file open/edit (tfs) source control. now, when loading 1 of our custom build process templates, i'm getting following error: could not load file or assembly 'microsoft.visualstudio.platform.vseditor.interop, version=14.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a' or 1 of dependencies. located assembly's manifest definition not match assembly reference. (exception hresult: 0x80131040) i have bunch of errors in error log. prominent / severe of is: compiler error(s) encountered processing expression "workspace". value of type 'microsoft.teamfoundation.versioncontrol.client.workspace' cannot converted 'microsoft.teamfoundation.versioncontrol.client.workspace'. type mismatch due mixing file reference 'c:\windows\assembly\gac_msil\microsoft.teamfoundation.versioncontrol.client\10.0.0.0__b03f5f7f11d50a3a\microsoft.teamfoundation.versioncontrol.client.dll' in project &

soap - How to handle relative paths of xsds while publishing wsdl in spring web services? -

i have soap web services exposed through springs... need expose wsdl same. bean definition expose wsdl shown below. <bean id="schemacollection" class="org.springframework.xml.xsd.commons.commonsxsdschemacollection"> <description> bean wrap messages.xsd (which imports types.xsd), , inlines them one. </description> <property name="xsds"> <list> <value>/web-inf/classes/schema/hl7v3/ne2008/multicacheschemas/prpa_in201301uv02.xsd</value> <value>/web-inf/classes/schema/hl7v3/ne2008/multicacheschemas/prpa_in201302uv02.xsd</value> <value>/web-inf/classes/schema/hl7v3/ne2008/multicacheschemas/prpa_in201304uv02.xsd</value> <value>/web-inf/classes/schema/hl7v3/ne2008/multicacheschemas/mcci_in000002uv01.xsd</value> <value>/web-inf/classes/schema/hl7v3/ne2008/multicacheschemas/prpa_in201309uv02.xsd</value> <value>/web-inf/classes/schema/hl7v3/ne2008/multicacheschemas/p

ocaml - Check element in a list -

i have example: let l = [0;1;2] let l1 = [0;2] from list l check whether or not there element of l belong l1 ; if yes return list of pair, instance [(1,0); (1;2)] for this, should iterate through each element in l. check if first element of l element of l1. if is, filter out elements equal. length of list of equal elements first character in tuple go return list. let check_list l l1 = let rec check l l1 combined = match l |[] -> combined |(h::t) -> if (list.mem h l1) check t l1 ((list.length(list.filter (fun x -> h=x) l1),h)::combined) else check t l1 combined in check l l1 []

augmented reality - How do I use "AR API" of FI -Ware? -

i found little information on api augmented reality fi- ware . know of tutorial or example of how work ? there short summary of augmented reality ge available in fiware academy: https://edu.fiware.org/course/index.php

ajax - retrieve multiple data for jquery datatable -

i hava datatable returns 25 records @ clientside (out of 100 records). along 25 rows, want 1 array or data structure contains first column of 100 records my code: var otable = $('#tblclipart').datatable({ 'bstatesave': true, 'bprocessing': true, 'bserverside': true, 'aasorting': [[6, 'desc']], 'bfilter': false, 'idisplaylength': 25, 'spaginationtype': "bootstrap", 'sdom': 'rlfrtlip', 'aocolumns': [ // code ], 'sajaxsource': '/handlers/manage.ashx' // handler page providing data }); handler code list<clipartentity> clipartentitylist = null; clipartentitylist = //get data server - 100 records var result = new { itotalrecords = totalrecords, itotaldisplayrecords = totalrecords, //display first 25 /* clipartids = clipartentityli

svn - Delete a Subversion branch in Netbeans on MAC 10.8.5 -

i've created wrong branch in subversion repository. work netbeans 8.0.2 , subversion plugin on mac os 10.8.5. i don't want keep branch, how can delete ? according netbeans issue (bug 137072) netbeans not have repository browser. therefore, should use external subversion client task (i.e. not 1 built-in netbeans ide).

eclipse - GWT Designer. Does it work with later versions? -

i'm starting project in eclipse luna using gwt , gae. wanted ask if possible run gwt designer(to make ui graphically) in gwt sdk 2.6 version. uibinder works fine, mean xml way. when try make ui designer, instead of writing source code in xml, shows me well-known error swt browser , xulrunner. after reading , trying lot of things i've come conclusion can use eclipse 3.7 , gwt 2.1 or olders. right? there other option make ui technologies? (like in xcode or visual studio) gwt designer no longer maintained (in part because of swt browser issues). implies doesn't work gwt 2.7 (it didn't work 2.6.0, , 2.6.1 temporarily reintroduced code gwt designer needed, gwt designer never updated stopped working 2.7). because of that, wouldn't recommend trying make gwt designer work current setup, it's guaranteed fail whenever you'll update either eclipse or gwt. i'm not aware of other ui builder gwt. last, not least, according latest gwt survey , 6% u

Socrata SODA within polygon is too complex -

using socrata soda api within_polygon error thrown stating complex. https://www.dallasopendata.com/resource/x9pz-kdq9.json?$where=within_polygon(location,%20%27multipolygon%20(((-96.79920%2032.77946,-96.807768%2032.7751,-96.7999%2032.76999,-96.79920%2032.77946)))%27) { "code" : "query.execution.querytoocomplex", "error" : true, "message" : "only simple comparison filters allowed", "data" : { "reason" : "validation.complex-filter" } } here working version: https://data.cityofchicago.org/resource/yama-9had.json?$where=within_polygon(location,%20%27multipolygon%20(((-87.63742446899414%2041.871733907393164,-87.64720916748047%2041.8687938398043,-87.6540756225586%2041.86080384272637,-87.64214515686035%2041.85287677909342,-87.63467788696289%2041.859141797891915,-87.62866973876953%2041.86329682898112,-87.63038635253906%2041.86789900978502,-87.64317512512207%2041.86380819876315,-87.64326095

python - How do I test one variable against multiple values? -

i'm trying make function compare multiple variables integer , output string of 3 letters. wondering if there way translate python. say: x = 0 y = 1 z = 3 mylist = [] if x or y or z == 0 : mylist.append("c") elif x or y or z == 1 : mylist.append("d") elif x or y or z == 2 : mylist.append("e") elif x or y or z == 3 : mylist.append("f") which return list of ["c", "d", "f"] is possible? you misunderstand how boolean expressions work; don't work english sentence , guess talking same comparison names here. looking for: if x == 1 or y == 1 or z == 1: x , y otherwise evaluated on own ( false if 0 , true otherwise). you can shorten to: if 1 in (x, y, z): or better still: if 1 in {x, y, z}: using set take advantage of constant-cost membership test ( in takes fixed amount of time whatever left-hand operand is). when use or , python sees each side of operator s

cypher - Relationship count duplicating in neo4j -

Image
i trying resolve query since last 3 days. unable find proper solution. have asked question before. reduced query 1 number see whats problem. issue in end received 7 nodes 2 way relationships. means total 17 relationships 7 nodes. in graphical view 14 in count table relationships count 28. means doubles in count. more clarification attaching images , query. start n= node(2679) match p=(n)-[:calls]-(a),(n)-[:calls]-(b),(a)-[:calls]-(n)-[:calls]-(b) a,b,n,p optional match q=(a)-[:calls]-(b),(b)-[:calls]-(a) a,b,n,p,q return q; for same data when count relationships distinct clause while using query start n= node(2679) match p=(n)-[:calls]-(a),(n)-[:calls]-(b),(a)-[:calls]-(n)-[:calls]-(b) a,b,n,p optional match q=(a)-[:calls]-(b),(b)-[:calls]-(a) a,b,n,p,q return count (distinct p ) all_paths, count (distinct q) backyard_paths order given_numbers asc; i can not check each values data in millions. in advance does after? // find , of friends call match (me:node {

lotus notes - In Domino Designer I want an interactive commenting section -

in domino designer have form , want interactive commenting section putting onto it, blog on internet, go onto form sit on database. recommendations? don't want table, bit more interactive that. you use technique describing here: http://blog.texasswede.com/dynamic-tables-in-classic-notes/ just create button create new comment document , refresh main form. use in bunch of applications.

php - Laravel Post Form data -

i having trouble taking data form in laravel app, , displaying using method in same controller. this formcontroller class forumcontroller extends controller { + + private $name, + $description; + + public function __construct() { + $this->middleware('auth'); + } + + /** + * show form creating new resource. + * + * @return response + */ + public function create() + { + return view('forum.create'); + + $this->name = input::post('name'); + } + + /** + * show details of input once created + */ + public function created() + { + var_dump($this->name); + } +} this routes.php route::get('/group/create', 'forumcontroller@create'); +route::post('/group/create', 'forumcontroller@created'); this forum create view. @extends('app') + +@section('content') + + <div class="container"> + <h1&g

Unsafe characters for programming and MySQL queries/databases -

im limiting clients entering characters. right allow: all numbers all english letters - _ i not allow: ' " ; what other safe characters and/or unsafe characters exist when doing query via programming using textbox or such? the safest way work sql (mysql included) use parameterized queries. allow clients enter characters want , prevent sql injections. you didn't mention language working here's .net example working mysql: http://dev.mysql.com/doc/connector-net/en/connector-net-tutorials-parameters.html

Desire2Learn: Maximum length of ShortTitle parameter in creation of link topic -

in desire2learn valence api, when making call endpoint /d2l/api/le/[le api version]/[org unit id]/content/modules/[parent module id]/structure/ to create link topic, there shorttitle parameter, determines how item appear in d2l gradebook. there seems maximum length parameter, resulting in many items share initial text appear identically (and unhelpfully) in gradebook. maximum length , can configured? i'm not sure if there's upstream limit, @ database layer content shorttitle field limited length 50. (as schema item upper bound not configurable)

xilinx ise - Square Waveform Generation in VHDL -

i'm working on stopwatch project in vhdl don't know how make clk square waveform of counter? please help. here code: library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity circuit port ( clk : in std_logic := '0'; clr : in std_logic; q : out std_logic_vector (5 downto 0)); end circuit; architecture behavioral of circuit signal s: std_logic_vector := "000000"; begin process (clk, clr) begin if rising_edge(clk) if clr = '1' or s = "111011" s <= "000000"; else s <= s+1; end if; end if; end process; q <= s; end behavioral; let's clock 1 mhz, want seconds counter process work @ 1 hz. need divide incoming clock 1 million. constant clock_divider : integer := 1000000; signal clock_divide_counter : integer range 0 clock_divider-1 := 0; signal one_hz_pulse : std_logic := '0'; ... process (clk) begin if (rising_edge(clk)) if (

java - How is composed "public host key and certificates (K_S)" in SSH_MSG_KEX_DH_GEX_REPLY message? (SSH2 key exchange) -

i'm trying implement ssh2 key exchange in java, , having difficulties. rfc4419 states, that: the server responds with: byte ssh_msg_kex_dh_gex_reply string server public host key , certificates (k_s) mpint f string signature of h my question - how "server public host key , certificates (k_s)" should composed? can find information? i have host public , private key, , can read information needed example: /* read required variables public key. */ dsaparams pubkeydsaparams = ((dsapublickey) pair.getpublic()).getparams(); biginteger p = pubkeydsaparams.getp(); biginteger q = pubkeydsaparams.getq(); biginteger g = pubkeydsaparams.getg(); /* read private exponent private key. */ dsaprivatekey privkey = (dsaprivatekey) pair.getprivate(); biginteger x = privkey.getx(); found answer myself in rfc4253 : signatures encoded follows: string signature format identifier (as specified public key/certificate format) byte[

html5 - HTML 5 - Geolocation : position.coords.speed never come back to zero -

i'm using geolocation : navigator.geolocation.watchposition(successcallback, errorcallback, {maximumage:0,enablehighaccuracy:true}); var speed_convert = position.coords.speed; speed_convert = speed_convert * 3.6; speed_convert = math.round(speed_convert); when used application in car speed never come 0 km/h. there more parameters set ? thank you change this, navigator.geolocation.watchposition(successcallback, errorcallback, {maximumage:0,enablehighaccuracy:true}); to this, navigator.geolocation.watchposition(successcallback, errorcallback, {maximumage:0,enablehighaccuracy:true,timeout=1000}); and have life!

Java enum (or int constants) vs c enum -

i'm trying in c: typedef enum { http =80, telnet=23, smtp =25, ssh =22, gopher=70} tcpport; approach 1 here have in java, using enum : public static enum tcpport{ http(80), telnet(23), smtp(25), ssh(22), gopher(70); private static final hashmap<integer,tcpport> portsbynumber; static{ portsbynumber = new hashmap<integer,tcpport>(); for(tcpport port : tcpport.values()){ portsbynumber.put(port.getvalue(),port); } } private final int value; tcpport(int value){ this.value = value; } public int getvalue(){ return value; } public static tcpport getforvalue(int value){ return portsbynumber.get(value); } } approach 1 - problems i find having repeat pattern in various places, wondering: there better way? particularly because: this seems convoluted , less elegant, , it shifts compile time run time". one of