Posts

Showing posts from February, 2013

ios - multiple apps from one certificate -

i have 2 active projects, main app , test app. seems case using "generate" button run certificate wizard, have generate certificates scratch each time switch 1 app other. "use existing" option never works. generating new cert 1 app invalidates cert other app. doesn't seem right, doing wrong? what doing wrong assumption use existing didn't work. when pick use existing generate provisioning , need copy p12 files other project valid. can define single set of p12 files entire ide in ide global preferences. run certificate wizard regenerate provisioning or manually in apple website.

cs50 - Splitting strings and printing the capitalized first characers in C -

i working on code takes string containing name of , prints initials of name capitalized, whenever run code, keep getting initials printed twice, don't know how fix issue , desired output. here code: #include <cs50.h> #include <stdio.h> #include <string.h> #include <ctype.h> int main(void) { string name = getstring(); char* pointer; pointer = strtok(name, " "); while (pointer != null) { printf("%c", putchar(toupper(pointer[0]))); pointer = strtok (null, " "); } printf("\n"); } when run code example: ahmed salah eldin output: aassee i need : ase you using printf() , putchar() need 1 of them. when call putchar() returns output character passed printf() , output again. change to fputc(toupper(pointer[0]), stdout);

ios - Animate a UIImage which is drawn with a blend mode to the background -

i have several rounded rect's filled , set blend mode make blend background image doing this: uigraphicsbeginimagecontextwithoptions(self.view.frame.size, no, 0.0); uiimage *bgimage = [uiimage imagenamed:@"uemenubackground.png"]; [bgimage drawinrect:self.view.frame]; uibezierpath *textfield1 = [uibezierpath bezierpathwithroundedrect:textfield1rect cornerradius:21]; [[uicolor colorwithred:174.0f/255.0f green:9.0/255.0f blue:34.0f/255.0f alpha:1.0] setfill]; [textfield1path fillwithblendmode:kcgblendmodeoverlay alpha:1.0f]; uibezierpath *textfield2path = [uibezierpath bezierpathwithroundedrect:textfield2rect cornerradius:21]; [[uicolor colorwithred:0 green:0 blue:0 alpha:.35] setfill]; [textfield2path fillwithblendmode:kcgblendmodenormal alpha:1.0f]; uiimage *drawnimage = uigraphicsgetimagefromcurrentimagecontext(); uigraphicsendimagecontext(); uiimageview *finishedbgimage = [[uiimageview alloc] initwithimage:drawnimage]; [self.view addsubview:finishedbgimage]; [s

sql server - Optimizing lengthy SQL query for datatable -

