Posts

Showing posts from April, 2011

Spurious module ".." in Android Studio project -

i followed steps in how share single library source across multiple projects add external library project. my project(s) structure: project mytest1: module mylib project mytest2: module myapp i edited settings.gradle in mytest2 , added , ..:mytest1:mylib include directive. now, able see , use external library project within mytest2 project. things work expected. however, see spurious module ".." alongside myapp , mylib . there no nodes under , doesn't seem cause problems. wondering module , if there way rid of it. regards. edit both projects under directory c:\mydev. appears that, anytime bring mytest2 project, modifies file mytest2.idea\modules.xml , inserts following line: <module fileurl="file://c:/mydev.iml" filepath="c:/mydev.iml" /> it complains module not loaded , creates fake ".." module. think root of problem. do not declare ..:mytest1:mylib include. cause many problems. instead, declare f...

java - Square-Retrofit Response content type was not a proto (Protobuf) -

i'm trying send post request server, i'm getting response caused by: retrofit.converter.conversionexception: response content type not proto: application/x-protobuf;charset=utf-8 i'm not sure if i've coded wrong. interface restinterface: @headers({"accept: application/x-protobuf", "content-type: application/x-protobuf", "authorization: basic mtaymtg3ojewmje4nw=="}) @post("/dashboard/mobile") mobiledashboardresponse getquotagroupsbypublisher(@body mobiledashboardrequest mobiledashboardrequest); adapter: restadapter restadapter = new restadapter.builder() .setendpoint(baseurl) .setconverter(new protoconverter()).build(); example usage mobiledashboardrequest mobiledashboardrequest = mobiledashboardrequest.newbuilder() .setipaddress("97.65.116.172") .setuserid(30002996) .build(); mobiledashboardresponse mobiledashboardresponse = pfsrestapi.getquotagroupbypublisher(mobiledashboardrequest); ...

running python function with arguments from cmd.exe -

Image
i have python function takes 1 arguments def build_ibs(nthreads,libcfg): # nthreads int,libcfg string import os # module os must imported import subprocess import sys i use following in cmd.exe(on win7) call it c:>cd c:\svn\python code c:\svn\python code>c:\python27\python.exe build_libs(4,'release') that throws error using following c:>cd c:\svn\python code c:\svn\python code>c:\python27\python.exe 4 'release' # dosn't work c:\svn\python code>c:\python27\python.exe 4 release # dosn't work does nothing, , no error displayed even. what correct way call both in cmd.exe or python shell command line? thanks sedy you can't call function command line - must inside file. when type python filename.py @ command line, feed contents of filename.py python interpreter namespace set __main__ . so when type python.exe 4 'release' tries find file named 4 . since file not exist, windo...

ios - NSUserDefaults not saving to disk with sharing extension -

