Posts

Showing posts from May, 2014

Laravel 5.1 relationships, Have users ids, but i dont have they usernames -

Image
i'm novice i'm trying build 1 way friendlist relationship, can see userid of users, need usernames, problem is, these ids coming relationship table "friends" results of query, doesn't have usernames, instead stores users_id. this get! here config *usuarios stands users* table usuarios: id->primary username friends table: id->primary user_id->reference->users.id friend_id->reference->users.id user model: public function friends() { return $this->belongstomany('app\user', 'friends', 'user_id', 'friend_id'); } now routes: /* single user id */ route::get('user/{usuario}', function($usuario) { $usuario = db::table('usuarios')->where('username', $usuario)->first(); $friends = db::table('friends')->where('user_id', '=', $usuario->id)->get(); return view('users.profile') ->with('friends', $fr

use barcodeScanner in cordova (with angularjs) -

(i'm fr) i'm trying use barcodescanner in cordova (works angularjs) app seems code can't works. i'd understand should do. :c first : cordova plugin rm https://github.com/wildabeast/barcode cordova plugin add https://github.com/wildabeast/barcode then, here code : index.html <!doctype html> <html> <head> <meta charset="utf-8" /> <meta name="format-detection" content="telephone=no"> <meta name="msapplication-tap-highlight" content="no"> <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width"> <link rel="stylesheet" type="text/css" href="css/style.css"> <title>hello world</title> </head> <body ng-app="app" ng-controller="barcodectrl"> <header class="header unselectable"

css - Is Quicksand a default font on Windows machines? -

i'm using font 'quicksand' design website. font installed on macbook, know if default font on windows machines? or safer include in css files? any or guidance appreciated! through comments , few other resources found not default font on windows machines - therefore have include font in css files.

linux - Installing RVM with a specific bash command format using `-s` -

i'm trying install rvm via bash. according installation guide on rvm.io , command is: \curl -ssl https://get.rvm.io | bash -s stable --auto-dotfiles i'm, however, compelled download script , run separately. so, bash command attempt execute downloaded file (let's call rvm-installer ). how can execute rvm-installer using format below: /bin/bash -c './rvm-installer 2>&1' obviously, above command incorrect. i'm thinking should more this: /bin/bash -s stable --auto-dotfiles './rvm-installer 2>&1' i know above command sets positional parameters in correct order because of this: $ printf "%s\n" "$@" stable --auto-dotfiles ./rvm-installer 2>&1 and this: $ echo "$shlvl" 2 but i'm confident rvm-installer not running because replaced contents following, test once command above run, see no output: #!/usr/bin/env bash gimme syntax error echo "$1" echo "foo bar" e

c - OSI Layers on local host -

i wrote small application try display protocol headers of captured packets. packets captured libpcap's pcap_loop. way program works follows: wrote own headers based of structures defined in if_ether.h ip.h , tcp.h. pcap_loop sets char pointer beginning of packet, , step through packet, casting appropriate structure each time, , incrementing pointer size of header. it's important remember question isn't code specific; code works there logical flaws dont undestand; keep in mind packets sent on same machine, different port(i wrote tiny python server send data telnet): 1.the ethernet header doesn't display looks correct when packets sent on localhost (when use program on internet packets, mac adresses dosplayed correctly though) 2.through trial , error, i've determined structure iphdr starts 16 bytes after start of packet buffer, opposed expected 14 bytes, size of ethernet header those observations lead me ask following questions: when packets sent on local h

python - Creating pandas dataframes within a loop -

i attempting create approximately 120 data frames based upon list of files , dataframe names. problem after loop works, dataframes don't persist. code can found below. know why may not working? for fname, dfname in zip(csv_files, df_names): filepath = find(fname, path) dfname = pd.dataframe.from_csv(filepath) this python feature. see simpler example: (comments show outputs) values = [1,2,3] v in values: print v, # 1 2 3 v in values: v = 4 print v, # 4 4 4 print values # [1, 2, 3] # values have not been modified also @ question , answer: modifying list iterator in python not allowed? the solution suggestd in comment should work better because not modify iterator. if need name access dataframe, can use dictionanry: dfs = {} fname, dfname in zip(csv_files, df_names): filepath = find(fname, path) df = pd.dataframe.from_csv(filepath) dfs[dfname] = df print dfs[df_names[1]]

how to make a mfc dialog's height unsizeable? -

i playing mfc github project xtrader on github. managed running , having 1 question cannot understand. this project dialog based mfc based app, main dialog xtraderdlg, when run it, found height of dialog not sizable, width does. i have being read source quite time , review every place handles setwindowpos() or onsize(). there not traces how done. comment out onsize() or oninitdialog(), height remains unchangeable. the code has tricks save width , height in config file , reload next time up. believe doesnot matter. the code has line. ::setwindowpos(m_hwnd, hwnd_topmost, 0, 0, 0, 0, swp_nomove | swp_nosize); remove line result still same. , swp_nosize wont cause height unsizeable. myth me indeed. can advise me why? main dialog code here. https://github.com/lpswufe/xtrader/blob/master/xtraderdlg.cpp this done in ongetminmaxinfo wm_getminmaxinfo .

c++ - Define multiprecision pi in boost:multiprecision -

i need pi (3.1415...) in arbitrary (but fixed) precision in boost::multiprecision . the constants in boost::math::constants defined fixed number of digits, pointed out in this answer , need compute myself. because i'm using number , large number of digits, compute in runtime once. simple yet fast way have it? i thought using typedef number<cpp_dec_float<precision> > mpfloat; // precision compile time. const int pi = atan(mpfloat(1))*4; but i'm not sure common idiom it. in c++14 can use template variable ( http://en.cppreference.com/w/cpp/language/variable_template ). note can have want including #include <boost/multiprecision/detail/default_ops.hpp> that header ends including constants.hpp defines template <class t> const t& get_constant_pi() . this c++03 idiom template variables (as stores function-local static result value). calc_pi has first 1100 digits hardcoded, , rest calculated via optimized formulae if re

sql - How to write a query that builds a string dynamically based on a 2 tables -

i have 2 tables: maintable , controltable . i want write query builds string representing file path. file path built dynamically depending on query result between 2 tables. main table has following columns: controlnumber customerid customerstatement the control table has 1 column: controlnumber i need write query checks if main table has controlnumber defined in control table. if there match, append \foldera filepath if no match, append \folderb ending result this: c:\customers\foldera or c:\customers\folderb i suspect need use left join how can that? you're right want left join. combine case...when expression determine value: select *, case when control.controlnumber not null '\foldera' else '\folderb' end filepath main left join control on main.controlnumber = control.controlnumber it's not clear rest of path comes from; maybe it's static , want concatenate value case expression: 'c:\c

c# - Trying to finish only one thread from various -

first of all, must clarify i'm new working threads. now, have application executes multiple threads in different times. mean, have objects each of them executes thread in moment. i'm gonna more specific. have list of task, each associated particular object. when click of button (that apply object), task associated starts run. in moment, can have more 1 thread. works correctly. problem when finish 1 of them. finish 1 thread, of rest stop too. of course, there wrong in implementation. don't understand why threads stopped. here implementation (i'm working in mvc on windows application forms): in main forms have //this method starts when press button specific object private void starttask( int idtask ) { int counter = this.controller.gettaskssize(); //this list<objecttask>, method returns count (int = 0; < counter; i++) { //gettasks() returns list<objecttask> if (this.controller.gettasks()[i]

Oracle 12 c RAC connection issue in jboss 4.2.3 through datasource -

we using oracle 11g, in jboss 4.2.3 using datasource xml file .it working fine.now moved oracle 12 c rac version. changed url in datasource xml file giving [org.jboss.resource.connectionmanager.jbossmanagedconnectionpool]throwable while attempting new connection: null but using same url in jdbc connection using class. forname(....), working proper. please me out , why not able connect through datasource xml file. our configuration : jboss 4.2.3 oracle 12c rac jdk 1.6 ojdbc6.jar try adding new datasource(12c one) jboss console, rather doing manually.

Wix - Creating a Windows Share - but why can it be deleted? -

this question might not 100% related wix, appreciated. have wix msi along installing stuff, creates windows share based on past in folder path: <directory id="topfolder"> <component id="cmptopfolder" guid="{9e6c5291-xxxx-yyyy-zzzz-6fb6a12dfe99}"> <createfolder /> <util:user id="everyone" name="everyone"></util:user> <util:fileshare id="fstopfolder" description="my shared folder" name="my_share"> <util:filesharepermission user="everyone" genericall="yes" /> </util:fileshare> </component> </directory> this works fine , windows share created , ticks along nicely .... on sites ( & in our office ) , again, when using our app accesses share, find windows share has gone ?! so wondering, firstly if have set share correctly in wix , if so, can please let me know might cause wind

ios - Include GCM sdk to cocoapod project -

i have podsfile importing several other projects frameworks, works pretty nicely. unfortunately not possible install gcm ios library framework. way go here? drag , drog gcm pod project? there's setup guide both objective-c , swift on developers site of gcm, can found here - https://developers.google.com/cloud-messaging/ios/client?ver=swift pod init open podfile created application , add following: pod 'google/cloudmessaging' save file , run: pod install this creates .xcworkspace file application. use file future development on application.

Need direction on jQuery style of coding -

i posted question asking if there way consolidate initialization of typeahead.js + bloodhound controls here: can multiple inputs each using typeahead.js different sources consolidated? . i have around 10 inputs on single page typeahead-enabled , seemed going call lot of repetitive code. i came "solution" of sorts posted answer, , works - configuring input easy. realized had fallen old microsoft mfc function call style of having lot of parameters may or may not need along no clear indication of parameters are, betraying 30+ year career visual c++ programmer i've read through of documentation here: https://learn.jquery.com/about-jquery/ still don't feel have sense of best way address question. all of sample code i've seen contains 1 typeahead element, approach in "real world" when have page multiple typeahead elements or other similar control requires significant configuration? i'm new jquery , apply accepted practices as possible, tips

How to create a camera-window in Unity3D -

i'm new in unity , want create camera-window on website: http://gamasutra.com/blogs/itaykeren/20150511/243083/scroll_back_the_theory_and_practice_of_cameras_in_sidescrollers.php#h.elfjc4ap4hpe there example curb camera motion. want make camera-window pushes camera position player hits window edge. any ideas, how realize this? i used code: using unityengine; using system.collections; public class cameracontroller : monobehaviour { public gameobject player; public vector3 min; public vector3 max; private vector3 offset; void start () { offset = transform.position - player.transform.position; } void lateupdate () { vector3 newpos = player.transform.position + offset; newpos.x = mathf.clamp(x, min.x, max.x); newpos.y = mathf.clamp(x, min.y, max.y); newpos.z = mathf.clamp(x, min.z, max.z); transform.position = newpos; } } unfortunately, camera moving not correct. ideas, how create camera-window? the main

c# - How to reduce memory usage for processing many images? -

i working on c# wpf application uses pixel data many images process 1 image. it requires user open multiple images of format. these images stored using system.drawing.bitmap class in memory using lockbits() method , memory addresses first pixel datas stored in byte* . new system.drawing.bitmap created , processed using lockbits() method , direct memory access in unsafe context system.threading.tasks.parallel class, , pixel values calculated using pixel values of opened images each pixel , saved memory. processed system.drawing.bitmap encoded jpeg , saved selected location. dispose() , unlockbits() , gc.collect() methods called. the problem above method, opened images must stay in memory until whole operation completed. example, if open 50 images resolution of 4160x3120, takes 4160*3120*3*50 bytes: 1857 megabytes of memory. is there possible solution not require images in memory, or other solution reduce memory usage? i working on c# wpf application us

Android RenderScript - Syntax Error -

my current script is: #pragma version(1) #pragma rs java_package_name(foo.bar) rs_allocation inpixels; int height; int width; int threebythree[]; void root(const uchar4 *in, uchar4 *out, uint32_t x, uint32_t y) { float3 pixel = convert_float4(in[0]).rgb; if(x==0 || x==width || y==0 || y==height){ pixel.r = 0; pixel.g = 191; pixel.b = 255; }else{ //do image processing here float3 pixelnh = convert_float4(rsgetelementat_uchar4(inpixels, x+1, y)).rgb; float3 pixelnv = convert_float4(rsgetelementat_uchar4(inpixels, x, y+1)).rgb; int grayavg = (pixel.r + pixel.g + pixel.b)/3; int grayavgnh = (pixelnh.r + pixelnh.g + pixelnh.b)/3; int grayavgnv = (pixelnv.r + pixelnv.g + pixelnv.b)/3; int edgeoperatorvalue = 2*grayavg - grayavgnh - grayavgnv; if(edgeoperatorvalue < 0){ edgeoperatorvalue = -1 * edgeoperatorvalue; }; pixel.r = edgeoperatorvalue; pixel

java - Spring security authentication manager unresolvable circular reference -

i'm using spring security 3.2.5. have 2 authentication providers. have problem unresolvable circular reference. first security.xml: <security:http use-expressions="true" auto-config="false" entry-point-ref="loginurlauthenticationentrypoint"> <security:intercept-url pattern="/**" access="permitall" method="options" /> <security:intercept-url pattern="/user/login" access="permitall" /> <security:intercept-url pattern="/**" access="isauthenticated()" /> <security:custom-filter position="form_login_filter" ref="twofactorauthenticationfilter" /> <security:logout logout-url="/user/logout" logout-success-url="/demo/user/logoutsuccess" /> <security:session-management session-authentication-strategy-ref="sas" /> </security:http> &l

Websocket server with Django -

i want use websockets in django project can't find decent app/framework works django works in python 3. suggested in post run tornado or socket.io , make them talk described article . all these old, , websocket gaining popularity there more elegant way use websocket django? how https://pypi.python.org/pypi/django-websocket-redis/ ? haven't tried myself, looks working , actively supported solution.

c# - Silverlight/WPF Calendar how to get visible dates -

Image
i want visible dates in calendar, example following image want june 28th of 2015 august 8th of 2015 all in event displaydatechanged addeddate = {01/07/2015 00:00:00} (july 1st) removeddate = {25/06/2015 00:00:00} (june 25th) at first thought displaydatestart , displaydateend give me information, realized these properties not readonly, instead set them other purposes such date range displayed. so workaround or way calculate or result want? i got answer through questions , doing changes in calendar template. i clicked edit additional templates / edit calendardaybuttonstyle , added following: <setter property="tag" value="{binding path=date}" /> private void mycal_displaydatechanged(object sender, calendardatechangedeventargs e) { var grid = findvisualchildbyname<grid>(mycal, "monthview"); datetime? dtbegin = null; datetime? dtend = null; if (grid != null &a

c# - How to ignore custom model binder? -

i have model binder in global.asax: modelbinders.binders.add(typeof(string), new stringmodelbinder()); and have model in want ignore binder 1 of string properties: public class mymodel { ... public string stringprop { get; set; } ... } for instance stringmodelbinder trims string. don't want trim stringprop. how can ignore binder in such case? edited: not looking solution trim string. i'm looking solution ignore trimming string.

maven 3 - How to include an excluded source file for tests? -

i have initial data class should excluded in normal (default profile) build. if specify example run profile class should included. furthermore class needed tests. needs included tim. i used excludes achieve first part, dependency test breaks testcompile goal. <plugin> <artifactid>maven-compiler-plugin</artifactid> <executions> <execution> <id>default-compile</id> <goals> <goal>compile</goal> </goals> <configuration> <excludes> <exclude>**/initialdatabuilder.java</exclude> </excludes> </configuration> </execution> <execution> <id>default-testcompile</id> <goals> <goal>testcompile</goal> </goals> <configura

ios - How to properly animate UIButton between states? -

i wanted make slow dissolve animation between default , highlighted uibutton state. pressing button performs segue, , takes viewcontroller. have managed animation writing subclass of uibutton single method: - (void) touchesbegan:(nsset *)touches withevent:(uievent *)event { [uiview transitionwithview:self duration:0.15 options:uiviewanimationoptiontransitioncrossdissolve animations:^{ self.highlighted = yes; } completion:nil]; [super touchesbegan:touches withevent:event]; } and writing in prepareforsegue method of main viewcontroller: if ([sender iskindofclass:[uibutton class]]) { uibutton* button = (uibutton*)sender; [uiview transitionwithview:button duration:0.15 options:uiviewanimationoptiontransitioncrossdissolve animations:^{ button.highlighted = no; } completion:

java - How to send nested json object to server using spring mvc + jackson -

i have hotel entity , has object called location . @entity public class hotel implements serializable { private static final long serialversionuid = 1l; @id @generatedvalue(strategy = generationtype.auto) private long id; string name; @onetoone(fetch=fetchtype.lazy) @joincolumn(name="loc_id") location location; //getter setter } location object that: @entity public class location implements serializable { private static final long serialversionuid = 1l; @id @generatedvalue(strategy = generationtype.auto) @column(name="loc_id") private long id; string name; public location() { } public location(string name) { this.name = name; } public string getname() { return name; } public void setname(string name) { this.name = name; } } i can send location object server ( {"name":"mynewloc"} ). can

Visual Basic, Form1 checkbox Function in Module can't see checkbox -

visual basic 2008: form1 design page have checkbox text. have module1 series of functions , of working. have come across idea make 1 of these functions count of items passed , processed. (simple every time increments 1 within loop) don't want count. hence form1 checkbox. in module - function have if checkbox.checked count if not dont it.. but module - function can't see checkbox state. help please

Left truncate Scala function - list from integer -

i totally new in scala, me simple function - input parameter integer, function should return list of integers first entry input integer , , rest gotten omitting left digit 1 one. example, if input 0 , returns list(0) , input =5678 returns list(5678,678,78,8) . def lefttrunc(input:int):list[int] thanks lot in advance 5678.tostring.tails.tolist.init.map(_.toint) //> res0: list[int] = list(5678, 678, 78, 8) convert number string. tails want. except it's iterator, convert list , , has empty string @ end, use init return last element. they're strings, use map convert them int again but i'm pretty sure instructor expecting numerically :) here's numerical version, in case deliberately uncommented can work out how works val n = 5678 val digits = n.tostring.size list.iterate(10, digits)(10*) map { n % _} edit: requested in comment, other way around uses inits instead of tails (and reverse requested ordering) 5678.tostring.inits.toli

vb.net - VB How to Limit Line number of RichTextBox -

i have problems richtextbox.i have limit rtb's sizes regarding required character number(10 height 10 width).i tried limit number of lines using maxlength property.i mean can limit line length e.g. 10 if define max length 100 there can 10 lines.everything ok without enter key. when press enter not count rest of current line.if press enter after 6th char of line skips next line. , count previous line 6.so box gets longer through downwards. in advance...my code below. private sub textbox1_keydown(byval sender object, byval e system.windows.forms.keyeventargs) handles richtextbox1.keydown 'here im trying count character number of each line dim count integer = 0 each s string in me.richtextbox1.lines count = count + 1 msgbox(count) dim nextlinetext string = s if e.keycode = keys.enter if count < (takefromcombo(combobox1)) richtextbox1.maxlength = richtextbox1.maxlength - (takefromcombo(combobox1) -

jQuery mobile 1.3.2 slide transition broken in Chrome 43 -

in chrome 43, slide page transition of jquery mobile 1.3.2 seems broken. used work in older versions of chrome. steps reproduce: go http://demos.jquerymobile.com/1.3.2/widgets/transitions/ click on "page" button of "slide" transition. on new page click on "take me back". after transition, old page disappear. any idea how fix this? it's better upgrade latest jquery mobile version (> 1.4 ). there issue animationcomplete function in jquery mobile 1.3.2

How to insert multiple image names in a same row and display it php-mysql -

i struggling on mysql me. using $sql = "insert properties (agent_id, property_name, category, location, property_type, search_radius, price, bed_rooms, bath_rooms, commercial_type, area, address, description, image_name, date_added) values ('$agent_id', '$property_name', '$listing_for', '$city', '$property_type', '$area', '$price', '$beds', '$baths', '$commercial_type', '$area_sf', '$address', '$description', '".$filename."', now() )" ; this query insert values database. here image_name ( $filename ) contains 3 images. getting names using array , insert db. here fields single. image_name contains 3 values. when use script inside loop, totally 3 rows inserted. when use outside loop inserted last $filename . need want add 3 image_names , other data single row. after need fetch data display it. how can that. me mates. thanks.

javascript - Jsp : Checkbox and Hiperlink dependency -

i using jsp , struts2. if user selects checkbox without clicking on hyperlink, user should error msg above checkbox line. i think on click of hyperlink should call 1 function sets global var true. onclick of checkbox, should call function checks var val , if false error should display. in case of checkbox uncheck error should not visible. terms , want user should click on hyperlink see terms. please help. <tr> <td colspan="2" style="padding-left: 3%;"> <s:text name="text1" /> <a href='<s:property value='#session.url'/>' class="l1" target="_blank"><s:text name="text2" /></a> <s:text name="text3" /> </td> <tr> <td colspan="2" style="padding-left: 3%;"><s:checkbox name="ist" id="ist" label="ist" value="%{ist}" tabindex="12" />&nbsp;&nbsp;

javascript - How to make the calendar image respect the disabled property? -

the below code disables , enables div (it disables 2 text boxes). problem facing cannot disable calendar popup (popup occurs on clicking calendar image). can still interact it. javascript function(){ var btnenabledisable = document.getelementbyid('enable-disable'); var divtwotextboxdiv = document.getelementsbyclassname('two-text-box-div'); btnenabledisable.onclick = function(){ if(btnenabledisable.value=='disable'){ btnenabledisable.value = 'enable'; enabledisablediv(true) }else{ btnenabledisable.value = 'disable'; enbaledisablediv(false) } } var enbaledisablediv = function(boolval){ for(var key in divtwotextboxdiv){ divtwotextboxdiv[key].disabled = boolval; } } } html <div class="two-text-box-div" id="div2" > <table> <tr> <td> <asp:label id="lblstartdate" runat="server" text="sta

session - Rails 4 authenticity_token using multiple servers -

regarding sessions in rails using cookiestore, if have 2 servers same rails applications , configured same way (identical hashes, , config), know if 1 user hits first server , starts session, if next requests hit second server application work okay. that's ok now. but, regarding forms , authenticity_token, how deal (preventing csrf)? suppose have cookie hash session (using cookiestore) stored using cookies in client side (browser). no session used on server side @ all. so, if generate authenticity_token server 1 , next request (post form) hits server 2, request rejected throwing error or rails exception. how deal this? sharing authenticity_tokens in memory or using "middleware" software, instance redis key value storage every server can verify authenticity_tokens? thanks! as rails version 4 see that: "if have secret_key_base set, cookies encrypted. goes step further signed cookies in encrypted cookies cannot altered or read users. default sta

java - Hibernate 4 Multi-tenancy Issue - No Entity Persisters Found -

i have been trying integrate hibernate 4 multi-tenancy support in our application below exception on executing hql query java.lang.arrayindexoutofboundsexception: 0 @ org.hibernate.jpa.spi.abstractentitymanagerimpl.resultclasschecking(abstractentitymanagerimpl.java:362) @ org.hibernate.jpa.spi.abstractentitymanagerimpl.createquery(abstractentitymanagerimpl.java:344) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:62) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43) @ org.springframework.orm.jpa.extendedentitymanagercreator$extendedentitymanagerinvocationhandler.invoke(extendedentitymanagercreator.java:344) @ com.sun.proxy.$proxy288.createquery(unknown source) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:62) @ sun.reflect.d

javascript - Connect with google plus button -

Image
i have implemented connect google plus on website. working fine except following case: consider have logged in google account , visit website can see popup google according snipped screen shot below i don't want popup visible ever. the best way deal problem creating simple javascript code , putting in pages. if problem occurs on pages, create master file {name}.js , import on relevant pages. right click on bar, , choose "inspect element". note down div id/class name , cancel inspect element dialog. next, create js script, states onload, div box in concern not displayed.

c# - How to get ODP.NET to return null value for User Defined Type from out parameter in Oracle stored procedure? -

i having trouble odp.net regards udt (user defined type) behavior. my problem arises when have a procedure containing out parameter returns specific udt . when return an instantiated udt out parameter there no problem . when return a null value out parameter i nullreference error : a first chance exception of type 'system.nullreferenceexception' occurred in oracle.dataaccess.dll i have tried setting isnullable = true on relevant oraclecommand parameter without success. i have no problem sending , receiving rather complex udt's, e.g. udt's nested udt's , collections of objects , udt's witgh nested collections of objects. any ideas if can solved using odp.net other making oracle procedure return instance of object type? update - solved: the issue udt type nested udt type not correctly initialized null. using auto generated code solved problem. using oracle user-defined types .net , visual studio christian shay , thank re

ios - Create controls in UIView at runtime? -

i have 1 uitextfield , button in view. once button pressed, value in text field need searched fieldid column in core data table , value[comma separated]. separate string comma , assign values array. a new uiview needs inserted in main screen , place n number[count of array] of labels , textfields , align. i able 1, 2 , uiview creation. can me create n number of controls in sub uiview @ runtime? for(int i=0;i<self.yourarray.count; i++) { uilabel *label = [[uilabel alloc] initwithframe:cgrectmake(10,80*i+60,self.view.frame.size.width-20,60)]; label.text = [yourarray objectatindex:i]; [self.view addsubview:label]; } please explain problem more !

android - Creating a simple instance of ExoPlayer -

i looking develop application utilises dash through exoplayer in android. to begin going through demo project having trouble creating simple working instance of exoplayer can stream mp3 or similar. would appreciate can give relating getting simple exoplayer instance working can adapt , build upon or if has leads more references or guides can follow there seems little documentation available. thanks , help! first of instantiate exoplayer line: exoplayer = exoplayer.factory.newinstance(renderer_count, minbufferms, minrebufferms); if want play audio can use these values: renderer_count = 1 //since want render simple audio minbufferms = 1000 minrebufferms = 5000 both buffer values can tweaked according requirements now have create datasource. when want stream mp3 can use defaulturidatasource. have pass context , useragent. keep simple play local file , pass null useragent: datasource datasource = new defaulturidatasource(context, null); then create samples

java - How to Configure IntelliJ IDEA 14 for your migration from Eclipse -

i have installed intellij, learn java. have been learning java in eclipse, lot of seniors have suggested me start developing in intellij save time in future. now problem environment totally different, cannot add packages directly, have configure lot of things, making me confuse, option need correctly run applications. can me out how go it. intellij different eclipse little reading on getting started pages helpful. me, understanding modules part hardest. for migrating eclipse, have pretty tutorial besides ide options import eclipse projects.

which is best to use $rootScope.$emit or $$rootScope.$broadcast for angularjs loader indicator in angularjs -

$rootscope.$emit flows $rootscope , $rootscope.$broadcast flows down scope $rootscope , $scope's in angularjs. still confused of use angularjs loader indicator . $rootscope.$emit lets other $rootscope listeners catch it. when don't want every $scope it. $rootscope.$broadcast method lets pretty hear it. this might help, can refer original answer here

How to implement referential integrity and cascading actions in liferay service xml file? -

i have requirement need implement ondelete cascade functionality liferay service builder. how can achieve in liferay? first of all: ondelete cascade not liferay service builder functionality. funtionality provided database. next: liferay has premise, data processing , evaluation should done in code, , not in database. having said that: something similar ondelete cascade implement model listener. modellistener listening changes of model. (i know, misleading name ;) ) in model listener, implement onafterremove. in onafterremove goes code deletion of related records. here small sample have written. code listening changes of group object, , tries delete referenced objectgeodata object, if there 1 present. package de.osc.geodata.modellistener; import com.liferay.portal.modellistenerexception; import com.liferay.portal.kernel.exception.portalexception; import com.liferay.portal.kernel.exception.systemexception; import com.liferay.portal.kernel.log.log; import com.l

android - Getting Error " You haven't set up branch link propoerly" when try to open link from Branch metrics? -

Image
i working on deep linking.i integrate branch.io sdk in application. create application on branch.io also. create deep link application. when sent link device , try open in broswer showing error message "it seems haven't set branch link. please head setting tab in dashboard more guidence." on android, in order link know redirect to, must configure link settings. here requirements: 1. if check 'i have android app', must select destination redirect to. can either choose app play store, or set custom url if app not live. if set custom url, please specify package name of app project you'll test with. here's example of custom url: if don't check 'i have android app', must specify default url @ bottom.

sql - DML lock while starting server -

what dml lock, when happen. while starting server, getting automatically dml lock, not able start server. am unable find root cause of it. what dml lock, when happen. as oracle document states : a dml lock lock obtained on table undergoing dml operation (insert, update, delete). as problem , there query running ? or can know happening in session ?

sql server - SSDT implementation: Alter table insteed of Create -

we trying implement ssdt in our project. we have lots of clients 1 of our products built on single db (dbdb) tables , stored procedures only. we created 1 ssdt project database dbdb (using vs 2012 > sql server object browser > right click on project > new project). once build project creates 1 .sql file. problem : if run file on client's dbdb - creates tables again & deletes records in [this fulfills requirements deletes existing records :-( ] what need : update not present on client's dbdb should update new changes. note : have no direct access client's dbdb database comparing our latest dbdb . can send them magic script file update dbdb latest state. the way update client's db compare db schemas , apply delta. way it, need way hold on schema thats running @ client: if ship versioned product, easiest deploy version n-1 of development server , compare version n going ship. way, ssdt can generate migration script need ship c

java - select element list under textbox -

in web page there field name street name :* , when put in number , list of addresses ,which have number, appears under field. when click on 1 of addresses ,this field contains address, , other fields city or postal code automatically populated values present in street name. want same java using junit libraries of selenium. want junit clicks on 1 of elements of list appears under field street name :* after having inserted number in field. private webdriver driver= new firefoxdriver(); webelement street_name=driver.findelement(by.id("street_name")); string pac_input="3"; street_name.sendkeys(pac_input); i insert webelement , street_name value "3" , under box appears list of addresses have number "3" want junit clicks on 1 of elements of list java command should use filling webelement value selected in list appears under box street_name ? how can it? help, alberto

javascript - ngRepeat is not working in colorbox -

i trying repeat number in array , want output in colorbox, reason can't see the numbers array. not escaping special character or missing concatenation ? $scope.somenumber = [1,2,3,4]; jquery.colorbox({html:"<div ng-model= 'somenumber' ng-repeat='number in somenumber'>{{number}}</div>"}); inject $compile controller , like: jquery.colorbox({html:$compile("<div ng-model= 'somenumber' ng-repeat='number in somenumber'>{{number}}</div>")($scope)}); the reason html has compile in order angularjs retrieve/evaluate expressions , make work properly, otherwise angular can't know happened

Cant connect R and PostgreSQL throught Putty -

i have problem integration postgresql , r. unload outputs sql queries .txt file , download em r using read.table() function. need outputs queries directly in r. know sql? it's postgresql , use putty connect db know such information putty connection as host name(or ip adress) port saved session ='dbcenter' connectiontype = ssh key -- file .ppk extension passphrase key also, before writing queries, choose in opened window region databases this full information know putty , have no idea how write queries directly in r script. tried rpostgresql package, no success. can me? firstly, make sure can connect remote db without r, example, using pgadmin3 or psql (see link1 , link2 more idea pgadmin/psql/remote/port forwarding). then, try along these lines: dbname <- "myname"; dbuser <- "myname"; dbpass <- "iwillnottell"; dbhost <- "remotehostname"; dbport <- 5432; if remote host withing

php - get background image of tag using dom -

using dom, want show image in new html page <a> tag via id mentioned.. <a class="lazy clogo" id="newphoto0" href="javascript:;" title="abc" onclick="opengall('phouter', '0612px612.x612.100906141758.c1u8', 'newphoto0');" data-original="http://content4.jdmagicbox.com/patna/u8/0612px612.x612.100906141758.c1u8/catalogue/10729ad97cafdc32d7957a5729aefb17.jpg" style="background: url(http://content4.jdmagicbox.com/patna/u8/0612px612.x612.100906141758.c1u8/catalogue/10729ad97cafdc32d7957a5729aefb17.jpg) 50% 50% / cover no-repeat;"><span class="rghtimgarw"></span></a> <a class="lazy clogo" id="newphoto1" href="javascript:;" title="xyz" onclick="opengall('phouter', '0612px612.x612.130831165451.v7j7', 'newphoto2');" data-original="http://content2.jdmagicbox.com/patna/j7/06

vba - Difference between two cells _VBA Excel Mac 2011 -

i want subtract days (todaydate - violationdate) , save answer in difference column. taking account user enter violation date. once user press command button, show answer. i have used code not giving me answer. private sub commandbutton1_click() range("a" & rows.count).end(xlup).offset(1, 0).value = textbox1.text range("b" & rows.count).end(xlup).offset(1, 0).value = date range("c" & rows.count).end(xlup).offset(1, 0).value = range("c" & rows.count).end(xlup).offset(0, -1).value - range("c" & rows.count).end(xlup).offset(0,-2).value end sub please help. thank much. you can use this: private sub commandbutton1_click() range("a" & rows.count).end(xlup).offset(1, 0).resize(, 3).value = array(textbox1.text, date, date - cdate(textbox1.text)) end sub

javascript - Change color of certain row with the selection module -

when property has value, i'd color row. question has been asked before , has working solution here: how color row on specific value in angular-ui-grid? i'm setting front color (with color: #ff0000), not background color. this works fine until add selection module. module, have checkbox @ beginning of row. when check this, background color of row changes (not front color!). add class, declared in grid's css: .ui-grid-row.ui-grid-row-selected > [ui-grid-row] > .ui-grid-cell { background-color: #c9dde1; } when checkbox checked, class added element. the code have similar code in linked answer: rowtemplate: '<div ng-class="{\'targetrow\': row.entity.target }"><div ng-repeat="(colrenderindex, col) in colcontainer.renderedcolumns track col.uid" class="ui-grid-cell" ng-class="{ \'ui-grid-row-header-cell\': col.isrowheader }" ui-grid-cell></div></div>', .targetrow { c

REJECTED_NONFASTFORWARD error in git remote push Netbeans -

Image
i'm working on remote git, , find remote i'm trying push send new changes other remote (for joining origin / master) , sending pull or push pull upstream in screen locked in image screen advancing hangs on screen, want do: take pull, merge , send new files push. how proceed? i'm using netbeans ide 8.0 (windows) . after , shows error: , in final output: remote repository updates branch update : master old id : 0000000hgfh0000fdffgg1f32g1fdg2fd1gd1g2fd new id : 0000dsadda000hgfh06546f32g1fdg2fd1gd1g2fd result : rejected_nonfastforward local repository updates branch update : origin/master old id : 0000000hgfh0000fdffgg1f32g1fdg2fd1gd1g2fd new id : 0000dsadda000hgfh06546f32g1fdg2fd1gd1g2fd result : not_attempted ==[ide]== 24/06/2015 21:54:14 pushing you need pull first since remote has new commits not have locally. attempting push.