i want retrieve logs of logins on basis of date. in addition need functionality of jquery-datatable sorting , searching in it! have worked on many queries , datatables 1 tougher thought. create procedure [dbo].[sp_login_logs] ( @sp_start_date datetime, @sp_end_date datetime, @sp_offset int, @sp_count int, @sp_search varchar(max), @sp_sort int ) begin select table1.email,table1.city,table1.latitude,table1.longitude,table1.first_log, table1.last_log,table1.platform,table1.app (select ll.email, isnull(ll.city,'') city, ll.latitude, ll.longitude, (select min(insertdate) [loginlog] email=ll.email) first_log, ll.insertdate last_log, case when platform '%iphone%' or platform '%darwin%' or platform '%ipad%' or platform '%ios%' 'iphone' else case when platform &

Do python ctypes differ from c++ when dealing with winapi? -

i prefer dynamic language python has easier syntax typed languages c++ i writing code extensively uses win32 api , question whether ctypes differ c++ when calling winapi in terms of performance , execution speed. pure python code not fast c++. if planning on extensively using win32 api, converting python types c types , again expensive compared using c++ win32 api directly. you should pywin32 , library exposes of win32 api python. @eryksun mentions in comments below, using straight ctypes means having write wrappers c functions, definitions structures, , context managers resources, prone error. pywin32 alleviates commonly used win32 apis, doesn't contain them all.

Android Studio: Extension Methods are not supported at this language level -

the following code produced error "extension methods not supported @ language level" in android studio: public interface test { static string test2(string a) { return ""; } } as 2.0 beta 2 what have done wrong? you're trying use static interface method , feature new in java 8. not supported in android until android n . more information see use java 8 language features form android guides. still there's bug moment. you have use java 8 compile following mentioned instructions. here's example of build.gradle : apply plugin: 'com.android.application' android { compilesdkversion 'android-n' buildtoolsversion "24.0.0-rc3" defaultconfig { applicationid "example.com.examplejdk8" minsdkversion 24 targetsdkversion 'n' versioncode 1 versionname "1.0" jackoptions { enabled true } } compil

angularjs - How to insert data from client to backend using express and mysql? -

i have issue posting data backend, using angularjs on client side problem getting data client can see console.log(post) printing values angular factory, getting below error. new express , mysql dotn know how fix issue appreciated. app.js app.post("/test/create", function(req,res) { var post = { firstname: req.body.firstname, lastname: req.body.lastname, address: req.body.address }; console.log("got data client",post); connection.query('insert worker_table set ?', post, function(error) { if (error) { console.log(error.message); } else { console.log('success'); } connection.end(); }); }); error got data client { firstname: 'dasd', lastname: 'dad', address: 'dad' } cannot enqueue query after invoking quit. events.js:141 throw er; // unhandled 'error' event ^ error: cannot enqueue quit after i

ruby on rails - Could not find table 'users'? -

i tried possible. adding files kindly have look. i have run: rake db:drop (to drop tables) rake db:create (to create databse) rake db:migrate (to create tables) rake db:test:prepare (to create test database) controller file: class userscontroller<applicationcontroller respond_to :html, :json def new @user = user.new end def create @user = user.new(params[:user]) if @user.save redirect_to root_url, notice: "thank siging up!" else render "new" end end end my html.erb file. <h1>login</h1> <% form_for @user |f|%> <% if @user.errors.any? %> <div class="error_message"> <h2>form invalid</h2> <ul> <% @user.error.full_message.each |message| %> <li><%= message%></li> <% end %> </ul> </div> <% end %> <div class="field"> <%= f.label :email %><br /> <%

bootstrap modal - How to pass the parameter from view to controller in Rails -

i new rails , working on simple application "tasklist" (to list). in app, want categories tasks based different type of category(shopping, todo - user can create own category). created separate model user , category , task , each task linked 1 category . in view ( users/show.html.erb -n side render view category , task ), have listed categories in left side , open tasks in right side. want make categories links, when user select 1 categories, tasks linked category type displayed in right side. i understand how normal link_to works when takes new page. understand how button works in bootstrap. not able identify how can pass category selection controller, can pull task category matches user selected. thanks help. you need pass category parameter sort of evaluation function, filtering appropriate categories. can either done javascript or rails : rails <% category.all.each |category| %> <%= link_to category.name, users_path(user, catego

arrays - How to access nested data Values in D3 -

i have nested data this var nested_data = d3.nest() .key(function(d) { return d.country; }) .entries(csv); and have found can access values of array if use function when bind data name.selectall('.name') .data(function(d) { return d.values; <--- accesses nested data }) .text(function(d) { return d.name; <--- nested value }) however having trouble using elsewhere in project. nested value need string called ['starting point']. how can can access value use in d3.filter() example? var filter = nested_data.filter(function(d) { return ("island" == d['starting point']) }); i'd try: d.values['starting point'] or creating new variable var nested_values = nested_data(function(d) { return d.values}); but none of valid. should here? you can filter data on nested data this: nested_data.map(function(m) { //for each group filter on each value m.values = m.values.filter(f

android - java.lang.IllegalStateException in the ViewPager after data update -

i exception when dinamically add data viewpager 02-07 19:21:24.488 5577-5577/com.jamesb.encoderyapp e/androidruntime: fatal exception: main process: com.jamesb.encoderyapp, pid: 5577 java.lang.illegalstateexception: application's pageradapter changed adapter's contents without calling pageradapter#notifydatasetchanged! expected adapter item count: 4, found: 8 pager id: com.jamesb.encoderyapp:id/pager pager class: class android.support.v4.view.viewpager problematic adapter: class com.jamesb.encoderyapp.adapters.viewpageradapter @ android.support.v4.view.viewpager.populate(viewpager.java:1000) @ android.support.v4.view.viewpager.populate(viewpager.java:952)

sql server - Jmeter - No suitable driver found for jdbc:microsoft:sqlserver://x.x.x.x:1433 -

i'm using jmeter 2.9 , trying connect sql server 2008. within jdbc connection configuration , have following in connection properties: database url = jdbc:microsoft:sqlserver://x.x.x.x:1433 jdbc driver class = com.microsoft.sqlserver.jdbc.sqlserverdriver i've downloaded latest microsoft sql server jdbc drivers , placed following jars under jmeter/lib directory: sqljdbc.jar , sqljdbc4.jar . i'm getting following error: java.sql.sqlexception: no suitable driver found jdbc:microsoft:sqlserver://x.x.x.x:1433 can please suggest i'm missing? your solution not work me, here solution: ​adding jdbc connection library jmeter lib folder: download lastest jdbc driver microsoft http://msdn.microsoft.com/en-us/sqlserver/aa937724.aspx unzip file , find driver need: http://msdn.microsoft.com/en-us/library/ms378422.aspx copy required jar file jmeter/lib folder. (you need restart jmeter if running it.) in jdbc configuration: databaseurl:

delphi - Why TRttiField.GetValue fails to fill result? -

i have complex nested record type. need monitor changes in values of it's fields after method call. used rtti (originally copied here ): procedure comparefields(const rec1, rec2: pointer; const recttypeinfo: trttitype; const basename: string; const baseoffset: integer; const lines: tstrings); var r1field, r2field: pointer; myfield: trttifield; state: string; path: string; begin if recttypeinfo.typekind = tkrecord begin myfield in recttypeinfo.getfields begin r1field := pointer(integer(rec1) + baseoffset + myfield.offset); r2field := pointer(integer(rec2) + baseoffset + myfield.offset); if comparemem(r1field, r2field, myfield.fieldtype.typesize) state := '==' else state := '<>'; path := basename + '.' + myfield.name; lines.add(format('%2s | %-20s | +%2d | %10s[%2d] | %22s | %22s', [state, path, baseoffset + myfield.offset, myfield.fieldtype.tostri

java - MVN Package Build Failure -

i trying package java project using maven. i've done before on old computer, can't seem make work on new computer. here error: ` (env)kyle@thinkpad ~/code/simplefilehosting $ mvn -version apache maven 3.0.5 maven home: /usr/share/maven java version: 1.7.0_95, vendor: oracle corporation java home: /usr/lib/jvm/java-7-openjdk-amd64/jre default locale: en_us, platform encoding: utf-8 os name: "linux", version: "3.16.0-38-generic", arch: "amd64", family: "unix" (env)kyle@thinkpad ~/code/simplefilehosting $ java -version java version "1.7.0_95" openjdk runtime environment (icedtea 2.6.4) (7u95-2.6.4-0ubuntu0.14.04.1) openjdk 64-bit server vm (build 24.95-b01, mixed mode) (env)kyle@thinkpad ~/code/simplefilehosting $ javac -version javac 1.7.0_95 (env)kyle@thinkpad ~/code/simplefilehosting $ here version information java, javac , mvn: (env)kyle@thinkpad ~/code/simplefilehosting $ mvn -version apache maven 3.0.5 maven ho

pyspark - trouble in adding spark-csv package in Cloudera VM -

i using cloudera quickstart vm test out pyspark work. 1 task, need add spark-csv package. , here did: pyspark_driver_python=ipython pyspark -- packages com.databricks:spark-csv_2.10:1.3.0 pyspark started fine, did warnings as: **16/02/09 17:41:22 warn util.utils: hostname, quickstart.cloudera resolves loopback address: 127.0.0.1; using 10.0.2.15 instead (on interface eth0) 16/02/09 17:41:22 warn util.utils: set spark_local_ip if need bind address 16/02/09 17:41:26 warn util.nativecodeloader: unable load native-hadoop library platform... using builtin-java classes applicable** then ran code in pyspark: yelp_df = sqlctx.load( source="com.databricks.spark.csv", header = 'true', inferschema = 'true', path = 'file:///directory/file.csv') but getting error message: py4jjavaerror: error occurred while calling o19.load.: java.lang.runtimeexception: failed load class data source: com.databricks.spark.csv @ scala

python - raspberry pi i2c clock -

i trying create clock raspberry pi. using this guide, , using supplied files (or trying to) error: [errno 2] no such file or directory cd directory, , run: python clock_i2c.py doesnt tell me file can't find, , unlike other questions, there isn't in code trying open anything. know problem?

python - Location of contour lines -

Image
below code , plot: import matplotlib import matplotlib.mlab mlab import matplotlib.cm cm import matplotlib.pyplot plt import numpy np %matplotlib inline delta = 0.00025 a=0 x = np.arange(0, 0.10, delta) y = np.arange(0, 0.1, delta) x, y = np.meshgrid(x, y) z = a*(x**2+y**2)+2*x*y manual_locations = [(0.1,0.1), (0.2,0.2), (0.3,0.3), (0.015, 0.015), (0.00255, 0.0025), (0.00005,0.00005)] line_widths = (1, 1, 1, 1, 1, 1) plt.figure() cs = plt.contour(x, y, z, 6, # add 6 contour lines linewidths=line_widths, # line widths colors = line_colours) # line colours plt.clabel(cs, inline=1, # add labels fontsize=10, # label font size manual=manual_locations) # label locations plt.title('indifference map') # title plt.show() it seems manual_locations nothing, python picks equally

javascript - Injecting jQuery into Google.com using a Chrome Extension -

i'm building chrome extension , quite inject jquery google website, reason isn't working me. here manifest file content_scripts : "content_scripts": [{ "matches": ["*://www.google.com/*"], "css": ["src/inject/inject.css"], "js": ["js/jquery/jquery.min.js", "src/inject/inject.js"], "run_at" : "document_start" }] and jquery in folder supposed be. in inject.js file have: $("body").append("hello world"); console.log("loaded."); and strangely enough when go google.com, loaded. appear in console, hello world not appended body , nor error in console strange. did inside of inject.js : if (window.jquery) { $("body").append("hello world"); console.log("loaded."); } else { console.log('not loaded.'); } and loaded. appeared in console again, , hello world did not appened

java - how to use left outer join in hibernate using hibernate query language -

hi trying execute hql query using left outer join thowing exception org.hibernate.hql.ast.querysyntaxexception: unexpected token: on near line 1, can pls tell me worng in query select * creditcarddetails cred left outer join customerhistory custhist on cred.creditcarddetailsid=custhist.creditcarddetailsid , custhist.carda=0000 assuming have association named history relates entity creditcarddetails customerhistory . from creditcarddetails cred left outer join cred.history custhist custhist.carda=0000

regex - Python substitute a word for a word and the next concatenated -

i want able take in string , if r'\snot\s' located, concatenate 'not' , next word (replacing white space in between underscore). so if string string="not name brian , not happy nothing" the result after regular expression be: 'not_that name brian , not_happy nothing' (not in nothing not touched). i need locate 'not' either seperated white space or @ start of sentence , join '_' , next word. use re.sub() saving groups: >>> re.sub(r"not\s\b(.*?)\b", r"not_\1", string) 'not_that name brian , not_happy nothing' not\s\b(.*?)\b here match not followed space, followed word ( \b word boundaries). (.*?) capturing group capture word after not can reference in substitution ( \1 ).

webpack - React-native taking over 150-200% of computers CPU -

i've been having problem when run react-native app in xcode starts use 150% of cpu. insane! i've got no idea why well? i'm using webpack convert babel react. here modules: "scripts": { "android-setup-port": "adb reverse tcp:8081 tcp:8080", "start": "env node_env=dev rnws start --hostname localhost", "build": "env node_env=production rnws bundle", "test": "eslint src", "debugger-replace": "remotedev-debugger-replace --hostname localhost --port 5678", "remotedev": "npm run debugger-replace && remotedev --hostname localhost --port 5678" }, "engines": { "node": ">=4", "npm": ">=2 <4" }, "dependencies": { "@exponent/react-native-navigator": "^0.4.1", "file-loader": "^0.8.5",

if statement - r: when to use if else loops vs. functions -

need resolve loop issue; example data: data2 <- structure(list(a = c(101, 102, 103, 104, 105, 106, 107, 108,109,110), b = c(1,1,1,1,2,2,3,4,4,4), c = c(4, 4, 4, 4, 2, 2, 1, 3,3,3)), .names = c("id", "band", "group_qty"), row.names = c(na, 10l), class = "data.frame") example desired output: output <- structure(list(a = c(101, 102, 103, 104, 105, 106, 107, 108, 109, 110), b = c(1,1,1,1,2,2,3,4,4,4), c = c(4,4,4,4,2,2,1,3,3,3), d = c(102,103,104,103,"class b","class b","class a",109,110,109)), .names = c("id", "band", "group_qty","newid"), row.names = c(na, 10l), class = "data.frame") draft if else statement: note: doesn't work. data2$newid <- for(i in 1:length(data2$id)) {

c++ - What's the cause of a D8049 error in visual studio? -

i'm creating project openframeworks (the full source here: https://github.com/morphogencc/ofxasio/tree/master/example-udpreceiver ), , empty project seems compile fine. i added asio library, , few header classes, , project seems give me following error: 1>------ build started: project: example-udpreceiver, configuration: debug x64 ------ 1> main.cpp 1>cl : command line error d8049: cannot execute 'c:\program files (x86)\microsoft visual studio 14.0\vc\bin\x86_amd64\c1xx.dll': command line long fit in debug record 1>cl : command line error d8040: error creating or communicating child process i couldn't find examples of error d8049 on stackoverflow or on microsoft's pages, , google turned painfully few results. remotely useful 1 github issue: https://github.com/deplinenoise/tundra/issues/270 but i'm still not sure what's causing problem. familiar error, , can recommend method troubleshooting what's causing it? thanks in adva

linux - creating an alias and then store? -

i want create alias cp, mv, , rm commands somehow prompts user confirmation , store commands in bashrc file. how this? create alias , copy them or append them ~/.bashrc file? yes, copy exact alias command in console, ~/.basrc file. remember new alias take effect after relaunch terminal emulator (strictly speaking, bash process). edit: the obligatory link high-rated question on topic .

javascript - how to change color of rectangle every 5 seconds in js -

this code change color of rectangle fast. how can change color change every 5 seconds? var bgcolorlist=new array("#dfdfff", "#ffffbf", "#80ff80", "#eaeaff", "#c9ffa8", "#f7f7f7", "#ffffff", "#dddd00") pop.draw.rect(0, 0, pop.width, pop.height, bgcolorlist[math.floor(math.random()*bgcolorlist.length)]); please try var bgcolorlist=new array("#dfdfff", "#ffffbf", "#80ff80", "#eaeaff","#c9ffa8", "#f7f7f7", "#ffffff", "#dddd00") function draw(){ var canvas = document.getelementbyid('a'); var context = canvas.getcontext('2d'); context.beginpath(); context.rect(20,20, 100, 100); context.fillstyle =bgcolorlist[math.floor(math.random()*bgcolorlist.length)]; context.fill(); context.linewidth = 7; } draw(); setinterval(function(){ draw(); },5000);

c++ - Override VCL class/component protected method - How to code and use? -

i rewriting old existing code , i'm giving icons overhaul. used have bitmaps assigned tmenuitem s i'm changing in favor of imageindex , timagelist colordepth 32bit, containing icons alpha channel. imagelist created , populated icons @ design time. imageindex assigned during program startup , changed if/when appropriate. i noticed when menuitem disabled ( enabled = false ), resulting image doesn't great (at all) , read due vcl . mentioned link links delphi code can convert icon greyscale values. i'm not fluent in delphi nor changing vcl components, subclassing them, inheriting them etc. use available without changing it. i'm starting basic questions: here's simple attempt inherit timage , override dodraw(), make never disable icon in first place (decipering delphi code greyscale can done in second step) class mytimagelist : public timagelist { public: __fastcall mytimagelist(classes::tcomponent* aowner) : timagelist(aowner)

ios - making nsurlsession request with parameters -

hy, new swift , doing work on nsurlsession. here code func webrequesttoserver() { let request = nsurlrequest(url: nsurl(string:"some url")!) let urlsession = nsurlsession.sharedsession() let task = urlsession.datataskwithrequest(request, completionhandler: { (data, response, error) -> void in if let error = error { print(error) return } // parse json data if let data = data { let datastring = nsstring(data: data, encoding: nsutf8stringencoding) print(datastring) nsoperationqueue.mainqueue().addoperationwithblock({ () -> void in }) } }) task.resume() } thus code data arrives websrvice want first takes 2 parameters me , show data? please me. sorry english. it's weak. frame parameters dictionary

SQLAlchemy for Python, 'Query' object has no attribute 'fetchone' -

i'm working on database-centric project fellow programmer. have following code retrieving information our database: # create connection database engine = create_engine(url(**database)) session = sessionmaker(bind=engine) session = session() # construct query query = session.query(mediatext.line_number, mediatext.start_time_stamp, mediatext.end_time_stamp).\ filter(mediatext.oclc_id == oclcid) # info first line snapshot line_to_snapshot = query.fetchone() when try run code, following error: attributeerror: 'query' object has no attribute 'fetchone' what's confusing partner can run code fine. we're both running python 3.4 , have version 1.0.9 of sqlalchemy library on our systems. know going wrong here? from sqlalchemy's query api , know (python 2.7 , sqlalchemy 1.0.4) fetchone not part of query api, although one is. how changing to: line_to_snapshot = query.one() , see if works?

windows - Key echo in Python in separate thread doesn't display first key stroke -

Image
i try post minimal working example, unfortunately problem requires lot of pieces have stripped down best can. first of all, i'm using simple script simulates pressing keys through function call. tweaked here . import ctypes sendinput = ctypes.windll.user32.sendinput pul = ctypes.pointer(ctypes.c_ulong) class keybdinput(ctypes.structure): _fields_ = [("wvk", ctypes.c_ushort), ("wscan", ctypes.c_ushort), ("dwflags", ctypes.c_ulong), ("time", ctypes.c_ulong), ("dwextrainfo", pul)] class hardwareinput(ctypes.structure): _fields_ = [("umsg", ctypes.c_ulong), ("wparaml", ctypes.c_short), ("wparamh", ctypes.c_ushort)] class mouseinput(ctypes.structure): _fields_ = [("dx", ctypes.c_long), ("dy", ctypes.c_long), ("mousedata", ctypes

c - optimal thread pool size in tizen -

i have developed partial in tizen project using 6-7 thread(pthread) network i/o. requirement changing. if keep design might require 50+ threads eventually. or can change design , keep event queue , distribute task of threads , make work using 8+ threads. wondering optimal number of thread tizen. it noted atleast 15+% of time threads idle. the best way answer optimization question try something, generate profiling data, try different. repeat until notice trend or find configuration satisfied with. due cross-platform nature of tizen, , not knowing nature of project requirements or devices run on, hard specific.

c# - Hosting Sitefinity project on staging server -

i hosting sitefinity project on staging server on multiple projects hosted. the url created on staging : www.testing.info/sitefinityproject when click on link on page, redirects http://www.testing.info/about-us but should : http://www.testing.info/sitefinityproject/about-us i cannot find links pages , images while running website. i cannot host project on root i.e. new website. if have not hard-coded links, should resolve automatically when run site virtual folder (as opposed web site). maybe try republish base page template , see if helps.

ruby on rails - defining custom mapping in searchkick does not work -

i have campaign model , how custom mapping looks like: searchkick mappings: { campaign: { properties: { title: {type: "string", analyzer: "snowball"}, deal_title: {type: "string", analyzer: "snowball"}, description: {type: "string", analyzer: "snowball"} } } } when reindex campaign documents, , do c = campaign.search "this is" i following error: searchkick::invalidqueryerror: [400] { "error":{ "root_cause":[ { "type":"query_parsing_exception", "reason":"[match] analyzer [searchkick_search] not found", "index":"campaigns_development_20160205130806185", "line":1, "col":96 } ], "type":&q

Creating matrices using for-loops in C -

Image
i'm trying create 2 matrices using loops in c. matrix [18x16], each element a[i,j] = + j, (i=1,...,18; j=1,...,16) matrix b [16x18], each element b[i,j] = + 2j, (i=1,...,16; j=1,...,18) according ubuntu (virtual machine) terminal output, i'm missing entire row matrix a, , both matrix , b have incorrect elements @ 2 specific places: a[17,16] , b[15,18], respectfully (please see picture below). code follows, , appreciated. #include <stdio.h> int a[18][16]; int b[16][18]; int i, j; int main(void) { // create matrix for(i = 1; < 18; i++){ for(j = 1; j < 16; j++){ a[i][j] = + j; printf("%d ", a[i][j]); } // end inner loop printf("\n"); } // end outer loop printf("\n"); // create b matrix for(i = 1; < 16; i++){ for(j = 1; j < 18; j++){ b[i][j] = + (2*j); printf("%d ", b[i][j]); } // end inner loo

ios - Program UICollectionViewCell Programmatically -

i trying create cell programmatically without using story board, stumble upon problems. cell code following. import uikit class productcategorycollectionviewcell: uicollectionviewcell { required init?(coder adecoder: nscoder) { super.init(coder: adecoder) self.setupcell() } var productcategoryimageview :uiimageview! func setupcell(){ //seting imageview subview productcategoryimageview = uiimageview() productcategoryimageview.translatesautoresizingmaskintoconstraints = false let subviewdictionary = ["productcategoryimageviewkey" : productcategoryimageview] let productcategoryimageviewwidth = contentview.bounds.size.width let productcategoryimageviewheight = contentview.bounds.size.height let productcategoryimageviewhorizontalconstrain = nslayoutconstraint.constraintswithvisualformat("h:[productcategoryimageviewkey(\(productcategoryimageviewwidth))]", options: nslayoutformatoptions(rawvalue: 0), metrics: nil, views: su

SAPUI5 - Uncaught TypeError: this.getRouter.navTo is not a function -

i referring code used in tdg master-detail demokit application. i getting error "uncaught typeerror: this.getrouter.navto not function". i have written console.log("is router fine? "+ this.getrouter().tolocalestring()); before this.getrouter.navto prints " eventprovider company.accounts_positions_splitpage.myrouter " any suggestions issue? thanks you have call this.getrouter().navto() instead of this.getrouter.navto() with this.getrouter not execute function, function object. there try execute function navto() , object itselve not provide such function. with this.getrouter() execute function , return value (a router) object. on router can use navto() , did in console.log .

html - Selection bar implementation in xtype-selectfield same as datepickerfield -

Image
in sencha touch version 2.3.0 have xtype:'datepickerfield' have default bar indicates selected date. this selection blue bar can modified using following css property. .x-picker-bar { background: rgba(247, 109, 48, 0.6); } now have component xtype:'selectfield'. want implement bar component well. how can implemented? suggestions? below css serve purpose pushkar: .x-picker-slot .x-dataview-item.x-item-selected { background: rgba(247, 109, 48, 0.6) !important; } let me know helps or not.

Dynamic view getting inserted with whole screen android -

i trying create app parent layout scrollable view , add view dynamically parent layout using following code: linearlayout ll = (linearlayout) findviewbyid(r.id.parent); for(int i=0;i<5;i++){ layoutinflater inflater = (layoutinflater) getsystemservice( context.layout_inflater_service ); view format = inflater.inflate(r.layout.student_present_absent,null); ll.addview(format); } here view want insert view: <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:background="@drawable/backgroundf" android:weightsum="8" android:id="@+id/takeattendanceinterim"> <linearlayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="0dp