Posts

Showing posts from June, 2015

java - Grails app terminates after giving exception -

this strange application stops working after sometime , throws error. below details same. any worth os : ubuntu0.14.04.1 java version : open jdk 7 grails version : 2.4.5 application type : rest application error / exception missing exception handler pc 0x00007fa0613a429c , handler bci -1 exception: java.lang.stackoverflowerror - klass: 'java/lang/stackoverflowerror' compiled exception table : exceptionhandlertable (size = 288 bytes) catch_pco = 344 (1 entries) bci -1 @ scope depth 0 -> pco 1329 catch_pco = 516 (1 entries) bci -1 @ scope depth 0 -> pco 1523 catch_pco = 532 (1 entries) bci -1 @ scope depth 0 -> pco 1528 catch_pco = 868 (1 entries) bci -1 @ scope depth 0 -> pco 1533 catch_pco = 920 (1 entries) bci -1 @ scope depth 0 -> pco 1535 catch_pco = 944 (1 entries) bci -1 @ scope depth 0 -> pco 1537 catch_pco = 1160 (1 entries) bci -1 @ scope depth 0 -> pco 1465 catch_pco = 1188 (1 entries) bci -1 @ scope dept

javascript - Getting error while updateing the document using mongoDB and node.js -

i getting following error while updating document using mongodb , node.js. error: typeerror: db.profile.updateone not function @ exports.updateprofile (c:\xampp\htdocs\cit_node\route\route.js:101:13) @ layer.handle [as handle_request] (c:\xampp\htdocs\cit_node\node_modules\e xpress\lib\router\layer.js:95:5) @ next (c:\xampp\htdocs\cit_node\node_modules\express\lib\router\route.js:1 31:13) @ route.dispatch (c:\xampp\htdocs\cit_node\node_modules\express\lib\router\ route.js:112:3) @ layer.handle [as handle_request] (c:\xampp\htdocs\cit_node\node_modules\e xpress\lib\router\layer.js:95:5) @ c:\xampp\htdocs\cit_node\node_modules\express\lib\router\index.js:277:22 @ function.process_params (c:\xampp\htdocs\cit_node\node_modules\express\li b\router\index.js:330:12) @ next (c:\xampp\htdocs\cit_node\node_modules\express\lib\router\index.js:2 71:10) @ immediate.<anonymous> (c:\xampp\htdocs\cit_node\node_modules\express-sess ion\index.js:433:7)

Java how to transform functional code into methods -

something awesome object oriented programs can make efficient , quick programming, did not learn how use it. far know basics of how construct programs in script style fashion, never use methods/objects, question how convert code use methods, can learn how this, googled how, watched videos on how still dont understand, need real world examples. here's script style code: string[] studentroster = { "1,john,smith,john1989@gmail.com,20,88,79,59", "2,suzan,erickson,erickson_1990@gmailcom,19,91,72,85", "3,jack,napoli,the_lawyer99yahoo.com,19,85,84,87", "4,erin,black,erin.black@comcast.net,22,91,98,82", "5,adan,ramirez,networkturtle66@gmail.com,24,100,100,100" }; (int k = 0; k < studentroster.length; k++) { string s2 = studentroster[k]; string [] parts2 = s2.split(","); string email2 = parts2[3]; string

c++ - Are my variables global? -

hello i've been working on homework , due homework rules im not allowed use global variables. i've made research global variables couldnt realy understand if variables global or local. variables defined in constructor inside class. how header looks like: #include <string> using namespace std; class team{ public: string tcolor; string tname; }; class player{ public: string ppos; string pname; }; class socreg { private: team *teams;// these variables im not sure of player *players;// these variables im not sure of int playernum, teamnum; // these variables im not sure of public: socreg(); ~socreg(); void addteam( string teamname, string color ); void removeteam( string teamname ); void addplayer( string teamname, string playername, string playerposition ); void removeplayer( string teamname, string playername ); void displayallteams();

