Posts

Showing posts from September, 2011

How do implicit joined columns work with Android contacts data? -

i'm querying contactscontract.data table find phone records. i error when create new cursorloader : java.lang.illegalargumentexception: invalid column deleted my code: import android.provider.contactscontract.commondatakinds.phone; import android.provider.contactscontract.data; ... string[] projection = { phone.deleted, phone.lookup_key, phone.number, phone.type, phone.label, data.mimetype, data.display_name_primary }; // "mimetype = ? , deleted = ?" string selection = data.mimetype + " = ? , " phone.deleted + " = ?"; string[] args = {phone.content_item_type, "0"}; return new cursorloader( this, data.content_uri, projection, selection, args, null); any idea why phone.deleted column isn't included in cursor? documentation - some columns associated raw contact available through implicit join. looks you've found feature has been documented in ma...

javascript - Angular Custom Directives: Calling a function with arguments from within the link function -

i'm building list of clickable options filtered input, using custom directive. html: <combobox input-model="mymodel" options="mylist" option-label="label" option-select="selectfn()"></combobox> the directive (simplified): app.directive("combobox", function() { return { restrict: "e", replace: true, template: "<input type=‘text’ ng-model=‘inputmodel’ />" + "<button ng-repeat='option in options | " + "filter: inputmodel’" + "ng-mousedown=‘optionselected(option)’" + ">{{option[optionlabel]}}</button>", scope: { inputmodel: "=", options: "=", optionlabel: "@", optionselect: "&...

android - How to add submenu items to NavigationView programmatically instead of menu xml -

Image
i'm trying add submenu items navigationview programmatically . i'm able add items menu not submenu adding items menu works menu menu = mnavigationview.getmenu(); menu.add(menu.none, menu.none, index, "menu item1"); but adding items sub menu doesn't work menu menu = mnavigationview.getmenu(); submenu submenu = menu.addsubmenu("sub menu title"); submenu.add(menu.none, menu.none, index, "submenu item1"); the trick call baseadapter.notifydatasetchanged on underlying adapter contains menu items. use reflection grab listview or loop on navigationview children until reach it. this isn't up-to-date code, fas know google hasn't pushed recent changes support library, navigationmenupresenter.preparemenuitems called when call baseadpater.notifydatasetchanged . but if want see recent source, can download through sdk manager. choose sources android mnc . navigate to yourandroidsdk/sources/android-mnc/android/support...

Unable to knit R program -

i unable knit file in r. tried reloading both r , r-studio again, did not help. code running fine on console. below error message getting, when try knit r program. error in loadnamespace(i, c(lib.loc, .libpaths()), versioncheck = vi[[i]]) : there no package called 'stringi' calls: <anonymous> ... trycatch -> trycatchlist -> trycatchone -> <anonymous> execution halted any appreciated.

html - Images being distored if width is smaller than container -

i'm trying of these different size images remain undistorted. images great except ones have smaller width container of 285px. i'm ok images being blurry because know stretching them. want of them keep aspect ratios. ones not working images #2, #3, , #4. i can't use javascript this. needs pure css. http://jsfiddle.net/pp74fb7b/9/ .squaregallerywrap { width: 285px; height: 285px; } .squaregallerywrap img { min-width: 100%; min-height: 100%; max-height: 286px; min-width: 286px; display:block; margin:auto; position:relative; -moz-transform:translatex(-50%); -webkit-transform:translatex(-50%); -ms-transform:translatex(-50%); -o-transform:translatex(-50%); transform:translatex(-50%); left:50%; } li { float: left; overflow: hidden; -webkit-transition: 0.4s linear; transition: 0.4s linear; } have tried using https://github.com/karacas/imgliquid just include: <script src="js/imgliquid-min.js"></script> call function $(document...

mysql - Apply Python Code To Sqlalchemy Filters -

