Posts

java - How to pass a many string different parse rule in ANTLR 4? -

i trying develop tool using antlr 4.0. new antlr , advance java. had downloaded package i.e antlr-4.2.2-complete.jar . antler working fine. have few doubts. i took basic grammar , give below: grammar test; start : (aa) | (bb); aa : c d; bb : c b; : 'a'; b : 'b'; c : 'c'; d : 'd'; ws : [ \t\r\n] ->skip; now using command prompt parse string in it.. c:\javalib\test>java org.antlr.v4.tool test.g4 c:\javalib\test>javac test*.java c:\javalib\test>java org.antlr.v4.runtime.misc.testrig test start -gui -tree **acb** ^z (start (bb c b)) string acb parsed , output obtained (start (bb c b)) . now, want know how can parse manystrings/ file in antlr. each line in file have different start rule. example , file have parse (input file) start : acb bb : acb aa : acd i can't take advice of changing grammar accordingly 1 start rule can used strings, because grammar on working vast. i can change format of input string, can parse in an...

jquery - Issue facing when trying to fix the navigation bar at the top when user scrolls the page -

i trying fix navigation bar @ top when user scrolls page. facing problem it. while doing found elements overlaps on i.e hides navigation bar , displays on it. say have nav bar of background-color blue , div somewhere down background color yellow. when scroll down div overlaps nav , hide blue color of nav bar , shows yellow color.. any regarding helpful. sounds want set position: absolute , z-index. without code cant give specific answer should in right direction

JavaScript: Splitting and joining dates in mm/dd/yyyy format -

i'm having bit of difficulty comparing 2 dates entered in mm/dd/yyyy format. have following code written try convert them yyyy-mm-dd format, , display error div if start date greater end date: for(i=0; i<=9; i++) { datefrom+i = document.getelementbyid('projdatefrom'+i).value; dateto+i = document.getelementbyid('projdateto+i').value; datefrom+i = datefrom+i.split("/").reverse().join("-"); dateto+i = dateto+i.split("/").reverse().join("-"); if(datefrom+i > dateto+i) { document.getelementbyid('dateerror').style.display = ''; return false; } when enter dates on form in mm/dd/yyyy format, , deliberately enter projdatefrom greater projdateto, nothing happens. missing? moment.js fantastic date tool: http://momentjs.com/docs/#/displaying/difference/ here's fiddle take date format, convert proper javascript object wrapped many convenient date methods. exa...

c - Better way to discard output from function tested by glib test -

if test functions glib's testharness, face ugly fact, output of functions i'm testign mixed output of glib's functions. code: #include <stdlib.h> #include <glib.h> #include <stdio.h> #include <fcntl.h> #include <unistd.h> void to_test(void) { printf("this function being tested"); } void test_to_test(void) { to_test(); } int main(int argc, char *argv[]) { g_test_init(&argc, &argv, null); g_test_add_func("/test", test_to_test); return g_test_run(); } generates: /test: function being testedok the solution found redirecting filedescriptors of standardout/-err /dev/null time function called , resetting them afterwards, like: void test_to_test(void) { int backup, new; new = open("/dev/null", o_wronly); backup = dup(stdout_fileno); dup2(new, stdout_fileno); to_test(); fflush(stdout); close(new); dup2(backup, stdout_fileno); } the output looks intended: /test: ok u...

oracle - How can I serve the collection to cursor parameter? -

please find rc1 in code. want return v_teminatkayit collection cursor. how can it? this not work; open rc1 select * table(cast(v_teminatkayit t_teminattip)); this not working? how can return collection cursor out parameter!?3 create or replace procedure krd_sel_gnakdiriskdetay_sp ( p_musterino in number default 0, rc1 in out sys_refcursor, rc2 in out sys_refcursor ) v_rcrteminat sys_refcursor; v_urunadi varchar2(80); v_risktutar number(26, 2); v_gnakdirisktoplam number(26, 2) := 0; v_kullandirimtarih date; v_vade date; v_muhatap varchar2(300); v_konu varchar2(600); type t_teminattip record( v_urunadi varchar2(80), v_mektupttr number(26, 2), v_mektuptar date, v_kkrvade date, v_muhatap varchar2(300), v_konu varchar2(600)); type t_t...

javascript - Developing a full public facing enterprise app with AngularJS -

good day all, working on public facing web app, work in progres, front-end 100% based on angularjs, uibootstrap, css, html. so, have user form-action invoking restful web service using $resource service , injecting json object different form control or html dom. also, things shopping checkout , basket crud operation done via service invocation using angularjs. but, getting concerned accessibility issues visually impaired, java scrip disabled browsers etc please, need practical ideas, challenges , solutions gurus , enthusiasts out there. post saw regarding dated , things have moved on in resolving accessibility issues ..... input . angular not work in javascript disabled environment. cannot worked around , if requirement not suggest using angular. however, can make web pages more screen reader friendly use of semantic aria enabled html. semantic html means layout dom in logical way. tables data. lists lists. forms in appropriate form tags. example: don't want use ...

vba - How to erase a multidimensional variant array holding objects and numbers -

i have following array want erase, or @ least clear: dim arrfiles() variant the array has 2 columns, lngindex , objfile. i remember reading somewhere erase works in conditions. erase work on type? also, what's best way amount of memory used array? thanks dim arrfiles() variant indicates dynamic array it's not declared dimensions erase free memory using, e.g. attempting retrieve dimensions error. as size, array of variant each number 16 bytes , each string 22 bytes + lenb(thestring) if concerned size, don't use variants; mix strong types in array structure use array of user defined type allow typearray(i).index / .file