Posts

Showing posts from January, 2013

javascript - Remove input element from cell and preserve the value, when clicked outside of cell or another cell -

i want input elements in cells disappear when click outside of cells or on cell (note clicked cell must active afterwards, have input element). , cell must keep value of input element. when cell clicked, input element must appear (that part solved). html: <table> <tr> <td>content</td> <td>content</td> </tr> <tr> <td>content</td> <td>content</td> </tr> </table> javascript: //this part creates input in td element, allows editing cell content , //when enter pressed removes input leaving cell value (the okay part) $("td").click(function(){ if($(this).find("input").length==0){ var cellcontent = $(this).html(); $(this).empty(); $(this).append("<input type='text' size='"+cellcontent.length+"' value='"+cellcontent+"'>"); ...

jquery - post data to new tab via ajax -

here try achieve: let's have 2 files, order.php , print.php. in order.php there button printing data. when user clicks button want post data order.php print.php. easy. how? this last attempt this. $.ajax({ type: 'post', url: '../event/print', async: false, data: {json:$("input[name=json]").val(),id:"2"}, success:function(data){ mywindow = window.open('../event/print', "_blank"); mywindow.focus(); }, error:function(data){ swal("oops...", "something went wrong.", "error"); } it shows me error alert everytime 500 internal server error. i'm doing wrong? edit i've changed things around web, , not show error. cant see $_post parameters. in way calling page ../event/print twice. the first time post request via ajax, second time request due fact opening new tab. what describing not ajax request, form target="_blan...

ruby on rails - Limit pg_search to the associations of an individual User object -

for example: class user < activerecord::base has_many :cars end # name :string(255) class car < activerecord::base belongs_to :user end how use pg_search full text search of names of cars single user instance has (versus cars)? i'm author of pg_search. sounds want chain pg_search_scope onto association: class user < activerecord::base has_many :cars end class car < activerecord::base include pgsearch belongs_to :user pg_search_scope :search_by_name, against: :name end user = user.find(1) user.cars.search_by_name("ford")

gitlab - git diff not working on a bare repo, post-receive hook -

i working on post-receive hook on bare repo. want file names changed , pushed in bare repo (only latest one). using command. git diff --name-only head^ this gives me error when push bare repo. remote: fatal: operation must run in work tree i got there no worktree in bare repo command fails how run? i believe command looking git diff --name-only head^ head . compare "current" commit commit before it.

load - Using Registry to install Excel AddIn -

i created excel add-in called project count_per person.xlam when open excel , go development>addins , select addin install, not stay installed if close out of excel after saving. addin made, creates new menubarbutton under tab 'addins' so created new registry key install addin @ startup under hkey_current_user\software\microsoft\office\excel\addins\projectcount_perperson the key looks this (default) reg_sz (value not set) description reg_sz project count_per person friendlyname reg_sz project count_per person loadbehavior dword 0x00000003 (3) manifest reg_sz c:\users\b012918\appdata\roaming\microsoft\addins\project count_per person.xlam when start excel, displays installing addin, an exception reading manifest from file:///c:/users/b012918/appdata/roaming/microsoft/addins/project%count_per%person.xlam: the manifest may not valid or file not opened. http://pastebin.com/bn1datv5 an...

c# - Why can I cast an A[] to a B[] if A and B are enum types? -

enum makes code more readable , easy understand in many case. can't understand when can use line below : public enum { apple,orange,egg } public enum b { apple,orange,egg } public static void main() { a[] aa = (a[])(array) new b[100]; } can give me source code sample can used type of enum array. the clr has more generous casting rules c# has. apparently, clr allows convert between arrays of enums if underlying type has same size both types. in question linked case (sbyte[])(object)(byte[]) surprising. this in ecma spec partition i.8.7 assignment compatibility. underlying types – in cts enumerations alternate names existing types (§i.8.5.2), termed underlying type. except signature matching (§i.8.5.2) iii.4.3 castclass says if actual type (not verifier tracked type) of obj verifier-assignable-to type typetok cast succeeds castclass instruction c# compiler uses perform cast. the fact, enum members same in example has nothing pro...

machine learning - Python NLTK pos_tag not returning the correct part-of-speech tag -

