Posts

Showing posts from February, 2012

xamarin.android - How to use Google Maps v2 API with MVVMCross -

i'm trying google maps v2 api working mvvmcross v2 (vnext) , have run problems. the example have using google maps mvvmcross has view inherits mvxbindingmapactivityview. trouble uses mapview google maps v1 api, api deprecated , google no longer issuing license keys. i have code adapted xamarin google maps v2 example works great: https://github.com/xamarin/monodroid-samples/tree/master/mapsandlocationdemo_v2 but don't understand how working mvvmcross v2. uses fragments, , i'm not sure whether supported current version of mvvmcross? i can google maps v2 activity working fine outside of mvvmcross framework firing off intent mvvmcross view, , option, wondering if there support inside mvvmcross google maps v2 or whether hackery involved more trouble it's worth. thanks! matthew the maps code in v1 ( master ) , v2 ( vnext ) mvvmcross both relied on google maps v1 api - no longer option new apps. meanwhile, master , vnext firmly rooted in android

CSS <button> Reset: Vertical Label Position? -

Image
i want reset button 's inherited css behaves other inline-block element. however, i've run problem text of button forever stuck vertically-centered. in fiddle (and screenshot) below, button , div have exact same styles according chrome developer console, yet button's text vertically-centered, while div's not: http://jsfiddle.net/rgthree/vt3a7/ anyone know of property or selector reset button, including label position? answer there's no way in browser other chrome ~25. reached out chromium project not working in chrome 27 (see @winterblood answer & comments). said this: the issue use margin:auto on anonymous block inside button centering inside button in order safe-centering. so, unfortunately, there's no way style css. able control behavior before implementation detail leaking out. so, true answer cannot style in browser, except chrome ~25 -webkit-box-align inadvertently exposed to, @winterblood answered. for webkit nee

eclipse - Using flamingo ribbon in e4 application -

