Posts

c# - Code to be working in code a and b -

this regex code v>fant <strong>(.+?) treff</strong> på ditt søk< works code a <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\"><tr><td><div id=\"boxhit\"><div> <div>fant <strong>12 treff</strong> på ditt søk</div></div></div></td></tr></table></div> but not code b <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\"><tr><td><div id=\"boxhit\"><div> <div>fant <strong>1 162 treff</strong>, viser de 100 første</div></div></div></td></tr></table></div> i don't know part need add in order change in order regex code working code , b. use http://regexstorm.net/tester in order test code. you use v>fant <strong>(.+?) tre...

Error when reassigning the ESC key in isearch-mode of Emacs -

i follow instruction of god-mode in emacs reassign esc key isearch-mode-map , god-mode-isearch-map encounter following error error: key sequence <escape> <tab> starts non-prefix key <escape> the relevant code in emacs init file is: (require 'god-mode-isearch) (define-key isearch-mode-map (kbd "<escape>") 'god-mode-isearch-activate) (define-key god-mode-isearch-map (kbd "<escape>") 'god-mode-isearch-disable) the problem comes second line (define-key isearch-mode-map (kbd "<escape>") 'god-mode-isearch-activate) . if line commented out, no error reported, cannot reassign <escape> key of isearch-mode i did try google un-set <escape> key haven't been able resolve it. is there know how fix it? thanks taking time @ question!

Pivot multiple input parameter in SQL server?How to reduce query running time -

below query have writing daily inventory-sale each shop in have 2millon row data month have more 250 shop!! take longer expected !! alter procedure [dbo].[getdaily] --declare @date1 date = '2015-06-01' ,@date2 date = '2015-06-30' ,@storeno nvarchar(max)=' , s.storeno in (61,63,450,451)' begin if object_id(n'tempdb..#calender') not null drop table #calender if object_id(n'tempdb..##temp') not null drop table ##temp if object_id(n'tempdb..##inv1') not null drop table ##inv1 if object_id(n'tempdb..##inv2') not null drop table ##inv2 if object_id(n'tempdb..#stock') not null drop table #stock if object_id(n'tempdb..##storelist') not null drop table ##storelist if object_id(n'tempdb..##final') not null drop table ##final if o...

Netbeans curly braces formatting -

when declaring new method in netbeans, follows: $cursor used mark position of cursor public void inc(){$cursor} then hit enter, output follows: public void inc(){ $cursor} what want follows: public void inc(){ $cursor } how can achieve result in netbeans? i this: public void inc(){$cursor then hit enter. in short: don't type out second curly brace, it's generated line break.

c - Convert an int** array into a char** array of a different size / composition -

i'm trying convert int** array looks below, char** array made number of rows , comma seperated. 1 2 3 4 5 6 7 8 9 3 2 1 an example of char** array represented [['1','1','2','3','4'], ['2','5','6','7','8'] , ['3','9','3','2','1']] every 0'th index represented row number. i'm not sure how able achieve this, there known methods converting int** this? thanks. i think needed string, not 2d-array. can written out string write standard output implementing string simple extension. #include <stdio.h> #include <stdlib.h> #include <string.h> typedef struct char_vec { char *v; size_t capacity; size_t used; } sstream; sstream *ss_new(void); void ss_free(sstream *ss); void ss_putc(sstream *ss, char ch); void ss_puts(sstream *ss, char *str); int main(void){ int rows = 3; int cols = 4; int **array = malloc(r...

Regex is matching quotes when I do not want it to -

here link demo http://www.regexplanet.com/cookbook/ahjzfnjlz2v4cgxhbmv0lwhyzhnydwssbljly2lwzrjrstamda/index.html select java 1 , @ input. can supply arguments either within quotation marks or without. however, when regex captures groups, don't want capture quotes arguments enclosed within quotes. it's confusing because quotes out of brackets don't know why they're being captured. how can fix this? edit: to clarify, want output this: hello-world hi \" \\ sparta if don't want double quotes caught need avoid matching them using zero-width assertions - lookarounds: (?<=")(?!\s+")(?:[^\\"]+|\\")+(?=")|[^"\s]+ live demo

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -

i'm trying read json file local machine. @path("/") public class jsonparsing { file f = new file("file.json"); if (f.exists()){ inputstream = new fileinputstream("file.json"); string jsontxt = ioutils.tostring(is); system.out.println(jsontxt); jsonobject json = new jsonobject(jsontxt); string = json.getstring("1000"); system.out.println(a); } } but i'm getting error in tostring() method. possible read .txt file containing json object local machine? if possible, how done? firstly: whenever ask question- add imports well. secondly: yes possible read .txt file containing json object. steps: 1. add maven dependency in pom.xml - <dependency> <groupid>com.googlecode.json-simple</groupid> <artifactid>json-simple</artifactid> <version>1.1.1</version> </dependency> or add jar of dependency. 2.import...