Posts

Showing posts from April, 2012

python - Why is it important to protect the main loop when using joblib.Parallel? -

the joblib docs contain following warning: under windows, important protect main loop of code avoid recursive spawning of subprocesses when using joblib.parallel. in other words, should writing code this: import .... def function1(...): ... def function2(...): ... ... if __name__ == '__main__': # stuff imports , functions defined ... no code should run outside of “if __name__ == ‘__main__’” blocks, imports , definitions. initially, assumed prevent against occasional odd case function passed joblib.parallel called module recursively, mean practice unnecessary. however, doesn't make sense me why risk on windows. additionally, this answer seems indicate failure protect main loop resulted in code running several times slower otherwise have simple non-recursive problem. out of curiosity, ran super-simple example of embarrassingly parallel loop joblib docs without protecting main loop on windows box. terminal spammed following erro

python 3.x - numpy assignment doesn't work -

suppose have following numpy.array : in[]: x out[]: array([[1, 2, 3, 4, 5], [5, 2, 4, 1, 5], [6, 7, 2, 5, 1]], dtype=int16) in[]: y out[]: array([[-3, -4], [-4, -1]], dtype=int16) i want replace sub array of x y , tried following: in[]: x[[0,2]][:,[1,3]]= y ideally, wanted happen: in[]: x out[]: array([[1, -3, 3, -4, 5], [5, 2, 4, 1, 5], [6, -4, 2, -1, 1]], dtype=int16) the assignment line doesn't give me error, when check output of x in[]: x i find x hasn't changed, i.e. assignment didn't happen. how can make assignment? why did assignment didn't happen? the "fancy indexing" x[[0,2]][:,[1,3]] returns copy of data. indexing slices returns view. assignment happen, copy (actually copy of copy of...) of x . here see indexing returns copy: >>> x[[0,2]] array([[1, 2, 3, 4, 5], [6, 7, 2, 5, 1]], dtype=int16) >>> x[[0,2]].base x false >>> x[[0,2]][:, [1,

powershell - Removing a Special Character from a Text file is returning Blank File -

i have text file , want remove special character file. example: sample@ in file tess.txt i want remove special character text file , want output as:- sample i have used below powershell script in spite of replacing special characters, deleting text file. powershell "get-content c:\tess.txt | foreach-object { $_ -replace '@' } > c:\tess.txt" when try output file tess1.txt, see correct output sample. powershell "get-content c:\tess.txt | foreach-object { $_ -replace '@' } > c:\tess1.txt" but did not want create new text file. want remove @ existing file. i'm new powershell scripting. please help. you cannot in pipeline without first reading entire file memory: (get-content c:\tess.txt) | foreach-object { $_ -replace '@' } > c:\tess.txt this because get-content reading file 1 line @ time, , passing down pipeline, waiting pipeline finish line before asking next one. means you're trying overwrite f

How to run script from within Mysql workbench? -

i have sql script distribute others run mysql ide, not mysql command prompt. i want user load script window of workbench (or ide sqlyog) , run script, inserts records based on variables, example: select value mytable key = "mykey" @columnid; insert mytable (col2,col3) values ( @columnid, 'testvalue' ) we have mysql workbench installed don't see way workbench. is there way run script (that in editor window) workbench (or other mysql ide) way can run scripts other database ide's toad or sql server management studo? there 2 different methods: file -> open sql script : loads file contents new sql query tab in sql editor. here, execute query if typed in. file -> run sql script : opens sql script in own "run sql script" wizard includes [run] button execute query. displays part of query, allow user override selected schema , character set. note: this feature added in workbench 6.2. i suspect want simpler "run sql s

ios8 - iOS Share extension how to support *.wav files -

as title states, want extension show when users share *.wav files i've come across following apple documentation: https://developer.apple.com/library/ios/documentation/general/conceptual/extensibilitypg/extensionscenarios.html#//apple_ref/doc/uid/tp40014214-ch21-sw8 i'm trying figure out how use mentioned in documentation so. documentation leaves me feeling have if not pieces need, not how go together. i understand i'll have build "subquery(..)" statement, go? how use it? i ended doing following: for nsextensionactivationrule key, changed type dictionary string , entered following string (you can keep formatting, doesn't need inline): subquery ( extensionitems, $extensionitem, subquery ( $extensionitem.attachments, $attachment, $attachment.registeredtypeidentifiers uti-conforms-to "public.image" || $attachment.registeredtypeidentifiers uti-conforms-to "public.movie" ||

Passing an Array from PHP to Javascript -

i'm trying pass on php array use array in javascript. the php code i'm using follows: <?php $link = mysqli_connect("localhost", "root", "password", "database"); /* check connection */ if (mysqli_connect_errno()) { printf("connect failed: %s\n", mysqli_connect_error()); exit(); } $query = "select * employees"; if ($result = mysqli_query($link, $query)) { /* fetch associative array */ while ($row = mysqli_fetch_assoc($result)) { $data[] = $row; } print_r($row); /* free result set */ mysqli_free_result($result); } /* close connection */ mysqli_close($link); //convert php array json format, works javascript $json_array = json_encode($data); ?> javascript: <script> var array = <?php echo $data; ?>; console.log(array); </script> the data array in php doesn't

loops - Java Monopoly Game -

i made board , set board's layout null. position token's moving them pixel pixel. when turning corners having trouble. after first 10 position token can make turn , continue next 10 position. impossible token make 2. turn. can advice me better code problem. think make things more complicated is. if(g.getposx() <= 650 && g.getposx() >= 50 && g.getposy()==650) { if(g.getposx()-unitchange*d.getdice() <= 50) { temp = unitchange*d.getdice() - (g.getposx() - 50); g.setposx(50); g.setposy(g.getposy()-temp); } else { g.setposx(g.getposx()-unitchange*d.getdice()); temp = 0; } } else if(g.getposy() <= 650 && g.getposy() >= 50 && g.getposx()==650) { if(g.getposy()-unitchange*d.getdice() <= 50) { temp = unitchange*d.getdice() - (g.getposy() - 50);

java - How do I add to ListView and not replace it? -

i'm new android , i'm trying add things listview activity. able add things list, each time add list replaces entered. i have tried using notifydatasetchanged() invalidateviews() neither seem work? here related files: activity_main.xml <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margin" android:paddingtop="@dimen/activity_vertical_margin" android:paddingbottom="@dimen/activity_vertical_margin" tools:context=".mainactivity" android:weightsum="1" android:orientation="vertical"> <button

makefile - How to build freebsd kernel ? -

according freebsd handbook, need use following targets build freebsd kernel :- make kernconf=config_file buildkernel now, if make small change in single source file, takes long time compile kernel. pretty sure because, built again including files not affected in anyway. this creating big problem me build time large (around 45 minutes) . how can build freebsd kernel , not rebuild ? i have looked @ handbook , makefile couldn't find information related it. use make kernconf=config_file buildkernel -dno_clean . see build man page more details. p.s. can put kernconf=config_file in /etc/make.conf , no_clean=true in /etc/src.conf avoid having type every time, don't have chance accidentally forget.

php - Symfony 2 - Multiple entities with one form -

i've got following tables relationships: useraddress table (holds basic information address) useraddressfields table (holds value each field associated address) useraddressfieldstranslation table (holds field ids) userstates table (holds values of states in , abbreviations) useraddress has 2 foreign keys: profile_id -> useraccounts.id state_id -> userstates.id useraddressfields has 1 foreign key: address_id -> useraddress.id i've created entities 4 of these tables (getters , setters have been removed save space, generated via console): useraddress.php <?php namespace scwdesignsbundle\entity; use doctrine\orm\mapping orm; use scwdesignsbundle\entity\userstates; use usersbundle\entity\user; /** * @orm\entity(repositoryclass="scwdesignsbundle\entity\repository\ useraddressesrepository") * @orm\table(name="user_addresses") */ class useraddresses { /** * @orm\id * @orm\column(type="integer&q

condition - WIX Directory Search Always Fails -

it seems no matter do, condition put in product in wix blocks install running. below i've put simple code should check if program file directory exists , if does, run installer. message saying "program files folder not found." indicating condition returns false. missing here? <?xml version="1.0" encoding="utf-8"?> <wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> <product id="*" name="setupproject1" language="1033" version="1.0.0.0" manufacturer="toshiba" upgradecode="bb557911-769b-4a30-8461-3ad860ddc10e"> <package installerversion="200" compressed="yes" installscope="permachine" /> <majorupgrade downgradeerrormessage="a newer version of [productname] installed." /> <mediatemplate /> <property id="pffolder" > <directorysearch id="systemfolderdriverversion&

html - Left and right Divs in CSS -

i want left div box, , right div box. right div shoulld 300px wide , show right beside left div. i awful css, , despite trying solutions 5 other stack overflow questions similer one, im still not able figure out. i have tried display: inline; have tried tables/table cells. have tried fixed , auto margins have tried padding. have searched last hour , continued tinker. i @ wits end stupid language , need help. i have news feed on homepage, want 300px box on right of main article show news. have boiled down simple possible components test solutions, , none of them appear work @ all. my style.css: #left { float: left; margin-right: 400px; } #right { float: right; width: 298px; } my html file: <div id="right"> latest news </div> <div id="left"> <p>my problem comes when p tag gets long. ok when short, regardless of wrapping, gets screwed second long , driving me bonkers.</p> </div> yo

qt - Render web content offscreen using QtWebEngine -

i trying port application uses qtwebkit render web content on 1 uses qtwebengine. i limited can change architecturally have stick current approach of rendering page, capturing memory buffer , moving across different process buffer used texture in opengl. i've tried porting code on (broadly speaking) replacing webkit webengine, apis different. can tell me if possible? if so, please point me in right direction illustrates how hook up. yes, apis different, , code path used rendering uses scene graph (yes, widgets-based api). so in case not webengine-specific problem rather problem of how pixels out of qt quick scene. qquickrendercontrol , introduced in qt 5.4 trying address. qtwebengine might have additional quirks related visibility when doing offscreen stuff in 5.4 , hopefully fixed in 5.5 though. this use case not demonstrated qtwebengine examples, contributions welcome.

angularjs - Angular/Ionic Link Updates URL, but controller and template not being called -

ok, friend , have been working on while , couldn't figure out bug is. basically, story want start list view of messages, , when click on 1 of messages go detail page. standard simple stuff. so problem when click on message, url updates, controller isn't being called nor new template getting rendered. can see below in message-detail-controller.js, i'm logging message console isn't showing @ all. ok here's code: app.js angular.module('exampleapp', ['ionic', 'ui.router']) .config(function($stateprovider, $urlrouterprovider, $ionicconfigprovider) { $ionicconfigprovider.views.maxcache(0); $stateprovider .state('tab', { url: '/tab', abstract: true, templateurl: 'app/tabs/tabs.html', controller: 'tabsctrl' }) .state('tab.messages', { url: '/messages', views: { 'tab-messages': { templateurl: 'app/messaging/messages.html',

ios - Navigation controller back button when getting back from Facebook share -

Image
i'm using facebook share dialog when sharing content app. i'm presenting content going share on marypopin controller , works perfect except navigation controller. adds "back button" when getting facebook. any ideas why happening? you're using navigation controller, adds "back" (or custom text) button default navigation bar. if want hide button (not remove or replace it), in viewdidload add line of code: obj-c: self.navigationitem.hidesbackbutton = yes; swift: self.navigationitem.sethidesbackbutton(true, animated:true);

ruby on rails - how to remove this error : undefined method `inc' for nil:NilClass -

i wrote in browser " http://localhost:3000/items/create?name=car1&description=good+car&price=500000&weight=0&real=1 " , , got error undefined method `inc' nil:nilclass extracted source (around line #11): 9 after_initialize { puts 'initialize' } 10 after_save { puts 'saved' } 11 after_create { category.inc(:items_count, 1) } 12 after_update { puts 'updated' } 13 after_destroy { category.inc(:items_count, -1) } 14 rails.root: e:/work/my_store application trace | framework trace | full trace app/models/item.rb:11:in `block in <class:item>' app/controllers/items_controller.rb:9:in `create' request parameters: {"name"=>"car1", "description"=>"good car", "price"=>"500000", "weight"=>"0", "real"=>"1"} in line 11 you're doing category.inc(:items_count, 1) means cate

c# - Using Dropbox Generated Access Token with DropNetRT -

i'm using dropnetrt library , can't find way create working dropnetclient using generated access token app page in dropbox account. if use user secret , user token works: public static async task uploadstuff() { dropnetclient client = new dropnetclient("apikey", "appsecret"); client.setusertoken(new userlogin() { secret = "mysecret", token = "mytoken" }); // upload data client } but, instead of usertoken , usersecret, want use generated access token. it looks this, sure: jfjfdkfkdfikaaaaaaaaaadkfkdjsjfjisjofdjfjjfojoidjsojsfkpfkpejkfjiksfd3_thd now, tried using userlogin access token token , without usersecret, client threw exception, guess that's not right way that. how can that? there way create client access token library, or have upload file manually using httpclient? if so, have no idea on how that. thanks! sergio edit: tried (it's not working): public static async task testuploadgen

php - Laravel 4 / Intervention / Dropzone.js not working with some images -

i using laravel / intervention / dropzone.js upload images site using ajax. problem having images return "error: 500" when uploaded. problem isn't file size, or dimensions, i've tested both of those. problem, believe, lightroom. images fail upload images edited using lightroom. there should doing images (encoding, sending headers) causing this. else works fine. code. if(input::hasfile('file-upload')) { $file = input::file('file-upload'); $key = input::get('_uuid'); $img = image::make($file[0]); $img = image::make($file[0])->widen(500, function ($constraint) { $constraint->upsize(); }); $img = image::make($file[0])->heighten(1080, function ($constraint) { $constraint->upsize(); }); $filename = uuid::generate(); $extenstion = $file[0]->getclientoriginalextension(); $fil

php - cannot select a row in mysql -

edit1 : used double quotes , single quotes getting same error. edit2 : same query returning me result in mysql shell i selecting row table. if(!isset($_get['title']) || !isset($_get['user'])){ echo "hi"; //something come here } else{ $title = $_get['title']; $title = mysqli_real_escape_string($conn,$title); $user = $_get['user']; $user = mysqli_real_escape_string($conn,$user); echo $title ; echo $user ; // tried giving value directly test no luck $query = "select * site client=\"chaitanya\" && title=\"werdfghb\" "; $result5 = mysqli_query($conn,$query) or die(mysqli_error()); $count = mysqli_num_rows($result5); echo $count ; while($result9 = mysqli_fetch_array($result5)){ $kk=$result9['url']; echo $kk ; } $page = $kk; include ( 'counter.php'); addinfo($page); } in database there row columns title , client , values entered in row when echo count(no of

How can I get Xdebug working in PHPStorm with Laravel? -

i'm following laracast phpstorm , setting xdebug. when run xdebug on controller in laravel project, prompts me install chrome extension. if install said chrome extension, browser window stating fatal error: class 'basecontroller' not found . jeff doesn't mention extension, nor in comments. result, i'm not seeing in debugger except "connected jetbrains chrome extension". gives? followed tutorial precisely. i follow jetbrains guide plus proxying tunneling 9000 port. for me proxying / tunneling debugger connection trick. i need bring port 9000 local machine this: ssh -r 9000:localhost:9000 vagrant@192.168.50.10 //or wathever ip of homestead instead of run homestead sh login homestead machine. i hope works you.

c# - Why is my table not being generated on my PDF file using iTextSharp? -

i'm trying add table pdf file i'm generating. can add stuff "directly" want put various paragraphs or phrases in table cells align nicely. the following code should add 3 paragraphs "free-form" first, same 3 in table. however, first 3 display - table seen. here's code: try { using (var ms = new memorystream()) { using (var doc = new document(pagesize.a4, 50, 50, 25, 25)) { using (var writer = pdfwriter.getinstance(doc, ms)) { doc.open(); var titlefont = fontfactory.getfont(fontfactory.courier_bold, 11, basecolor.black); var doctitle = new paragraph("ucsc direct - direct payment form", titlefont); doc.add(doctitle); var subtitlefont = fontfactory.getfont("times roman", 9, basecolor.black); var subtitle = new paragraph("(not used reimbursement of services)", subtitlefont)

Trying to add string objects into a linked list in alphabetical order by using compareTo but I am stuck on inserting elements in the middle. Java -

public void addelement(object element) { if(first == null) //empty list { addfirst(element); } else { //having these move boolean cloud = true; linkedlistiterator hamsters = new linkedlistiterator(); while (hamsters.hasnext() && cloud) //while there elements in list. { //getting strings compare string str = (string) element; //string entered system.out.println(str +" string entered"); string str2 = (string) hamsters.next(); system.out.println(str2 +" string inside list"); //if string entered greater second string, insert new node. if(str.compareto(str2) > 0 || str.compareto(str2) == 0) { hamsters.add(element); cloud = false; } } } the problem code compares first element (and inserts element after first element) in linked list. if

android - Any idea why setting the background in custom notification using an attribute resource crashes? -

i'm trying set background color of custom notification main layout color depending of selected theme: android:background="?attr/actionbar_background" it makes app crashes. if replace 'fixed' color works fine: android:background="@color/actionbar_background_back" attr/actionbar_background correctly defined because i'm using in other layouts , works fine here's stacktrace i'm getting: android.app.remoteserviceexception: bad notification posted package com.xxx.yyy: couldn't expand remoteviews for: statusbarnotification(pkg=com.xxx.yyy user=userhandle{0} id=1000001 tag=null score=10 key=0|com.xxx.yyy|1000001|null|10582: notification(pri=1 contentview=com.xxx.yyy/0x7f03003f vibrate=null sound=null defaults=0x0 flags=0x62 color=0x00000000 category=transport vis=public)) is android limitation ? try this: define new style on styles.xml <style android:name="myremotestyle" parent="@style/yourpar

javascript - Disable Anchor Within Hover Div on Mobile Until Open -

i've searched high , low can't find solution exact problem. on desktop browser, when user hovers on image, div appears , can click link within div if want. however, on mobile device, hover triggered click. if user clicks in right spot, though div isn't visible yet, can accidentally click anchor , navigate away page. (in other words, div goes display:none display:block @ same time link clicked.) i want prevent accidental click happening on mobile browsers, still want link usable once div visible. my code: <style> .staffpic { position: relative; width: 33.33333%; height: auto; } .staffpic:hover .popup { display: block; } .staffpic img { display: block; width: 110px; height: 110px; margin: 0 auto; } .popup { display:none; position: absolute; bottom: 0; left: -5px; width: 100%; height: 100%; box-sizing: border-box; padding: 15px; background-color: rg

Send/Receive in Outlook and close conection via code vba -

i want send/receive in outlook vba , after disconnect sendandreceive() , syncobject don't notify when finished. how can resolve this? the syncobject class provides syncend event fired after microsoft outlook finishes synchronizing user’s folders using specified send/receive group.

database - MySQL dbCursor not working -

here's code. trying move cart items order items table. possibly wrong not working? create procedure `insert_order_details` (in `customer_id` varchar(255), in `order_id` varchar(255), in `shipping_country` varchar(255), in `shipping_state` varchar(255), in `shipping_address` varchar(255)) begin declare v_finished integer default 0; declare product_id varchar(255); declare quantity integer; declare unit_price integer; declare cart_cursor cursor select @order_id, product_id , quantity, unit_price, userid cart userid=@customer_id , status = 'pending'; declare continue handler not found set v_finished = 1; open cart_cursor; read_loop: loop fetch cart_cursor order_id, product_id, quantity, unit_price, customer_id; if v_finished = 1 leave read_loop; end if; insert order_details (order_id,product_id, quantity, unit_price, customer_id,shipping_country,shippping_state, shipping_address) values (@o

How can I monitor the Task queues in the .NET TaskSchedulers (across AppDomain) -

as developer, monitor size (and progress) of work in task queues in taskschedulers can evaluate whether experienced slowdown under production load due magnitude or perhaps stall of tasks scheduled. normally attach debugger , inspect task sizes, but: the application running under mono , in production, cannot attach using visual studio i deliver output of analysis on data surveillance input health-monitoring of service i have been through docs , found taskscheduler.getscheduledtasks , delivers information debugger. protected (which circumvent), seem require guarantees frozen threads cannot honor. however, willing use inconsistent data. how list of running tasks in .net 4.0 . focuses on running tasks, not interesting me. interested in size of backlog , whether work progressing. i willing to: use code designed other purposes (such debugger) accept inconsistent data (this statistics , analysis) things not want are: add tracking each task created. some of c

C++/Qt: QTcpSocket won't write after reading -

i creating network client application sends requests server using qtcpsocket , expects responses in return. no higher protocol involved (http, etc.), exchange simple custom strings. in order test, have created tcp server in python listens on socket , logs strings receives , sends back. i can send first request ok , expected response. however, when send second request, not seem written network. i have attached debug slots qtcpsocket 's notification signals, such byteswritten(...) , connected() , error() , statechanged(...) , etc. , see connection being established, first request sent, first response processed, number of bytes written - adds up... only second request never seems sent :-( after attempting send it, socket sends error(remotehostclosederror) signal followed closingstate , unconnectedstate state change signals. before go deeper this, couple of (probably basic) questions: do need "clear" underlying socket in way after reading ? is possible

cypher - Update to: Adding node to Neo4j Spatial Index -

i'm hoping can provide updated clarification on adding nodes spatial. best instructions can find is: neo4j spatial 'withindistance' cypher query returns empty while rest call returns data however it's 2 years old , has contradictory information acknowledged bug ( https://github.com/neo4j-contrib/spatial/issues/106 ), appears still open. i found tutorial: http://mattbanderson.com/setting-up-the-neo4j-spatial-extension/ which says should add node layer , insert neo4j id# node property, not insert node geom index. my main priority here able query via cypher (within browser) want able query via rest well. so, ideally i'd insert nodes in such way can both. so, questions are: 1) correct steps here allow querying via both rest , cypher? 2) if call /addsimplepointlayer , /index/node add spatial index (both via curl or rest), can use load csv insert nodes , able query spatial plugin via both rest , cypher? 3) if using rest insert nodes, calls (and

ios - iTunes Connect error for archive uploaded from Xcode 6.3: contains invalid version of Swift -

i built , uploaded app itunes connect using release version of xcode 6.3 last night rejected "invalid binary". email app review said using invalid or beta version of swift. appreciate or ideas how work around problem. i created app in release version of xcode (6.1 think) worked on in beta versions of 6.3 on last month or so. causing "invalid binary" rejection, though built , uploaded archive in release version of 6.3? if so, can it? i have tried deleting derived data, revoking certificates, , editing each of app's source code files in release version of 6.3 see if (it didn't). you using old version of swift. inside xcode there should menu option "upgrade latest version of swift" this error can occur if using beta version of swift ahead of app store. if using beta version of xcode, open project in latest release version , try build again. - cannot submit apps compiled in beta app store. if using old swift - try figure out

spring - How can attachment names be retrieved from a JavaMailSender exception? -

i'm using org.springframework.mail.javamail.javamailsender (spring framework 4.1.6). i'm sending multiple emails calling: mailsender.send(mimemessagepreparators); where mimemessagepreparators mimemessagepreparator array. each mimemessagepreparator built follows: mimemessagepreparator mimemessagepreparator = new mimemessagepreparator() { public void prepare(mimemessage mimemessage) throws messagingexception { mimemessagehelper mimemessagehelper = new mimemessagehelper(mimemessage, true); // subscribers of attachment , put them recipients // of email mimemessagehelper.setto(subscribers); // email have same from, bcc, reply to, subject, , body string fromemailaddress = emailtemplate.getfromemailaddress(); mimemessagehelper.setfrom(fromemailaddress); // note: bcc sender email mimemessagehelper.setbcc(fromem

sandbox - Sandboxing untrusted code in c#, Security Permissions seem not working -

this code: system.security.permissionset ps = new system.security.permissionset(permissionstate.none); ps.addpermission(new fileiopermission(fileiopermissionaccess.allaccess,path)); ps.addpermission(new securitypermission(securitypermissionflag.execution)); appdomainsetup ads = new appdomainsetup(); ads.applicationbase= path; appdomain domain = appdomain.createdomain("pluging", null, ads, ps, null); assembly asm = assembly.loadfrom(path + "macrobase.dll"); domain.load(asm.fullname); macrobase.macrobase em = (macrobase.macrobase)domain.createinstanceandunwrap(asm.fullname, "macrobase.macrobase"); em.application(1); parameter path has address of floder contains dll. right "d:\programming projects\server3\macros\c7b465b2-8314-4c7e-be3c-10c0185b4ac6" copy of macrobase.dll inside guid folder. appdomain loads dll , runs method application. i expected last line not able access c:\ due fileiopermissionaccess applied @ be

ruby on rails - Error installing/bundling gem unf_ext -v '0.0.6' -

i'm trying bundle intall unf_ext -v '0.0.6' keep getting error: gem::ext::builderror: error: failed build gem native extension. checking main() in -lstdc++... yes checking ruby/encoding.h... yes creating makefile make "destdir=" clean make "destdir=" compiling unf.cc in file included unf.cc:1: in file included ./unf/normalizer.hh:4: in file included /library/developer/commandlinetools/usr/bin/../include/c++/v1/vector:265: in file included /library/developer/commandlinetools/usr/bin/../include/c++/v1/__bit_reference:15: in file included /library/developer/commandlinetools/usr/bin/../include/c++/v1/algorithm:628: in file included /library/developer/commandlinetools/usr/bin/../include/c++/v1/memory:604: /library/developer/commandlinetools/usr/bin/../include/c++/v1/iterator:341:10: fatal error: '__debug' file not found #include <__debug> ^ 1 error generated. make: *** [unf.o] error 1 make failed, exit code 2 i've run g

php - preg_match_all empty matches -

i want match letter , underscore between 2 dollar signs , matches result. example: i <a href="$url$">foo</a> , want have url or $url$ i've tried following 2 patterns $pattern = "/\$([a-z\_]*)\$/i"; $pattern = "/\$(.*)\$/i"; // well, that's not want. preg_match_all($pattern, $line, $matches, preg_pattern_order); okay should work - @ least on regex101 . doesn't when test within app. empty test results array(2) { [0]=> array(2) { [0]=> string(0) "" [1]=> string(0) "" } [1]=> array(2) { [0]=> string(0) "" [1]=> string(0) "" } } // ... any ideas? here sample text use test (i test per line) <li> <div class="parent"> <a href="$application_url$"> <img preview_image src="$thumbnail$"> <div class="battle_tag">$btag$</div> <div class=&qu

javascript - Pass Selected Radio Value to PHP using onclick, then opening php file to use value in SQL query -

i pretty new coding php , javascript have manged scrape way through far. however, have hit wall. i'm not 100% sure i'm trying can done, or i'm attempting in effective way. i have dynamically filled table, made of rows sql statement using php. on each row radio button, each 1 given unique value based on row number (a unique value in 1 of database columns). attempting program button enables user pass selected radio button value separate php enabled page allow user edit row information using unique row value. also, used confirm option, because add if else statement allows user cancel, if wrong row selected (i haven't attempted yet because haven't been able value pass). page button <input type="button" id="edit_order_button" value="edit order"></input> jquery page $(document).ready(function(){ $("#edit_order_button").click(function(){ var selected = $("input[name ='order_edit_selec

c++ - `static constexpr` function called in a constant expression is...an error? -

i have following code: class myclass { static constexpr bool foo() { return true; } void bar() noexcept(foo()) { } }; i expect since foo() static constexpr function, , since it's defined before bar declared, acceptable. however, g++ gives me following error: error: ‘static constexpr bool myclass::foo()’ called in constant expression this is...less helpful, since ability call function in constant expression the entire point of constexpr . clang++ little more helpful. in addition error message stating argument noexcept must constant expression, says: note: undefined function 'foo' cannot used in constant expression note: declared here static constexpr bool foo() { return true; } ^ so...is two-pass-compilation problem? issue compiler attempting declare member functions in class before of them defined? (note outside of context of class, neither compiler throws error.) surprises me; intuitively, don't see reason static

mezzanine - django-categories - cannot add parent category -

i've installed django-categories mezzanine cms , cannot use it. here description: installation: pip install django-categories >> added "categories" , categories.editor in settings.py >> python manage.py syncdb >> python manage.py migrate i go admin page , select categories left menu (url: http://localhost:8000/admin/categories/ ) => first run, there no categories => click "+add" => give name new category => click save , following error: traceback: file "/home/user1/.envs/bs-3/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) file "/home/user1/.envs/bs-3/local/lib/python2.7/site-packages/django/contrib/admin/options.py" in wrapper return self.admin_site.admin_view(view)(*args, **kwargs) file "/home/user1/.envs/bs-3/local/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapped_