Posts

dsl - Is it possible to build JetBrans MPS editor into my program? -

they have tool design dsls: https://www.jetbrains.com/mps/ is possible embed editor there program? or purpose use during development (to compile dsl)? in principal, since mps editor java swing application, embedded, however, current wiring makes not trivial process. off beaten path. the preferred way create single-purpose ides around dsls build standalone ide, leverages intellij platform , bundles desired dsls - https://confluence.jetbrains.com/display/mpsd34/building+standalone+ides+for+your+languages

Some regex pattern is breaking the javascript regex engine -

i wrote following regex: /\d(?!.*\d)|^-?|\d+/g i think should work way: \d(?!.*\d) # match last non-digit | # or ^-? # match start of string optional literal '-' character | # or \d+ # match digits but, doesn't: var arrtest = '12,345,678.90'.match(/\d(?!.*\d)|^-?|\d+/g); console.log(arrtest); var test = arrtest.join('').replace(/[^\d-]/, '.'); console.log(test); however, when playing pcre(php) -flavour online @ regex101 . works described. i don't know if think should work 1 way doesn't work. or if there pattern not allowed in javascript regex-flavour. js works differently pcre. point js regex engine not handle zero-length matches well, index manually incremented , next character after zero-length match skipped. ^-? can match empty string, , matches 12,345,678.90 start, skipping 1 . if have @ string#match documentation , see each call match global reg...

javascript - How to unsubscribe from event handler in SignalR hub proxy? -

i working javascript signalr client. open hub connection like: hubconnection = $.hubconnection(url); proxy= hubconnection.createhubproxy('somehub'); when want subscribe hub event: proxy.on("someevent", function(somedata){ console.log(somedata); }); how unsubscribe listening hub event? tried proxy.off("someevent"); doesn't work. use off method: var mycallback = function(somedata) { console.log(somedata); } proxy.on("someevent", mycallback); proxy.off("someevent", mycallback);

sharepoint online - Micorosft Graph Group API get file previous versions -

is possible previous versions of file microsoft graph api. upload file group multiple times (version history shown in sharepoint online library going contextmenu - version history). cannot find in graph api documentation. for example file found at: https://graph.microsoft.com/v1.0/groups/{group-id}/drive/items/{file-id} . data present there, alongisde download url sharepoint site, version history found. is possible? or need use sharepoint csom or that?

pandas - Python: how to iterate over dataframes while using their name as a string? -

i have 3 different pandas dataframes df_1 df_2 df_3 i loop on dataframes, computations, , store output using name of dataframe. in other words, this for my_df in [df_1, df_2, df_3]: my_df.reset_index(inplace=true) my_df.to_csv('mypath/' + my_df +'.csv') output files expected: 'mypath/df_1.csv' , 'mypath/df_2.csv' , 'mypath/df_3.csv' i struggling doing because df_1 object, , not string. ideas how that? thanks! another more general solution create dict column names , loop items() : d = {'df_1':df_1,'df_2':df_3, 'df_3':df_3} k, my_df in d.items(): my_df.reset_index(inplace=true) my_df.to_csv('mypath/' + k +'.csv') another possible solution use list dataframes names, enumerate , value of name position: names = ['a','b','c'] print ({names[i]: df i, df in enumerate([df_1, df_2, df_3])})

regex - Regular Expression for Digits and Special Characters - C# -

i use html-agility-pack extract information websites. in process data in form of string , use data in program. sometimes data includes multiple details in single string . name of movie "dog eats dog (2012) (2012)" . name should have been "dog eats dog (2012)" rather first one. above 1 example many. in order correct issue tried use string.distinct() method remove duplicate characters in string in above example return "dog eats (2012)" . solved initial problem removing 2nd (2012) created new 1 changing actual title. i thought problem solved regex have no idea how can use here. far know if use regex tell me there duplicate items in string according defined regex code. but how remove it? there can string "meme 2013 (2013) (2013)". actual title "meme 2013" year (2013) , duplicate year (2013). if bool value indicating string has duplicate year, cant think of method remove duplicate substring . the duplicate year com...

collect2: error: ld returned 1 exit status in c++ -

this question has answer here: compiling c++ program gcc 7 answers i have switched elementary os , installed sublime text editor. wrote basic hello world program in c++ check working. , error. /tmp/cc3pmvft.o: in function `main': source.cpp:(.text+0xa): undefined reference `std::cout' source.cpp:(.text+0xf): undefined reference `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)' source.cpp:(.text+0x14): undefined reference `std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&)' source.cpp:(.text+0x1c): undefined reference `std::ostream::operator<<(std::ost...