i'm trying figure out how apply python code (like splitting list) sqlalchemy filter. example follows: database stores full name field in table. want query database people have given first name. want like: user.query.filter(user.name.split()[0].lower() == 'henry'.lower()) when try run query, error: attributeerror: neither 'instrumentedattribute' object nor 'comparator' object associated user.name has attribute 'split' what general way apply python commands split() , lower() , etc. sqlalchemy queries? sqlalchemy constructing sql expression, not python expression. can apply sql functions expression using func object. from sqlalchemy import func user.query.filter(func.lower(func.substring_index(user.name, ' ', 1)) == 'henry')

inheritance - Ember-CLI extend a custom route (as a base "class") -

i'm using ember-cli develop ember app. i have "super" route (in routes/authenticate.js), this: import ember 'ember'; export default ember.route.extend({ }); i want make base class other routes in app, (route/home.js): import ember 'ember'; export default app.authenticatedroute.extend({ }); it doesn't work. console says: uncaught referenceerror: app not defined ember-cli guide doesn't have word on scenario (which believe essential). anyone know how correctly , in simple way? thanks, raka i found answer: http://discuss.emberjs.com/t/base-route-in-ember-cli/7103 import authenticated './authenticated'; export default authenticated.extend({ });

ios - Include Pod's Bridging-Header to Build Settings of Project's Target? -

i created objective-c pod 2 files: source/someviewcontroller.h source/someviewcontroller.m i created bridging header in pod: source/bridging-header.h with content: #import "someviewcontroller.h" my podspec looks this: pod::spec.new |s| s.name = 'testlib' s.version = '0.0.1' s.license = 'mit' s.ios.deployment_target = '7.0' s.source_files = 'source/*.{h,m}' s.requires_arc = true s.xcconfig = { 'swift_objc_bridging_header' => 'source/bridging-header.h' } end i created demo project did pod init , inserted pod. after pod install following output: installing testlib 0.0.1 (was 0.0.1) generating pods project integrating client project [!] `testlibproject [debug]` target overrides `swift_objc_bridging_header` build setting defined in `pods/target support files/pods-testlibproject/pods-testlibproject.debug.xcconfig'. can lead problems cocoapods installation - use `$(inherited...

node.js - $unset is empty. You must specify a field like so: {$unset: {<field>: ...}} -

mongodb version 3.0.1 mongoose version 4.0.3 i'm trying this: groupsmodel.updateq({_id:group._id},{ $unset:{"moderators":""}, $set:{"admins":newadmins} }) and i'm getting mongoerror catch stating '\'$unset\' empty. must specify field so: {$unset: {<field>: ...}}' but isn't empty. moderators , however, isn't in schema, why i'm trying remove it. i wasn't able reproduce error message, you've seen, mongoose update fields defined in schema. however, can override default behavior including strict: false option: groupsmodel.update( {_id: group._id}, {$unset: {"moderators": ""}, $set:{"admins": newadmins}}, {strict: false} )

How to pass an NULL (or empty) array to a JDBC callableStatement (that expects an Array) -

