Posts

Showing posts from September, 2012

How to integrate frontend and admin theme together in ruby on rails -

Image
i have application admin in ruby on rails. need add front-end in application. don't know how ingrate both in single application. you can create "admin" area pretty once know how. comes down namespaces , specifically: #config/routes.rb namespace :admin # sets "/admin" root "application#index" end namespaces "folders", influence names of rails classes (for example, controller class names). this means you'll able use following: #app/controllers/admin/application_controller.rb class admin::applicationcontroller < actioncontroller::base layout :admin def index #do stuff here end end your models remain (no need make them admin namespaced). -- the above code should give ability access yoururl.com/admin , have controller/action work with. of course, negates fact you're going have populate area data & controller actions; works "standard" rails app once working. you'...

ios - How to convert [String : String?] to [NSObject : AnyObject]! in Swift 2.0 for Firebase Api? -

Image
how can convert [string : string?] [nsobject : anyobject]!? right project using firebase backend swift app. after updated xcode 7 , swift 2.0, i got error .updatechildvalues function , image below. how can fix this? thanks! the problem values in dictionary of type string? , , contain nil . when dictionary passed objective-c code in firebase, it's converted nsdictionary . values in nsdictionary can't nil . i'm guessing self.deckname.text or self.deckdetails.text returning string? instead of string part of sdk update in xcode 7. if you're absolutely never return nil , can add exclamation point after self.deckname.text and/or self.deckdetails.text unwrap string? string . note if make bad assumption , return nil , program crash. if you're uncertain, self.deckname.text ?? "" , means "return deckname.text if it's not nil, otherwise return empty string".

c# - DataAdapter throws error while filling DataTable -

Image
i trying fill datatable using npgsqldataadapter. have prepared command string commandstring=@" drop table if exists tempdata; create temp table tempdata select x x x x (_query_); select x+x, xx, x-y newtemptable tempdata; and using below function fill data in datatable public datatable searchpg(string commandstring, npgsqlparameter[] param) { datatable resulttable = new datatable(); try { openconnection(); dbcommandpg.commandtext = commandstring; dbcommandpg.connection = databaseconnectionpg; dbcommandpg.parameters.clear(); if (param != null) { dbcommandpg.parameters.addrange(param); } adappg.selectcommand = dbcommandpg; resulttable.clear(); adappg.fill(resulttable); } catch (exception ex) { file.writeexception(ex.message, null); throw ex; } { databaseconnectionpg.close(); } return resulttable; } error oc...

c# - Deserialize list set index to object property -