javascript - Does Firefox 41 have a bug when formatting `new Intl.NumberFormat("es-ES").format(3500)` as `3 500`? -

when trying become familiar support of number formatting in different browsers found firefox 41 formats new intl.numberformat("es-es").format(3500) 3 500 (with space group separator) while ie 11, edge , google chrome give me 3.500 (with dot . group separator). i wondering, bug in firefox? or number format allowed in spanish in spain ambiguous? var d1 = 3500; var eses = new intl.numberformat("es-es"); var formattednumber = eses.format(d1); document.body.insertadjacenthtml('beforeend', '<p>formatted number ' + d1 + ' numberformat ' + eses.resolvedoptions().locale + ' ' + formattednumber + '<\/p>'); i have tried firefox nightly , returns 3.500 instead of 3 500 . searched bugzilla , looks there have been various bug reports related number formatting locale "es-es", https://bugzilla.mozilla.org/show_bug.cgi?id=1013091 , https://bugzilla.mozilla.org/show_bug.cgi?id=1078154 h

xpages - Want to create an column in Dynamic View Panel that displays "Favorites" icon -

i using dynamic view panel , create "favorites" column in view. underlying view has "favorites" multivalue names field contains users have flagged document favorite. handle conversion in "customizer" bean can compare current user stored vales in "favorites" column , see if in list. if present "green star" icon (not standard notes icon) else present empty star icon. make star icon live if click on star toggle favorite value in database on/off. how implement such feature? what dominoviewcustomizer methods need override? (looking @ aftercreatecolumn) how , set column values? (really lost here) how column display notes resource image (my stars) or need store in directory on server? how make star icon clickable? how capture click event? using domino v9.0.1 if don't have use dynamic view panel here's way of doing work view panel, repeat, or data table... use "favorites" document each user. have con

php - Transform simple array in hierarchy array -