i'm having trouble passing null value jdbc stored function (using callable statement) expects array type. problem if i'm trying set in parameter null (eg., can create , pass empty array, shouldn't have that). for example, can work-around: callablestatement.setobject(index, callablestatement.getconnection.createarrayof("numeric", array().asinstanceof[array[anyref]])) but bothers me. first of all, there supposed api passing null arrays. second of all, i'm creating empty array no reason (and i'll have create correct array type not one-liner, i'll need support several different types). gets messy. i should able this, think (or @ least pretty similar): callablestatement.setnull(index, types.array) but results in exception: com.edb.util.psqlexception: error: function app_fetch_user_list_pkg.n_execute(character varying, character varying[], character varying, boolean, integer) not exist any ideas? (we working postgresql/edb oracle... ...

oop - CIL instructions unexpected return value -

i trying create il-instructions manually learning purposes, have run small problem. i have simple structure interface: "myinterface" single method: "handle", class called "addtwo" implements "myinterface" , "program" class entrymethod. il-dump looks this: .class interface public abstract auto ansi myinterface<tinput,toutput> { .method public hidebysig newslot abstract virtual instance !toutput handle(!tinput a_1) cil managed { } // end of method myinterface::handle } // end of class myinterface .class public auto ansi plustwo extends [mscorlib]system.object implements class myinterface<int32,int32> { .method public hidebysig newslot virtual final instance int32 handle(int32 x) cil managed { // code size 13 (0xd) .maxstack 2 il_0000: ldarg 0 il_0004: nop il_0005: nop il_0006: ldc.i4 0x2 il_000b: add il_000c: ret }...

javascript - In WordPress how do I pass multiple variables into the URL and retrieve them? -

for reason can retriever first variable, in instance, "product_category" out of url http://localhost/coffeesite/?product_category=coffee&brand=bourbon . i'm outputting javascript confirm i've set variable, again, coffee alerted, , not brand. i'm using wordpress's 'get_query_var'. see code below: <?php echo '<script> product_category = "' . get_query_var('product_category') . '"; brand = "' . get_query_var('brand') . '"; alert(product_category); alert(brand); </script>'; ?> any appreciated - i'm struggling solve it! since testing, maybe test php directly? function get_query_var wrapper generic php array $_get. should have these values available @ $_get['product_category'] , $_get['brand']. instead of assuming supposed be, why not check hav...

ios - displaysSearchBarInNavigationBar deprecated in iOS8 -

Image
i'm trying find alternative displayssearchbarinnavigationbar ios8, there can use (in swift)? i tried self.navigationitem.titleview = resultsearchcontroller.searchbar doesn't anything. i don't understand how find replacement functions deprecated, on apple documentation deprecated no alternative, if have tips appreciated. you can put uisearchbar in uinavigationbar without using uinavigationcontroller without problem, have minor change only, first need define @iboutlet uinavigationitem inside uinavigationbar name need different navigationitem property defined in uiviewcontroller class, see following code: class viewcontroller: uiviewcontroller, uisearchcontrollerdelegate, uisearchresultsupdating, uisearchbardelegate { var searchcontroller : uisearchcontroller! @iboutlet weak var navigationitembar: uinavigationitem! override func viewdidload() { super.viewdidload() self.searchcontroller = uisearchcontroller(searchresults...

javascript - How to update background of page dynamically with Flickr API -

edit : static source urls can constructed flickr images. explanation: https://www.flickr.com/services/api/misc.urls.html i making ajax request grab photos , parse information in order update background of page. this rough code: $.ajax({ url: 'https://api.flickr.com/services/rest/?method=flickr.photos.search&api_key=[api_key]&safe_search=&lat=' + geolat + '&lon=' + geolong + '&format=json&nojsoncallback=1', error: function() { console.log('flickerapi error'); }, success: function(data) { var photoid = data.photos.photo[0].id; var ownerid = data.photos.photo[0].owner; var backgroundimageurl = 'http://www.flickr.com/photos/' + ownerid + '/' + photoid + '/'; $('body').css('background-image','url(backgroundimageurl)'); }, always: function() { ...

python count files and display max -

i tying count al file extenties in directory. , count them , display how many of them there. best way make this? script gonna big al pdf= 0 lines of code. how can display output of how many files there are, high lower. import os pdf = 0 doc = 0 docx = 0 xls = 0 xlsx = 0 ppt = 0 pptx = 0 file in os.listdir("c:\\users\\joey\\desktop\\school\\icommh"): if file.endswith(".pdf"): pdf += 1 print(file) if file.endswith(".doc"): doc += 1 print(file) if file.endswith(".docx"): docx += 1 print(file) if file.endswith(".xls"): xls += 1 print(file) if file.endswith(".xlsx"): xlsx += 1 print(file) if file.endswith(".ppt"): ppt += 1 print(file) if file.endswith(".pptx"): pptx += 1 print(file) print(pdf) print(doc) print(docx) you use dictionary: import os exts =...

Availabilty of setCameraFunction on HDR-AZ1 using Sony Camera Remote API SDK -

if camera (hdr-az1) connected pc via camera's built in access point, "setcamerafunction" api available. if use live setting camera connects router, "setcamerafunction" conspicuously not available. camera , pc connected router can perform functions require, except downloading images. questions: is design , if there way around it? is there way transfer images camera without "setcamerafunction"? thanks. to answer questions: yes designed way. don't know purpose have myself struggling design. able download content camera need set camera mode contents_transfer using setcamerafunction there 1 other way download images camera. when take picture through acttakepicture call url taken picture can use download without setting contents_transfer . video not possible without setting camera mode contents_transfer .

r - geom_rect() main variable not found -

Image
i want plot rectangle "shading" in ggplot. ggplot code works , provides image shown below. looked information here , constructed data frame x , y values. mydf<-data.frame(tiempo=df5$tiempo,vel=df5$tr2x45.17)[1:14,] structure(list(tiempo = c(618.2, 618.4, 618.6, 618.8, 619, 619.2, 619.4, 619.6, 619.8, 620, 620.2, 620.4, 620.6, 620.8), vel = c(0, 0, -4, -9, 5, 9, 1, 4, 0, 0, -1, -4, 0, 1)), .names = c("tiempo", "vel"), row.names = c(na, 14l), class = "data.frame") rects <- data.frame(xstart = seq(618,619.5,.5), xend = seq(618.5,620,.5), col = letters[1:4]) ggplot(data=mydf, aes(x=tiempo,y=vel))+theme_minimal()+ geom_point(size=4)+ labs(title=c("velocidad ejemplo pasaje figura"))+ geom_smooth(method="loess", span=.3, se=false, colour="red", size=1,alpha=0.5) + geom_rect(data = rects, aes(xmin = xstart, xmax = xend, ymin = -inf, ymax = inf, fill = col), alpha = 0.4) if ru...

javascript - Start / stop embedded facebook video -

facebook has embedded html5 iframe including video's example (function(d, s, id) { var js, fjs = d.getelementsbytagname(s)[0]; if (d.getelementbyid(id)) return; js = d.createelement(s); js.id = id; js.src = "//connect.facebook.net/nl_nl/sdk.js#xfbml=1&version=v2.3"; fjs.parentnode.insertbefore(js, fjs); }(document, 'script', 'facebook-jssdk')); <div id="fb-root"></div> <div class="fb-video" data-allowfullscreen="true" data-href="/iloveamersfoort/videos/vb.785215881547195/804162796319170/?type=1"> does body know how start stop javascript if have more 1 embedded video on page. with html5 video can do: document.addeventlistener('play', function(e){ var videos = document.getelementsbytagname('video'); for(var = 0, len = videos.length; < len;i++){ if(videos[i] != e.target){ videos[i].pause(); } } }, true); but...

java - android cannot open my app -

i have built .apk little application wrote android. on installation finished screen "open" option grayed out , can not chosen. after when search device application no icon appears, if check installed apps there still cannot opened. believe problem androidmanifest.xml. have little experience androidmanifest , work java. <application android:allowbackup="true" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:theme="@style/apptheme"> <activity android:name=".mainactivity" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.main"/> <category android:name="andriod.intent.category.launcher"/> </intent-filter> </activity> </application> above manifest, understand manifest has many errors th...

How to convert Spring Integration XML to Java DSL for errorChannel -

i have below xml configuration in application , convert java dsl. so in reference i'm explicitly defining name error channel. example reason. reference i'm expecting happen when downstream process throws , exception should route payload through error channel. java code like? <int-jms:message-driven-channel-adapter id="notification" connection-factory="connectionfactory" destination="otificationqueue" channel="notificationchannel" error-channel="error" /> <int:chain id="chainerror" input-channel="error"> <int:transformer id="transformererror" ref="errortransformer" /> <int-jms:outbound-channel-adapter id="error" connection-factory="connectionfactory" destination="errorqueue" /> </int:chain> ...

c++ - Ignoring Listcontrol 'DELETE_ALL_ITEMS' Event when closing application -

i have mfc listcontrol in application. have event occurs when "all items in view deleted". event throws error message , closes program. my problem event gets called if x (close) button clicked. here code lvn_deleteallitems event: void users::onlvndeleteallitemslist1(nmhdr *pnmhdr, lresult *presult) { lpnmlistview pnmlv = reinterpret_cast<lpnmlistview>(pnmhdr); messagebox("the sql connection has been dropped. please restart application.","sql connection error",mb_iconstop); exit(exit_failure); *presult = 0; } is there way keep event being called if application closed correctly (with button in top right corner)? this normal behavior. when x button gets pressed, main window receives wm_close, , start call children destructors. when listview destructor called item cleaned up, there goes lvn_deleteallitems notification. the (logical) error connection db being dropped test being performed here (and abnormal exi...

javascript - increment value of a number with a specific timer-value -

i've tried , looked around not find similar. <div> <span>23</span>/ 30 </div> my thought process here want 23 increment in 1 value every 15th second. and when hits 30, shall stop counting. have no idea how make "stop" counting , how should approach problem this. any appreciated! here possible solution, note iteration every second demo, can lower rate doing settimeout(count,15000); . var wrapper, value, timer; window.addeventlistener('load', startcounter, false); function startcounter(){ document.queryselector('button').onclick = startcounter; wrapper = document.queryselector('span'); value = 22; count(); } function count(){ cleartimeout(timer); value++; wrapper.innerhtml = value; if(value < 30){ timer = settimeout(count,1000); } } <div> <span>23</span>/ 30 </div> <button>reset</button>

c - Different functions to print a linked list -

i saw 2 (different?) implementations of function print linked list. let me first give code example: #include <stdio.h> #include <stdlib.h> struct node { int x; struct node *next; }; void free_list(struct node *current); void print_list_a(struct node *current); void print_list_b(struct node *head); int main() { struct node *head; struct node *second; struct node *third; head = null; second = null; third = null; head = malloc(sizeof(struct node)); if (!head) { exit(exit_failure); } second = malloc(sizeof(struct node)); if (!second) { exit(exit_failure); } third = malloc(sizeof(struct node)); if (!third) { exit(exit_failure); } head->x = 1; head->next = second; second->x = 2; second->next = third; third->x = 3; third->...

.net - "Concurrency violation: the UpdateCommand affected 0 of the expected 1 records" when updating a new added record in MS Access database from C# app -

please resolve problem. i'm getting error "concurrency violation: updatecommand affected 0 of expected 1 records" when trying update newly added table record in ms access (2000 format) database (.mdb) application written in c#. error rather generic , , tried solutions suggested on different forums, no success. here's step step: i have table 'tracks' in mdb has these columns among others: id - type 'autonumber' (key column) title - 'text' fulltitle - 'text' length - 'date/time' i establish connection database , table records way: public partial class mainform : form { public oledbconnection dbconn = new oledbconnection(); public dataset dataset = new dataset(); protected oledbdataadapter adtracks = new oledbdataadapter(); protected oledbcommandbuilder cmb; arraylist arrartists = new arraylist(); public mainform(string strfilename) { initializecomponent(); cmb = ne...

c++ - Explicit member specialization using IBM Rational Rhapsody -

i want explicitly specialize member functions inside class using ibm rational rhapsody. what have done far; created function inside regular class, marked template . marked cg::generate specification . prototype of template. then created function. marked template. pointed function created above primary template under template parameters. filled implementation. here code rhapsody generates: //## class myconvert class myconvert { //// constructors , destructors //// public : myconvert(); ~myconvert(); //// operations //// //## operation strtox(char*,char*) template <typename t> inline static t strtox(char* in, char** end); //## operation strtox(char*,char**) template <> inline double strtox<double>(char* in, char** end) { //#[ operation strtox(char*,char**) return strtod(in, end); //#] } }; when compile this, this: error: explicit specialization in non-namespace scope 'class myconvert' explicit specializati...

Does Atom support CSS snippets -

i able add javascript snippets in atom editor, couldn't add css snippets. there way add css snippets in atom? #js works fine ".source.js": "getelementbyid": "prefix": "geid" "body": "documnet.getelementbyid($1)" #css not work ".source.css": "blue background": "prefix": "bgblue" "body": " background-color: blue " i tried posted, , worked me. make sure atom updated, , make sure document you're trying use snippet in using appropriate language/grammar.

javascript - Functionality of window.open() in google chrome -

i not experienced javascript programmer means, trying prototype design purposes , need help. here questions have window.open() in chrome how page open in new window. not chrome tab. is possible me click link in 1 window , have open in other window open on browser. if can open in window possible specify tab. whether tab that's open or opening new tab. thanks i quote other answers helpful posts go more in depth need know, answers here in javascript: open url in new tab open url in new window javascript open url in new tab or reuse existing 1 whenever possible i want open new tab instead of popup window you cannot open new windows or new tabs javascript not know because outside scope. i hope helps, please feel free comment if need further!

html - Actionmailer css adding to the whole app -

i'm trying style actionmailer mail view doing following: i have email.css.scss file with: @import "bootstrap-sprockets"; @import "bootstrap"; { color: #23527c; a:hover { color: #1c70bb; } } in assets.rb : rails.application.config.assets.precompile += %w( email.css ) in send_email.html.erb : <%= stylesheet_link_tag 'email' %> but when go app links a in color haven't imported email.css.scss in application.scss file. how can put email.css.scss file read in specific email view? also, rake assets:precompile if has it. thanks! edit: i followed article on how send emails using rails , bootstrap: http://stefan.haflidason.com/sending-emails-using-rails-and-bootstrap/ it uses 2 gems this: gem 'nokogiri' gem 'premailer-rails' you can't. have style mailers inline (in actual mailer template), , once so, mailer styles won't have effect on rest of app. won't able...

asp.net - how to change label with button in vb? -

so want have button changes text of label when click , says page not available, when comment out update panel atleast shows up. <form id="form1" runat="server"> <asp:scriptmanager id="s1" runat = "server"></asp:scriptmanager> <div> <h1>update panel test page</h1> start text : hello <br /> updated text: world<br /> <hr /> <asp:updatepanel id="p1" runat="server"> <contenttemplate> <asp:button id="button1" runat="server" text="update" onclick="updatelabel" height="29px" width="110px"/> --> text: <asp:label id="label1" runat="server" text="hello"></asp:label> </contenttemplate> </asp:updatepanel> </div> </form> codebehind public class aaaa inherits system.web.ui.page protected sub pag...

jquery - Add arrows to my existing accordion -

i building accordion our website faq page. have accordion implemented asked add arrows(pointing right) before each question point down when section clicked on , goes pointing right when section clicked on. here existing code: http://jsfiddle.net/gvolkerding/ancu6fgu/2/ html: <div class="accordion-section"><a class="accordion-section-title" href="#how1">how can insert question in spot when come content?</a> <div id="how1" class="accordion-section-content"> lorem ipsum dolor sit amet, </div><!--end .accordion-section-content--> </div><!--end .accordion-section--> <div class="accordion-section"><a class="accordion-section-title" href="#accordion-2">how can insert question in spot when come content?</a> <div id="accordion-2" class="accordion-section-content"> ...

python module to decode OSX plist integer dates? -

is there python module/snippet can decode integer datestamps contained in osx - mail - plists? eg, bit: <key>date-sent</key> <integer>1264001747</integer> is in jan 2010. how deconstruct? i'm aware of plistlib - gets me integer. you can use datetime.datetime.fromtimestamp >>> import datetime >>> datetime.datetime.fromtimestamp(1264001747) datetime.datetime(2010, 1, 20, 10, 35, 47) the value 1264001747 timestamp given in seconds epoch. returned datetime object shown in order (year, month, day, hour, minute, second)

swift - iOS Scaling Constraints for Different Screen Sizes -

Image
this first ios app , i'm using swift. i'm following tutorials on codewithchris.com. the user tapping on series of icons determine device model have. far i've used handful of constraints icons placed on iphone 6 display. when using iphone 5s/5c/5 or 4s/4 display sizes icons , text still render @ full size iphone 6 , go off screen. here's process building layout: grab , parse json nsarray. returns ["iphone", "android", "windows", "ipad"] create uiview object each item in nsarray. set name variable associated name. place each uiview using addsubview() apply height, width, , bottom-margin constraints uiview set uiview position constraints based on position in row add icons (uiimageviews) each uiview set height , width constraints based on type of device add text labels i'm using bunch of constraints place uiviews , uiimageviews. how can make these constraints dynamic based on device's screen size? ip...

C++ insertion sorting elements -

other way elements in function instead of main program? void insertionsort(int array[], int number) { int j, temp; (int = 1; i<number; i++) { j = i; while (j>0 && array[j - 1]>array[j]) { temp = array[j]; array[j] = array[j - 1]; array[j - 1] = temp; j--; } } } int main() { int number = 8; int array[] = { 2, 7, 5, 6, 4, 8, 1, 3 }; insertionsort(array, 8); (int = 0; i<number; i++) cout << array[i] << " "; cout << endl; system("pause"); return 0; } while data sorted could moved sort function, doing creates function that's pretty useless--since ever sorts 1 set of data, it's equivalent return {1, 2, 3, 4 5, 6, 7, 8}; your insertion sort bit of mess. pseudo-code insertion sort looks this: for in 1 size temp = array[i] j in downto 0 , array[j-1] > temp ...

Openlayers 3.5 feature disappear -

so updated openlayers version v3.0 v3.5. created feature overlay added map bounding box, search extense functionality. noticed feature overlay disappear map whenever cursor not directly on map , reappear when cursor gets on map. not case on old version of openlayers, v3.0. knows of changes may have caused issue? thanks

sas macro - Check if a SAS DIS parameter is null -

in sas dis have set date parameters on job. tried setting default values using drop down menu provided, each time error syntax error, expecting 1 of following: !, !!, &, *, **, +, -, /, <, <=, <>, =, >, ><, >=, and, eq, ge, gt, in, le, lt, max, min, ne, ng, nl, notin, or, ^=, |, ||, ~=. i therefore decided try check if parameter null before proceeding, none of various attempts succeeded. there way user-written code? if(&date_param = .) do; date = today(); else do; date = &date_param; end; i tried within macro , did not work. much gratitude. assuming similar standard sas macro variable, couple of things. first off, null parameter literally blank, not period (that's numeric dataset variables). in data step check so: if "&date_param." = " " do; second, depending on context may need in macro syntax. if you're setting parameter, may need do: %if &date_param. eq %then %do; %let dat...

makefile - android custom build. adding an app to the build -

i want make custom build of android editing code of android. main motive adding , removing apps build. removing app build pretty simple. deleted entry core.mk file. but want add application build. every time make error. make: *** no rule make target `packages/apps/myapplication/androidmanifest.xml', needed `out/target/product/generic/obj/apps/myapplication_intermediates/package.apk'. stop. need following topics how write makefile application. helloworld app (for first experiment). do need add entry application anywhere else build/target/product/core.mk file. what error refers to. , solution.

git - Opsworks - Rails application in subdirectory -

i have following folder structure in git repository: / /myapp /myapp/app /myapp/bin /myapp/... /mobileclient myapp rails application (directory) i'm trying deploy using aws opsworks. mobileclient directory sounds. i'm deploying via git (also, set document root setting myapp/public) deployment fails , i'm seeing on machine generated config, log , public directories on root level instead of being in subdirectory. is there simple way of using git deployment rails app resides in subdirectory?

c# - Filter Linq with Guid Stored in Session -

i using code filter linq data , keeps crashing. public actionresult index() { var model = db.tickets .include(t => t.ticketnotes) .where(t => t.openuserid == guid.parse(session["logeduserid"] string)) .orderby(t => t.opendate) .tolist(); return view(model); } the error is: an exception of type 'system.notsupportedexception' occurred in entityframework.sqlserver.dll not handled in user code the error know on line: .where(t => t.openuserid == guid.parse(session["logeduserid"] string)) because working when guid hardcoded in case: public actionresult index() { var model = db.tickets .include(t=>t.ticketnotes) .where(t.openuserid == new guid("00000000-0000-0000-0000-000000000000")) .orderby(t=>t.opendate); return view(model); } you error because linq code transformed in sql. in sql m...

Moving Emails to subfolder with Powershell -

i trying write sender/subject info of emails in outlook inbox csv file , move emails subfolder of inbox (called "after") using powershell. csv file created correctly email info, first half + 1 emails moved subfolder. here code: $olfolderinbox = 6; $outlook = new-object -com outlook.application; $mapi = $outlook.getnamespace("mapi"); $inbox = $mapi.getdefaultfolder($olfolderinbox); $inbox.items|select senderemailaddress,subject|export-csv c:\scripts\testing.csv -notypeinformation; foreach ($item in $inbox.items){ try{ $item.move($inbox.folders.item("after")) | out-null; }catch{ write-host "failed move item", $item.id.uniqueid; } } this first time using powershell appreciated! move() changes collection. use down "for" loop (from items.count down 1) instead of "foreach".

android - to change the drawable right of an edit text -

Image
i'm trying change drawable in edittext in image. i'm using following code make drawable clickable. password_edittext.setontouchlistener(new ontouchlistener() { @override public boolean ontouch(view v, motionevent event) { final int drawable_left = 0; final int drawable_top = 1; final int drawable_right = 2; final int drawable_bottom = 3; if (event.getaction() == motionevent.action_up) { if (event.getrawx() >= (password_edittext.getright() - password_edittext .getcompounddrawables()[drawable_right].getbounds() .width())) { // action here toast.maketext(mainactivity.this, "drawable click", toast.length_long).show(); return true; } } ...

c# - EF - Part of composite keys in foreign key relationships -

i attempting utilise "code first database" feature of ado.net. generation works , outputs of desired models. have several ef models both have composite keys primary keys. i've given 2 such models example below. public partial class labrole { public labrole() { labrolepermissions = new hashset<labrolepermission>(); labuserroles = new hashset<labuserrole>(); rolesubscriptions = new hashset<rolesubscription>(); } [key] [column(order = 0)] [stringlength(50)] public string roleid { get; set; } [key] [column(order = 1)] [stringlength(50)] public string labid { get; set; } public virtual icollection<labrolepermission> labrolepermissions { get; set; } public virtual lab lab { get; set; } public virtual icollection<labuserrole> labuserroles { get; set; } public virtual icollection<rolesubscription> rolesubscriptions { get; set; } } and: public par...

jquery - Adding an event listener to an element that doesn't exist yet in vanilla javascript -

in jquery can do: $(document).on("click","a.somebtn",function(e){ console.log("hi"); }); to add event listener element doesn't exist yet. cannot seem figure out how add event listener element not exist yet in vanilla javascript. following not work obviously: query.addeventlistener( "click", somelistener ); edit what compare item query selectors. selecting element not exist yet queryselectorall . little more dynamic checking tag name. use target property in event object clicked element. then, manually test type/attributes/ids document.addeventlistener( "click", somelistener ); function somelistener(event){ var element = event.target; if(element.tagname == 'a' && element.classlist.contains("somebtn")){ console.log("hi"); } }

android - Multiple lines in edittext changes the layout -

i developing first application in android. xml layout file has relativelayout , linearlayout both. root layout relative layout has textviews, buttons , edittext , 2 more relativelayouts in it. in 1st relativelayout have edittext below have button , switch. when enter data more 1 line in edittext button , switch below overlaps. how can let edittext accept more 1 line without changing layout of widgets below ? <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:id="@+id/relative1" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/blue3" > <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:textappearance="?android:attr/textappearancemedium" android:text="name" android:id="@+id/textview5" ...