having this: text = word_tokenize("the quick brown fox jumps on lazy dog") and running: nltk.pos_tag(text) i get: [('the', 'dt'), ('quick', 'nn'), ('brown', 'nn'), ('fox', 'nn'), ('jumps', 'nns'), ('over', 'in'), ('the', 'dt'), ('lazy', 'nn'), ('dog', 'nn')] this incorrect. tags quick brown lazy in sentence should be: ('quick', 'jj'), ('brown', 'jj') , ('lazy', 'jj') testing through online tool gives same result; quick , brown , fox should adjectives not nouns. in short : nltk not perfect. in fact, no model perfect. note: as of nltk version 3.1, default pos_tag function no longer old maxent english pickle . it perceptron tagger @honnibal's implementation , see nltk.tag.pos_tag >>> import inspect >>> print inspect.gets...

c++ - Trouble with a recursive algorithm and pointers -

so i'm trying make algorithm starts @ first "room" , recursively goes outward , starts deleting rooms outside in. room struct 4 "doors" (pointers rooms): north, south, east, , west. the function takes 2 arguments: pointer current room , char (to identify direction: north, south, east, or west). here logic algorithm (roomdelete): base case start @ first room , call function (roomdelete) on non-null pointers; input function calls should appropriate pointer room n/s/e/w, , appropriate char representing direction n/s/e/w. check see pointers (n/s/e/w) null --> delete current room. done/return. recursion make sure not backtrack (travel in direction came from), using char hold value opposite of direction char. call function on non-null, non-backtrack pointers/directions. break connection previous room. check see pointers null --> delete current room. here simple picture on rooms/pointers like: http://i.imgur.com/btkz5jb.png i have cod...

Does Emacs regex support possessive quantifiers? -

referring this question , found quite interesting. can't test right if emacs supports possessive quantifiers . manual says lazy quantifiers supported: ?, +?, ?? non-greedy variants of operators above. normal operators ‘ ’, ‘+’, ‘?’ match as can, long overall regexp can still match. following ‘?’, match little possible... but not find possessive quantifiers ?+ , *+ , ++ for example on string ab .*+a|b would match b .*a|b would match a . are possessive quantifiers supported in emacs regex flavor? no, emacs not support *+ etc. see elisp manual, node regexp special .

makefile - How to correctly make install of binaries and data after compile in linux? -

after make of sources have compiled executable file , data directory images it. should @ "make install" phase correctly install these files linux system? , how application can find installed data (in case when binary , data placed in different directories)? are there standards this? there many ways install packages on linux , unix system other operating system. normal method of installing software through distributions package manager. package managers different based on distribution using in general take package (a file filled binaries source code or other files required piece of software work) , place corresponding places defined filesystem hierarchy standard . when make install doing bypassing package manager , placing binaries hierarchy standard directly making impossible package manager handle or account programs existence. not thing hard keep system secure or stable many unknown files placed throughout system. please if want install manually please take ...

java - Problems with unicode variables in subprocess.check_output Python with Django -

recently in work brought server , cofigure it. contextualize. problem working in code in java (cogroo, grammar checker in portuguese) , have codes in python, make work both codes i'm calling jar file within python code. when working in local machine works fine , when put in server have troubles. >>> = u"ele anda à cavalo" >>> print(type(a)) >>> <type 'unicode'> >>> u'ele anda \xe0 cavalo' >>> print(a) ele anda à cavalo in local machine , on server terminal works fine, if same on python script brings me error "ascii' codec can't encode character u'\xe0' print python". in script can't print unicode string. when try call output = subprocess.check_output(cd.encode("utf-8"), shell=true) var cd has java code , path cd = 'java -jar path/file.jar grammarchecker -country br -lang pt -text "' + auxtextpure + '"' var auxtextpure unicode stri...

(PHP) If statement stupidity -

this code checks if pin correct or not. code login/index page. <!doctype html> <html> <h1> project_01 </h1> <h2> please enter access pin. </h2> <form action="checker.php" method="get"> <input type="text" name="pin"/> <input type="submit" value="submit"> </form> </html> which works fine. code check if pin right turns blank page. <!doctype html> <html> <p> <?php $enc = $get_["pin"]; if($enc == "7885") { echo ("user login."); elseif($enc == "5296"): echo ("admin login"); else: echo ("error."); } ?> </p> </html> either prints out rest of code, or of if statements return true. why happen , how fix it? ...