i'm looping trough below array has multiple entries. in example have 3 elements each element have 3 values inside. [0] ['name'] => 'aaa' ['id'] => 38679 ['parent-id'] => 0 [1] ['name'] => 'bbb' ['id'] => 38830 ['parent-id'] => 38679 [2] ['name'] => 'ccc' ['id'] => 38680 ['parent-id'] => 38830 so, looping trough array, need construct 1 in format (the idea construct hierarchy): [0] [38679] => 'aaa' [38830] => 'bbb' [38680] => 'ccc' maybe there's way this. suggestion great. one of possible solutions use recursive function: $test = [ 0 => [ 'name' => 'aaa', 'id' => 38679, 'parent-id' => 0 ], 1 => [ 'name' => 'bbb', 'id' =>

php - AngularJS $resource can't deserialized array into an object -

i'm working php tonic , angularjs. have angular call rest resource. code of rest this: /** * @method */ public function getdata(){ $response = new response(); $response->code = response::ok; $response->body = array("one","two"); return $response; } on backend, code return response object array in body. angular use $resource service call backend: return { getbackdata : function(){ var call = $resource('/table_animation_back/comunication'); call.get(function(data){ console.log(data); }); } } the result of console.log this: resource {0: "a", 1: "r", 2: "r", 3: "a", 4: "y", $promise: d, $resolved: true}0: "a"1: "r"2: "r"3: "a"4: "y"$promise: d$resolved: true__proto__: resource i tried use: call.query(function(){...}) but response in php object , not array, in way got j

marklogic - Count of facet and search differs from search result -

when there character underscore(_) , % in search string, results count , facets count not match search results. i got 1 search result correct result count , facet count come more that. using search:parse , passing structured cts:query parameter. what may issue , it's resolution, please suggest. your search results being filtered, while other values not. when using search api, default behavior filter search results. means first gets candidate result set using indexes, , checks , removes false positives. facets , total result count can calculated using indexes, therefore never filtered. there couple ways handle this. easiest specify option <search-option>unfiltered</search-option> , , run queries unfiltered. however, means inaccuracies in facet , result counts reflected in search results. the accurate way configure indexes , queries such correct results can returned using indexes. may take trial , error. generally, want sure use searchable-expression

android - Encoding not correct with Volley JsonObjectRequest API - UTF-8 -

i have problem between api (nodejs) , android client encoding. android volley request: jsonobjectrequest jsobjrequest = new jsonobjectrequest(request.method.get, tmpurl, null, new response.listener<jsonobject>() { @override public void onresponse(jsonobject response) { log.e("test", "" + response.tostring()); } }, new response.errorlistener() { @override public void onerrorresponse(volleyerror error) { error.printstacktrace(); } } ); queue.add(jsobjrequest); header of request: content-type → application/json; charset=utf-8 test log: test: {"announces":[{"_id":"56360bca8c9356a3289788aa","title":"marché", .... normal title sho

What does ; random string ; represent in C -

this question has answer here: why no semicolon gives errors many of them don't? 5 answers semicolon stands termination of statement in c, allows code ; " int random string " ; to compile without warnings , causes trouble in ; int random string ; which rules involved here ? the 2 semicolons ;; represent empty statement. this construction ; " int random string " ; represents expression statement has no effect. this construction is ; int random string ; is invalid. as for -statement construction this for( ;; ) { /*...*/ } means 3 expressions omitted , condition implied equal true . infinite loop can interrupted using jump statement in body (statement).

c++ - Convert malloc to new -

how write following code using new operator? please explain in detail. in advance. #include<alloc> #define maxrow 3 #define maxcol 5 using namespace std; int main() { int (*p)[maxcol]; p = (int(*)[maxcol])malloc(maxrow*sizeof(*p)); } quite simply, answer question literally: p = new int[maxrow][maxcol]; this allocates 2d array (maxrow maxcol) on free store and, usual new , returns int(*)[maxcol] - same type decaying 2d array. don't forget delete[] p; . the last part brings importance of std::vector . presumably, know size of second dimension @ compile-time. therefore, std::vector<std::array<int, maxcol>> work added bonus of not requiring delete[] statement, plus knows size (maxrow). please use if @ possible. in fact, in example, both dimensions known @ compile-time, meaning std::array<std::array<int, maxcol>, maxrow> work here. that's typically preferable dynamic allocation. if neither dimension known @ compile

nullpointerexception - Strange null pointer exception after in-app purchase successful (Android) -

i've written app in app billing (iab). seems work fine, except 1 thing. if instigate purchase, google play iab purchase appears , purchase item fine, purchase complete window appears, , disappears fine. however, main app doesn't seem start animating again , after few seconds, app crashes. logcat output says null pointer exception (related own coding - nothing android specific) try { bundle buyintentbundle = mservice.getbuyintent(3, mactivity.getpackagename(), (string)args[1], "inapp", "bgoa+v7g/yqdxvkrqq+jtfn4uqzbpiqjo4pf9rzj"); if(buyintentbundle.getint("response_code") == billing_response_result_ok) { pendingintent pendingintent = buyintentbundle.getparcelable("buy_intent"); try { mactivity.startintentsenderforresult(pendingintent.getintentsender(), 1001, new intent(), integer.va

html - Real time agenda with javascript and json -

i have div on website needs real time agenda list of events. have events loaded through json file , using javascript populate div data file. the problem data displays stacked item item in 1 column within div, need split div 3 separate columns/divs. 1 events happening now, next, , coming soon. ex) 1 event @ 7am, next 7:30, , coming 8am. but not able select each item , move using css since code populates 1 item upon page load , cannot see index each item (video side content item) on , on display events necessary. this lot easier if format items being populated 3 separate columns through css, can't figure out how this. by way site written using flexbox, hence why there "row" in 1 of divs. also can please point in right direction how real time? or other helpful solution achieve this? thanks in advance help. picture of i'm trying do function populate data function agendarealtimeupdate() { if ($('.real-time-agenda').length !== 0) {

javascript - Using variables from previous ASP page -

on first page have array defined as: dim selection selection = array("name", "city") on following asp page i'd call same variables i'm having hard time figuring out how. has been basic structure attempt different solutions not work, results blank because don't think i'm calling variables correctly: dim userselect userselect = request.form("selection(0)") dim cityselect cityselect = request.form("selection(1)") if can in vbs great, if can in javascript, awesome, i'm not sure start , appreciate help. you have options, or put values inside html form on first page , post second page , request.form values; or call second page , pass values caller name (ex. page2.asp?varname=varvalue ), request.querystring these values on second page; or use session variables. ex.: session("varname")=varvalue on second page way session("varname") . example: response.write(session("varname

Rails slow view rendering -

does console output normal? 16:10:01 rails.1 | started "/" 10.0.2.2 @ 2015-11-01 16:10:01 +0000 16:10:02 rails.1 | processing pagescontroller#home html 16:10:02 rails.1 | (1.5ms) select count( ) "parks" 16:10:02 rails.1 | (1.0ms) select count( ) "trains" "trains"."superseded_at" null 16:10:02 rails.1 | train load (10.9ms) select "trains".* "trains" order "trains"."train_sort" asc 16:10:02 rails.1 | cycle load (26.6ms) select "cycles".* "cycles" "cycles"."train_id" in (22147, 21958, 22055, 22059, 22356, 22045, 22001, 22072, 21836, 22000, 21800, 22042, 22373, 21818, 22024, 22364, 22365, 22168, 21863, 22242, 22054, 22060, 21899, 22392, 22117, 21920, 21822, 22354, 22401, 21931, 21826, 21834, 22306, 21970, 21980, 21791, 21790, 21961, 22037, 21955, 21985, 22191, 22391, 21870, 22004, 22180, 22164, 22383, 22405, 22161, 22169, 22254, 21812, 22031,

symfony - How to read logs from Monolog in my application? -

my symfony application runs calculations based on user's request. i'd send them email response. i have created custom channel , handler in config.yml : # config.yml # ... monolog: handlers: buildbot: level: info type: stream channels: [buildbot] now write logs various services: <?php // appbundle/services/buildbot.php $this->buildlogger->info('fabricating robot shell'); in service want email requestor log lines "buildbot" monolog channel. how can read log lines? from design perspective don’t think symfony’s logger right tool use task. in opinion logger meant log information application’s activities may or may not useful developer (or other kinds of administrators). whereas in use case log meant end user , doesn’t contain application-level information request-level information. separate that. my personal approach create simple service (that might implement logger interfa

how to apply colour to a single barplot in R? -

Image
this barchart i want show "2014" plot in pink colour.i tried using >barplot(seq(1:12), col=topo.colors(12)) all plots coloured,i want "2014" plot coloured in pink & remaining plots should remain same color.please guide me package too.

open another activity when got a result "success" from php webservice But doesn't work, android -

i have used php webservice matching login credentials if true pass "success", if false pass "failure". and in java code, matching result data , apply condition when open activity , when show toast wrong credentials. but when put either wrong or right credentials open activity. never show toast so please me , should ? my code @override protected void onpostexecute(string result) { string str = result.trim(); if(str=="success") { startactivity(new intent(login.this,mainactivity.class)); } else{ toast.maketext(login.this, "either username or password not correct", toast.length_short).show(); } dialog.dismiss(); } my php code $sql = "select * master_login_tbl user_id = '$user' or email='$user' , password = '$pass' "; $result = mysql_query($sql); $check = mysql_fetch_array($result); $num_of_rows = mysql_num_rows($result)

loops - How to iterate keyframe percentages Less CSS -

i have read less#loops , less#functions docs. can't figure out how apply percentage function, or similar way loop percentages progressively without using such function. when calculate it, out of loop, pointed out in post width: percentage(140/620); , works, not when trying loop using variables. on 2014 @pixelass suggested use external library loop easier, don't feel using external library. what trying loop (and doesn't compile): .loop (@n, @index: 0) when (@index < @n) { percentage(@index * (100/@n)){ // line messing day. // code } .loop(@n, (@index + 1)); // next iteration. } @keyframes anim { .loop(20); // launch loop. } i trying translate sass less: @keyframes anim{ $steps:20; @for $i 0 through $steps{ #{percentage($i*(1/$steps))}{ // code } } } it seems less compiler not evaluate functions when directly used selector. solution make use of temporary variable in ei

javascript - Click on all 'a' elements in paragraph with specific class in CasperJS -

i have following problem. have structure of html code: <p class="description"> lorem ipsum, bla bla bla <a href="# onclick="somemethod(id)">click</a> </p> <p class="description"> lorem ipsum, bla bla bla </p> <p class="description"> lorem ipsum, bla bla bla <a href="# onclick="somemethod(id)">click</a> </p> now need click via casperjs on every "a" in paragraphs class 'description'. i try this: while (selector = document.queryselector('p.description a')) { casper.then(function () { this.click(selector); console.log('click'); }) } but doesn't work. are there possibilities how this? you have 2 problems. you cannot use document , casper @ same time, because document available inside of page context ( casper.evaluate() ), casper not available in page context.

Android google play games select activity to launch when clicked on notification -

is there way select activity launch when press on game services notification? brings me main activity, though have registered notificationlistener in activity. there intent extra/bundle have for? or else? edit: through question thread here on stackoverflow found out every intent launched google play games notification contains flag 0x14000000 . ok check flag , redirect user actual multiplayer activity?

.net - How to automate Outlook? -

i'm trying send e-mail our erp system. tried using smtp works internal mail , fails external mail complaining unable relay or something. think manager either doesn't want or know how configure exchange properly. so boss told me use outlook. problem code works fine in debug fails if outlook open, in every case. did work modifying vendors installation, prefer not that. using intuitive erp 8.5. stores library files in standard folder , there custom folder custom code or inherited vendor objects. program files\intuitiveerp.exe program files\intuitiveerp\custom program files\intuitiveerp\standard if put program directory on root of c: , combine standard , custom folders code works whether outlook open or closed. prefer not modify vendor's installation because if may cause problems updates. 'fails cannot create activex component. objoutlook = ctype(createobject("outlook.application"), outlook.application) 'fails retrieving com class factory co

encryption - Python code returning error 'Object is not callable' -

so, have started playing around encryption coding , have been trying create unique encryption key based time. code far : from threading import timer pyclbr import function import hashlib, binascii, time key1="" buffer1="" buffer2="" class repeatedtimer(object): def __init__(self, interval, function, *args, **kwargs): self.timer=none self.function=function self.interval=interval self.args=args self.kwargs=kwargs self.is_running=false self.start() def _run(self): self.is_running=false self.start() self.function(*self.args,**self.kwargs) def start(self): if not self.is_running: self.timer=timer(self.interval,self._run) self.timer.start() self.is_running=true def stop(self): self.timer.cancel() self.is_running=false def generatekeys(): global key1 global buffer1 global buffer2 t

javascript - div keeps moving when div next to it is removed -

i'm making windows 8 metro styled website , when click 1 of squares bounces jquery .slideup(). when slid up, square next jumps in it's place, not want. $(document).ready(function() { $(".blok").click(function() { $(this).slideup(1200, "easeoutbounce"); }); }); html, body { margin: 0; padding: 0; width: 100%; height: 100%; } .menu { height: 8%; box-sizing: border-box; display: flex; align-items: center; justify-content: center; color: white; background-color: #363636; font-family: "raleway", sans-serif; font-size: 50px; } .inhoud { height: 84%; width: 100%; } .blok { background-color: #ec1d25; display: flex; float: left; overflow: auto; align-items: center; justify-content: center; box-sizing: border-box; color: white; text-align: center; font-size: 36px; font-family: "raleway", sans-serif; } #blokgroot { height: 100%; width

c# - How to Use One EF DataContract and 2 WCF Services in the Same Application -

i'm having horrible time trying work. have multiple - identical - wcf services using ef installed on different servers. each of them access different database on different instances of sql server. i'm trying create method will allow me connect instance1.mydatabase , instance2.mydatabase @ same time. i can create 1 endpoint address in app.config because there 1 contract ef data. here endpoint in app.config <endpoint address="http://server01/dataservice/data.svc" binding="basichttpbinding" contract="query.ipsidata" bindingconfiguration="wcfhttpbinding" behaviorconfiguration="wcfhttpbehavior" /> when creating data context object entity framework object, have tried using 2 different uris. context1 = new deventities(service1uri) context2 = new deventities(service2uri) what happens context1 returns data , context2, while creating , querying without error, not returning records. have tr

caching - How to store two different cache "tables" in Redis under the same database/index? -

trying build data set of 2 cache tables (which stored in sql server) - 1 actual cache table (cachetbl); other staging table (cachetbl_staging). the table structure has 2 columns - "key", "value" so i'm wondering how implement in redis i'm total noob nosql stuff. should use set or list? or else? thank in advance! you need decide whether want separate redis keys entries using set , get, or put them hashes hset , hget. if use first approach, keys should include prefix distinguish between main , staging. if use hashes, not necessary, because hash name can used distinguish these. need decide how want check cache validity, , cache flushing strategy should be. requires additional data structures in redis.

matlab - exponential curve fitting with 3 coefficients -

i have data (two same size vectors x , y) , fit exponential function f(x)=a+(b-a)*exp(-c*x) data matlab. goal find coefficients a, b , c. i found fit(x,y,'exp2') , fit(x,y,'exp1','startpoint',[x0,y0]) in matlab manual little different looking for. you can fit using custom equation : f = fit(x, y, 'a+(b-a)*exp(-c*x)')

javascript - calling jquery function from a link after adding link using jquery -

i trying call jquery function after add using jquery. here code (this in document.ready): $("#addrow").on("click",function() { alert("made it"); //$('#moduletable tr:last').after('<tr class="child"'+table_length+'><td>info</td><td></td><td></td></tr>'); table_length += 1; }); $("input[name='module_type']").change(function(){ var content = ""; //content += '<a href="javascript:void(0);" id="addrow">add row</a>'; content += '<br><br>'; content += '<table id="moduletable" style="width:100%">'; content += '<tbody>'; content += '<tr>'; content += '<td align="center">question</td><td align="center">header</td><td align="cente

java - Sudden shutdown with IllegalStateException without doing anything -

after 26 minutes leaving app running without doing user, "app has stopped" window pop , logcat prints this: 07-15 20:34:16.595 27361-27363/test.game d/dalvikvm: gc_concurrent freed 1419k, 44% free 13902k/24391k, paused 4ms+9ms, total 66ms 07-15 20:34:28.997 27361-27363/test.game d/dalvikvm: gc_concurrent freed 1416k, 43% free 13903k/24391k, paused 3ms+7ms, total 56ms 07-15 20:34:29.418 27361-27361/test.game d/androidruntime: shutting down vm 07-15 20:34:29.418 27361-27361/test.game w/dalvikvm: threadid=1: thread exiting uncaught exception (group=0x412b52a0) 07-15 20:34:29.498 27361-27361/test.game e/androidruntime: fatal exception: main java.lang.illegalstateexception: onmeasure() did not set measured dimension calling setmeasureddimension() @ android.view.view.measure(view.java:15293)

joomla3.0 - Joomla Content builder short codes appearing on webpage -

Image
my website has been attached malware , trying reinstate website doing fresh install. have set localhost ensure installation working before migrating host server. have done necessary installations can think of , running php v 5.6, mysql, , joomla 3.5, sppagebuilder free v 1.3., shaper_qubic - default template. set displays webpages alright sp bulder codes in front end pages. not cool , have reinstalled , updated every plug in problem doesnt go away. here screen shot of facing. i have no idea else , have exhausted search materials solution. my problem above led me sp page builder section of joomla found ugly look. seems query sp_page builder hits snag cant think far root cause , how fix it. thought database culprit checked database section joomla , seems pretty okay per screen shot below. i kindly awesome, helpful, big heart, gurus here me figure out. thanks inputs. my sincere amit , extending hand. have followed answer , here updates. thing, error message on sp_page

javascript - Specific start and end 'x' coordinates for a Draggable div inside a parent div with overflow:hidden -

Image
i'm having trouble trying create formula universal within responsive website. using bootstrap. specifically, have "timeline" div inside border div. have draggable. trying make stop dragging when reaches specific point on either side of timeline. see here: draggable timeline dragging timeline right towards first year no problem. have working. stops dragging supposed to. however, dragging timeline left towards last year, stops dragging in different spot depending on window size. when think have working @ 1 window size, resize window , off. in images below, end result trying achieve. timeline should have 15px margin on either end. the start position: (working) the end position (not working) the timeline dynamically generated javascript. problem keep @ 5000.4px in width. this html: <div id="timeline-border" class="timeline-border"> <div id="timeline" class="timeline"> </div><

swift - Compare two dates for Countdown Timer Swift2 -

i'm querying createdat column parse. my parse methods above code , i'm doing this: var createdat = object.createdat if createdat != nil { let twentyfourhours = nstimeinterval(60 * 60 * 24) self.expiresat = nsdate(timeinterval: twentyfourhours, sincedate: (createdat!!)) } i querying many dates parse. however, i'm unable store them in createdat because createdat of type nsdate? . i need make array, can't figure out how store many nsdate values can compare them. how can store values i'm querying , put them array can compare many createdat dates nstimeinterval method using method: nsdate(timeinterval: twentyfourhours, sincedate: (createdat!!)) ? am using correct function? thanks in advance. i guess easiest way store data double let date = nsdate().timeintervalsince1970 let doubledate = double(date) create array, store , easy compare. when query it, do: var date = nsdate(timeintervalsince1970: double(datedouble)) exempl

java - Regex Sentence Split -

i'm trying split string "sentences" i'm having issue trailing words. example: "this isn't cool. doesn't work. this" should split [this cool., doesn't work., this] so far i've been using "[^\\.!?]*[\\.\\s!?]+" can't figure out how adjust trailing word since there no terminating character , nothing for. there can add or need adjust completely? instead of splitting string can find sentences , matching trailing sentence can use anchor $ match end of string: list<string> sentences = new arraylist<string>(); matcher m = pattern.compile("[^?!.]+(?:[.?!]|$)") .matcher("this isn't cool. doesn't work. this"); while (m.find()) { sentences.add(m.group()); }

django.core.exceptions.FieldError: Unknown field(s) (is_admin) specified for freelancer -

models.py class myusermanager(baseusermanager): def create_user(self, name, skills, password=none): if not name: raise valueerror('users must have unique name ') user = self.model( name=self.name, skills=skills, ) user.set_password(password) user.save(using=self._db) return user def create_superuser(self, name, skills, password): """ creates , saves superuser given email, date of birth , password. """ user = self.create_user( name, password=password, skills=skills, ) user.is_admin = true user.save(using=self._db) return user class freelancer(abstractbaseuser, permissionsmixin): name = models.charfield(max_length=20, unique='true') password = models.charfield(max_length=20) field_of_interest = models.charfield(max_length=2

How to return a multidimensional character array from a function in a header file in C -

i have main file, , header file. in main file, want return 2d char array char function header file. char function following: char character_distribution(int length, char redistribution[length][2]) { char *buffer, distribution[256][2] = {0}; long lsize; struct bar result = funct(); buffer = result.x; lsize = result.y; length = collect_character_distribution(buffer, lsize, distribution); reorganize_character_distribution(length, distribution, redistribution); return redistribution; } and main function follows: #include <stdio.h> #include "character_distribution.h" void main() { int length; char distribution[length][2]; distribution = character_distribution(length, distribution[length][2]); int a; for(a = 0; < length; a++) { printf("%c\n", distribution[a][0]); } } when run code, following error: warning: retu