Posts

osx - Spelling suggestions in NSTextField -

my app has nstextfields input; purposely not use nsnumberformatter in order special handling of input. app implements "full screen" mode. when app in full screen, , focus in text field, , press esc key resume windowed mode, instead pop-up spelling suggestions/completions. don't want either of these behaviors when esc key pressed: completions pop-up, nor not being able exit full screen mode. suggestions? thanks. you need setup nstextfielddelegate handle command, , set delegate on textfield. here's example: @property (weak) iboutlet nswindow *window; @property (weak) iboutlet nstextfield *textfield; @end @implementation appdelegate - (void)applicationdidfinishlaunching:(nsnotification *)anotification { // insert code here initialize application self.textfield.delegate = self; } - (bool)control:(nscontrol*)control textview:(nstextview*)textview docommandbyselector:(sel)commandselector { if (commandselector == @selector(canceloperation:)) { ...

kie server - Drools externalize condition -

in organization have decided use kieserver running drools. not using kieworkbench, because need more control on deployment , should aligned related application. ask externalize condition check. for example in rule below, check "2008" stored in database when $customer:customer(membersince <= "2008") $customer.setofferpercent("50%") i have figured out way value 2008 database/inmemory cache implementation , change below. allow operations/business change such values without deployment in kie server , reduce lot of efforts when $customer:customer(membersince <= cache.get("member_since_elite")) $customer.setofferpercent("50%") my question is, there other way declare global , auto populate values when changed in database. hoping below using annotations, , need help. declare properties member_since_elite : string @property("member_since_elite") end when $customer:customer(membersince ...

javascript - Fetch html page content into a var -

just small question here, how fetch html content via ajax variable use later. right now, have button on click of which, fetch html page through load method follows: $('#container').load('http://127.0.0.1/someurl') i want content var instead @ later time use append dom $('#somecontainer').append(somevar) var somevar; $.get("http://127.0.0.1/someurl",function(data){ somevar = data; }); i use $.get instead

c# - Simple Membership: can I create a user without referencing webmatrix? -

i have restrictions not reference webmatrix here. i want create user record in membership tables of simple membership (using ef 5). make easier, have mapped ef models tables. is possible code without webmatrix ? edit i don't want use membership provider. edit the system uses simple membership. don't want change that. separate project, want add user database without referencing webmatrix. possible ? no, cannot use simplemembership without webmatrix simplemembership lives in webmatrix namespace. you can, however, use number of other membership providers, such original sqlmembershipprovider, universal providers, or number others available. edit: yes, can add user database manually. in comments below have included link source simplemembershipprovider.cs, examine code , use same methods in own project.

Python: Write Nested JSON as multiple elements in List -

after 2 3 days of programming, seeking help. what want do: import json string/ file , write database. there multiple combination of input (cars). lowest nested dict/ list defines number of elements of list written in db. here json/ string: input = [{"id":"bmw_1_series", "years":[{"id":10052,"year":2008, "styles":[{"id":560,"name":"128i 2", "submodel":{"body":"conver","nicename":"conve"},"trim":"128i"}, {"id":561,"name":"135i ", "submodel":{"body":"conver","nicename":"conver"},"trim":"135i"} ] }, {"id":427,"year":2016, ...

Android WebView Responsive While Zooming -

the font size , image in webview able zoom, not responsive screen. expected fit on width of 100%. not applicable on android 5.0 lollipop , above. tried on kitkat device, worked. i'm wondering should in order make works on 5.0 , above. i did configure meta tag of webpage: < meta name="viewport" content="width=device-width, initial-scale=1" /> the following configurations have applied on webview: webview wv1 = (webview) findviewbyid(r.id.webview); wv1.setwebviewclient(new mywebviewclient()); wv1.getsettings().setloadsimagesautomatically(true); wv1.getsettings().setjavascriptenabled(true); wv1.getsettings().setloadwithoverviewmode(true); wv1.getsettings().setusewideviewport(true); wv1.getsettings().setloadwithoverviewmode(true); wv1.getsettings().setsupportzoom(true); wv1.getsettings().setbuiltinzoomcontrols(true); wv1.getsettings().setdisplayzoomcontrols(false);

ios - Audio not playing in simulator -

i have 3 buttons , i'm trying sound play each button. the sounds don't play on simulator wondering going wrong in code. import uikit import avfoundation class viewcontroller: uiviewcontroller { override func viewdidload() { super.viewdidload() } @ibaction func mmm_sound(sender: uibutton) { playsound("mmm") } @ibaction func aww_sound(sender: uibutton) { playsound("aww") } @ibaction func maniacal_sound(sender: uibutton) { playsound("hah") } //sound function func playsound(soundname: string) { let sound = nsurl(fileurlwithpath:nsbundle.mainbundle().pathforresource(soundname, oftype: "wav")!) do{ let audioplayer = try avaudioplayer(contentsofurl:sound) audioplayer.preparetoplay() audioplayer.play() }catch { print("error getting audio file") ...