Posts

Showing posts from April, 2011

c - Retrieving return code from child process using wait()? -

i have 2 files "prime.c" , "singleprime.c" , inside of singleprime.c trying create child morphs "isprime.exe" executable made out of "prime.c". want return number isprime.exe either 1 or 0 depending on if input number prime or not , store in childnum inside of main() function of "singleprime.c" can print terminal whether it's prime number or not based on 1 or 0 returned "isprime.exe". below 2 files: prime.c: /* file isprime.c purpose: program checks if given number prime number input: number - positive int entered via command line parameters. example isprime 1234 output: 0 - if input number not prime number 1 - if input number prime number 2 - if command line parameter not correct assumption: program not check if number positive integer */ #include "stdio.h" #include "stdlib.h" #include <unistd.h> #include "prime.h" int main(int argc, char *argv[]) { int i; ...

c# - Nested partials and templates; How to implement a conditional view or editor? -

i've been using c# while, , have done share of web-forms, i'm new mvc , don't know how phrase question googles. i'm developing mvc site backed ef , trying hang of things. have view allows user create entity "a". entity has reference entity b, it's address, in turn has reference entity c, address' region. so i've figured out can create editor template can injected create view entity a, , returns model it's entity b reference populated. can same thing on entity b template, injecting editor template entity c , getting correct entity in b's reference property. my problem entity c created entity. user needs ability create one, , it's trivial entity (has name , country_enum), don't want user have visit special page create entity after they've figured out correct c entity isn't yet in list, come page , reenter other fields might have filled. how can create "conditional" view or set of views, allow user either ...

ios - How can I make a textView sit on top of the keyboard when pressed? -

i have text view on bottom of 1 of views, , hidden keyboard when pops if didn't anything. did when keyboard appear, text view moves 160 points. problem doesn't sit in exact same place on every iphone because of different sizes. know if possible text view sit say, 20 points on top of keyboard, instead of pushing 160 points its' origin. override func viewdidload() { super.viewdidload() nsnotificationcenter.defaultcenter().addobserver(self, selector: selector("keyboardwillshow:"), name:uikeyboardwillshownotification, object: nil); nsnotificationcenter.defaultcenter().addobserver(self, selector: selector("keyboardwillhide:"), name:uikeyboardwillhidenotification, object: nil); } var isshown: bool = false var willhide: bool = false func keyboardwillshow(sender: nsnotification) { isshown = true } func keyboardwillhide(sender: nsnotification) { willhide = true } func textviewdidbeginediting(textview: uitextview) { if issho...

javascript - Change slider to select box -

i having issues trying figure out how change bmi calculator slide select box , passing input have calculated. for feet have inches set values , when inches selected need added on feet total. <div class="form-group"> <label for="height-ft">feet</label> <select name="height-ft" id="height-ft" class="form-control"> <option value="12">1'</option> <option value="24">2'</option> <option value="36">3'</option> <option value="48">4'</option> <option value="60">5'</option> <option value="72">6'</option> <option value="84">7'</option> </select> </div> <div class="form-group"> <la...

php - Appending URL via href - more than once on same page -

i have 2 menus, , i'd each able append url , stack these appends. achievable via php , html alone? so instance, when user clicks selection in first menu, url append "?variable=example" , link like: <a href="?variable=example"> but i'd user able select second menu , add "?variable2=example2" or "&variable2=example2" if second selection user has made. if make links in second menu "&variable2=example2" appends base url not want. the tricky part i'd users able start either menu. can done without javascript? while pretty sure can in plain php, bit of arduous , obtuse process. task javascript meant for, if determined via php, have store url in cookie. have menus each read in , modify cookie , post request. big issue each menu have refresh page since have read in cookie, rewrite cookie each time wanted make change url. php not maintain "state," or "memory," php sends , recei...

When would lambda functions be useful for classes in C++? -