github - Python - Resolving PEP8 errors -

i'm trying resolve pep8 errors generated travis build after pull request firefox ui github repo. i've been able reproduce these errors locally using pep8 library. have following line in file exceeds 99 character limit: wait(self.marionette).until(lambda _: self.autocomplete_results.is_open , len(self.autocomplete_results.visible_results) > 1)) the error produces on running through pep8 given by: $ pep8 --max-line-length=99 --exclude=client firefox_ui_tests/functional/locationbar/test_access_locationbar.py firefox_ui_tests/functional/locationbar/test_access_locationbar.py:51:100: e501 line long (136 > 99 characters) the line calls wait().until() method marionette python client. line 2 separate lines: wait(self.marionette).until(lambda _: self.autocomplete_results.is_open) wait(self.marionette).until(lambda _: len(self.autocomplete_results.visible_results) > 1) the repo manager advised me combine these 2 lines one, has extended length of resulting l...

matlab - Displaying surface with non-rectangular boundary -

Image
refer attached image. want display image in matlab using function surf() . however, want display region of actual object without background (the pale-green region surrounding actual object has 0 value). how that? tried replacing outer region 0 nan , setting values in height map nonzero value, still error message: subscript indices must either real positive integers or logicals. so how can display surface has non-rectangular boundary? setting values nan should do. here's example: [x, y] = ndgrid(linspace(-1,1,500)); z = cos(2*pi*(x+y)*2); z(x.^2+y.^2>1) = nan; %// remove values outside unit circle surf(x,y,z,'edgecolor','none') colorbar view(2) axis equal

html - Div background image full height on browser -

i tried searching on google can't seem find solution problem make background image part of div appear full size , cover whole browser window. moving background image body element not possible (constraint theme using) , have tried using height:100% (which doesn't work) , height:100vh (which work background image extend more necessary.) i have simplified problem this: <body> <div id="topmenu">menu</div> <div id="box1"> <div id="box2"> <div id="box3"> <div id="homepage"> <div>text</div> </div> </div> </div> </div> </body> #homepage buried under several layers of div has background image extend full screen. i have created fiddle understand talking about. https://jsfiddle.net/6x08snnt/17/ thank help! percentage height based ...

sql - How Can I do Access Query -Count- -

Image
how can write query database output excel tables. please me. my databese , excel table if helps, have screenshots access 2013. menu descriptions same. grid output asked different mode. there table design view used make table. switch data sheet view through menu option. select query 1 of 4 possibilities: select update delete append depending on trying data, query type should chosen. used select . i used select query data. won't change data when run it. run query , view results: the select query created has mode called sql view have query there if used guide design query. sql looked like: select employee.ename, employee.job employee order employee.ename desc; enjoy!

java - Design pattern for returning responses from child threads -