i trying save data nsuserdefaults later use share extension. however, data never saved when re-open app. likewise extension not able retrieve data i have singleton class called appuser has username property. if set appuser.username = "bob" and run saveappdata() class func saveappdata() { let data = nskeyedarchiver.archiveddatawithrootobject(appuser.singleton) var shareddefaults = nsuserdefaults(suitename: "group.ca.mycompany.myapp") shareddefaults!.setobject(data, forkey: "appuser") shareddefaults!.synchronize() } close app & re-open class func loadappdata() { var shareddefaults = nsuserdefaults(suitename: "group.ca.mycompany.myapp") if let data = shareddefaults!.objectforkey("appuser") as? nsdata { println("unarchived file succesfully") nskeyedunarchiver.unarchiveobjectwithdata(data) //should throw data appuser.singleton class println("username is: ...

unity3d - Assigning multiple assets to multiple variables on inspector -

Image
is there way assign multiple assets multiple variables on inspector??? my case this, have 5 objects, objects have script wich have around 1200 variables used play sfxs. when unity compile script have manually drag , drop sfx assets variable on inspector, or go inspector, scrol variable, click dot , select sfx file window. is there way speed up? you should create public list of audio sources appear in inspector. lock inspector clicking in right top. select files project , drag on list. files added list. if want specific file can find file name example: audiosource getaudiosource(string sourcename) { return audiosourcelist.find(item => item.name == sourcename); }

javascript - Why is the html code of width 100% for full bar is not working when I am writing. Forget about that, even the copy paste is not working. Why? -

my basic code not working, have div tried extend full window. <!doctype html> <html> <head> <meta charset="utf-8"> </head> <body> <div style="width:100%; position:relative; height:100px; background-color:#f00;"></div> </body> </html> and have tried copy paste, failed when copy pasted. this original code, should seen (below) http://codepen.io/chriscoyier/pen/pwzbbw and copy paste code, have done (below) http://codepen.io/anon/pen/gjvmee this caused default browsers css. have padding, margin , other default values. use normalize.css or reset.css layer clear default values , set them scratch yourself. css layers: https://github.com/necolas/normalize.css/ or http://yuilibrary.com/yui/docs/cssnormalize/ in example, there difference between original copied in normalize library. (settings -> css -> normalize)

directx - How to CreateSwapChainForHwnd -

in following code, device instance of comptr<id3d12device> initialized d3d12createdevice , getting failing hresult . value 0x887a0001. appreciate ideas doing wrong. dxgi_swap_chain_desc1 swapchaindesc = {}; swapchaindesc.width = 0; swapchaindesc.height = 0; swapchaindesc.format = dxgi_format_r8g8b8a8_unorm; swapchaindesc.stereo = false; swapchaindesc.sampledesc.count = 1; swapchaindesc.sampledesc.quality = 0; swapchaindesc.bufferusage = dxgi_usage_render_target_output; swapchaindesc.buffercount = 2; swapchaindesc.scaling = dxgi_scaling_none; swapchaindesc.swapeffect = dxgi_swap_effect_flip_discard; swapchaindesc.alphamode = dxgi_alpha_mode_straight; swapchaindesc.flags = 0; comptr<idxgiswapchain1> swapchain; throwiffailed(factory->createswapchainforhwnd(device.get(), wnd.handle(), &swapchaindesc, nullptr, nullptr, &swapchain)); the first parameter create...

ios - centering an object so vertical constraints are always even -

Image
i need center uibutton('call') between uiview(the dialpad) , bottom layout guide. view align center x , align center y. so, i'd have vertical constraints between view , call button , call button , bottom layout guide equal the uiview ('dialpad') constraints the uibutton ('call') constained bottom layout guide. want spaced evenly between uiview , bottom layout guide and storyboard preview shows different sizes , how call button not centered between uiview , bottom layout guide. extremely obvious in 4.7" layout have tried doing @ runtime through constraints ? , approach follow : have constraints set current state need outlet button constraint (the 1 button bottom layout guide) viewcontroller (you outlet uikit control) , in viewwillappear or viewdidappear can write following code : //here end y point of dial view . cgfloat dialpadyendpos = self.dialpad.frame.origin.y + self.dialpad.frame.size.height; //here space between ...

java - HashMap created in Main method want to access in other functions -

i have hashmap in main , want access function ? public class slr{ public static first(string fst){ *want access entire hashmap here } public static void main (string[] args){ hashmap<string, string> mymap = new hashmap<string, string>(); added data mymap } } there number of ways this. preferrably, might consider using class instance field, since don't have instance of class, won't work here (at least not far code has gone). you use static field, leads bad habits better avoided ( static not friend , bury in pile of problems , issues if not used carefully). in case, 1 of better solutions change first method take map 1 of parameters, example... public class slr{ public static first(string fst, map<string, string> mymap){ *want access entire hashmap here } public static void main (string[] args){ hashmap<string, string> mymap = new hashmap<string, st...

ios - Enable Disable Watch Target in iPhone app setting Xcode -

Image
recently have developed watch app iphone app , added watch target in iphone app. want know there kind of setting can choose add/hide(enable/disable) watch target in iphone app, in current market release don't want include watch app, there setting can make disable in iphone build code exist in app. there kind of target/info plist or build settings can achieve this. please suggest. any highly appreciated. thanks in advance. go application target, build phases, target dependencies, , remove watchkit extension list.

php - Many objects under objects -

i have doubt relationship , how show it. i have channel can have many channels, can have more channels, can have more channels.......... how can relate them? i thought each channel can have field tells channel it's related to, like: id name related_channel 2 example1 null 3 example2 2 4 example3 2 5 example4 4 what think it? after relating them, how can show channels under channel? thanks in advance! i big fan of self-joins, stored procs near recursive (but not) operations on them. wrote example in link . let of know if need that. luck.

javascript - API and JSON request error -

i trying use json data received api ( http://forismatic.com/en/api/ ). below json data api. parsequote({"quotetext":"if you\'re feeling low, don\'t despair. sun has sinking spell every night, comes every morning. way see it, if want rainbow, gotta put rain.", "quoteauthor":"dolly parton", "sendername":"", "senderlink":"", "quotelink":"http://forismatic.com/en/d49c34aa09/"}) when try data html file, continuously encounter error on .js page: uncaught referenceerror: parsequote not defined here codepen link of pages: http://codepen.io/cenjennifer/pen/aoeoxz

php - twig: appending to parent template region from multiple includes -

general.tpl: <head> <!-- default meta tags --> </head> <body> {% block mainarea %}{% endblock %} {% block sidebar %}{% endblock %} <!-- standard footer --> <script src="base.js"></script> {% block js %}{% endblock %} </body> page1.tpl: {% extends "base.tpl" %} {% block mainarea %} content {% endblock %} {% block sidebar %} ... {% include 'one-of-many-widgets.tpl' %} ... {% endblock %} one-of-many-widgets.tpl requires specific javascript library must referenced before <body> tag , needs emit specific in-line javascript before library after referencing base.js requres specific meta tags added page head block requires append additional legal information page footer q1: how putting additional script , meta info into one-of-many-widgets.tpl file? given there several included widgets contribute scripts area of page. q2: there page2.tpl, need ...

ios - Swift: How to enable pinch-to-zoom for CALayer? -

i have been trying scroll , zoom calayer, cashapelayer, of several polygon paths. added calayer uiscrollview has enabled scrolling around calayer. however, pinch zoom not working. several tutorials have implemented zooming uiimageview uiscrollviewdelegate so: @iboutlet var scrollview : uiscrollview! var imageview = uiimageview() scrollview.addsubview(imageview) func viewforzoominginscrollview(scrollview: uiscrollview) -> uiview? { return imageview } but calayer incompatible uiview , have found no information on reconciling difference. is there similar native way zoom calayer in swift? simple escaped me? appreciated; apologies if missing obvious. after digging found related documentation apple . turns out pinch-to-zoom handled automatically on calayers if set correctly. adapted demo code swift , came basic structure, worked me. class viewcontroller: uiviewcontroller, uiscrollviewdelegate { @iboutlet var scrollview : uiscrollview! var layerview = u...

html - How do I link CSS files to my view in Rails? -

how link css stylesheet html file. using rails generate application, file structure still quite confusing. have directory stylesheets in assets, don't know how link them. here index.html file looks like: <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content=""> <meta name="author" content=""> <title>stylish portfolio - start bootstrap theme</title> <!-- bootstrap core css --> <link href="css/bootstrap.min.css" rel="stylesheet"> <!-- custom css --> <link href="css/stylish-portfolio.css" rel="stylesheet"> <!-- custom fonts --> <link h...

php - codeigniter pagination setup image? -

i have problem please me, find in google how solve problem cannot see, problem is. i have image @ header, when @ page 1 (pagination), image still have, when go next page (pagination) image gone, think problem @ link not know how handle it. public function listtender(){ //pagination settings $config['base_url'] = site_url('tender/listtender'); $config['total_rows'] = $this->db->count_all('tender'); $config['per_page'] = "8"; $config["uri_segment"] = 3; $choice = $config["total_rows"] / $config["per_page"]; $config["num_links"] = floor($choice); }

python - How can i get this output in order? -

import xlrd import sys collections import defaultdict out = defaultdict(list) workbook = xlrd.open_workbook('dummy input data.xlsx') worksheet = workbook.sheet_by_index(0) headers = worksheet.row(0) result = [] index in range(worksheet.nrows)[1:]: result.append(worksheet.row(index)[0].value) uniq in set(result): sum = 0 index in range(worksheet.nrows)[1:]: if uniq == worksheet.row(index)[0].value: sum = sum + worksheet.row(index)[4].value out[uniq] = int(sum) rec in out: print rec+" "+str(out[rec]) got output this: engineer-2 16 engineer-3 19 engineer-1 11 engineer-4 24 engineer-5 12 how sort names , numbers, need result in orderly like: engineer-1 11 engineer-2 16 engineer-3 19 engineer-4 24 engineer-5 12 how result above,it should take starting 1,2,3,4,5... getting output not in order. you use 2 different data-structures not have sense of order - dictionary set - getting result in order different o...

Swiffy runtime error bug -

i have noticed runtime engine swiffy has updated v7.2.0 v7.3.0 has created noticeable bug newly created converted files. the issue when publish swiffy file site , scroll off screen, when try scroll onto screen disappears off page altogether. i should have link tomorrow demonstrates old file versus new created file. if else has experienced issue great know.

android - C# mvc web api. Convert json plain text to cipher text over http -

i developing mobile backend application written in c# mvc web api's. know best secure mechanism transmit json data. there issue sending data in json format, or should convert json som encrypted format? actual data this. { "id":2130, "location":"florida" } my question is, there way convert json other format can decrypted @ mobile side folllows { "zxs#%df":"dfd5d2f", "fgfd5f5gdd":"fdgfdg699" } or plain text "dfsdfs^^dfsd^%$$fsdfsd*fs6556df$6" which can converted actual json data use https. it unlikely can create our own protocol comparable security.

Where to get Elasticsearch shield license? -

when start kibana, got following exception: licenseexpiredexception[license expired feature [shield]] i checked document , found that: the first time start node, 30 days trial license automatically created enable shield operational. within these 30 days, able replace trial license 1 provided on purchase. isn't shield free software? purchase license? can't find in document. i contacted elasticsearch know how license personal use. have single server, , want simple security realm (3 users : admin, logstash, kibana). well, point called me 1 hour after form submission. but, bad point have no plan personal usages, have (for now) single bundle included: professional support (ticket, phone) license every software (marvel, shield, watcher) tons of cool features unfortunately, fits professional usage, because plans 1600 $/year/cluster . i told support having no plan developer bad thing, thing said " sorry ". so i'm heading t...

outlook - Setup Auto Responders (Multiple Times) -

i have set rule website goes follows:- apply rule after message arrives 'enquiry' in subject or body reply using c:z\path-to-template-file i'm happy how works. thing is, can sent once per sender. if sender makes more 1 'enquiry', e-mail not automatically sent. wondering if guide me on how set additional rule says like:- apply rule after second message previous sender arrives 'enquiry' in subject or body reply using c:z\path-to-template-file i hope can help instead of creating rule subject create auto response including sender along "enquiry" . create or condition such outlook send autoresponse if mail comes specified sender , contaning text "enquiry". hope helps!

angularjs - Cordova BarcodeScanner not working on iOS 8 -

i'm using ionic framework barcodescanner plugin . the barcodescanner working fine on ipad , iphone 4 running ios7, today tested on iphone 5 , 6 running ios8 , scanner doesn't show up, neither shows errors. code i'm using in controller, simple. $cordovabarcodescanner.scan().then(function(imagedata) { if (imagedata.cancelled) { return; } console.log("we got barcode" + "result: " + imagedata.text + "n" + "format: " + imagedata.format + "n" + "cancelled: " + imagedata.cancelled); }, function(error) { console.log("an error happened -> " + error); }); i've been trying research issue hours , haven't found yet. do think have add kind of permission use camera on iphone? or different?

java - Android ListView with active and inactive entries -

i need listview has several clickable entries. however, of them inactive until asynctask releases them. how should best this? first thought of having seperate arraylist booleans seems somehow cheap. there way expand stablearrayadapter? this current adapter import android.content.context; import android.widget.arrayadapter; import java.util.hashmap; import java.util.list; public class stablearrayadapter extends arrayadapter<string> { hashmap<string, integer> midmap = new hashmap<>(); public stablearrayadapter(context context, int textviewresourceid, list<string> objects) { super(context, textviewresourceid, objects); (int = 0; < objects.size(); ++i) { midmap.put(objects.get(i), i); } } @override public long getitemid(int position) { string item = getitem(position); return midmap.get(item); } ...

vb.net - jquery confused with multiple DropDownLists in same class name -

i have more 1 dropdownlistfor generated in partial view following: in loop: @html.action("listunpairedpermissions", item) the partial view code: <div> @if ctype(model, ienumerable(of usermodel.permission)).count > 0 @html.dropdownlistfor(function(r) ctype(model, ienumerable(of usermodel.permission)).lastordefault.permission_id, new selectlist(model, "permission_id", "permission_description"), "--select--", new {.class = "pid"}) html.validationmessagefor(function(m) m.singleordefault.permission_id) else @<p>this role has permissions</p> end if </div> my jquery code: $('.addpermission2role').each(function (index) { $(this).on("click", function () { var tr = $(this).closest('tr'); var _role_id = tr.find('.roleidclass').attr('roleidtd'); var _permission_id = $('.pid').v...

javascript - How to get the value dynamically from JSON object -

this question has answer here: javascript object: access variable property name string [duplicate] 3 answers i want retrieve json value dynamically json object. below code using value json object. var jsonobj = json.parse(jsondata); console.log(jsonobj); jsonsplit = jsontofind.split(htmlsplit+".")[1].trim(); console.log(jsonobj+"."+jsonsplit); but getting [object object].ensighten_tag . here ensighten_tag dynamic key value. can suggest me how value dynamically ? console.log(jsonobj[jsonsplit])

drop down menu - Storing country state city in MongoDB -

i working on building database store country-state-city information later used drop down menus in our website. i wanted few suggestions on schema have decided how efficiently work. i using mongodb store data. the schema have designed follows: { _id: "xxxx", country_name: "xxxx", more fields state_list:[ { state_name: "xxxx", more fields city_list:[ { city_name : "xxxx", more fields }, { city_name : "xxxx", more fields } ] } ] } the data increasing. there long list of cities each state. how schema work intended purpose? should use linking documents technique (this require manual coding map _id) ? i think data increase , schema collapse. best way break database in 3 schemas , use refrence of ids. country schema: { _id: "xxxx", country_name: ...

How to change the asp.net gridview column width using jquery ajax -

i creating webpage using asp.net, c#, bootstrap , jquery. now, have taken grdiview , given bootstrap "table" class css-class gridview. now, data loaded gridview using jquery ajax. detail code given below: .aspx page <div id="user_list"> <asp:gridview id="grduserslist" runat="server" autogeneratecolumns="false" cssclass="table table-hover" headerstyle-cssclass="info"></asp:gridview> </div> jquery ajax function showactiveusers(stat) { alert(stat); $.ajax({ type: "get", url: "http://localhost:49541/admin_userdet.svc/allusers?stat="+stat, datatype: "json", contenttype: "application/json; utf-8", success: populateuserslist, error: function (xhr, errortype, exception) { alert("error: " + errortype); alert(exception); } }); } function populateuserslist(response) { //console.log(response); $(...

java - How to determine the origin of a thrown exception without writing a try/catch for each statement? -

i wondering if possible without writing try/catch block every single call. want able tell method threw exception can handle them differently. consider following 2 (fairly identical) methods: public void setbranchid(string id) throws numberformatexception{ if(id.trim().length() != 0 && id != null){ try{ branchid = integer.parseint(id); }catch(numberformatexception ex){ outputfunc.printerror(ex); //prints stack trace console throw ex; } } else{ branchid = null; } } public void setcashonhand(string cash) throws numberformatexception{ if(cash.trim().length() != 0 && cash != null){ try{ cashonhand = double.parsedouble(cash); }catch(numberformatexception ex){ outputfunc.printerror(ex); throw ex; } } else{ cashonhand = null; } } what want do: try{ setbranchid(string1); setcashonhand...

jquery - How to solve the pie-donut chart tooltip transparent without using any css? -

Image
how solve above image tooltip transparent issue fix? without using z-index , seperate css? using 4.0.1 version. in advance. you need use css styles: .highcharts-container { overflow: visible !important; } .mycharttooltip { position: relative; z-index: 50; border: 2px solid rgb(0, 108, 169); border-radius: 5px; background-color: #ffffff; padding: 5px; font-size: 9pt; } and edit tooltip: tooltip: { backgroundcolor: "rgba(255,255,255,0)", borderwidth: 0, shadow: false, formatter: function () { return '<div class="mycharttooltip"><span class="ag-title">' + this.key + ' &#40;' + this.percentage.tofixed(0) + '&#37;&#41;</span><br/> <span><span style="font-size:25px">' + highcharts.numberformat(this.y, 0) + '</span> mytickets</span></div>'; }, u...

Python File Remains Empty After Writing to it Issue -

i trying read url directly mysqldb table , tldextract domain url , find spf(sender policy framework) record domain. when i'm trying write spf records of each , every domain scan,my ouput_spf_records.txt not contain records write. not sure issue,any suggestions please ? import sys import socket import dns.resolver import re import mysqldb import tldextract django.utils.encoding import smart_str, smart_unicode def getspf (domain): answers = dns.resolver.query(domain, 'txt') rdata in answers: txt_string in rdata.strings: if txt_string.startswith('v=spf1'): return txt_string.replace('v=spf1','') db=mysqldb.connect("x.x.x.x","username","password","db_table") cursor=db.cursor() cursor.execute("select application_id,url app_info.app_urls") data=cursor.fetchall() x=0 while x<len(data): c=tldextract.extract(data[x][1]) #pr...

How use MAX in mysql to get follow result -

Image
this query select research_id, if(product_id = 4, if(value regexp '^-?[0-9]+$' > 0, value, if(value = 'yes', 1, 0)), 0) val1, if(product_id = 8, if(value regexp '^-?[0-9]+$' > 0, value, if(value = 'yes', 1, 0)), 0) val2 research_product_details rpd left join products p on rpd.product_id = p.id (product_id = 4 , value >= 50) or (product_id = 8 , value >= 50) order research_id asc , product_id asc and got result query i want follow as @jkike mentioned in comment, 1 way achieve want wrap current query , group by research_id column, selecting max value val1 , val2 columns: select t.research_id research_id, max(t.val1) val1, max(t.val2) val2 ( select research_id, if(product_id = 4, if(value regexp '^-?[0-9]+$' > 0, value, if(value = 'yes', 1, 0)), 0) val1, if(product_id = 8, if(value regexp '^-?[0-9]+$' > 0, value, if(value = 'yes', 1, 0)), 0) val2 r...

ios - How to declare object variables for good code structure objective C -

i know question silly need know further development. developing iphone application programmatically without using xib , storyboard , have declared multiple object variables below uinavigationcontroller *navigationcontroller; uiactivityindicatorview *activityindicator; uiimageview *splashimage; nstimer *checkjsontimer; uilocalnotification *localnotification; nsuserdefaults * defaults; @property (strong, nonatomic) uiwindow *window; @property (strong, nonatomic) login *loginview; @end above code .h file had declared, question of uiobjects declared without @property , variable declaring properties , attributes also. objects ui , ns , how declare above 2 methods. which 1 proper way of programming , too?. you should read documentation.. short answer properties give getters , setters free. (but please read docs, there lot more , possible) when define @property don't have define variable anymore (in past had actually). want want use pr...

php - Show posts by user -

so, here php show posts wordpress: <div class="rfp_hide" id="rhm_profile_item"> <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $args = array( 'post_type' => 'product', 'paged' => $paged, 'posts_per_page' => 20, 'orderby' => 'date', 'order' => 'desc' ); $loop = new wp_query( $args ); while ( $loop->have_posts() ) : $loop->the_post(); global $product, $post, $paged; ?> <div class="rhm_post_container"> posts go here </div> <?php endwhile; ?> <?php wp_reset_query(); ?> </div> it shows posts regardless of posted. each post has href following: <a class="royal_author_link" href="<?php echo $userpro->permalink( $post->post_author ); ?>"> on post author pa...

html - Border radius circle -

i've code : span p { margin: 0; } span { background-color: red; display: inline-block; border-radius: 50%; } <span> <p>25</p> <p>08</p> </span> i want make perfect circle on span. try border-radius: 50%; not work. thanks ! you can giving span fixed width , height: span p { margin: 0; } span { background-color: red; display: inline-block; border-radius: 50%; width: 50px; height: 50px; text-align: center; } <span> <p>25</p> <p>08</p> </span>

makefile - Does Make expand recursive-variables before exporting them? -

given makefile: ifeq "$(makelevel)" "0" 0 :: @$(make) else 1 :: @echo 'foo is: "$(foo)"' endif and executing, get: $ make foo='$@' make[1]: entering directory '/home/myname' foo is: "1" make[1]: leaving directory '/home/myname' $ make foo='$@' --environment-overrides make[1]: entering directory '/home/myname' foo is: "0" make[1]: leaving directory '/home/myname' have here recursive variable foo value: $@ , - of course - expands name of target . now, have 2 options here: either, make expands first variable, , export variable sub-make. "logic", when make runs first makefile ( makelevel = 0 ), build target 0 , hence: expand variable foo (and value: $@ ) 0 , , export - expanded value - sub-make. result, sub-make running makefile, variable foo has simple value: 0 . in-fact case, when run make --environment-overrides , can...

Trying to send cURL in BASH more times -

i have bash script for in {1..15}; curl ..here curl.. ; done for send curl every 1500ms , 15x not 1500ms,and not know how edit it, im doing bad ? i order execute command every x seconds/milliseconds must somehow delay loop. using sleep easiest way it: for in {1..15} # non-blocking curl command here sleep 1.5 done as default curl command block execution of loop , times between each loop iteration longer , not even. overcome need prepare curl command non-blocking.

asp.net mvc 4 - how to display data in a single view from multiple tables in mvc 5 -

emp_table sno name salary country 1 xxxx xxxx 101 2 xxxx xxxx 102 country table cid countryname 101 ind 102 usa output sno name salary country 1 xxxx xxxx ind 2 xxxx xxxx usa select e.sno, e.name, e.salary, c.country emp_table e,country c e.country = c.cid

php - .htaccess doesn't support inserting data on codeignater -

i have .htaccess file on server (using codeignater) this view page <form action='cms/register' method ='post'> bla bla bla </form> and contoller-model know problem when click submit nothing happen if change form heading <form action='cms/index.php/register' method='post'> evreything works problem .htaccess. how can solve it? use dynamic urls this: $this->load->helper('url'); and in form: <form action="<?php echo site_url("register"); ?>"> if site_url() not working try base_url() . update: copied application/config/config.php, change 'index.php' '' $config['index_page'] if using mod_rewrite. /* |-------------------------------------------------------------------------- | index file |-------------------------------------------------------------------------- | | typically index.php file, unless you've renamed | else. if u...

dbm - Python dumbdbm, when will data be written back to disk? -

i'm using python2.7's dumbdbm , question applies python3's dbm.dumb . the documentation says: dumbdbm.sync() synchronize on-disk directory , data files. method called sync() method of shelve objects. i've got 3 questions: if don't call sync , disk file updated? and function write data disk, not inverse? what if call close ? one — perhaps best if not — way answer questions aren't addressed in documentation read source code (when it's available, here). the dumbdbm.py file should in /python/lib directory , can viewed online in browser through mercurial source code revision control system at:      https://hg.python.org/cpython/file/2.7/lib/dumbdbm.py the first thing notice longish comment @ beginning of private _database class — dumbdbm database — because seems deal seems overall theme of questions: class _database(userdict.dictmixin): # on-disk directory , data files can remain in mutually # in...

qt - Why does QComboBox ignore its fixed vertical size policy? -

Image
i have widget 2 stacked layers. first looks this, fine: the second looks this, wrong. here complete code produces widget , prints size policies. #include <qtwidgets> int main (int argc, char ** argv) { qapplication app (argc, argv); qwidget w; auto stack = new qstackedwidget (); qwidget * labelbox = new qwidget (); qwidget * combobox = new qcombobox (); qwidget * label = new qlabel ("label"); qwidget * button = new qpushbutton ("button"); qwidget * date = new qdatetimeedit (); auto gl = new qgridlayout (& w); auto hl = new qhboxlayout (labelbox); hl -> addwidget (label); hl -> addwidget (button); stack -> addwidget (labelbox); stack -> addwidget (combobox); stack -> setcurrentindex (1); // 0 layer, 1 bad gl -> addwidget (date); gl -> addwidget (stack, 0, 1); w .setminimumsize (300, 200); w .show (); (auto x : {(qwidget *) stack, labelb...

php - Can we change Web Address and Moodle directory of moodle platform? -

moodle installation web address , moodle directory set differently in localhost , server. i tried change default location of moodle directory server manually. i cannot change it, should upgrade moodle platform newest version? the web address , data directory can changed in config.php but looks don't have permission edit file. i suggest using different host.

css - How can I set the text on the right of a glyphicon into a Twitter BootStrap theme? -

i pretty new in twitter bootstrap , have following problem: i have defined section page: <!-- column 3: --> <div class="container"> <div class="col-md-4"> <div class="group-item"> <i class="glyphicon glyphicon-home"></i> <h4><a href="#">test</a></h4> <p>bla bla bla</p> </div> </div> so want i tag show bootstrap glyphicon on left , thext (test , bla bla bla) on right. so trying set following css: .groups { float: left; margin-right: 15px; width: 80px; } but can't work , obtain text under glyphicon. why? missing? how can fix issue? tnx the obvious solution move glyph link. .group-item { margin-right: .5em; /* margin tast */ } <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.cs...

probability theory - How to calculate multiple probabilities in Excel? -

could me excel formula run test. example probability of ticket getting $5 1 in 30 , probability of getting $10 1 in 70. know how run 1 or multiple (with results of each run) tests find out how many tickets need buy win. odds of both probabilities part of main calculation. there amount of tickets part of calculation. example when starting in beginning know there number of tickets , how many of each winning ticket.

How to locate Venue Map using eventbrite Api in other app -

i'm trying integrate eventbrite's events in app. want locate event's venue map , not able fetch venue map's image eventbrite's api. have idea? thanks! eventbrite uses venue's latitude , longitude call google maps api , map, it's not stored eb , cannot retrieved via api. can call google maps api , retrieve though.

cocoa - How to create a color picker wheel slider? -

Image
does know how create following? cannot find tutorials. i can effect without slider, not smooth. or can incorporate slider not update picker value expects cgpoints instead of ints , expects in gesture.locationinview(colorwheel) format, standard cgpoint not accept. you can use cocoa controller this. there of controllers similar interface. https://www.cocoacontrols.com/controls/hsv-color-picker hope link you.

android - Build failed with an exception -

i getting task 'jar' ambiguous in root project 'projectname'. candidates are: 'jardebugclasses', 'jarreleaseclasses'. while run ./gradlew clean jar can me out. the error information says wrong: gradle cannot determine task trying run jar short both jardebugclasses jarreleaseclasses . replacing jar jarr solve ambiguity (if want trigger jarreleaseclasses task - use jard jardebugclasses ).

How to use android XML's with libgdx such as selector style, animations -

i made game common android libraries, , made nice animations one: <?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:shareinterpolator="false"> <scale android:interpolator="@android:anim/accelerate_decelerate_interpolator" android:fromxscale="1.3" android:toxscale="1.8" android:fromyscale="1.4" android:toyscale="0.9" android:pivotx="50%" android:pivoty="50%" android:fillbefore="true" android:fillafter="false" android:duration="800" /> <set android:interpolator="@android:anim/decelerate_interpolator"> <scale android:fromxscale="1.8" android:toxscale=...

java - how to import Universal tween engine in IntelliJ with lib gdx -

okay.. i'm trying create splash screen mobile game. im using lib gdx library create game. have problem importing universal tween engine sprite splash. should do. i've downloaded universal tween engine , extracted in "libs" folder in ios, android, core, , root of project.. , copied , paste these lines each dependencies: project(":core") { filetree(dir: 'd:/game/core/libs', include: 'tween-engine-api.jar') compile filetree(dir: 'd:/game/core/libs', include: 'tween-engine-api->sources.jar') project(":desktop") { compile filetree(dir: 'd:/game/desktop/libs', include: 'tween-engine-api.jar') compile filetree(dir: 'd:/game/desktop/libs', include: 'tween-engine-api->sources.jar') project(":ios") { compile filetree(dir: 'd:/game/ios/libs', include: 'tween...

c# - Mapping db view without Id to class model in NHibernate -

in application, use nhibernate orm , automapper mapping entities class model. as: fluent-nhibernate/wiki/auto-mapping for tables working. problem when try mapping db view without id field, like: public class vtest { [notnull] public virtual aaatab aaa { get; set; } [notnull] public virtual bbbtab bbb { get; set; } } i create composite key : public void override(automapping<vtest> mapping) { mapping.ignoreproperty(x => x.id); mapping.compositeid() .keyproperty(x => x.aaa.id) .keyproperty(x => x.bbb.id); } but not working. error, becouse in db query have select id : [genericadoexception: not execute query [ select this_.id id7_0_, this_.aaaid aaaid7_0_, this_.bbbid bbb_7_0_ [vtest] this_ ] its possible use automapper case? i find solutions. in compositekey must use phisical exist property in db view, create new properties: public virtual int aaaid {get;set;} pub...

objective c - How to generate video thumbnail iOS without network call to server? -

i want when user pick video gallery want thumbnail image of video.so possible thumbnail image of video without uploading server? - (void)imagepickercontroller:(uiimagepickercontroller *)picker didfinishpickingmediawithinfo:(nsdictionary *)info { nsurl *urlvideo = [info objectforkey:uiimagepickercontrollermediaurl]; __block nsdata *moviedata = [[nsdata alloc]initwithcontentsofurl:urlvideo];avurlasset *asset=[[avurlasset alloc] initwithurl:urlvideo options:nil]; avassetimagegenerator *generator = [[avassetimagegenerator alloc] initwithasset:asset]; generator.appliespreferredtracktransform=true; cmtime thumbtime = cmtimemakewithseconds(0,30); avassetimagegeneratorcompletionhandler handler = ^(cmtime requestedtime, cgimageref im, cmtime actualtime, avassetimagegeneratorresult result, nserror *error){ if (result != avassetimagegeneratorsucceeded) { nslog(@"couldn't generate thumbnail, error:%@", error); } ...

asp.net c# Controller acting weird -

Image
first of, name of question not not think of better one. i'm working project report hours perday, , on diffrent projects. this how looks like. but problem now, if submit it end this. like can see here on summary of month, on secound date duplicates project , shows twice, happends if add more dates well. but never happends on first date. i've been debugging it, not see diffrent behavior when ran first time, values same etc. this controller public actionresult timereport(formcollection form, guid? id) { viewdatadictionary vd = new viewdatadictionary { ["projects"] = new databaselayer().getconsultantprojects(constants.currentuser(user.identity.name)), ["id"] = 1, ["showdescription"] = true }; viewdata["vd"] = vd; newtimereportmodel projectdata = new newtimereportmodel(); if (form != null && form.allkeys.contains("delete...