started application using flaming ribbon technology ( http://insubstantial.github.io/insubstantial/flamingo/ ) , looks nice. because software package growing fast, want use more flexible way handle code , application. looking around, found e4 (eclipse rich client platform) fit needs. plug-in technology , wondering, if there way integrate flamingo ribbon technolgy e4 applications. not bounded eclipse rcp, need plugin-framework, moveable , dockable windows , flamingo ribbon bar. have recommendation or hints how integrate flamingo e4? cheers carsten

oracle - select to get null value rows for concatination -

here table (table_1) select * table_1; pk_1 pk_2 pk_3 pk_4 pk_5 col_1 col_2 col_3 ---- ---- ---- ---- ---- ----- ----- ----- aaa bbb ccc ddd 1 1 2 3 aaa bbb ccc ddd 2 4 5 6 aaa bbb ccc ddd 3 7 8 9 i want output this: pk_1 pk_2 pk_3 pk_4 aggregate ---- ---- ---- ---- ------------------- aaa bbb ccc ddd 123 456 789 000 000 so have tried far: select pk_1 ,pk_2 ,pk_3 ,pk_4 , listagg (col_1 || col_2 || col_3 , ' ')within group (order pk_1 ,pk_2 ,pk_3 ,pk_4 , pk_5) "aggregate" table_1 group pk_1 ,pk_2 ,pk_3 ,pk_4 ; pk_1 pk_2 pk_3 pk_4 aggregate ---- ---- ---- ---- ----------- aaa bbb ccc ddd 123 456 789 the problem not getting 000 000 output because data missing 4th , 5th rows. need query output aggregate column in format xxx xxx xxx xxx xxx having 000 if respective rows missing according pk_5 . help please.. thinking needs with clause have no clue implement.

java - Android app says the file does not exist but it does. I need to install it -

here code: string dir = getfilesdir().getabsolutepath(); file myfile = new file(dir+"/file.apk"); if (myfile.exists()) { textview.settext("file exists."); } else { textview.settext("file not exist."); } myfile.exists() false. not know why. file exists , located in directory. when solve problem, i'll try this: intent intent = new intent(intent.action_install_package); intent.setdata(uri.fromfile(myfile)); intent.putextra(intent.extra_not_unknown_source, true); intent.setflags(intent.flag_activity_new_task); startactivity(intent); can help? why not see file? update: it's strange. if use code: if (myfile.exists()) { textview.settext("it exists"); } else { textview.settext(myfile.getabs

c# - Not supported MySQL source of file -

i've been looking hours solution, literal string @ , changing picture box image etc. in result i'm still stuck , here's problem i'm trying change picture box image image.fromfile, here's code string filepath = picturesource.tables[0].rows[0][0].tostring(); pbtile.image = image.fromfile(filepath); pbtile.invalidate(); picturesource dataset (select bla bla bla) , returns sources of image for ex : ‪d:\my project\semester 3\software development\untitled.png and in breaks @ pbtile.image line giving me error : "the given's path format not supported" is there wrong code or source? i've been looking hours , didn't find solution thanks guys edit 1 well seems this has solved problem don't know makes colon(:) on 3rd place made windows unsupport path, did retype path again on database , it's fine, seems there's hidden character between them. thanks well seems has solved problem don't know makes colon(:) on

haskell - Pattern matching in instances of Tofu [LYAH example] -

i'm playing weird tofu example lyah. i've little bit simplified eliminating record fields frank constructor, here it: class tofu t tofu :: j -> t j data frank m = frank (m a) deriving (show) instance tofu frank tofu x = frank x it's working , rather clear. want make value of type a modified tofu function. i've started expansion of value of x in instance declaration: instance tofu frank tofu (m y) = frank (m y) as result i'm getting: tofu.hs:13:15: parse error in pattern: m ok, next i've tried actual pattern matching inside instance declaration: instance tofu frank tofu (just y) = frank (just y) as result i'm getting: tofu.hs:16:15: couldn't match type `j' `maybe' `j' rigid type variable bound type signature tofu :: j -> frank j @ tofu.hs:16:9 expected type: j actual type: maybe in pattern: y in equation `tofu': tofu (just y) = frank (just y) in inst

php - Set conditional on template based on a refering page -

i trying create conditional template in wordpres condition should passed if referring page search page: i aware url_to_postid(wp_get_referer()) me page id of refering page in case not work search page not have id. there other way can this? edit: wordpress url search http:/mywebsite.com/?s=aaa search term depending using , how reliable needs use $_server['http_referer'] taken php manual the address of page (if any) referred user agent current page. set user agent. not user agents set this, , provide ability modify http_referer feature. in short, cannot trusted. you might better off either using post/get send parameter next page, or using session if need more reliability , or control.

excel - Copy data from a worksheet to another stepping by 6 -

Image
i have bit of problem : have 3 worksheets: - a.xlsm, - b.xlsm - c.xlsm. the worksheets have 1 sheet (sheet1) .the 3 worksheets fixed , not change. want copy cells a.xlsm- f1, l1, s1, w1 (jumping 6 cells) b.xlsm-column h- h1, h2, h3, h4 , a.xlsm- f2, l2, s2, w2 copy in c.xlsm- column h- h1, h2, h3, h4. any welcomed. thank you. sub testcopydata() dim wba workbook dim wbb workbook set wba = activeworkbook set wbb = "\\hofs\mike1.xlsm" dim sheeta worksheet dim sheetb worksheet sheeta = wba.sheets("sheet1") sheetb = wbb.sheets("sheet1") dim rowa integer dim lastrowa integer lastrowa = sheeta.cells(sheeta.rows.count, 1).end(xlup).row dim cola integer dim lastcola integer lastcola = sheeta.cells(1, sheeta.columns.count).end(xltoleft).column if strcomp(sheets("sheeta").cells(aa, 1).value, sheets("sheetb").cells(a, 1).value) = 0 then for rowa = 1 lastrowa cola = 1 lastcola sheetb.cells(c

ios - Why is "data" not a dictionary -

i'm trying parse json i'm getting api using swiftyjson , it's giving me error: optional(error domain=swiftyjsonerrordomain code=901 "dictionary["data"] failure, not dictionary" userinfo={nslocalizeddescription=dictionary["data"] failure, not dictionary}) the json: { "status": 200, "error": "", "data": { "cursusses": [ { "cursus": { "curid": 1, "curnaam": "lightroom tips & tricks", "catid": 1, "curinfo": "praktische en korte tips en tricks om sneller en prettiger met lightroom te kunnen werken.", "curthumbnail": "lr5-tips-en-tricks.jpg" } }, { "cursus": { "curid": 2, "curnaam": "lightroom

How to combine two Android source code easily? -

my app has 2 activities, these activities in different android project separately. project a: com.myapp.mainactivity project b: com.other.mainactivity now development complete. need combine them in 1 app for java code, easily, because package different. but res, such layout, string, values, image. since in same folder, no package, no namespace, got many conflict now need spend many efforts add prefix each item, , modify source cdoe make work. is there way combine them without changes? convert both project library project , add new project or main project. to make project library project, use apply plugin: 'android-library' in build.gradle instead of apply plugin: 'android'

ios - SKScene crashing the app while closing the view controller -

i following tutorial float hearts periscope. link tutorial to give basic hint, posting code below let heartheight: cgfloat = 18.0 let heartsfile = "heart-bubbles.sks" class heartbubblesscene : skscene { var emitter: skemitternode? override func didmovetoview(view: skview) { scalemode = .resizefill // make scene's size == view's size //backgroundcolor = uicolor.clearcolor() } func beginbubbling() { emitter = skemitternode(filenamed: heartsfile) let x = floor(size.width / 2.0) let y = heartheight emitter!.position = cgpointmake(x, y) emitter!.name = "heart-bubbles" emitter!.targetnode = self emitter?.numparticlestoemit = 1 addchild(emitter!) emitter?.resetsimulation() } in viewdidload, have code present scene heartbubblesview.presentscene(heartbubblesscene) where heartbubblesview skview, made through outlet. issue arises when , fro view controller , suddenly, crashed , shows me below

php - PDF management on WordPress plugin -

i want create e-library page in wordpress. want on page listed pdf have on media library. want able list them, search name, filter date or category. i'm using media-category-library plugin don't much, because of search page.. best plugin this, i'm new in wordpress , don't have idea how define plugin best? can me?

regex - Find after pattern plus next line -

Image
in html file php included <table> <tbody> <tr> <td>td1</td> <td>td2</td> </tr> <tr> <td colspan="3"> <?php echo 'something' ?> </td> <td> <?php echo echo 'something' ?> </td> <td> <?php echo 'something' ?> </td> </tr> </tbody> </table> i'd find <?php comes after <td ...> + next line . (here not td1 , not td2 ) approach: (?s)(<td.*?>)+(\n) ... matches <td>td1</td> , <td>td2</td> what comes after (?s)(<td.*?>) ? to remove <?php...?> can replace (<td[^>]*>)\s*<\?php.*?\?> $1 : explaining: (<td[^>]*>) # store in $1 want retri

c++ - CImg - Saliency with spectral approach -

i trying implement spectral approach saliency of image cimg, i'm having trouble getting there. might seems repost question ( spectral residual saliency detection in c++ cimg ) think got right 2 mistakes question (atan2 , fft arguments). here's code: int main(int argc, char * argv[]) { const char * input_file = "img/pic.png"; cimg<float> input = cimg<float>(input_file); const cimg<float> mask(3,3,1,1,1.0f/9.0f); resize_fft(input); // resize fft cimg<float> gray = any2gray(input); // single channel grayscale cimglist<float> fft = gray.get_fft(); cimg<float> amp = (fft[0].get_pow(2) + fft[1].get_pow(2)).get_sqrt(); cimg<float> amp_log = (amp + 1.0f).get_log().get_normalize(0, 255); cimg<float> phase = fft[1].get_atan2(fft[0]); cimg<float> residual = amp_log - amp_log.get_convolve(mask); cimg<float> real = residual.get_exp(); cimg<float>::fft(rea

emacs - Org-mode tag search results in separate buffer -

in org-mode, when search on tags c-c \, current buffer highlighted in yellow matching tags. sparse tree in separate buffer. have read depends on variable org-agenda-window-setup, don't have variable,when check alt-x using emacs24 on ubuntu. how can sparse tree in separate buffer? thanks saikari

android - Activity Lifecycle mismatch when turning off the display -

to solve problems regarding app pause/resume, tested activity lifecycle following simple app: public class mainactivity extends activity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.content_main); log.w("xxx", "create"); } @override public void onstart(){ super.onstart(); log.w("xxx","start"); } @override public void onresume(){ super.onresume(); log.w("xxx","resume"); } @override public void onpause(){ super.onpause(); log.w("xxx","pause"); } @override public void ondestroy(){ super.ondestroy(); log.w("xxx","destroy"); } @override public void onstop(){ super.onstop(); log.w("xxx","stop"); } @overrid

javascript - wp_head not working in plugin -

i've written simple plugin own use , i'm trying insert javascript head tag. if use add_action( 'init', 'add_to_head' ); then works, loads before jquery no good. if use add_action( 'wp_head', 'add_to_head' ); then nothing happens @ all! function i'm trying call. function add_to_head() {?> <script>alert("test");</script><?php } there's no errors in console unless use add_action 'init' says jquery not defined (obviously). update if use add_action( 'get_footer', 'add_to_head' ); works! i'm not sure if right hook use. use wp_footer hook, there nothing wrong use wp_footer hook. <?php function add_to_head() {?> <script>alert("test");</script><?php } add_action( 'wp_footer', 'add_to_head' ); ?>

how can I show the navigation gps data on google maps? -

i have gps device populates data continuously. need show movement on google maps. example user moving phoenix la. need show movement blue marker on google maps showing movement along path traveled. is possible there maps api me like: keep pinging new lat, long google maps. , google maps keep showing advancing movement on map. you need implement locationlistener force implement 4 methods. 1 of methods onlocationchanged method, when location changes update , want. guess want update , show current location. it important use requestlocationupdates() , check out: http://developer.android.com/training/basics/location/locationmanager.html

windows - What is the actual use of rundll32.exe? -

i searching why rundll32.exe process running on system, when found out information acts container run dll application / exe. cannot comprehend reason / use case in want dll run application. aren't libraries meant provide functional support rather running individual application? rundll32 isn't meant generically "run dlls" (it make no sense, dlls don't have single entrypoint , "classic" dlls don't have enough meta-information call correctly of exported symbols). instead, allows use dlls conforming defined specifications act executables multiple entrypoints; think idea either allow coalescing multiple small utilities shared code single binary, and/or provide "testing" entrypoints (to invoked manually) libraries meant consumption other applications. what rundll loading dll in memory , invoking specified function, expectation has have same signature of exe entrypoint. more information available in relevant kb article .

Getting "java.nio.charset.UnmappableCharacterException: Input length = 1" -

i getting unmappablecharacterexception on collect() method call (or on tolist() call): private static void handletransaction(path a_filepath, string a_strasactionname, string a_stransactionfilepath) { // read file stream, try-with-resources try (stream<string> stream = files.lines(paths.get(a_filepath.tostring()), charset.defaultcharset())) { list<string> list = stream.filter(line -> (line.indexof(a_strasactionname) > 0)) .collect(collectors.tolist()); list.foreach(line -> { system.out.println(line); try (bufferedwriter writer = files.newbufferedwriter(paths.get(_files_path + a_stransactionfilepath),charset.defaultcharset(), standardopenoption.append)) { writer.write(line + "\n"); } catch (ioexception e) { e.printstacktrace(); } }); } catch (ioexception e1) { e1.printstacktrace(); } it wo

oracle - Why is ojdbc14.jar not supporting shutdown and startup , they were supported in version 5 and 6 -

ocon.shutdown(oracleconnection.databaseshutdownmode.immediate); this line giving compilation error. using ojdbc14.jar . supported in ojdb5.jar . oracle's naming confusing (though influenced java): ojdbc14.jar older ojdbc5.jar. ojdbc14.jar java 1.4 (not supported anymore) ojdbc5.jar java 5 ojdbc6.jar java 6 ojdbc7.jar java 7 , 8

c# - No data insertion (message: insertion successful) -

private void isave_itemclick(object sender, devexpress.xtrabars.itemclickeventargs e) { using (sqlconnection conn = new sqlconnection(connection.con)) { conn.open(); using (sqlcommand cmd = new sqlcommand(@"insert [city] (name) values (@name)", conn)) { cmd.parameters.addwithvalue("@name", city.text.tolower()); messagebox.show(city.text); messagebox.show("insertion successful"); } using (sqlcommand cmd = new sqlcommand(@"insert [state] (name) values (@name)", conn)) { cmd.parameters.addwithvalue("@name", state.text.tolower()); messagebox.show("insertion successful"); } conn.close(); } } program not inserting,

c# - Unit Test for Event handlers -

i want test whether event has raised or not using unit testing. in project, passed progress value 1 class using event handler. working on mvvm method so, passed value model class viewmodel class. how write unit test event handler. i try write unit test event handlers called gettotalfilesize , transferredfilesize.but not raise events on test. so, have do? [test] public void isgettotalfilesizeeventfired() { worflowmanager = new mock<iworkflowmanager>().object; ripwatcherwindowshellviewmodel = new ripwatcherwindowshellviewmodel(worflowmanager); ripwatcherwindowshellviewmodel.gettotalfilesize += delegate { eventraised = true; }; assert.istrue(eventraised); } //production code is.. public ripwatcherwindowshellviewmodel(iworkflowmanager workflowmanager) { workflowmanager = workflowmanager; workflowmanager.transferredusffilesizechange

javascript - Cannot type into textarea with fastclick on iOS 9 -

i've spent last few days search solution, should work (according documentation) not. i'm using fastclick eliminate 300ms delay html5 application intended run on ipad. works great, except lost ability type text textarea. simple one-line fields work, not multi-line textarea. when tap on text area, keyboard pops , can start typing. first letter typed appears in text area - that's all. subsequent letters not. if close keyboard , tap on text area again, can type 1 letter in. i've tried suggested, including needsclick , needsfocus , etc. tried edit fastclick.js extend special code handling input elments cover textarea - nothing. i'm @ point may have dump fastclick because of , manually myself, lost week on problem. yet, before go way, maybe can point me in right direction. note, problem present on ipad , iphone ios 9.2 (specifically, 9.2.1 - latest version). ok, reason turned out rather simple - , nothing fastclick. this answer solved m

c# - Customizing a datagridview runtime -

i new c#,asp.net. creating small application want list data. below mentioned function binds data 3 columns. property name, property 'referenceid' , post date. using (sqlconnection con = new sqlconnection(strconnstring)) { using (sqlcommand cmd = new sqlcommand("proc_recent_history_header")) { cmd.commandtype = commandtype.storedprocedure; cmd.parameters.addwithvalue("@id", member); cmd.connection = con; con.open(); reader = cmd.executereader(); gridview1.datasource = reader; gridview1.databind(); con.close(); } asp.net <asp:gridview id="gridview1" runat="server" class="form-control" width="100%" viewstatemode="enabled" autogeneratecolumns = "false">

php mysql insert query having trouble -

i have query not inserting if use clause, without clause inserts data. weird , have never seen happen before in wamp $key=substr(md5(rand(0, 1000000)), 0, 5) ; $key1="insert login(key_id) values('$key') (email_id = '" . mysql_real_escape_string($_post['email_id']) . "')" if(mysql_query($key1)) { $message = 'user added!.'; echo "<script> alert('$message'); location='forgotpassword.php'; </script>"; } if echo $_post['email_id'] return valid result insert , not mix. when inserting, creating new record. used selecting deleteing or updateing, when have specify filter rows want select, delete or update. if want insert row, not use where. if want change row, use $key1="update login set key_id = '$key' (email_id = '" . mysql_real_escape_string($_post['email_id']) . "')";

java - how to add times to loop everytime the method runs? -

i need have loop loops x times after x times stops , adds 5 times loop. how can , doing wrong? private void loopmethod(anclass somename) { int g = 0; random o = new random(); int l = 50; int = l + g; //system.out.println(g); (int k = 0; k < a; k++) { int p = o.nextint(100); if(a == 100){ k = 101; } if (p == 1) { k = 101; } else { } } g = g + 5; } start declaring g global variable. can follows: /* global declarations */ private random o = new random(); private int g = 0; /* logic */ private void loopmethod(anclass somename) { (int k = 0; k < 50 + g; k++) { if(g == 50 || o.nextint(100) == 1) k = 101; else /* */ } g += 5; } this should fulfill needs.

simulator - How to simulate ESME send SMS to a mobile client -

i want simulate process of esme sending sms person b. how can this? tried logicaopensmpp. can send sms smsc esme don't know how forward message client. how can so? or there alternatives? thanks logicaopensmpp doesn't have forward function website stated the application behaves real smsc smpp interface, application can bind it, send messages, unbind etc., nothing delivered anywhere responses made-up simulator. if need that, download source , try inject forward functions.

More .class files generated than existing .java files after compilation -

this question has answer here: multiple .class files generated class? 5 answers i trying compile huge open source java project, , after building maven saw folders contain classes didn't exist before in corresponding folder. in other words, after building java project, more .class files generated in folders .java files existed before compiling. can explain reason? normal? practices lead such results , change structure of project? all nested classes have own .class file, resulting in more .class file .java files.

ruby - Understanding Celluloid Concurrency -

following celluloid codes. client1.rb 1 of 2 clients. (i named client 1) client2.rb 2nd of 2 clients. (named client 2 ) note: the difference between above 2 clients text passed server. i.e ( 'client-1' , 'client-2' respectively) on testing 2 clients (by running them side side) against following 2 servers (one @ time). found strange results . server1.rb ( a basic example taken readme.md of celluloid-zmq ) using example server 2 above clients resulted in parallel executions of tasks. output ruby server1.rb received @ 04:59:39 pm , message client-1 going sleep received @ 04:59:52 pm , message client-2 note: the client2.rb message processed when client1.rb request on sleep.( mark of parallelism ) server2.rb using example server 2 above clients did not resulted in parallel executions of tasks. output ruby server2.rb received @ 04:55:52 pm , message client-1 going sleep received @ 04:56:52 pm , message client-2 note: th

jvm - How do I write a correct micro-benchmark in Java? -

how write (and run) correct micro-benchmark in java? i'm looking here code samples , comments illustrating various things think about. example: should benchmark measure time/iteration or iterations/time, , why? related: is stopwatch benchmarking acceptable? tips writing micro benchmarks from creators of java hotspot : rule 0: read reputable paper on jvms , micro-benchmarking. 1 brian goetz, 2005 . not expect micro-benchmarks; measure limited range of jvm performance characteristics. rule 1: include warmup phase runs test kernel way through, enough trigger initializations , compilations before timing phase(s). (fewer iterations ok on warmup phase. rule of thumb several tens of thousands of inner loop iterations.) rule 2: run -xx:+printcompilation , -verbose:gc , etc., can verify compiler , other parts of jvm not doing unexpected work during timing phase. rule 2.1: print messages @ beginning , end of timing , warmup phases, can verify there no output ru

Getting Task list from Microsoft Graph with app-only scopes -

is possible retrieve task lists using microsoft graph api ( http://graph.microsoft.io/docs/api-reference/beta/api/task_list ) in service app? i can request token has of following scopes: calendars.read calendars.readwrite contacts.read directory.accessasuser.all directory.read list item directory.read.all directory.readwrite.all email files.read files.read.selected group.read.all group.readwrite.all mail.read mail.send notes.create notes.read notes.read.all notes.readwrite.all offline_access openid people.read profile sites.read.all tasks.readwrite user.read user.read.all user.readbasic.all user.readwrite user.readwrite.all user_impersonation i able lists of users, groups, applications , other entities, requests tasks or plans endpoints return following error: { "error": { "code": "unknownerror", "message": "<!doctype html public \"-//w3c//dtd xhtml 1.0 strict//en\" \"

c++ - unresolved symbol for opencv error -

i've spent last 2 days trying opencv work. im using visual studio 2015 community , opencv 3.1.0. i've added lib files , dlls , configured properties project. insight great have no clue how fix this. #include <opencv2\opencv.hpp> using namespace cv; int main() { namedwindow("win"); waitkey(0); return 1; } the code above throws following error. lnk2019 unresolved external symbol "void __cdecl cv::namedwindow(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,int)" (?namedwindow@cv@@yaxaebv?$basic_string@du?$char_traits@d@std@@v?$allocator@d@2@@std@@h@z) referenced in function main opencv namedwindow belongs highgui library. try adding #include<opencv2\highgui.hpp> and link corresponding library. also, namedwindow has 2 arguments: "windowname" , cv_window_type , latter can be: cv_window_autosize cv_window_normal and ot

c# - Disable "Constant Literals Pruning" in Eazfuscator.NET -

i disable "constant literals pruning" in eazfuscator.net (assembly level). how possible? background: use enums in custom attribute constructor. type of constructor parameter object, because attribute class in assembly doesn’t reference assembly containing enum. before obfuscation: [myattribute(myenum.value3)] public class myclass { } after obfuscation (decompiled): [myattribute(2)] public class myattribute : attribute { } in constructor of attribute cast value enum. generates exception in obfuscated assembly, not in unobfuscated variant: public class myattribute : attribute { public myattribute(object value) { var x = (enum) value; // throws invalidcastexception after obfuscation } } i'm colleague of frans, , thought of following solution. able cast integer enum-value, have pass type of enum. any thoughts? [myattribute("description", param1: myownenum.myparticularenumvalue, param2: myownenum.myparticularen

list - What's wrong with my for loop? Python -

this loop should iterate on 'lines' in input, holds users name place in dictionary key, dictionary inside key. output include information needed, odd lines not want. i'm new python i'm still trying understand syntax. here's code: def get_name(string_input): split_fullstop = string_input.split('.') list = [] #creates list line in split_fullstop: count = 0 if count % 2 == 0: #if count list.append(line.split('is connected to')) #add info 'list' count += 1 #increase count names = {name[0]:{} name in list} return names and here's output after printing function: {'': {}, 'levi ': {}, 'bryant ': {}, 'jennie likes play super mushroom man, dinosaur diner, call of arms': {}, 'olive likes play legend of corgi, starfleet commander': {}, 'debra likes play 7 schemers, pirates in java

php - How to condition behavior in a unit to global config value -

if want write s.o.l.i.d. code what's best way condition behavior inside loosely coupled , testable unit global configuration value? is better inject sort of object containing information or reference global static/singleton? i'm working php guess question language agnostic. thanks in advance. if have 2 different behaviors depending on global state / configuration, refactor out strategy (strategy pattern) , inject strategy. it job of main inject correct strategy depending of configuration. if strategy depends on changing configuration i.e. configuration changes @ runtime, strategy should wrapped in provider/supplier. (probably not case php) an alternativ have generic feature-toggle type injected. toggle can setup main return true or false. toggle object can have more complex logic simple boolean, depends on usecase. but don't alternative, because simpler class didn't know 2 different behaviors.

php - Warning: mail(): Could not execute mail delivery program '/usr/sbin/sendmail -t -i' in /home/ipx12489/public_html/ -

i got above warning when trying send email ajax php file. trying code: $to = "suman5571@gmail.com"; $subject = "this subject"; $message = "<b>this html message.</b>"; $message .= "<h1>this headline.</h1>"; $header = "from:suman5571@gmail.com \r\n"; $header = "cc:dhillon0jags@gmail.com \r\n"; $header .= "mime-version: 1.0\r\n"; $header .= "content-type: text/html\r\n"; $retval = mail ($to,$subject,$message,$header); if( $retval == true ) { echo '1'; } else { echo '0'; } you should check sendmail_path settings in php. check if program exists , installed.

How do I populate a hash (that has been defined in a separate file) in my Perl script and do necessary operations on it? -

how populate hash (that has been defined in separate file) in perl script , necessary operations on it? for ex: file1.pl -- contains defined hash, file2.pl -- user defined code should populate hash file1.pl my %tgs = ( 'articles' => { 'vim' => '20 awesome articles posted', 'awk' => '9 awesome articles posted', 'sed' => '10 awesome articles posted' }, 'ebooks' => { 'linux 101' => 'practical examples build strong foundation in linux', 'nagios core' => 'monitor everything, proactive, , sleep well' }, ); @gibron has answered question. show code, may more interested. way of populating ordinary hash same of populating 'hash on hash'. i'm using data::dumper show hash structure directly, can choose own way know final hash contains. use strict; use data::dumper qw(dumper); 'fil

How to display total of records in jqgrid -

i trying display total records in jqgrid. here code using display.grid displaying not getting total. and getting error:footer-row invalid propert can tell me mistake? $("#jqgrid").jqxgrid( { pagesize: 5, source: dataadapter, width: 700, sortable: true, pageable: true, autoheight: true, columnsresize: true, filterable: true, showfilterrow: true, showtoolbar: true, footerrow: true, userdataonfooter:true, rendertoolbar: function (toolbar) { var container = $("<div style='overflow: hidden; position: relative; margin: 3px;'></div>"); var exportbutton = $("<div style='float: right; margin-right: 5px;'> <img style='position: rel

How do you retrieve the first n lines of a file? (php) -

$filename = file ("gstbook.txt"); $rows = count ($filename); // $char string added file. if ($char != '') { $char = str_replace ("\n","<br>",$char); $char = strip_tags ($char, '<br>'); $newrow = '<tr><td>' . ($username) . ": " . ($char) . '</td></tr>'; $oldrows = join ('', file ('gstbook.txt') ); $filename = fopen ('gstbook.txt', 'w'); fputs ($filename, $oldrows . chr(13) . chr(10) . $newrow); fclose ($filename); } i'm working tutorial on website. it's guestbook program i'm trying turn tiny chat use 1 of other apps. where i'm stuck has these 2 lines: $oldrows = join ('', file ('gstbook.txt') ); and: fputs ($filename, $oldrows . chr(13) . chr(10) . $newrow); i can tell it's inputting entire file single string. outputting string. haven't been able figure out google how make

javascript - Scrolling does not minify iphone browser -

i searched on can't find solution. have mobile website using container div (width , height 100%). use -webkit-overflow-scrolling: touch; make content in div smooth scrolling. however, when scroll down in iphone addressbar shrink , controls @ bottom totally disappear. because of container div having same size body phone not detect scrolling in body. , therefor not optimize screen availability. know workaround? i fiddled brim , other js solutions nothing seems work. in advance.

javascript - Formatting buttons for contentEditable reflect selection formatting -

Image
we have contenteditable="true" div use wysiwyg text editor. added basic formatting toolbar similar 1 uses medium.com using execcommand() , we're able make selected text bold if, instance, user presses bold button. works great. however, haven't managed yet make bold button highlighted if user selects part of text in bold, illustrated in picture above. done passing is-active class on button of course, how know selected text is, in case, bold ? we think perhaps done using selection api use case seems undocumented. since execcommand() use html tag wrappers b tag bold . when selecting word sure using sort of js show formating tollbar add more code in function this. if(selectedelement.nodename == "b"){ toolbarboldbutton.classlist.add("is-active"); } note: using js function "nodename" tag name wrapped around execcommand() in case bold/b matching if matches tag , if true adding is-active class toolbars bold sty

javascript - Disable collapsing animation in bootstrap on "close" click -

i have made collapsing panels bootstrap. added method "close" , remove panels using angular. problem when close panel, collapsing, open/close functionality still works. panel might open , disappear, when should disappear. here simplified version of html <div class="panel-group"> <div class="panel panel-info fadein fadeout" ng-repeat="p in panels"> <div class="panel-heading" data-toggle="collapse" data-target="#test_{{p}}" style="cursor:pointer"> <h4 class="panel-title"> open / close - {{p}} <span class="glyphicon glyphicon-remove pull-right" ng-click="close(p)"></span> </h4> </div> <div id="test_{{p}}" class="panel-collapse collapse" aria-expanded="false"> <div class="panel-body&q

php - Tinymce Editor not coming up on Croogo on server -

i new croogo. have created few pages on local server. able use editor there when uploaded files on server can't find editor attached, can see few html tags text. is error: parse error: syntax error, unexpected '(' in /hermes/bosoraweb081/b2606/sl.onpointsaliency/public_html/app/plugin/tinymce/webroot/js/tiny_mce.js on line 1 clear cache files under /app/tmp, , delete browser cache since cakephp sets cache plugin assets, , try re-loading page.

Android studio 2.0 Preview 8 with gradle plugin 2.0.0-alhpa8, memory warning despite heap size to 4Gb -

i updated android studio version 2.0 preview 8 , gradle plugin 2.0.0-alpha8. noticed there's warning in case heap space not big enough dexing. as in proper page ( http://tools.android.com/recent ) in 2.0.0-alpha8 we've added automatic diagnostics this: if build process small, switch out-of-memory dexing , emit build warning explaining how bump gradle daemon size. (we're working on additional related improvements next build after alpha8.) when went building project got following error: to run dex in process, gradle daemon needs larger heap. has 3641 mb. faster builds, increase maximum heap size gradle daemon more 4g specified in dexoptions.javamaxheapsize. this, set org.gradle.jvmargs=-xmx4g specified in dexoptions.javamaxheapsize in project gradle.properties. more information see https://docs.gradle.org/current/userguide/build_environment.html actually, lot of these in row. surprises me because that's see in gradle.properties fi

Opencv 4 Android detect boxes -

Image
i'm developing android app recognizes, store shelf image, boxes (products) present on shelf. my approach far following: grayscale bilateral filter (or gaussianblur, i've found using bilateral filter better preserve edges) adaptive threshold dilate (don't know if it's necessary) canny findcontours so, if source image simple, (like b/w drawing of shelf , boxes) can detect them, real images of shelves isn't working. the main problem single boxes have different "foreground" colors , logos, , steps detect edges of "inner" box (i.e., colours inside edges of box) , gives me totally nosense results. simplicity i'll show belows intermediate results , source image: 1)source 2)grayscale 3)bilateral filtering (in case gaussianblur) 4)adaptive threshold 5)dilation 6)canny as can see, because cannot remove foreground of each box, edges given logos or text come play , noises results. how can overcome problem? my ony idea

radio button - RadioButton - Checked if radiobutton is checked inside a radiogroup - Android -

i'm having problem checking if 1 of radiobutton selected inside inside radiogroup , i've tried lot of methods if(rg.getcheckedradiobuttonid() == -1) still not working on code. on logcat string selectedanstext = selectedans.gettext().tostring(); in line logcat pointing problem, can me. tried .ischecked not working. in advanced bt.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { radiobutton selectedans = (radiobutton) findviewbyid(rg.getcheckedradiobuttonid()); string selectedanstext = selectedans.gettext().tostring(); if(rg.getcheckedradiobuttonid()== -1){ toast.maketext(grade_four_post_test.this, "choose answer", toast.length_long).show(); }else { //do } ps: bt declared properly 01-28 22:27:07.390 27612-27612/com.example.computer.mathkiddofinal:second w/system.err: @ android.view.view.performclick