Posts

linux - Are there any replacement for Synaser Serial Communciation tool for Lazarus compiler? -

i working latest lazarus compiler , have worked synaser serial communication previous version of lazarus. has worked flawlessly, latest version of lazarus synaser code not compiling raising sorts of error. so, question this. there replacement synaser tool lazarus? if not, there update synaser tool? fpc 2.6.2 lazarus 1.0.8 there several serial communication (com port) options available lazarus, first suggest giving synaser try. i'm using lazarus 1.2.4 synaser synapse v40 , latest trunk revision without problems. alternative com port implementations: tcomport port lazarus (cportlaz) serial communications windows api (createfile, readfile, setcommmask, etc) more in hardware access , serial communication lazarus

networking - Android InetAddress.getByName(ip).isReachable(timeout) always returns false -

i see 24 similar questions asking inetaddress.isreachable() instance never returns true, when network otherwise reachable, 1 exception of tests against 127.0.0.1 . if (inetaddress.getbyname("google.com").isreachable(2000)) { system.out.println("visible"); } else { system.out.println("not visible"); } and permissions <uses-permission android:name="android.permission.internet" /> <uses-permission android:name="android.permission.access_network_state"/> this code started within thread (of course). app needs know if specific ip accessible (not google, in above example). behaves same in emulator. is there better way test network connectivity?

UIScrollView with iOS Auto Layout Constraints: Wrong size for subviews -

Image
i'm trying generate view in code. here's hierachy of view object uiscrollview uiview uibutton the scrollview should same size window. button should big possible. i'm using ios auto layout, constraint strings of objects this h:|[object]| v:|[object]| i've set translatesautoresizingmaskintoconstraints no each object. the problem button gets default button-size. parent view object (uiview) gets size subviews need. red: uiscrollview / yellow: uiview how can force views big scrollview? when use uiview instead of th uiscrollview works great... here's code: - (void) viewdidload { [super viewdidload]; // scroll view uiscrollview* scrollview = [uiscrollview new]; scrollview.backgroundcolor=[uicolor redcolor]; scrollview.translatesautoresizingmaskintoconstraints = no; //container view uiview *containerview = [uiview new]; containerview.translatesautoresizingmaskintoconst...

scala - Pattern matching on tail of arrays -

i trying implement distinct function on arrays this: def distinct(a: array[int]): array[int] = match { case array() => case array(head, tail @ _*) => head +: distinct(tail.toarray).filter(_ != head) } i don't like, have transform tail toarray every time. otherwise compiler complains tail sequence , not array. possible pattern match better in case? it isn't sexy enough pattern matching, go way: def distinct(a: array[int]): array[int] = match { case array() => case htail => htail.head +: distinct(htail.tail).filter(_ != htail.head) }

c# - Winforms version WPF ScaleTransform? -

i'm attempting create of software zoom image in winforms application. noticed answer similar issue stating achieved mousewheel using private void image_mousewheel(object sender, mousewheeleventargs e) { var st = (scaletransform)image.rendertransform; double zoom = e.delta > 0 ? .2 : -.2; st.scalex += zoom; st.scaley += zoom; } that solution need, appears part of system.windows.media, doesn't seem part of winforms architecture. does know of similar option winforms end resembling functionality? google searches haven't turned :( thanks! you might want graphics.scaletransform . idea of arbitrary transformations part of rendering process isn't all-pervasive in windows forms, transform 1 image image via graphics , believe.

javascript - Exists a way to let crawlers ignore parts of a document? -

i aware can control documents crawler/spider can access robots.txt, meta tags, link attributes , on. but in special case want portion of document being ignored. portion can not exist in iframe, "normal" content. <noscript> blocks amazing, mark partial content "don't index this, please." first, thought using document.write() write out parts, learned assumption "spiders not execute javascript" seems wrong. i thinking serving different version of page when detect crawler, not accurate, right? also, can not put content on image. are there tricks avoid getting specific part of document (not specific words spread around document) indexed? [edit] know "if user agent in list of robots", don't idea. possibly there more agnostic approach. part suppressed contains dynamic content , whatever doing, has work "old" browsers ie6 :\ only difference between static content , dynamic content extension of file incl...

cypher - Neo4j Auto indexing issues -

i have tried auto indexing , have set neo4j.properties file following: # autoindexing # enable auto-indexing nodes, default false #node_auto_indexing=true # node property keys auto-indexed, if enabled #node_keys_indexable=name,type,currentversion,datetimecreated,currentversiondatetime,versioncount, customername,documentreference,version before had set node_auto_indexing=true false , created own index testing want auto index node properties? and when run cypher query returns 0 rows? start n = node:node_auto_index(name = "mike") return n; what doing wrong here? did create nodes when node_auto_indexing false? if so, these existing nodes won't "automatically" indexed when set property true. have manually add them auto index ( http://docs.neo4j.org/chunked/milestone/auto-indexing.html ) note new nodes created node_auto_indexing=true indexed without manual intervention.