i have following xml <itemsroot> <itemlist> <item> <name>a</name> <itemlist> <item> <name>aa</name> </item> <item> <name>ab</name> </item> </itemlist> </item> <item> <name>b</name> </item> <item> <name>c</name> </item> </itemlist> </itemsroot> my classes are public class item { [xmlignore()] public int itemindex {get;set;} public string name {get;set;} private item[] itemslist; [xmlelement(isnullable = true)] [xmlarrayitem("item", typeof(item))] [xmlarray("itemlist")] public item[] itemslist { { return itemslist; ...

android - Extract Images from JSON Object -

i fetching popular movies api, , trying poster images each movie. need extract poster_path parameter json string. this code extract information json string: final string owm_results = "results"; final string owm_posterpath = "poster_path"; string aux; // moviejsonstr string full http request jsonobject moviejson = new jsonobject(moviejsonstr); jsonarray moviearray = moviejson.getjsonarray(owm_results); for(int = 0; < moviearray.length(); i++) { jsonobject movieobj = moviearray.getjsonobject(i); aux = movieobj.getstring(owm_posterpath); log.v("aux: ", aux); } the json string looks this: { "page":1, "results":[ { "adult":false, "backdrop_path":"/tbhdm8ujab4victsulyfl3lxmcd.jpg", "genre_ids":[ 53, 28, 12 ], "id":76341, "original_language":"en", "original_title":...

android - Map Fragment doesn't load with same GPS location and Map Type -

i'm new android programming. i'm working on android project need access google maps. i've navigation drawer couple of options include google map location too. so whenever try load map first time works fine , loads map current gps location , map type defined. but whenever try switch other fragment , come map fragment, gps function , map type doesn't work. help needed. in advance. i'm trying possible fix it. :) my code below. what i'm trying here whenever user touches somewhere, marker placed on location. public class addcustomerlocationfragment extends fragment implements locationlistener { private mapview mapview; private googlemap map; private marker marker; private boolean markeravailable; private bundle bundle; button btnreset, btnsetlocation; locationmanager locationmanager; private view view; private double[] addcustomerlocation = new double[10]; @override public view oncreat...

iphone - draw route with multiple markers on Google Map iOS -

i'm new iphone development, in application want draw route between 2 points , show multiple markers on route. i'm done route between 2 points don't know how draw multiple markers on route. please me this. thanks in advance!!! _markerstart = [gmsmarker new]; _markerstart.title = [[[routedict objectforkey:@"legs"] objectatindex:0]objectforkey:@"start_address"]; _markerstart.icon = newimage; //[uiimage imagenamed:@"startmarker.png"]; _markerstart.map = gmsmapview; _markerstart.position = startpoint; _markerfinish = [gmsmarker new]; _markerfinish.title = [[[routedict objectforkey:@"legs"] objectatindex:0]objectforkey:@"end_address"]; _markerfinish.icon = newimage; //[uiimage imagenamed:@"finishmarker.png"]; _markerfinish.map = gmsmapview; _markerfinish.position = endpoint; here have added start , end marker. as completed drawing route between 2 points, have co-ordinates route. can take co-ordinates ...

wordpress - Restrict single url for a single IP -

i have denied ips except few in htaccess file. now want new ip allow access 1 particular url (it not html page page wordpress ). not want ip access other content of website. i not want password protection affect other users. can ? add new ip list of allowed ones, restrict access uri s except allowed one. assume want deny access of user ip: 124.255.124.255 urls except of www.example.com/url-to-hide .after granting access urls, put following code in .htaccess file of root directory: options +followsymlinks rewriteengine on rewritecond %{remote_addr} ^124\.255\.124\.255 rewritecond %{request_uri} !^/url-to-hide$ rewriterule ^(.*)$ - [f,l]

html - Combine multiple table results into one table in php -

i followed web tutorial on how build basic search engine database problem when results displayed shows each result in own table on page? want merge results show under 1 table in html. <?php include("dbconnect.php"); if(!isset($_post['search'])) { header("location:www.bacons.me"); } $search_sql="select * users username or firstname '%".$_post['search']."%'"; $search_query=mysql_query($search_sql); if(mysql_num_rows($search_query) !=0) { $search_rs=mysql_fetch_assoc($search_query); } ?> <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="description" content="bacons.me"> <meta name="keywords" content="html,css,javascript"> <meta name="author" content="james narey"> <meta name=viewport content="width=device-width, initial-scale=1"> <link rel="ico...

Security extension for Magento, scanning server for changes files -

i use plugin wordpress called "wordfence". works scanning files on server , checking changes or suspicious code. i looking similar magento. exist? to put way, looking extension security, , scanning files looking changes lot. you should use version control system that, describe (and more). for example, git status show modified files since last release. use .gitignore exclude media files , other volatile stuff. see yireo's tutorial on git , magento on how started.

r - Comparing two dataframes in ddply function -

i've 2 dataframes, data , quantiles . data has dimension of 23011 x 2 , consists of columns "year" , "data" year sequence of days 1951:2013. quantiles df has dimension of 63x2 consists of columns "year" , "quantiles" , year 63 rows, ie. 1951:2013 . i need compare quantile df against data df , count sum of data values exceeding quantiles value each year. that, i'm using ddply in manner : ddply(data, .(year), function(y) sum(y[which(y[,2] > quantile[,2]),2]) ) however, code compares against first row of quantile , not iterating on each of year against data df. want iterate on each year in quantile df , calculate sum of data exceeding quantile df in each year. any shall appreciated. the example problem - quantile df here , data pasted here the quantile df derived data , 90th percentile data df exceeding value 1 quantile = quantile(data[-c(which(prcp2[,2] < 1)),x],0.9)}) why not in 1 go? c...

html - Background color of a div doesn't work -

Image
one of div element acting strange. when write inside div shows it's background color (sticking text). if dont write background color disappears. image text: image without text: here html code: body { margin: 0; padding: 0; font-family: bebas; } header { max-width: 960px; height: 80px; margin: 0 auto; line-height: 80px; } #leftruler { width: 15%; height: 80px; float: left; background: #f3af9d; } #bannercontent { width: 70%; height: 80px; float: left; background: #e8603c; line-height: 80px; } #rightruler { width: 15%; right: 80px; background: #f3af9d; float: left; } #logo { height: 80px; float: left; font-size: 40px; display: block; color: #e8603c; } #menu { float: right; } #menu ul { padding: 0px; margin: 0px; float: right; } #menu ul li { display: inline-block; } #menu ul li { text-decoration: none; font-size: 16px; color: #b9b9b9; margin-left:...

elasticsearch - Can I update existing document without _id? -

i'm using elasticsearch version 1.5 i want updating exist document without _id _id auto generated. how can without searching update document ? _id has unique key. there update query plugin can utilize. best option. if trying update large amount of documents in single call , might not work out.

javascript - How to have paginated table from database -

i've tried bunch of different react table solutions ( reactable , griddle , work similar. can pass them set of data , populate table. offer pagination, not in since it's source. can pull 100 rows database, , show 10 @ time via table pagination. if data coming database / flux store, how supposed pull need database? in case of relational database, handle pagination on database level, if rdbms supports it, in sql query itself. need following: make ajax query backend pagination settings: page size , page number in backend, issue query against database, using aforementioned settings, prepare json result. return results frontend, parse json.parse() , pass grid component. in case of flux store, bit more complex has different notions relational database. basic principles same though, pass parameters access component, make query, return json or javascript objects. pagination in rdmses for example, in mysql (mariadb) pagination limit qualifier: select * tabl...

Xamarin App Keyboard is a different size to iOS Keyboard -

Image
i'm developing ios app in xamarin ( not using forms, using xamarin.ios ) , have noticed keyboard appears in xamarin built app larger keyboards appear in other apps. e.g. app e.g. other ios app (apple notes) the numbers aren't important, important there difference in size between 2 keyboards in terms of key height , key spacing. there not appear obvious options or settings surrounding this. trying different keyboard styles (i'm using "default") not solve problem. i keyboard same size normal ios app keyboard. edit krumelur's answer correct. this how specified launch screens https://stackoverflow.com/a/25960203/807836 in visual studio, there appear issue xml entry being lost if edit project file through ide. this not xamarin related. app running in compatibility mode on iphone5 or 6. have provide launch screen particular device or launch image let ios know support bigger screen. see here on how use launch screens.

javascript - Add event listener that changes / removes class when sound is done playing -

how add event listener performs function remove class when sound file has ended. (make play button in jsfiddle turn green when done playing) jsfiddle: https://jsfiddle.net/wyfjdgyb/4/ $(".play").on('click',function(){ var key = $(this).attr('key'); evalsound(key); var this_play = $(this); $(".play").each(function() { if ($(this)[0] != this_play[0]) { $(this).removeclass("pause"); } }); $( ).toggleclass( "pause" ); }); var thissound = new audio(); var currentkey; function evalsound(key) { if(currentkey !== key) thissound.src = "http://99centbeats.com/beats/" + key + ".mp3"; currentkey = key; if (thissound.paused) thissound.play(); else thissound.pause(); thissound.currenttime = 0; currentplayer = thissound; } $(".play").bind('ended', function(){ // done play...

excel - Update current time and date if a column value changed to predefined text -

i want column add current time if specific column have predefined text. in cell of b column have written formula update time in basis of column text. =if(a2="resolved",=now(),"not done") this shows error. i want apply formula entire column. tied: =if(a2="resolved",now(),"not done") but time in column b gets updated same value if cell changed in column. this because have worksheet set auto calculate. time condition true, or cells in column match condition, cause current time stamp used. the way prevent changing cells matching condition change manual calculation, have select cell , press enter perform calculation. unfortunately disable automatic calculation entire workbook, other formulas not update either. unfortunately there no way on cell cell basis, other use vba, trigger if cells changed.

SQL Server compare values of two rows of same table and get not matching column names -

i need compare 2 rows ( inserted & deleted ) of same table , compare values. , need not matching columns. inside trigger. here i've tried far 've no idea of how compare these 2 rows , column names contains different values . select * inserted inner join deleted d on d.purchasingdocitemno = i.purchasingdocitemno , d.purchasingdocno = i.purchasingdocno , d.referencedocumentno = i.referencedocumentno , d.productno = i.productno change select : select -- each column you're checking. account isnull if need case when i.col1 = d.col1 0 else 1 end col1changed....... inserted inner join deleted d on (i.<pk> = d.<pk>)

How to change border color in QT -

in application need use dark grey color border progress. googling changed border color , background color like, qstring st = qstring ("qprogressbar::chunk {""background-color: #00b82e;""}"); st.append("qprogressbar {""border: 6px solid grey;" "border-radius: 9px;""text-align: center;""background: #00b82e;""}"); progress->setstylesheet(st); but not able find out list of border color "border: 6px solid grey;".how find out list of colors "6px solid grey" because need change color border qt style sheets take lot html cascading style sheets (css). documentation qcolor::setnamedcolor says color name can 1 of svg color keyword names: a name list of colors defined in list of svg color keyword names provided world wide web consortium; example, "steelblue" or "gainsboro". these color names work on platforms. note these color names no...

c++ - Pass container of raw pointers and smart pointers to template function -

is there possibility abstract pointer type of objects container when container (e.g.: std::vector ) passed function template? i have following 2 methods: template <typename t, typename alloct, template <typename, typename> class containert> static void parse(containert<t *, alloct> &entries, const rapidjson::value &jsondocument) { (rapidjson::sizetype entryit = 0; entryit < jsondocument.size(); ++entryit) { entries.push_back(new t()); entries[entryit]->parse(jsondocument[entryit]); } } and template <typename t, typename alloct, template <typename, typename> class containert> static void parse(containert<std::unique_ptr<t>, alloct> &entries, const rapidjson::value &jsondocument) { (rapidjson::sizetype entryit = 0; entryit < jsondocument.size(); ++entryit) { entries.push_back(std::move(std::unique_ptr<t>(new t()))); entries[entryit]->pars...

sql - Print data from a DB grouped under the starting letter using PHP? -

i'm trying set loop print data database table starts letter. example, let's usernames in database, want print every username starting letter "b". end result want achieve along lines of this: a adam angel apple b ball bear blue c car cell chris # 0wen 1uis 3than .,_ .apple. ,car, _jeff_ i want able print usernames under corresponding character in start with. have starting characters under heading tags, need print usernames under them. figured running simple loop under each heading tag filters data trick, life of me can't figure out how go doing it. code far (i know print every user in table): require_once 'important/connect.php'; $query = $link->prepare('select distinct usr info order usr'); $query->execute(); $users = $query->fetchall(pdo::fetch_obj); foreach ($users $user) { print "<center><a href=\"log.php?id={$user->usr}\" onclick=\"return popup(this.href)\">{$user->usr}</...

php - finding occurrence of string within a string -

i trying find out whether string contains of strings particular table of strings , assigning string found match variable , inserting said variable database. doesn't seem able find match when there match. appreciated. this code: $stringtomatch = 'good morning'; $string_list = "select string strings"; $resultstringlist = mysqli_query($link, $string_list) or die(mysqli_error($link)); $string_name = "test"; while ($row = mysqli_fetch_array($resultstringlist)) { if (stristr($stringtomatch, $row)) { $string_name = $row; } } mysqli_query($link, "insert table (string) values ('$string_name')") or die(mysqli_error($link)); at point, appear in table "test" in string column. ideally should insert word "morning" instead can found in table strings stristr() returns of haystack starting , including first occurrence of needle end. you fetching array form query. need pass string stristr function match...

Reset status bar if a macro returns an error Excel VBA -

i'm using application.statusbar update status of macro runs. beacuse have screenupdating turned off. now if stop macro during process or if encounters kind of error status bar stays @ last set gives appearance of program still running. is there way reset status bar @ such occurance? i use this: sub gracefulexit() dim errmsg string on error goto ender: application.calculation = xlcalculationmanual application.screenupdating = false application.enableevents = false application.statusbar = "running gracefulexit" err = 1004 'set error invoke ender: ender: 'this defy indentation in module - stays in col 1 if err <> 0 'display error errmsg = "an unexpected error has occured:" & vbcrlf & vbcrlf _ & vbtab & "error no: " & err & vbcrlf _ & vbtab & "description: " & error & vbcrlf _ & vbtab & "statusbar...

python - How to get sql query from peewee? -

simple peewee example: mysql db "pet" autoincrement "id" , char-field "name". doing my_pet = pet.select().where(name == 'garfield') with .sql() sql interpretation. how raw sql query from: my_pet = pet.get(name='garfield') ? when write: my_pet = pet(name='garfield') nothing @ happens in database. you have created object. there no magic, peewee activerecord orm, , saves when call method model.save() or model.create() . if want sql query model.create() , should using model.insert() instead: insert_stmt = pet.insert(name='garfield') sql = insert_stmt.sql() new_obj_id = insert_stmt.execute() the downside there aren't returned model instance, primary key.

jquery - electron use post request fails -

i trying turn node app desktop using electron. in current code use "post" request , res.send() return data node script. express handles end points. however, when try , use same code electron get net::err_connection_refused i have spent lots of time trying figure solution , seems caused cors issue , have added "web-preferences": { "web-security": false } to electron browserwindow config has not helped. can share sample of doing jquery post request in electron. big help. thanks

javascript - Why do browser blocks specific Ajax requests? -

i have 2 code snippets: $.getjson("https://noembed.com/embed", {"format": "json", "url": input.val()}, function (data) { // work data }); the second one: $.getjson("https://www.youtube.com/oembed", {"format": "json", "url": input.val()}, function (data) { // work data }); the first 1 successful, second 1 not. both sent http://localhost:8080/myapp/page . why same origin policy not permit both requests? (actually it's question browsers). some servers permit browsers cross origin requests, not. see cors . there can multiple cors headers involved, either none of them present or required particular operation missing youtube. but, point server decides if wants permit cross origin operations browsers , 2 servers offering different capabilities in regard. this particular youtube api bit suspect though because exists purely cross-origin reasons there must else going on preventing working...

Angular 2 child component refers to parent component -

i have application contains 3 components. application, editview,dialog. application components contains editview components can contain many other editview components , 1 dialog component( if dialog component visible on page). dialog component contains application component. when put in dialog component in declaration path: directives:[application] i'am getting error: unexpected directive value 'undefined' on view of component 'dialog' is possible @ have such structure child component can contain component upper level regarding conditions? if drop application component dialog or replace other components works fine. zlaja putting in directives list won't work, can still have access parent component having injected in constructor of child directive: constructor(@host(application) application: application) { } and parent component can live list of child components using @query : constructor(@query(editview) editviews: querylist...

c# - Fog Changing by position transform.position.y -

i need fog change 2 times once on level of y150 , second time on level y90. wanted set gameobject.transform.position.y function y150 y80 cant figure out how done. thank here code far // use initialization void start () { } bool isunderwater(){ return gameobject.transform.position.y < 150; rendersettings.fog = true; rendersettings.fogcolor = new color (0.15f, 0.35f, 0.40f, 0.5f); rendersettings.fogdensity = 0.03f; } bool isnotunderwater(){ return gameobject.transform.position.y < 90; rendersettings.fog = true; rendersettings.fogcolor = new color (0.8f, 0.4f, 0.2f, 0.5f); rendersettings.fogdensity = 0.03f; } // update called once per frame void update () { rendersettings.fog = isunderwater(); rendersettings.fog = isnotunderwater (); } the 'return' statement in programming languages, including c#, exit function, returning given value. means following lines affect fog settings never run. there bunch of d...

unity3d - How to get the color of pixel currently under mouse pointer -

i want color of pixel under mouse pointer. i have come code, not give exact position texture2d.getpixel not work float. code give color not give color of exact mouse position have cast values integer since texture2d.getpixel cant handle float texture2d texture; public color colorbelowmouse; public vector3 x; // use initialization void start () { texture=gameobject.getcomponent<guitexture>().texture texture2d; } // update called once per frame void update () { debug.log(texture.getpixel((int) input.mouseposition.x, (int) input.mouseposition.y)); colorbelowmouse=texture.getpixel( (int) input.mouseposition.x, (int) input.mouseposition.y); } please tell me how color of exact mouse position. if approach wrong, please tell me correct one. vector2 pos = input.mouseposition; camera _cam = camera.maincamera; ray ray = _cam.screenpointtoray(pos); physics.raycast(_cam.transform.position, ray.direction, out hit, 10000.0f); color c; if(hit.collider) { ...

ios - Cannot invoke initializer for type 'MCNearbyServiceAdvertiser' -

working on ios multipeer connectivity, after updating swift 2.0, facing issue following codes: var advertiser:mcnearbyserviceadvertiser! var peer:mcpeerid! func startendadvertising(value:bool) { if advertiser == nil { var someobject: [string : anyobject] = ["profilename" : datacentral.getinstance.userpeervo.peername] advertiser = mcnearbyserviceadvertiser(peer: peer, discoveryinfo: someobject, servicetype: "shadow-chat") advertiser.delegate = self } } this following line generates error "cannot invoke initialiser type 'mcnearbyserviceadvertiser' argument list of type '(peer: mcpeerid!, discoveryinfo: [string : anyobject], servicetype: string)'" advertiser = mcnearbyserviceadvertiser(peer: peer, discoveryinfo: someobject, servicetype: "shadow-chat")

debugging - AVR/GNU C Compiler and static memory allocation -

update - rephrase question: since know bug is! how know when statical allocation fails @ compile time in embedded? older: i have simple , easy understand code in "c" below running in atmega328p-au 2k sram. use behaved uart library( used many during debugging ) debug strings in pc terminal. there bug in code: freezes. output... hello world - loading i should '+' every loop. can explain me why freezes , why compiler not inform me allocating statically more memory uc can get. in code there info may need. /************************************************************************************************** info **************************************************************************************************/ /* device: atmega328p-au - no arduino ide: atmel studio 6.2 compiler: avr/gnu c compiler : 4.8.1 f_cpu: 8000000 hz defined in makefile fuses: extended: 0x07 high: ...

r - How to get J48 size and number of leaves -

if build j48 tree by: library(rweka) fit <- j48(species~., data=iris) i following result: > fit j48 pruned tree ------------------ petal.width <= 0.6: setosa (50.0) petal.width > 0.6 | petal.width <= 1.7 | | petal.length <= 4.9: versicolor (48.0/1.0) | | petal.length > 4.9 | | | petal.width <= 1.5: virginica (3.0) | | | petal.width > 1.5: versicolor (3.0/1.0) | petal.width > 1.7: virginica (46.0/1.0) number of leaves : 5 size of tree : 9 i number of leaves variable n (so n 5 ) , size of tree s (so s 9 ). is there way information directly j48 tree? as pointed out @lyzander not easy on j48 object directly. generally, objects returned fitting functions in rweka contain relatively few informations on r side (e.g., call , fitted predictions). main ingredient typically reference java object built weka weka's own methods can applied on java side via .jcall , returned in r. however, j48 trees...

scala - Insert if not exists in Slick 3.0.0 for bulk insert -

i read answer . how can same bunch insert? i have list of items, , insert these items: tbl ++= items each item item(id:string, text:string) , id primary key. i want insert not existed items in table tbl using 1 sql query. slick 3, postgresql you can try as: check entries exists in database filter them out bulk insert code sample: def markasnew(list: seq[issueevent]): future[option[int]] = { val ids = list.map(_.origineventid)).map(_.origineventid) dbrun((for { existing <- events.filter(_.origineventid inset ids).result filtered = list.filter(event => existing.contains(event.origineventid)) count <- events ++= filtered } yield count).transactionally) }

Python TypeError: 'int' object is not subscriptable -

this question has answer here: typeerror: 'int' object not subscriptable 2 answers i trying create ballot system in user can input candidates names , input preference scores. program works out winner , prints result. i getting annoying return console when run line of code. for in range(len(winners)[i]): the error reads: typeerror: 'int' object not subscriptable (edited: code dump redacted.) you want iterate on winners: for in winners: what trying do:: for in range(len(winners)): will iterate through indexes, error [i] have nothing here.

Oracle: Conditional Grouping -

i having data in following format : cons_type column_name p (col1) r (col6_reference) r (col6_reference) u (col5_com_unique) u (col3_unique,col4_com_unique) finally, want listagg column_name, cons_type wise cons_type either 'p' or 'u' only. other cons_type 'r' must not list aggregated using listagg() function. and final expected output must in following format. cons_type column_name p (col1) r (col6_reference) r (col6_reference) u (col3_unique,col4_com_unique),(col5_com_unique) try: select "cons_type", "column_name" tbl "cons_type" not in ('p', 'u') union select "cons_type", listagg("column_name" , ',') within group (order "cons_type") tbl "cons_type" in ('p', 'u') group "cons_type" order ...

xml - Paste special for .NET 4.5 only? -

i'm using vs 2013 ide tool edit->paste special->paste xml classes. 1 of requirements available target framework 4.5. will class generated way work in fw4.0 project? class support serialize/deserialize? the code .net 2 compatible. uses xml framework classes have been there since .net 2. the paste special option visual studio ide feature, isn't related .net 4.5. will class support serialize/deserialize? yes, serialize/deserialize expect. can use xmlserializer job, has been there since .net 1.1.

jquery - Javascript click once -

i have following javascript in website: $('#example tbody').on( 'click', 'input', function () { var data = table.row( $(this).parents('tr') ).data(); $(".iframe").colorbox({href:"session_edit.php?id="+data[0]}); $(".iframe3").colorbox({href:"delete.php?id="+data[0]}); $(".iframe2").click(function() {location.href = "record_dt.php?id="+data[0]}); }); } ); when clicking respective buttons on datable 'iframe' , 'iframe3' work fine normal single click. however, when click on respective button iframe2 have click twice button respond. not double click 1 click , another. idea why happening? since 'iframe' , 'iframe3' associated colorbox respective code: full code: <script> $(document).ready(function() { $(".iframe").colorbox({iframe:true, width:"700...

ios - Auto Layout: layoutMarginsGuide -

how rewrite visual format addconstraints(nslayoutconstraint.constraintswithvisualformat("|-[label]-|", options: .alignallbaseline, metrics: nil, views: ["label": label])) addconstraints(nslayoutconstraint.constraintswithvisualformat("v:|-[label]-|", options: .alignallcenterx, metrics: nil, views: ["label": label])) by moving layout guides (with margins)? i tried with label.topanchor.constraintequaltoanchor(layoutmarginsguide.topanchor).active = true label.leftanchor.constraintequaltoanchor(layoutmarginsguide.leftanchor).active = true label.bottomanchor.constraintequaltoanchor(layoutmarginsguide.bottomanchor).active = true label.rightanchor.constraintequaltoanchor(layoutmarginsguide.rightanchor).active = true but not work. layoutmarginsguide.layoutframe not have expected value (yes call in layoutsubviews after super executed). constraints set, acts there 0 margin. layouts , gives expected layoutframe when layout margin set negati...

php - emailing form data filled from db -

i have form name , details filled , iam able collect details filled , email data.but in form 1 field filled db "comments" field. <?php $sql = "select * comments id = no "; $result = mysqli_query ($conn,$sql) or die (mysqli_error ()); $count = 1; while ($row = mysqli_fetch_array ($result)) {?> <tr> <td valign="top" > <label for="old_comments">comments <?php echo $count ?>:</label> </td> <td style=" padding-bottom: 0px;"> <input type="text" name="old_comments" value="<?php echo $row ['updates']; ?> " readonly maxlength="500" size="30" style=" width: 710px; "> <br> <span class="helptext" >previous comments.</span> </td> </tr> <?php $count = $count + 1; } ?> there number of com...

google dfp - DFP ads not working in my django website -

i have created ad units , generated tags displaying ads in website dfp dashboard. works fine when make html file code generated. when try integrate same code website, ads not rendering. when checked in google console shows iframe type none , html file, iframe type safeframe. the problem ip. when run django server on localhost instead of ip, google ads got rendered.

xcode iOS simulator opens file picker on startup but does nothing else -

Image
happens when open ios simulator on el capitan - opens file picker , can not else. closing file picker closes ios simulator. can move file picker dialog box , ios simulator window freely around close file picker, closes ios simulator. i couldn't find settings nor can't find hints why happen... the iphone chrome dressing on window removed in xcode 6, not recent version of simulator. please make sure install recent version of xcode.app. el capitan supports xcode 6.4 , newer.

javascript - Create Unique Hidden Field IDS from Select Menu options -

i have modal displays stock information specific item has multiple locations within warehouse. user selects locations , quantities each menu , clicks confirm, information modal needs imported on pick list printed out. to planning use arrays transport data pick list. i have hidden field each row, containing values of location , qty picked there. location 1 + qty 1 = hidden field 1 location 2 + qty 2 = hidden field 2 i want able put hidden fields array once button clicked. hidden field 1 + hidden field 2 = array. i can create hidden fields fine, when go make final array contains data, seems want add newest hidden field created it. dialog - pick quantity button (used confirm selections): //pick quantity button 'pick quantity': function() { jquery('.ui-dialog button:nth-child(1)').button('disable'); //disables current selection, cannot editted $('#addlocqtypick'+picker).prop ('disabled', true); //disables cu...

Incorporating HTML with JavaScript in my Java application -

i'm writing small cbt java application. questions read in local mysql database. application dynamically builds question include drop down lists , provides instant feedback on incorrect answers. due java limitations, had resort using html , javascript construct these questions. have jeditorpane have simple html page built in: string html = ""; try { html+="<html><head></head>"; html+="<body onload='tester()'>"; html+="<div id='stuff'>"; html+="</div>"; html+="</body></html>"; htmlpane.setcontenttype("text/html"); htmlpane.settext(html); } catch(exception e) { e.printstacktrace(); system.out.println("some problem has occured"+e.getmessage()); } now trying figure out how add associated javascript populate "stuff" div. further, need return results javascript calling java method. ...

ruby on rails - Delay job with lambda -

i need send 2 actions background. write : myobject.delay.action1 myobject.delay.action2 but can't sure action2 starts after action1 finished, can i? so instead, create method on fly. def action1and2 myobject.action1 myobject.action2 end myobject.delay.action1and2 but feels stupid create named function meaningless group, doesn't it? so instead, inspired js, thought of writing lambda: -> { myobject.action1 myobject.action2 } can delay such function? or there alternative situation? myobject.delay.instance_eval { action1; action2 }

c# - tapisrv.exe hangs other processes when terminating from a developed program -

so i've developed program in c# in vs2013 utilizes tapi make phone call on 1 button. used tapi3 library, after discovering not in working state switched julmar's tapi 2 wrapper. i'm using windows 8 64 bit, , although program used elsewhere on win8 64 bit machines issue occur. whenever make phone call program, nothing abnormal happens , phone call made. code runs , ok. when close form tapi used (i.e terminating tapisrv.exe) service shuts down, , drags other processes every time. interfering drive mappings, cryptography services , other services depending on pc. error log in event viewer below; faulting application name: svchost.exe_tapisrv, version: 6.3.9600.17415, time stamp: 0x54504177 faulting module name: ntdll.dll, version: 6.3.9600.18007, time stamp: 0x55c4c16b exception code: 0xc0000008 fault offset: 0x000000000009311a faulting process id: 0xd4 faulting application start time: 0x01d0f45613fffb86 faulting application path...

How to iterate through json elements using for in Python -

this code works: #!/usr/bin/env python3 import urllib.request, json url = urllib.request.urlopen('https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.xchange%20where%20pair%20in%20(%22dkknok%2ceurnok%2cgbpnok%2cisknok%2cnoknok%2cplnnok%2cseknok%22)&format=json&env=store%3a%2f%2fdatatables.org%2falltableswithkeys') data = json.loads(url.read().decode(url.info().get_content_charset('utf-8'))) print(data['query']['results']['rate'][:]) it prints out 7 element of data['query']['results']['rate'] in conjunction. so i'm thinking code should work: #!/usr/bin/env python3 import urllib.request, json url = urllib.request.urlopen('https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.xchange%20where%20pair%20in%20(%22dkknok%2ceurnok%2cgbpnok%2cisknok%2cnoknok%2cplnnok%2cseknok%22)&format=json&env=store%3a%2f%2fdatatables.org%2falltableswithke...

java - JPA with Hibernate 5: programmatically create EntityManagerFactory -

this question specifically programmatically creating jpa entitymanagerfactory backed hibernate 5, meaning without configuration xml files , without using spring . also, question specifically creating entitymanagerfactory with hibernate interceptor . i know how create hibernate sessionfactory way want, not want hibernate sessionfactory , want jpa entitymanagerfactory backed hibernate sessionfactory . given entitymanagerfactory there way obtain underlying sessionfactory , if have sessionfactory , want entitymanagerfactory wrapper around it, appears out of luck. with hibernate version 4.2.2 ejb3configuration deprecated, there seemed no other way programmatically create entitymanagerfactory , doing this: @suppresswarnings( "deprecation" ) entitymanagerfactory buildentitymanagerfactory( unmodifiablemap<string,string> properties, unmodifiablecollection<class<?>> annotatedclasses, interceptor interceptor ) { ejb3...