so, see usefulness of lambda functions when used replace functors, when want use them in object oriented programming (with classes) setting in general , why? okay, little more (and less) helpful response comment. closures (that is, functions declared inside other functions, capture outer function's variables) interesting back-channel way implement classes. watch: auto makecounter(int initialcount) { int currentcount = initialcount; struct { std::function<void()> increment = [&]() { currentcount++; }; std::function<int()> getcount = [&]() { return currentcount; }; } thecounter; return thecounter; } now thecounter structure 2 members, 1 increments count , other retrieves current count. notice struct doesn't need store current count; instead implicitly held 2 lambdas, share currentcount between them. there's few problems this. it doesn't compile. not mostly. there ton of things wrong code snippe...

javascript - Magnific Popup link format -

so.... problem. seemed magnific popup wouldn't work libraries added correctly , console didn't display errors. figured out removing tags in link. have html markup not working: <a class="image-link" href="img/gallery1.jpg"> <img class="img-responsive" src="img/gallery1.jpg" alt=""> <span class="zoom"></span> </a> here's simple script lightbox: <script type="text/javascript"> $(document).ready(function() { $('.image-link').magnificpopup({type:'image'}); }); </script> but if remove span, lightbox triggers correctly. have span because icon hover effects in css. i'd make plugin work it. please me , don't assume much. don't know javascript/jquery programming.

javascript - Error calling forEach on array -

i getting problem foreach within anoter foreach function: the results variable contains object like: { names: [ 'someone', 'someone else' ], emails: [ 'someone@someemail.com' 'something@somemail.com' ] } i want unwind arrays , result in array this: [ {term: 'someone', type: 'names'}, ... ] here code: var keys = _.keys(results); console.log(keys); var finalresult = []; keys.foreach( function (key) { var arrterms = results[key]; console.log(key, arrterms); //arrterms prints fine arrterms.foreach(function (term) { //this line throws exception finalresult.push({ term: term, type: key }); }); }); the nested call foreach throws following exception: typeerror: uncaught error: cannot call method 'foreach' of undefined i tried using loop iteration till length, generated exception: typeerror: uncau...

android - saving checkbox states from list with shared preferences -

i asked question on how save checkbox state using textfile recommended use shared preferences. had tried method before using textfiles had same issue - checkboxes in list check , uncheck seemingly randomly. my app displays list of installed apps on device, displays title of app, icon , checkbox. if check 1 of items , scroll down , again, uncheck , other items checked randomly. i'm trying checkbox states loaded shared preferences, , saved when user manually checks box. here code listview custom adapter: public class appdetailsadapter extends baseadapter { private list<appdetails> data; private context context; public appdetailsadapter(context context, list<appdetails> data) { this.context = context; this.data = data; } @override public view getview(int position, view convertview, viewgroup parent) { view view = convertview; if (view == null) { layoutinflater vi = (layoutinflater) context.getsystemservice(context.layout_inflate...

sql - Merge two almost identical UNIONed queries into one -

i have multiple queries nested union alls; of inner queries same. for example select sum(x.amount) amnt, 'txt1' name, x.cfg cfg tbl1 union select -sum(x.amount) amnt, 'txt2' name, x.cfg cfg tbl1 result: amnt|name|cfg ----+----+--- 12 |txt1| z -12 |tst2| z since inner queries not small , go lot of tables i'm trying save processing time , resources combining these 2 inner queries one. take in consideration name (txt1/txt2) on inner query , not in table for particular example, need duplicate results returned, conditional logic. if put conditional logic cte perform cartesian join against main table every row in main table duplicated number of records in join. in case 2. with multiplier (m, name) ( select 1, 'txt1' dual union select -1, 'txt2' dual ) select multiplier.m * sum(t.amount), multiplier.name, t.cfg tbl1 t cross join multiplier

hive - Equivalent months_between function for HiveQL -

i'm trying use hive calcuate months between 2 dates years , decades apart. in netezza used: months_between(this_month('date_1'),this_month(date_2)) trying translate hive , don't think there existing date function or udf available. has tried stagger existing hive commands accomplish same goal? this has been fixed in latest version of hive (1.2.0) "months_between" available. https://issues.apache.org/jira/browse/hive-9518

java - JSF 2.0 set locale throughout session from browser and programmatically -

this question has answer here: localization in jsf, how remember selected locale per session instead of per request/view 5 answers how detect locale application based on initial browser request , use throughout browsing session untill user changes locale , how force new locale through remaining session? create session scoped managed bean follows: @managedbean @sessionscoped public class localemanager { private locale locale; @postconstruct public void init() { locale = facescontext.getcurrentinstance().getexternalcontext().getrequestlocale(); } public locale getlocale() { return locale; } public string getlanguage() { return locale.getlanguage(); } public void setlanguage(string language) { locale = new locale(language); facescontext.getcurrentinstance().getviewroot().setlocal...

javascript - ExtJS 5 first steps, cannot see a simple grid with one store -

Image
i'm trying become familiar ext js 5. took sencha generated app start point , modified see grid of 1 line. page blank. can anyone, please, show me doing wrong? not familiar mvvm pattern want learn it. here's set of files: and here js sources. applications.js ext.define('admin.application', { extend: 'ext.app.application', name: 'admin' }); base.js (base class models) ext.define('admin.model.base', { extend: 'ext.data.model', schema: { namespace: 'admin.model' } }); item.js (a simple model) ext.define('admin.model.item', { extend: 'admin.model.base', fields: [ { name: 'id', type: 'int' }, { name: 'title', type: 'string' } ] }); itemlist.js (a store of items want show in grid) ext.define('admin.store.itemlist', { extend: 'ext.data.store', alias: 'store.itemlist', model...

Can Servicestack.Interfaces dll be used without license? -

i assuming downloaded servicestack.client nuget package not need license. i'm looking build whitelabel apps connect central servicestack based api, hence want reference servicestack.client , servicestack.interfaces in various projects & solutions. yes can since servicestack.interfaces definition library , not limited of built-in free quotas .

java - MapReduce - reducer does not combine keys -

i have simple map reduce job building reverse index. my mapper works correctly (i checked that) , outputs key pair of word , docid:tfidf value: mapper (only output shown): context.write(new intwritable(wordindex), new text(index + ":" + tfidf)); the job of reducer combine these values. implementation: public static class indexerreducer extends reducer<text, intwritable, intwritable, text> { public void reduce(intwritable key, iterable<text> values, context context) throws ioexception, interruptedexception { stringbuilder sb = new stringbuilder(); (text value : values) { sb.append(value.tostring() + " "); } context.write(key, new text(sb.tostring())); } } however, not combine , output looks same form mapper. there lines in output same key although reducer supposed combine them - keys in output file supposed unique when using reduc...

unable to render facebook login button on android studio -

i'm facing strange problem facebook login button of facebook android sdk 4. i've follow guide convert previous code (i've used old facebook sdk), android studio not render correctly button. login button code: <com.facebook.login.widget.loginbutton xmlns:fb="http://schemas.android.com/apk/res-auto" android:id="@+id/fb_button" style="@style/facebookloginbutton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_above="@+id/my_button" android:layout_centerhorizontal="true" android:layout_marginbottom="-14dp" android:textsize="34sp" fb:login_text="@string/login_with_facebook" fb:logout_text="logout" /> wbhere facebook login button style is <style name="facebookloginbutton"> <item name="android:background">@drawable/button_facebook</it...

php - How to add quotes to the src attribute of the img tag -

i have correct several posts on database these: <a href="somelink.html"><img src=someimage.jpg border=1 alt="some text"></a> so need to: remove border=1 attribute (str_replace job) add quotes @ begin , end of src attribute: src="someimage.jpg" close img tag adding /> @ end of tag one thing tried parse dom , src source: $doc = new domdocument(); $body = $this->removeunnecessarytags($body); $doc->loadhtml($this->removeunnecessarytags($body)); $imagetags = $doc->getelementsbytagname('img'); foreach($imagetags $tag) { $result[] = [ 'src' => $tag->getattribute('src'), 'alt' => $tag->getattribute('alt') ]; } i know can done regex regex knowledge not good. ideas? thanks all need use domdocument features , libxml options: $html = '<a href="somelink.html"><img src=someimage.jpg border=1 alt="s...

php - Html Concatenate issue -

i have following code. echo "<label><input type='checkbox' data-path=".".".$infostatus['status'].""." id='name' class='new1' value=".$infostatus['status']."/>".$infostatus['status']."<span></span></label> </li>"; it produces this: <input type="checkbox" data-path=".deleted" without="" payment="" id="name" class="new1" value="deleted"> although trying produce this: <input type="checkbox" data-path=".deleted without payment" id="name" class="new1" value="deleted without payment"> i don't know doing wrong here, have tried everything. first echo variable, , make sure "deleted without payment". once have confirmed that, can wrap html around it. have quotes in variable's value ...

reference to ODC in excel with C# -

i trying create reference .odc file in excel. (the actual connection string saved in .odc file). file path(root/trusted domains/connections or something) , file name entered. idea upload excel to, sharepoint, , have pivot table automatically refresh data source. using c#. should use openxml or microsoft.office.excel.interop? have example of sort? i'm no expert in xml(reading, writing, look).

c# - ASP MVC Radiobutton from model in list -

i want show list of radiobuttons model using entity framework , mvc 5. list displayed radiobuttons, value of radiobuttons te same al rows , can't find fault in code. perhaps here have idea? code: model: public class resultindexmodel { public ilist<resultinsertmodel> resultlist { get; set; } } public enum beoordeling { voldoende, onvoldoende } public class resultinsertmodel { public int userid { get; set; } public int examid { get; set; } public int id { get; set; } public beoordeling issufficient { get; set; } public nullable<decimal> result { get; set; } public exam exam { get; set; } public user user { get; set; } } examscontroller: [authorize] public actionresult addresults(int? id) { if (id == null) { return new httpstatuscoderesult(httpstatuscode.badrequest); } viewbag.examname = examcatalog.getname(id); return view(examcatalog.getexamstudents(id)); } [authorize] [httppost] [validat...

how to enter prompt input through shell script -

i have shell script (main.sh) in first few lines read data through user's input. echo "enter model !!" read model echo "enter weight !!" read wgt echo "enter data file !!" read datafile echo "enter 2 column names !!" read coll1 coll2 these variables $model, $wgt, $datafile, $coll1, $coll2 being used in rest of programs. when run ./main.sh , give inputs respectively model, wgt, data, col1 col2, running fine. want give these inputs through file. created script file contains echo "col1 col2" | echo "data" | echo "wgt" | echo "model" | ./main.sh its taking first input i.e. model. there way correctly? don't pipe echo echo. echo doesn't read standard input , losing last one. if worked written backwards. you want more this: { echo "model" echo "wgt" echo "data" echo "col1 col2" } ...

c# - Custom Model Binder for a base class in Web API -

given following models public class requestbase { public datetime transactiontimestamp { get; set; } public guid requestmessageid { get; set; } } [modelbinder(typeof(requestbasemodelbinder))] public class standardrequest : requestbase { public guid myguidid { get; set; } public int myintid { get; set; } } the values in requestbase sent via headers i'm trying implement custom model binder bind them model this i've got far public class requestbasemodelbinder :imodelbinder { public bool bindmodel(httpactioncontext actioncontext, modelbindingcontext bindingcontext) { var requestbase = bindingcontext.model requestbase; if (requestbase != null) { requestbase.requestmessageid = guid.parse(actioncontext.request.headers.getvalues("requestmessageid").firstordefault()); requestbase.transactiontimestamp = datetime.parse(actioncontext.request.headers.getval...

c# - ASP .NET Scaffolding ignoring list data structures? -

i'm trying learn asp .net creating sample website, , have problem. suppose have following classes: public class player { public string name {get; set;} public int age {get; set;} public double salary {get; set;} public string gender {get; set;} public datetime contractsigndate {get; set;} } public class team { public string teamname {get; set;} public string sportplayed {get; set;} public list<player> players {get; set;} } now if try use scaffolding in vs2013 create controller , crud pages around model team, pages have fields teamname , sportplayed . players list control not catered for. ideally speaking, when i'm creating new team, i'd way define new players , add them team well. can either through player addition controls on team create page, or maybe button such 'manage players' when clicked, opens small popup players can added. how can achieved while using scaffolding ? you fix using partial view can use ...

javascript - Simulate turning on Sticky Keys in Windows -

using javascript, trying provide users option turn on sticky keys. manually can done pressing shift key 5 times. no success following. tried shiftkeyarg set true. function stickykeys() { var keyboardevent1 = document.createevent("keyboardevent"); var initmethod = typeof keyboardevent1.initkeyboardevent !== 'undefined' ? "initkeyboardevent" : "initkeyevent"; keyboardevent1[initmethod]( "keydown", // event type : keydown, keyup, keypress true, // bubbles true, // cancelable window, // viewarg: should window false, // ctrlkeyarg false, // altkeyarg false, // shiftkeyarg false, // metakeyarg 16, 0 ); var keyboardevent2 = document.createevent("keyboardevent"); var initmethod = typeof keyboardevent2.initkeyboardevent !== 'undefined' ? "initkeyboardevent" : "initkeyevent"; keyboardevent2[initmethod]( "keyup", // event type : keydown, keyup, keypress true, // bubbles true, // cancelable wi...

javascript - Server-Sent Events with Ruby Grape -

i trying create server-sent events on ruby grape api . problem connection seems closed fast time, connection closed event time on test webpage. the client connects server can see method being called, know why connection not constant , why don't receive data send using thread. here ruby code: $connections = [] class eventsapi < sinantra::base def connections $connections end "/" content_type "text/event-stream" stream(:keep_open) { |out| puts "new connection" out << "data: {}\n\n" connections << out } end post "/" data = "data\n\n" connections.each { |out| out << data } puts "sent\n" end end here javascript: var source = new eventsource('http://localhost:9292/events'); source.onmessage = function(e) { console.log("new message: ", e.data); showmessage(e.data); }; source.onopen =...

How to store time from java.util.Date into java.sql.Date -

i want convert java.util.date java.sql.date want hours, minutes, , seconds java.sql.date can used store date(no time) . tried below code giving year, month, , day java.sql.date object. simpledateformat format = new simpledateformat("yyyymmddhhmmss"); date parsed = format.parse("20110210120534"); system.out.println(format.parse("20110210120534")); java.sql.date sql = new java.sql.date(parsed.gettime()); system.out.println("sql date is= "+sql); current output: 2011-02-10 desired output: 2011-02-10 12:05:34 the java.sql.date type used store date (no time) information, maps sql date type, doesn't store time. tostring() method is: formats date in date escape format yyyy-mm-dd. to achieve desired output can use java.sql.timestamp , stores date and time information, mapping sql timestamp type. tostring() method outputs need: formats timestamp in jdbc timestamp escape format: yyyy-mm-dd hh:mm:ss.fffffffff,...

android - java.lang.OutOfMemoryError background -

this one, java.lang.runtimeexception: unable start activity componentinfo{ders.raydingoz.com.dersprogram/ders.raydingoz.com.dersprogram.aksamyemek}: android.view.inflateexception: binary xml file line #1: error inflating class <unknown> @ android.app.activitythread.performlaunchactivity(activitythread.java:2305) @ android.app.activitythread.handlelaunchactivity(activitythread.java:2363) @ android.app.activitythread.access$900(activitythread.java:161) @ android.app.activitythread$h.handlemessage(activitythread.java:1265) @ android.os.handler.dispatchmessage(handler.java:102) @ android.os.looper.loop(looper.java:157) @ android.app.activitythread.main(activitythread.java:5356) @ java.lang.reflect.method.invokenative(native method) @ java.lang.reflect.method.invoke(method.java:515) @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:1265) @ com.android.internal.os.zygoteinit.main(zygoteinit.java:1081) @ dalvik.system.nativestart.main(native method) caus...

ios - Update CoreData Objects with NSFetchedResultsController -

i made app uses core data , fetched results controller. i can add coredata objects , delete them. want update coredata object via fetched results controller. know have fetch objects , can change it. because i'm still learning don't know how this. i'd ask how this? when fetch coredata, if modify results update actual value within coredata when save it. you'll want first perform fetch: nsfetchrequest *request = [[nsfetchrequest alloc] init]; [request setentity:[nsentitydescription entityforname:@"entity" inmanagedobejctcontext:moc]]; nserror *error = nil; nsarray *results = [moc executefetchrequest:request error:&error]; // error handling code once have results, can modify individual records... myentity *entity = [results objectatindex:0]; entity.title = @"updated attribute"; // save context [moc save:&error]; edit: in swift, along lines of following: let appdelegate = uiapplication.sharedapplication().delegate appde...

How would I call a JavaScript function from a JSF Bean? -

i need java code, trying following, got stuck: uioutput js = new uioutput(); js.setrenderertype("javax.faces.resource.script"); js.getattributes().put("library", "js"); js.setvalue("alert(123);"); facescontext context = facescontext.getcurrentinstance(); context.getviewroot().addcomponentresource(context, js, "body"); i didn't error in server log, didn't see alert. any idea? edit: tried suggested solution, alleged duplicate, , didn't server error either, neither did see alert.. i'm assuming want jsf managedbean, not jsf component. i'm not sure there 'plain' jsf solution (meaning not adding framework or creating , maintaining specific java code). there @ least 2 solutions (the ones worked with): ajax.oncomplete("alert('hi'')") omnifaces utility framework requestcontext.getcurrentinstance().execute("alert('hi'')"...

javascript - jQuery .html() of all matched elements -

.html() function on class selector ( $('.class').html() ) applies first element matches it. i'd value of elements class .class . you selection elements class .class gather html content need walk trough of them: var fullhtml; $('.class').each(function() { fullhtml += $(this).html(); }); search items containig text inside of it: $('.class:contains("my search")').each(function() { // somethign }); code: http://jsfiddle.net/cc2rl/1/

Convert SQL query to Android Azure Mobile Service query -

i have query works fine in azure sql database, i'm trying use within android application , can't work correctly. find overlaps in time bookings. here sql query dummy data, arrival , depart both integers: select * bourguestmob.tableobjectbookings tabobjid = 28 , day = 30 , month = 3 , year = 2015 , ((arrival <= 1600 , depart > 1600) or (arrival< 1800 , depart >= 1800)); using mobile service provided, have use query like: tableobjectbookingstable.where().field("tabobjid").eq(tables.get(i).getid()) .and().field("day").eq(day).and().field("month").eq(month).and().field("year").eq(year) .and().field("arrival").lt(inttime).or().field("arrival").eq(inttime).and().field("depart").gt(inttime) that's have partially think part of query needs nested evaluated correctly. i think want change end of query so: .and(field("arrival").lt(inttime).or() .field("arrival...

mysql - Automatically xampp shutdown when computer start -

6:29:08 pm [mercury] run program xampp root directory! 6:29:08 pm [tomcat] problem detected: tomcat not found! 6:29:08 pm [tomcat] disabling tomcat buttons 6:29:08 pm [tomcat] run program xampp root directory! 6:29:08 pm [tomcat] problem detected: required tool catalina_start.bat not found! 6:29:08 pm [tomcat] problem detected: required tool catalina_stop.bat not found! 6:29:08 pm [tomcat] problem detected: required tool catalina_service.bat not found! 6:29:08 pm [main] starting check-timer 6:29:08 pm [main] control panel ready i installed xampp , use correctly.if shut down computer , start xampp apache,mysql,and options buttons disabled.then again uninstall , insatll xampp time worked.but if computer shutdown , start xampp not worked.i googled dll missing like.but not work.what problem exactly.anybody guide me. how take backup existing databases.i cant know how retrieve database files.

rspec - Rails ActionController::UrlGenerationError -

i have basic rspec tests client model. , broke after assigned current_user. have problems figuring out what's wrong. looking help. problem exist show , edit , delete actions require 'spec_helper' describe 'clientpage' subject {page} let(:user) {factorygirl.create(:user)} let(:client) {user.clients.build(client_name: client_name, client_secondname: client_secondname, budget: budget, project: project)} let(:client_name) {'client'} let(:client_secondname) {'first'} let(:budget) {3000} let(:project) {'project'} before {sign_in(user)} #==============================new page===========>> describe 'new client page' before {visit new_client_path} {should have_title('new client')} let(:submit) {"create"} describe 'create' context 'invalid creation' 'should not create client' expect{click_button submit}.not_to cha...

python - How to cache a small piece of information in Django -

i have website delivers list of questions users. set of questions same users. have these questions stored in text file. content of file not change while server running. i cannot use static page display these questions because have logic decide when show question. i cache these questions in memory (instead of reading file off hard drive every time user connects). using django 1.7. i did read caching django's website, think suggested methods (like memcached , database) heavy need. solution situation? use global variable? thanks! there many caching back-ends can use listed in https://docs.djangoproject.com/en/1.7/topics/cache/ i haven't tried file system or local memory caching myself, needed memcached, looks they're available, , rest piece of cake! from django.core import cache cache_key = 'questions' questions = cache.cache.get(cache_key) # if questions: # use questions fetched cache else: questions = { 'question1': 'how you?...

java - Android Studio didn't start. Shows issue like "tools, extra-android-m2repository and 6 more SDK components were not installed" -

Image
i tried start android studio cmd line, show issue "tools, extra-android-m2repository , 6 more sdk components not installed". think there problem jdk. tried change proxy settings in other.xml, opened android studio window , cannot able create or import new projects. people guide me. go , check update automatically update required packages , problem solved.

dynamics crm 2011 - CRM 2013 : Data change in Active Directory synced by office 365 in user record is not triggering a OOB Workflow automatically -

i have online crm organization , oob workflow written execute on change of primaryemailaddress field data in user record. workflow not getting triggered when there change in user data in active directory getting synced through office 365. workflow getting triggered when changing data manually in user record not active directory changes. is there limitions of workflow or actual reason behind not triggering workflow. if has faced issue before , me out in finding root cause of it. thanks, samit

How to add credentials to jenkins without using UI? -

as part of automating jenkins setup need add credentials use svn configuration in build jobs. manually add domain here http://< server >:8080/credential-store/ then add credentials here: http://< server >:8080/credential-store/domain/< domain >/newcredentials has managed automate this? there doesn't seem usable api , xml files contain hashed passwords stops me copying files around (plus worry security this)

ant - Test In Progress is Empty in Jenkins -

i have installed test in progress plugin in jenkins.and selecting show test in progress option. invoking ant specifying build file name .the job executed unable see test progress report(i.e empty).i have tried adding testinprogress-testng-client-0.1.jar test classpath shows no results.please help i had same issue in test in progress plugin , of empty test progress report in jenkins. solved adding testinprogress-testng-client in maven pom dependencies: <dependencies> ... <dependency> <groupid>org.imaginea.jenkins.plugins</groupid> <artifactid>testinprogress-testng-client</artifactid> <version>0.1</version> <scope>test</scope> </dependency> ... </dependencies> and then, set testinprogress listener (in case testng), under maven surefire/failsafe plugin configuration: <configuration> ... <properties> <property> ...

java - why getting socket closed error after running script by jmeter? -

i getting "non http response code: java.net.socketexception response message: non http response message: connection reset" type of error after running jmeter script i bet you're experiencing problem described in connection reset since jmeter 2.10 ? wiki page so recommend take next steps: switch "implementation" of http request samplers "httpclient4". best way using http request defaults have change value in 1 place. as per wiki page add next 2 lines user.properties file (lives under /bin folder of jmeter installation) httpclient4.retrycount=1 hc.parameters.file=hc.parameters add next line hc.parameters file (same location, /lib folder) http.connection.stalecheck$boolean=true remember restart jmeter after making these changes, properties change not dynamic, they're being picked upon jmeter startup. hope helps.

ios - view controller segue connections for multiple view controller interconnection -

working on application contains 3 view controllers a,b , c. can navigate view controller 1 view controller. a->b, a->c, b->a, b->a, c->a, c->b using storyboard segue type show each transition. while analysis came know view controller old instance not release , new instance created each navigation. while using button event dismissing current view controller [self dismissviewcontrolleranimated:yes completion:nil]; navigation instance released. cant used case, need switch view controller , release current view controller. suggest segue connection used such release of view controller should done? or other methods achieve should not affect performance. struggling different analysis since retain count increase new transition view controllers, analysed allocation tool. right present view controllers , dismissviewocontroller completion?

c# - (Solved) DataGrid binding on a List in an Object -

i'm trying bind class schedulep on datagrid in wpf application. inside class there's class every day of week, inside list. have 7 columns, , i'm trying bind data of list inside these columns i tried setting {binding day[0].name} not display anything... displaying time string. any ideas? thanks in advance. //cs public class schedulep { public string time { get; set; } public list<_day> day = new list<_day>(); public class _day { public string name; public string subject; public bool lab; } } public main() { initializecomponent(); schedulep sch = new schedulep(); sch.day.add(new schedulep._day() { name = "asd", subject = "asd", lab = true }); sch.time = "ads"; list<schedulep> users = new list<schedulep>(); users.add(sch); programmgrid.itemssource = users; ...

java - Gibberish characters in Excel Export -

i'm getting gibberish characters in exported excel web page in actionimpl.java excelbean.setheaders(constants.values); in constants.java public static final string[] values= { "agrès"}; i should - agrès although i'm getting - agrès replace è "agrès" below: java source code: è \u00e8 i.e. agr\u00e8s using html entity: è &#232; i.e. agr&#232;s

javascript - Multiple values from redis with nodejs -

i've been trying figure out how achieve nodejs , redis: var var1 = redisclient.get("foo"); var var2 = redisclient.get("bar"); if (var1 && var2) { do_something(); } else { do_something_else(); } i know redis calls asynchronous repeating like: var var1, var2; redisclient.get("foo", function(err, data) { var1 = data; redisclient.get("bar", function(err, data) { var2 = data; if (var1 && var2) { do_something(); } else { do_something_else(); } } }); doesn't feel right every time want access 2 variables. you can use async library control flow: async.parallel([ function(done) { redisclient.get("foo",done); }, function(done) { redisclient.get("bar",done); } ], function(err, result) { /...

implicit conversion - Why are non-boolean values not implicitly converted in boolean expressions? -

some programming languages evaluate 5 == true to true, or allow if 5 expr by converting 5 bool. julia not. why? because == equivalence relation . in julia, true , when converted integer, becomes 1 , , 1 == true . if true == 5 , in order == preserve transitivity, imply 1 == 5

jquery - Bootstrap clearer height differs -

i'm usuably using bootstrap build responsive websites , i'm using clearer-class enable correct clearing on mobile devices. can seen in fiddle below, clearer-height differs in last row - because row not filled. <div class="container"> <div class="row"> <div class="col-xs-6 col-sm-4"> <div class="thumbnail"> <img src="http://placehold.it/350x150" class="img-responsive" /> <div class="caption">test</div> </div> </div> <div class="clearfix visible-xs">&nbsp;</div> <div class="col-xs-6 col-sm-4"> <div class="thumbnail"> <img src="http://placehold.it/350x150" class="img-responsive" /> ...

php - Installing Laravel on DigitalOcean error -

i've tried install laravel on vps, got error in "bootstrap/compiled.php": file_put_contents(): 0 of 197 bytes written, possibly out of free disk space i'm using lamp stack, installing via composer create-project . followed these steps: install via composer create-project set permissions , user group: chgrp -r www-data myproject chmod -r 775 myproject/app/storage after these still getting error. trying, services.json created it's became empty , laravel can't write in it. what missing?

c# - How to write a moq test to setup a method to return a count value -

in controller action, whenever new product added check in database product no not present already. code check looks like public actionresult index(productmodel model) { var productcount = _productsservice.getall(true).count(x => x.productnumber == model.productnumber); if (productcount > 0) modelstate.addmodelerror("productnumber", product present in system!"); // more processing } i m new moq testing , trying write unit test setup getall method return 0. have written not seem work var _productsservice = new mock<iproductsservice>(); _productsservice.setup(m => m.getall(true).count()).returns(0); any ideas? thanks this not how use moq -- count not method (it's linq/other 3rd party), don't mock it. need mock getall method, method on mockable dependency. "tell" getall return product model matching parameter, so: [test] public void index_reportsmodelerror_whenproductalreadye...

php - Functional testing multilanguage Symfony2 app -

i trying test multilanguage app. have 4 languages form in application. try test indexaction(), when crawler go through page want check count of title, title can in english or in japanese example. when pass translation key not work. here code: $this->assertequals(1, $crawler->filter('html:contains("logo_text")')->count()); so question is, can pass translation key tests? or need somehow hardcode value? you can try solution florian eckerstorfer: https://florian.ec/articles/use-translation-keys-in-symfony2-functional-tests/ it creates new translator return key instead of real translation. class notranslator implements translatorinterface { public function trans($id, array $parameters = array(), $domain = null, $locale = null) { return $id; } ... } and registering it: # app/config/config_test.yml parameters: translator.class: acme\demobundle\translation\translator\notranslator the blog post describes possibility of using co...

vba - Calling a UDF (Sql server) from VB Access "Undefined function <function name> in expression" -

i trying call udf (sql server) vb code in access. connection db successful , able run queries on sql server tables. however, when try call udf, throws me error saying undefined function . please see code below: private sub cmd_login_click() ' code here set db = currentdb() ssql = "select userid tbl_user_login username = '" & cbo_user & "' , status = 0" set recset = db.openrecordset(ssql) recset.close set rectset = nothing ssql = "select fn_validate_user(" & gb_userid & ",'" & hash(me.txt_password + cbo_user) & "') passwordvalid" set recset = db.openrecordset(ssql) ' error undefined function fn_validate_user passwordvalid = recset("passwordvalid") can see if missing here. when run standard query in access first processed access database engine, if query refers odbc linked tables. access can recognize access user-defined ...

html - CSS3 Flex: flex-grow + justify-content? -

good day, i have 1 question can use @ once flex , justify-content ? i want "flex-item(s)" have full size container , simultaneously space between it <ul class="flex-container space-between"> <li class="flex-item">1</li> <li class="flex-item">2</li> <li class="flex-item">3</li> <li class="flex-item">4</li> <li class="flex-item">5</li> </ul> http://jsfiddle.net/7yttrtm4/ just use margin childs: .flex-item { margin: 0 10px; } to remove space left , right of container use first- , last-child selectors: .flex-item:first-child{ margin-left: 0; } .flex-item:last-child{ margin-right: 0; } see http://jsfiddle.net/7yttrtm4/2/ or add negative margin container: .flex-container { margin: 0 -10px; } see: http://jsfiddle.net/7yttrtm4/4/