i looking design pattern parent thread spawn multiple child threads. each child thread perform computation , return appropriate result. the parent thread waiting child threads complete. after child threads completed, consolidated result sent parent thread. the parent thread proceed consolidated result. check join method of thread class. here working sample: import java.lang.*; public class threads { public void callchildren() throws exception { thread t = new thread(new childthread()); t.start(); t.join(); system.out.print(t.getname()); system.out.println(", status = " + t.isalive()); } public static void main(string[] args) throws exception{ for(int = 0 ; < 4; ++) { new threads().callchildren(); } system.out.println("printing parent thread after child thread complete."); } private class childthread implements runnable{ @override public void run() { syste...

php - Importing Symfony project error -

i new symfony framework. have download file project https://github.com/thujohn/jobeet , try open url: http://localhost/job/web/app_dev.php/ , gives message: ( ! ) warning: require_once(c:\wamp\www\job\web/../app/bootstrap.php.cache): failed open stream: no such file or directory in c:\wamp\www\job\web\app_dev.php on line 22 call stack time memory function location 1 0.0011 244064 {main}( ) ..\app_dev.php:0 ( ! ) fatal error: require_once(): failed opening required 'c:\wamp\www\job\web/../app/bootstrap.php.cache' (include_path='.;c:\php\pear') in c:\wamp\www\job\web\app_dev.php on line 22 call stack time memory function location 1 0.0011 244064 {main}( ) ..\app_dev.php:0 please tell me should . i'm not shure, think need $ composer install $ php app/console cache:clear read this article , install symfony2.

php - Wordpress - Custom posts fails to export - too many entries? -

i think stackoverflow question , not serverfault question... if i'm wrong apologize! i trying export custom post type has around 500,000 entries. when export custom post type has few entries, exports successfully. but second export post type 500,000 entries (by going tools->export), receive following error: this webpage not available err_invalid_response firefox can't find file @ http://website.com/wp-admin/export.php?download=true&cat=0&post_author=0&post_start_date=0&post_end_date=0&post_status=0&page_author=0&page_start_date=0&page_end_date=0&page_status=0&content=card&submit=download+export+file. this resulting 500 error wordpress: [12/jun/2015:10:51:47 -0400] "get /wp-admin/export.php?download=true&cat=0&post_author=0&post_start_date=0&post_end_date=0&post_status=0&page_author=0&page_start_date=0&page_end_date=0&page_status=0&content=card&submit=download+export+f...

regex - Python Fabric won't comment beginning of line -

just trying comment out line in text file in python fabric. regex @ sign doesn't have ip1 or ip2 following. pattern searches fine , finds line, except instead of printing "# + line" prints "#@#@bad_ip_here". should : #*.info;mail.none;stuff.none;cron.none @bad_ip but prints *.info;mail.none;stuff.none;cron.none #@#@bad_ip it printing commented line twice, fine. don't know wrong or changed. tried forcing insert @ position 0 with line = line[:0] + "#" + line[0:] but didn't work either. def addcomments(): ip1 = '10.31.xx.xxx' ip2 = '10.30.xx.xx' host = env.host_string conf = open('/home/myuser/verify_yslog_conf/%s/hi.txt' % host, 'r') f = conf.read() conf.close() comment = open('/home/myuser/verify_yslog_conf/%s/hi.txt' % host, 'w') line in f: if re.search(r'(@(?!({0}|{1})))'.format(ip1, ip2), line): ...

java - ExecutorService fairness -

i have executorservice this executorservice executor = new threadpoolexecutor(threads, threads, 0l, timeunit.milliseconds, new arrayblockingqueue<>(1000, true)); and i'm sending work .execute(runnable) my runnable has @override public void run() { this.processor.performaction(this); } where processor has public void performaction(runnableaction action) { lock lock = lockmanager.getlock(action.getid()); lock.lock(); try { action.execute(); } { lock.unlock(); } } where lockmanager is public class lockmanager { map<string, lock> lockbyid = new hashmap<>(1000); public synchronized lock getlock(string id) { lock lock = lockbyid.get(id); if (lock == null) { lock = new reentrantlock(true); } return lock; } and actions/runnable have execqty field triggers update on o...

rx java - RxJava - Just vs From -

i'm getting same output when using observable.just vs observable.from in following case: public void myfunc() { //swap out here , same results,why ? observable.just(1,2,3).subscribe(new subscriber<integer>() { @override public void oncompleted() { log.d("","all done. oncompleted called"); } @override public void onerror(throwable e) { } @override public void onnext(integer integer) { log.d("","here integer:"+integer.intvalue()); } }); } i thought 'just' suppose emit single item , 'from' emit items in sort of list. whats difference ? noted 'just' , 'from' takes limited amount of arguments. observable.just(1,2,3,4,5,6,7,8,-1,-2) ok observable.just(1,2,3,4,5,6,7,8,-1,-2,-3) fails. same goes from, have wrap in list or array of sorts. i...

javascript - Dragging element obscures drop target -

i'm using native html5 drag , drop api drag elements on page. problem i'm having dragged element rather large , it's current position obscures of drop targets. when set dragged element display none or visibility hidden or pointer events none, or position absolute , left -10000px dragend event triggered on element. is there way overcome it? did try create temporary element behave shadow? function drag(ev) { var shadow = createshadowelement(); var element = document.getelementbyid(ev.target.id); element.appendchild(shadow); ev.datatransfer.setdragimage(shadow, 0, 0); ev.datatransfer.setdata("text", ev.target.id); } function drop(ev) { ev.preventdefault(); var data = ev.datatransfer.getdata("text"); var element = document.getelementbyid(data); ev.target.appendchild(element); } function dragend(ev) { removeshadowelement(); } see @ http://jsfiddle.net/89gs21jj/1/

web - Doc.Checkbox 'change' event does not occur in Websharper.UI.Next -

i have reactive var variable vardone , doc.checkbox representation named cbdoc. after changing value of vardone need call function. this, wrote code illustrated in following pseudo-code: open websharper open websharper.ui.next open websharper.ui.next.html open websharper.ui.next.notation // declaring reactive bool variable let vardone = var.create false (* else *) // creting doc-representation of model let rendermodel model = // declaring representation doc element let cbdone = div0 [ doc.checkbox [ "type" ==> "checkbox" ] vardone ] let result'doc = // doc-representation, contains cbdone let my'handler() : unit -> unit = // function should called when changing value of vardone // add event handler element cbdone changes (doc.aspagelet cbdone).body.addeventlistener( "change", my'handler, false ) result'doc but unfortunately no event occurs when checkbox changing. question is, doing wrong ,...

ios - Popping UIViewController causes previous UIViewControllers View to change position -

Image
i have uinavigationcontroller uiviewcontroller set it's rootcontroller, contains background on uiview using image set under navbar. push onto navigation controller new uiviewcontroller , when button pushed, previous controller looks different. using visual debugger can see self.view has moved entirely down below navbar @ top. have no idea , been racking brains why might happening -(void)pushiphonemessagingcontactscontroller:(messagecontactsviewcontroller *)contactscontroller{ self.selectorview.hidden = yes; [self.navigationcontroller pushviewcontroller:contactscontroller animated:yes]; } on rootviewcontroller (iphonemessagingnotificationscontroller) -(void)viewwillappear:(bool)animated{ self.selectorview.hidden = no; [[[self navigationitem] leftbarbuttonitem] settintcolor:[uicolor blackcolor]]; [[uiapplication sharedapplication] setstatusbarstyle:uistatusbarstyledefault]; if ([_displaytype intvalue] == messages_showing) { [self.noti...

Android- Bluetooth: Bluetooth Service behaving unexpectedly -

i writing android app can interact arduino. app have 2 buttons 1. connect 2. dis-connect, start , stop bluetooth service. have test sketch on arduino when receives "1" send "404"(just test!) phone. here's bluetooth service class public class bluetoothservice extends service { private bluetoothmanager bluetoothmanager; private servicehandler mshandler; public bluetoothservice(){} private final class servicehandler extends handler { public servicehandler(looper looper) { super(looper); } @override public void handlemessage(message msg) { } } @override public void oncreate() { super.oncreate(); handlerthread thread = new handlerthread("servicestartarguments", android.os.process.thread_priority_background); thread.start(); looper msloop = thread.getlooper(); ...

php - Retain the last value of the loop -

i have loop want retain last value of variable. $count = 20; $data_list = 6; $ceil = ceil($count / 6); for($y=0; $y < $ceil; $y++){ $new_x = 0; for($x=$new_x ; $count<20; $x++){ foreach($success_arr $key => val){ if($x < $data_list){ echo $val[$x]; $new_x = $x; $data_list = $data_list + $x; } } } } is possible retain value of new in next loop? , $data_list variable? initialise $new_x = 0; outside loop.

java - Top 5 records by size of collection -

i have following entity: public final class stock implements serializable { @jsonignore @manytomany(mappedby = "stocks", fetch = fetchtype.lazy) private set<user> users = new hashset<>(); [other fileds] [getters/setters] } and write query in jpql top5 stock entity based on size of set users. far write native query in sql , looks like: select s.ticker, count(s.ticker) t_stock s inner join t_user_stocks on s.id = us.stock_id inner join t_user u on us.user_id = u.id group s.ticker order count desc and want jqpl query return top 5 stocks entity. me? assuming entity mapped follows. @entity public class stock { @id @generatedvalue(strategy = generationtype.auto) private long id; @column private string ticker; @jsonignore @manytomany(fetch = fetchtype.lazy, cascade = cascadetype.all) @jointable(name = "stock_user", joincolumns = { @joincolumn(name = "stock_id", nullable ...

No module named .. while running Django tests with PyCharm -

i have following error when running django's tests pycharm 4.5 importerror: no module named date_utils . here short overview project tree: . ├── manage.py ├── settings.py ├── app1 │   ├── models.py │   ├── __init__.py #empty ├── utils │   ├── __init__.py #empty │   ├── date_utils.py in app1.models.py , utils.date_utils import my_wonderful_function i import both apps in settings.py installed_apps = ( 'grappelli', '...', 'djcelery', 'utils', 'app1', ) please note working when using manage.py test . can please understanding why happening pycharm not manage.py ? ! ok, found problem. problem pycharm have module named utils, , import not using module, pycharm's one.

opengl - Get normal of a gluDisk? -

i'm writing solar system simulator in opengl. 1 of components in solar system earth's orbit (simple circle around sun, created gludisk function). i wondering how can retrieve normal vector of disk because need use rotation vector camera (which needs follow earth's spin around sun). this code (java) creates orbit, works well. using code, how retrieve normal of disk? (as disk contained in plane, defined normal). gl.glpushmatrix(); // if tilt 0, align orbit xz plane gl.glrotated(90d - orbittilt, 1, 0, 0); gl.gltranslated(0, 0, 0); // orbit around origin gl.glcolor3d(0.5, 0.5, 0.5); // gray // draw orbit glu.gluquadricdrawstyle(quad, glu.glu_silhouette); glu.gludisk(quad, 0, position.length(), slices, 1); gl.glpopmatrix(); before transformation, disk in xy-plane. means normals point in z-direction, (0, 0, 1) . in fact, gludisk() emit these normal during rendering, , transformations specify applied them, rendering don...

ios - Swift: Performing a segue if PFObject = nil. -

currently have synced user , data on parse backend. want have user details page appear if users have not stated user details. there login page lead protected page (which show user details) , if there no details retrieved, page perform segue user details page. var query = pfquery(classname:"usersettings") var currentuser = pfuser.currentuser() query.wherekey("user", equalto: currentuser!) query.findobjectsinbackgroundwithblock { (objects: [anyobject]?, error: nserror?) -> void in if objects == nil { self.performseguewithidentifier("filluserdetails", sender: self) } however, segue not seem execute , remains on protected page rather directing new user user details page. appreciate , in advance. the block executed on background thread. when update ui should on main thread. try wrapping performseguewithidentifier in block this: var query = pfquery(classname:"usersettings") var curre...

javascript - Showing update time like Twitter's update notification -

i using momentjs finding difference specific date below: moment([mydate]).fromnow(); the code gives me results below: "a few minutes ago" or "10 hours ago" ... i tried change below find difference seconds moment([mydate]).fromnow().asseconds(); but code doesn't work. so implement codes twitter's last update notification. suggestion? if want make diff between 2 dates in seconds : moment().diff(mydate, 'seconds')

linq - How to remove list element? -

i have 2 lists below. list<string> apple= new list<string>(); apple.add("a"); apple.add("b"); list<string> ball= new list<string>(); ball.add("a,b"); ball.add("b,c"); ball.add("c,a"); now want remove elements ball list of there substrings of elements in apple list. if "a" occurs in ball list element, have remove listelements ball list. my expected output of ball list should (b,c). here quick linqpad var apple= new list<string>(); apple.add("a"); var ball= new list<string>(); ball.add("a,b"); ball.add("b,c"); ball.add("c,a"); ball.where(b=>apple.any(b.contains)) .tolist() //create duplicate, lists have foreach .foreach(b=>ball.remove(b)); ball.dump(); output is: b,c

html - Php echo not working on empty form field test -

i'm finding echo isn't working in scripts. stripped down script below i've been using debug this, result has been same. perhaps can see simple i've overlooked. appreciated. additional details: location: http://www.example.com/include/sandbox.php the web-server can execute php-scripts: phpinfo(); presents php version 5.3.24. no header lines worry about. (i'm wanting check field not empty before submitting database, , provide prompts or echo on submit.) <?php if($_server['request_method'] == 'post'){ if(!isset($fielda)){ echo "error: submission field empty."; } else{ echo "success! submitted field wasn't empty."; } } ?> <h1> example title </h1> <form method="post" action="sandbox.php" > <input type="text" name="fielda" value="" /> <br /> <input type="submit" name=...

Android design and output not match -

Image
i'm new in android , want know why app deisgn isn't same deisgn in android studio. here image link: 1.why on top banner appear "inc aio" string? related layout?how remove? 2.why login button locating close password text field, not design? hope can frpm here. thanks. this actionbar, u can remove it, here answer how. u need show layout file (.xml)

c# - could not find installable isam access #2 -

i have problem in c# application related connection string , think. scenarios: moved login form main form, in loading set connection string, , things fine. when closed main form, , re-login in con.open() step , error release: not find installable isam. my connection string: constring = @"provider=microsoft.ace.oledb.12.0; data source="; constring += application.startuppath + "//shdb.mdb; jet oledb:database password=2212123;";

ios - How to add more than 20 geofenced local notifications? -

i creating app using following code trigger local notifications based on location: let locattionnotification = uilocalnotification() locattionnotification.alertbody = "you have entered high risk zone (crown range road) , proceed caution" locattionnotification.regiontriggersonce = false locattionnotification.region = clcircularregion(circularregionwithcenter: cllocationcoordinate2d(latitude: 37.33182, longitude: -122.03118), radius: 100.0, identifier: "location1") uiapplication.sharedapplication().schedulelocalnotification(locattionnotification) this code works fine 20 alert messages thats limit in ios. i more i'm not sure how can go it. i hear can detect when significant location change made , work out distance nearest points , enable those. can provide me advice and/or code how can work out distance these various points , enable relevant ones? check answer similar question: need add more 20 geofence regions should you. let me know if ...

codesmith - How to use current stored procedure of database in code smith for create template? -

i have data base , create more stored procedure it,now want use created stored procedures in code smith , create template it. do? for example use table in code generator write follow property : <%@ property name="sourcetables" category="database" optional="true" type="schemaexplorer.tableschemacollection" description="the database tables" %> how write stored procedures ???? <%@ property ..... type="**schemaexplorer.???**" ... i work codesmith tools , there template want create stored procedures. can found in database/storedprocedures folder. source can found online here . if wish interact stored procedure via property can via commandschema type. <%@ property name="sourcecommands" category="database" optional="true" type="schemaexplorer.commandschemacollection" description="the database stored procedures" %>

Position of Apostrophe in Java Regex -

i'm trying see if log pattern layout has timestamp/date field , position in layout when splitted spaces. seems position of apostrophe in regular expression matters. e.g. when have pattern .*%d[ate]*\\{([\\w\\.'-\\:]+)}.* matches layout of format %x{ip} %x{field1} %x{field2} [%date{yyyy-mm-dd't'hh:mm:ssz} guid=%{guid} userid=%{userid} %msg%n . however, when interchange - , ' in regular expression, runtime error below. exception in thread "main" java.lang.exceptionininitializererror caused by: java.util.regex.patternsyntaxexception: illegal character range near index 19 .*%d[ate]*\{([\w\.-'\:]+)}.* ^ @ java.util.regex.pattern.error(pattern.java:1955) @ java.util.regex.pattern.range(pattern.java:2655) @ java.util.regex.pattern.clazz(pattern.java:2562) @ java.util.regex.pattern.sequence(pattern.java:2063) @ java.util.regex.pattern.expr(pattern.java:1996) @ java.util.regex.pattern.group0(pattern.java:290...

Swift slow on object creation and setValue:forKey: -

i accessing local mysql database in swift code translated objective c. in objective c performs fast, in swift 10 15 times slower depending on count of records. i using generics create data transfer objects. sql select method has signature: func sqlselect<t: nsobject>(select: string) -> [t]? first fetched 20.000 records mysql database , returned empty array of ts. time needed 0.3 seconds, not fast acceptable. then created 20.000 t instances in above function , appended them local swift array, fast: 0.1 sec. now creating 5 nsnumbers , 9 strings fetched mysql data slow: 1.2 sec. 280.000 object creations (14 * 20.000 = 280.000). additional 1.4 seconds used setting properties of each t instance setvalue:forkey: the same code in objective c , in xojo (aka realbasic) fast: less 1 second compared more 3 seconds. what options make swift code faster? first edit – added source code: func sqlselect<t: nsobject>(select: string) -> [t]? { ... // error handli...

root - MariaDB installed without password prompt -

i've installed mariadb ubuntu 15.04 repositories using ubuntu software center or @ command prompt (apt-get install maraidb-server), no password taken root user. i'm able connect mysql @ command without password, connecting using mysql-workbench or python mysqldb library failed "access denied user 'root'@'localhost'" message sudo mysql -u root [mysql] use mysql; [mysql] update user set plugin='' user='root'; [mysql] flush privileges; [mysql] \q

CSS + HTML accordian not working in IE 8 -

i want include accordion drop down website , not working in ie 8. here code reference. have checked in google , found out psuedo elements not work in ie 8 , below. alternative: .transition, p, ul li i:before, ul li i:after { transition: 0.25s ease-in-out; } .flipin, h1, ul li { animation: flipdown 0.5s ease both; } .no-select, h2 { -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } html { width: 100%; height: 100%; perspective: 900; overflow-y: scroll; background-color: #dce7eb; font-family: "titillium web", sans-serif; color: rgba(48, 69, 92, 0.8); } body { min-height: 0; display: inline-block; position: relative; left: 50%; margin: 90px 0; transform: translate(-50%, 0); box-shadow: 0 10px 0 0 #ff6873 inset; background-color: #fefffa; m...

unable to display my product name and categories in url of codeigniter website -

hi unable display product name , categories in url of codeigniter website actually muy url is: http://manimukta.com/search/details/738/5/5 i want make url http://manimukta.com/arts&artifacts/silver-articles/decoratives/animal/horse/738/5/5 can u please me out go application folder , in config.php file change $config['permitted_uri_chars'] . $config['permitted_uri_chars'] = 'a-z 0-9~%.:&_\-,()!$';

I accidentally created a Google calendar event in the year 15 AD, and now I can't delete it. -

the app i'm working on creates events in google calendar. due time travel datetime bug, event created in 15 ad. google calendar web interface seems unable cope this, , upon finding event (using search bar), there's no way delete it. checked js console, , appears has evaluated null on site. [error] typeerror: null not object (evaluating 'a.la') nf (undefined, line 168) xo (anonymous function) ([native code], line 0) c (anonymous function) ([native code], line 0) f bh (dc315ccd9d63034627cb97eaba422ebdcalendarjs_doozercompiled__en.js, line 113) sba (dc315ccd9d63034627cb97eaba422ebdcalendarjs_doozercompiled__en.js, line 114) (anonymous function) (dc315ccd9d63034627cb97eaba422ebdcalendarjs_doozercompiled__en.js, line 111) i can't believe google doesn't support editing events created 2000 years in past. gives? try find , delete event programatically (using api/interface used create it) instead of using web gui - mi...

sql - how can i remove the null values in two columns to show only data -

i have requirement have converted row values columns i'm trying remove null rows , show data declare @t table (id int,keys varchar(10),val varchar(10)) insert @t (id,keys,val)values (1,'name','hulk'),(2,'age','22'),(3,'name','ironman'),(4,'age','35') ;with cte ( select [name],cast([age] int)age ( select id,keys,val @t )t pivot(max(val) keys in ([name],[age]))p group [name],age) select (c.name),(c.age) cte c left join cte cc on c.age = cc.age , c.name = cc.name result : name age null 22 null 35 hulk null ironman null desired result set : name age hulk 22 ironman 35 i agree gordon, data structure flawed. if however, can assume age key id follows name key id 1, following work. if can change table structure, better.. declare @t table (id int,keys varchar(10),val varchar(10)) insert @t (id,keys,val) values (1,'name','hulk'),(2,'age','22'),(3,...

python - How to group sets by similarity in contained elements -

Image
i using python 2.7. have routes composed of arrays of nodes connect each other. nodes identified string key, ease use numbers: sample_route = [1,2,3,4,7] #obviously over-simplified; real things 20-40 elements long i create set made of tuple pairs of point connections using zip, end like: set([(1,2),(2,3),(3,4),(4,7)]) i need way filter out routes similar (like 1 or 2 added nodes) , use minimal route out of near-duplicates. plan right to: start first (probably optimal) route. iterate through rest of routes, , use following formula calculate similarity sequence in step 1: matching = len(value1.difference(value2)) + len(value2.difference(value1)) #value1, value2 = 2 compared sets the lower number, more similar. what way group routes based on similarity other routes? different lengths. have never taken statistics course. example: sets = [ set([(1,2),(2,3),(3,4),(4,5),(5,10)]), set([(1,2),(2,3),(3,4),(4,6),(6,5),(5,10)]), set([(1,7),(7,3),(3,8),(8,7),(7,6),(6,...