Posts

Showing posts from August, 2015

ios - Full Screen Custom Popover issue in iOS7 and iOS8 -

Image
i developing app ipad only. in in 1 functionality want display fullcustom popover . for code below:- duplicateviewcontroller *viewcontrollerforpopover = [self.storyboard instantiateviewcontrollerwithidentifier:@"duplicatepopovervc"]; viewcontrollerforpopover.arr_studentdetail = self.arrstudentdetail; viewcontrollerforpopover.dictselectedprog = dictselectedprogram; self.popover = [[uipopovercontroller alloc] initwithcontentviewcontroller:viewcontrollerforpopover]; [self.popover setpopovercontentsize:cgsizemake(self.view.frame.size.width, self.view.frame.size.height)]; viewcontrollerforpopover.modalpresentationstyle = uimodalpresentationfullscreen; [self.popover setbackgroundcolor:[[uicolor darkgraycolor] colorwithalphacomponent:0.4]]; [self.popover presentpopoverfromrect:self.view.bounds inview:self.view permittedarrowdirections:0 animated:yes]; i set popover size , tried other option can't make full screen.

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -

good morning i using angularjs-nvd3-directives, great, having difficulties when setting color of multi bar chart ( http://cmaurer.github.io/angularjs-nvd3-directives/multi.bar.chart.html ). the show legend works well: <div ng-controller="examplectrl"> <nvd3-multi-bar-chart data="exampledata" id="showlegendexample" width="550" height="300" showxaxis="true" showyaxis="true" xaxistickformat="xaxistickformatfunction()" showlegend="true"> <svg></svg> </nvd3-multi-bar-chart> </div> but when add option in conjunction color="colorfunction()" where, var colorarray = ['#ff0000', '#0000ff', '#ffff00', '#00ffff']; $scope.colorfunction = function() { return function(d, i) { return colorarray[i]; }; } the color of cha

How to update a List in C# -

ilist<receiptallocationmaster> objreceiptmaster = (ilist<receiptallocationmaster>)session["allocationresult"]; public class receiptallocationmaster { public string application { get; set; } public list<users> users { get; set; } } public class users { public string name { get; set; } public string surname { get; set; } } i need update above list value application = "applicationame" , users surname = "surname" same list. just iterate on list , modify matched items: (int = 0; < objreceiptmaster.count; i++) { var item = objreceiptmaster[i]; if (item.application == "applicationname" && item.users.any(x => x.surname == "surname")) objreceiptmaster[i] = new receiptallocationmaster(); } instead of new receiptallocationmaster() can write modification data logic.

entity framework - The EntitySet 'AspNetRoles' with schema 'dbo' and table 'AspNetRoles' was already defined. Each EntitySet must refer to a unique schema and table -

error in migrations : pm> enable-migrations checking if context targets existing database... system.data.entity.modelconfiguration.modelvalidationexception: 1 or more validation errors detected during model generation: aspnetroles: name: entityset 'aspnetroles' schema 'dbo' , table 'aspnetroles' defined. each entityset must refer unique schema , table. at system.data.entity.core.metadata.edm.edmmodel.validate() @ system.data.entity.dbmodelbuilder.build(dbprovidermanifest providermanifest, dbproviderinfo providerinfo) @ system.data.entity.dbmodelbuilder.build(dbconnection providerconnection) @ system.data.entity.internal.lazyinternalcontext.createmodel(lazyinternalcontext internalcontext) @ system.data.entity.internal.retrylazy 2.getvalue(tinput input) @ system.data.entity.internal.lazyinternalcontext.initializecontext() @ system.data.entity.internal.internalcontext.createobjectcontextforddlops

match - Regex .* not matching a lack of input -

hi have following regex statement:- <a .* href="http://www.someurl/test.htm">.*?<\/a> that matches following fine:- <a class=op_web href="http://www.someurl.co.uk/test.htm">test</a> however doesnt match when there nothing entered between opening 'a' tag , 'href' statement e.g.:- <a href="http://www.someurl.co.uk/test.htm">test</a> how rearrange statement can match @ between opening 'a' , 'href' including nothing @ all? <a .* href="http://www.someurl/test.htm">.*?<\/a> this because of spaces after <a .make <a\b.*href="http:\/\/www\.someurl\.co\.uk\/test\.htm">.*?<\/a> try <a\b(?:(?!<\/a>).)*href="http:\/\/www\.someurl\.co\.uk\/test\.htm">(?:(?!<\/a>).)*<\/a> see demo. http://regex101.com/r/lz5mn8/66

c# - Send client certificate from portable class library -

is there way use client certificate pcl? portable httpclient or other way? thank you! there no way make generic pcl httpclient use client certificate. can implement custom messagehandler each platform , pass httpclient's constructor. xamarin ios , android can make use of modernhttpclietnt (it's open source) , on wp way implement client certificate use ssl blackbox (which not free). on other platforms (like winrt) it's simpler achive goal.

Find similar record by given string in mysql -

i have word dynamic "sticky9 uk". might anything. i want find similar record based on 2 columns e.g my_word = "sticky9 uk" and in database coloumn1 : company_name = "sticky9" coloumn2 : contact_person = "sticky9.com" select * table coloumn1 '%<your word>%' or coloumn2 '%<your word>%'

java - Set XML values in jTable -

Image
i've got jtable , want add content of xml-file it. dont know how should browse through xml-file, able manipulate data (rewrite, deleting) , values of single tag , not of all. i'm using jdom my xml-file looks this: <?xml version="1.0" encoding="utf-8"?> <app> <!-- pfad für templates und speicher ort für die entity.java--> <entity> <name>aposting</name> <art>0</art> <datum>wed nov 19 10:51:10 cet 2014</datum> </entity> <entity> <name>aposting</name> <art>1</art> <datum>wed nov 19 11:30:34 cet 2014</datum> </entity> <entity> <name>aposting</name> <art>1</art> <datum>wed nov 19 15:21:12 cet 2014</datum> </entity> <entity> <name>aposting</name> <art>2</art> <datum>thu nov 20 8:01:10 cet 2014<

c# - How to find a control from tooltip -

ide: vs 2010, c# .net 4.0, winforms i have form form1, , having panels p1 p2 p3, having assigned tooltiptext "pan1", "pan2", "pan3" respectively. i know can search control in form using control[] c= this.controls.find("p1", true); but there way find control tooltip text, //example control[] c1 = this.control.findbytooltip("tooltiptext",true); i know can map using switch case there easier way..? if looking panel tooltip, signal designed wrong in application... here how it var c = this.controls.oftype<control>().where(p => tooltiphcp.gettooltip(p) == "tooltiptext");

vbaccelerator - Compile Eror: Next without for -

i'm trying learn code, , here is: sub lala() dim ha string dim objcell object dim ha2 string dim ha3 string each objcell in activesheet msgbox ("blah") ha = msgbox("do want same message box?", vbyesno) if ha = vbyes next objcell else msgbox("do want 1 @ all?", vbyesno) = ha3 if ha3 = vbyes ha2 = inputbox("what want say?") else exit sub end if end if end sub you mixing "if" , "for", "next" in "if" statement, while should outside it. here "corrected" code : sub lala() dim ha string dim objcell object dim ha2 string dim ha3 string each objcell in activesheet msgbox ("blah") ha = msgbox("do want same message box?", vbyesno) if ha = vbno exit next objcell msgbox("do want 1 @ all?", vbyesno) = ha3 if ha3 = vbyes ha2 = inputbox("what w

How can I replace first line of every file in Notepad++? -

i have 30 text files. then have 1 text file 30 lines. let's call 30lines.txt i want replace first line of each of 30 text files corresponding line 30lines.txt how do this? it's easy in synwrite app. have python console: enter there n commands. e.g. commands read contents of "30lines.txt" is: from sw import * file_open(r'c:\dir\30lines.txt') text = ed.get_text_all() text = text.split('\r\n') print('lines: '+str(len(text))) to replace 1st line "haha": from sw import * file_open(r'c:\new.txt') ed.set_text_line(0, 'haha')

Cannot paste code into Google script -

i trying paste sample code google script tutorial script editor instructed - code not transferred. highlight sample code, right click & select copy, position on google script editor , remove existing code instructed, right click , paste , nothing gets transferred. prove copy worked pasted notepad. ideas? have windows 7 & ie11 . help! some fields designed not accept paste data, see allot on register forms forced type in email , password manually, maybe happening there.

c++ - winapi get the mangled name from a function's address -

in c++ applicatoin have virtual addresses of functions , want mangled names. right can unmangled name using winapi symfromaddr function. there way mangled names ? use symsetoptions() . want turn off symopt_undname option see mangled name. so, roughly: dword options = symgetoptions(); symsetoptions(options & ~symopt_undname); if (symfromaddr(hprocess, dwaddress, &dwdisplacement, psymbol)) { // etc... } symsetoptions(options);

java - How to get time according to timezone -

i storing timezone value in database +5:30 or +2:00 or -1:00 i fetching data database , changing time according time zone in java. here know how can time according saved timezone value. use timezone , calendar . , check before asking... examples here , or here

python - Weird characters in XML response -

i try communicate our supplier xml on http. so far, request like: post /some-service http/1.1 host: me content-type: text/xml; charset=utf-8 content-length: 470 <?xml version="1.0" ?> <pnarequest> <version>2.0</version> <transactionheader> <senderid>my company</senderid> <receiverid>my supplier</receiverid> <countrycode>fr</countrycode> <loginid>my login</loginid> <password>my password</password> <transactionid>some hexa numbers</transactionid> </transactionheader> <pnainformation quantity="1" sku="more numbers here"/> <showdetail>2</showdetail> </pnarequest> (the content-length may differ, because changed body after i've pasted it.) i send on port 443 of supplier, no encryption (testing purposes). before, had correct response, nice xml struct

ios - How to adjust UILabel font size to fit the fixed Rectangle (for iOS7 +)? -

i know question has been asked many times , have seen of solutions like how adjust font size of label fit rectangle? how calculate actual font point size in ios 7 (not bounding rectangle)? nsstring sizewithfont: alternative in ios7 what want want adjust font size in given rect word wrapping technique. posts mentioned above somehow adjust font size none of them using word wrapping technique. let say, have label uilabel *templabel = [[uilabel alloc] initwithframe:cgrectmake(10, 10, 60, 25)]; \\60px width templabel.text = @"internationalisation"; templabel.numberoflines = 2; now should wrap text in 1 line (within 60 px) minimum possible font. keeps text in 2 lines bit bigger font , text breaks "internationali" in first line , "sation" in second. how can apply word wrapping in it. templabel.adjustsfontsizetofitwidth = yes; does not seem work 2 or more lines and cgsize size = [self sizewithfont:font minfontsize:minfontsize

How can I reference an image in GitLab markdown in the current directory with the path starting with ./ dot slash? -

i have stored markdown file , image file in git repo follows: readme.markdown images/ image.png i reference image readme.markdown this: ![](./images/image.png) this renders expected in retext, not render when push repo gitlab. how can reference image markdown file renders when viewed in gitlab? ![](images/image.png) without ./ works me: https://gitlab.com/cirosantilli/test/blob/bffbcc928282ede14dcb42768f10a7ef21a665f1/markdown.md#image i have opened request allowed at: http://feedback.gitlab.com/forums/176466-general/suggestions/6746307-support-markdown-image-path-in-current-directory-s , entered internet void when gitlab dumped uservoice.

java - WELD-001408 Unsatisfied dependencies - can't find the root cause -

i cannot inject logger cdi bean. tried solutions answers other similar questions none have helped. appreciate if can me find what's going on here. i using glassfish 4.0. error message eclipse when trying deploy application: deploy failing=error occurred during deployment: exception while loading app : cdi deployment failure:weld-001408 unsatisfied dependencies type [logger] qualifiers [@default] @ injection point [[backedannotatedfield] @inject protected learning.javaee.guestbook.unregistereduserpost.log]. please see server.log more details. cdi bean containing injection point: package learning.javaee.guestbook; import java.time.offsetdatetime; import java.util.logging.logger; import javax.enterprise.context.requestscoped; import javax.inject.inject; import javax.inject.named; @named @requestscoped public class unregistereduserpost extends abstractpost { private string name; private offsetdatetime datetime; @inject protected logger log; public

android - Alarm and Alarm Template table in clock app -

i little confused approach , , don't understand purpose of this. discovering default desk clock app android 4.4 have noticed weird. in clockdatabasehelper class there several tables created in database. // database , table names static final string database_name = "alarms.db"; static final string old_alarms_table_name = "alarms"; static final string alarms_table_name = "alarm_templates"; static final string instances_table_name = "alarm_instances"; static final string cities_table_name = "selected_cities"; so first string clear. second string why named old_alarms , real name of table alarms. why has such name ? , real puprose of this. next , third string has value "alarm_templates" ... why ? word "templates" represents ? why have such name ? instance table current state of alarm ...but still not clear me why can't write directly alarm table. please explain goal of doing stuf

php - Laravel how to delete a row from multiple tables in one query -

in question answers project, admin has functionality view questions , delete each 1 if wishes. 1 question id has 5 related tables. , each question id present in 5 tables in db , when admin deletes 1 question have delete entries these 5 tables based on question id. in controller db::table('user_questions')->where('question_id','=',$question_id)->delete(); db::table('masters_answers')->where('question_id','=',$question_id)->delete(); db::table('masters_questions')->where('question_id','=',$question_id)->delete(); db::table('question_to_category')->where('question_id','=',$question_id)->delete(); db::table('question_to_tags')->where('question_id','=',$question_id)->delete(); return redirect::action('admincontroller@anyshowquestions', array()); the above code works there way same procedure in 1 db query in laravel.? h

twitter bootstrap - custom btn-group class on td with less -

i want able use td btn-group, custom class cant work correctly markup <td class="actions"> <a href="/foo/bar" class="btn"><span class="fa fa-edit fa-lg "></span> edit</a> <a href="#" data-toggle="dropdown" class="btn btn-default dropdown-toggle"><span class="fa fa-caret-down fa-lg "></span></a> <ul class="dropdown-menu"> <li><a href="/foo/bar"><span class="fa fa-times fa-lg "></span> delete</a></li> <li><a href="/foo/bar"><span class="fa fa-times fa-lg "></span> delete</a></li> <li><a href="/foo/bar"><span class="fa fa-times fa-lg "></span> delete</a></li> </ul> </td> less td { &.actions { >

node.js - Starting Node/express project in terminal error -

i working on mean stack tutorial last night, https://thinkster.io/angulartutorial/mean-stack-tutorial/ , , working fine. morning when try start again keep getting npm error. says cannot connect localhost: 27017, connected port:3000 last night, , /bin/www code set 3000. i think error maybe in package.json file: "start": "node ./bin/www" not sure , need help. thanks. darraghs-macbook-pro:flapper-news dkdesign$ npm start > flapper-news@0.0.0 start /users/dkdesign/flapper-news > node ./bin/www events.js:72 throw er; // unhandled 'error' event ^ error: failed connect [localhost:27017] @ null.<anonymous> (/users/dkdesign/flapper-news/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/server.js:549:74) @ emit (events.js:106:17) @ null.<anonymous> (/users/dkdesign/flapper-news/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:150:15) @ emit (events.j

mongodb - mongoexport csv output last array values -

inspired question in server fault https://serverfault.com/questions/459042/mongoexport-csv-output-array-values i'm using mongoexport export collections csv files, when try target fields last members of array cannot export correctly. command i'm using mongoexport -d db -c collection -fieldfile fields.txt --csv > out.csv one item of collection: { "id": 1, "name": "example", "date": [ {"date": ""}, {"date": ""}, ], "status": [ "true", "false", ], } i can access first member of array writing fields following name id date.0.date status.0 is there way acess last item of array without knowing lenght of array? because following doesn't work: name id date.-1.date status.-1 any idea of correct notation? or if it's not possible? it's not possible reference last element of

php - m.example.com won't redirect properly -

i trying make pretty urls mobile site. have working site desktop, , give user option enter mobile version. i have php file called mobile.php in same dir index.php. parameters of sites same. parameters desktop version working fine, but. if enter m.example.com go desktop version, if enter m.example.com/something go mobile version. # changing www nonwww rewriteengine on rewritebase / rewritecond %{http_host} ^www\.(.*)$ [nc] rewriterule ^(.*)$ http://%1/$1 [r=301,l] #redirect mobile site rewritecond %{http_host} ^m.example.com rewritecond %{request_filename} !-f rewritecond %{request_uri} ^/([^/]+)/?([^/]*)?/?([^/]*)?/?([^/]*)?/? [nc] rewriterule ^(.*)$ mobile.php?site=%1&brand=%2&model=%3&repid=%4 [l] #redirect dekstop. rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewritecond %{request_uri} ^/([^/]+)/?([^/]*)?/?([^/]*)?/?([^/]*)?/? [nc] rewriterule .* index.php?site=%1&brand=%2&model=%3&repid=%4 [l] furthermor

javascript - Sample array at even intervals -

i have array size , i'm interested in fixed number of elements, evenly distributed. want 1000 elements. if there 1000 or less elements in array, want them all, that's easy. if there 2000 elements in array, want every second one. 3000 elements , i'd want every third one... , on. i'm having trouble implementing this. thought of using modulo , works round numbers. e.g. 2000 / 1000 = 2 simple if (n % 2 == 0) works here (so skip each element evaluates true). likewise 1200: excess 200 1200 / 200 = 6 if (n % 6 == 0) works. however, breaks down when number of elements divided excess isn't nice round number: elements = 2788 limit = 1000 factor = 2788 / (2788 - 1000) = 1.559288 here modulo operator won't work n % 1.55928 never going give remainder of zero. know how achieve this? i'm using javascript. thanks! what want uniform discrete distribution. because number of elements not divisible limit, want flexibility in limit keep

android - How to show my application first in list of application -

Image
actually today installed flashlight application .usually default android applications arranged alphabetically flashlight application displayed @ first in applications list idea how possible?.i curious know how so. use 'zero width space' followed 'normal space' first character. <string name="app_name">&#8203; zapp</string> you can use following well &#x200b; (html entity hex value)

Hiding dropdownlist in templatefield in gridview asp.net C# after insert into the database -

Image
i have problem, after value dropdown list picked up, inserted db hide dropdown list , show grade of product user rated, on 2 following pictures: this first picture showing how user needs insert grade db of product: the result after should following: the dropdownlist should invisible user rated product. have tried using rowdatabound event , following code: if (e.row.rowtype == datacontrolrowtype.datarow) { hsp_narudzbe_detalji_result k = (hsp_narudzbe_detalji_result)e.row.dataitem; if (k.ocjena!=null) { e.row.cells[4].text = k.ocjena; } } but doesn't works, shows grade once, , when press button grading product, dropdown list back... :/ can me out this? edit (aspx code of page): <asp:gridview id="griddetaljinarudzbe" autogeneratecolumns="false" allowpaging="true" pagesize="10" runat="server" onrowcommand=&

CSV Import with custom Identity Part Separator in RavenDb -

i'm preparing csv file imported ravendb, , have column named raven-entity-name specify collection documents have imported. this data used asp.net mvc app, , ravendb's default identity part separator ( / ) doesn't wreck havoc routes, define custom 1 on app's start-up: documentstore.conventions.identitypartsseparator = "-"; the csv import generates id's using default separator, there way can specify custom identitypartsseparator when importing csv file or manually generating id's on csv file option? no, there isn't. need load csv file using code control that.

javascript - Submenu under submenu display when hover on menu using bootsrtap -

Image
i trying create submenu under submenu.i using bootstrap 3.1. problem when mouse hover on menu(see image: hover on "what offer" ) submenu under submenu(from image link 4.1) display. should display when hover on link4 only. how can prevent this. 1 have idea? please share me. my codes below: <li class="dropdown"> <a href="/">what offer<span class="caret"></span></a> <ul class="dropdown-menu dropdown-menu-left"> <li> <a href="/static_pages/index">link1</a> </li> <li> <a href="/static_pages/index">link2</a> </li> <li> <a href="/static_pages/index">link3</a> </li> <li class="dropdown"> <a href="/stati

create and index views combined in 1 view -

i want able add players , upon addition in same want display them in table similar page index view offers. did combine index , create views in 1 page. but when debugging i'm have resource cannot found error. can 1 please correct i'm going wrong index view: @model ienumerable<sportsmania.player> @{ viewbag.title = "create"; } <h2>create</h2> @using (html.beginform()) { @html.antiforgerytoken() <div class="form-horizontal"> <h4>category</h4> <hr /> @html.validationsummary(true) <div class="form-group"> @html.label("player name") <div class="col-md-10"> @html.editor("player name") </div> </div> <div class="form-group"> @html.label("team") <div class="col-md-10"> @html.dropdownlist("team", viewbag.team se

gulp-ruby-sass plugin not caching Sass files -

how cache sass files gulp-ruby-sass ? seems should default option, that’s not happening. must missing something. while watch task runs, every time change in app/styles/main.scss , gulp-ruby-sass compile bootstrap's sass again unnecessarily, taking around 4-5 seconds . my app/styles/main.scss file looks this: // project defaults @import “my_project/variables"; // bower:scss @import "../bower_components/bootstrap-sass-official/vendor/assets/stylesheets/bootstrap.scss"; // endbower // ... the gulpfile.js generated on 2014-11-25 using generator-gulp-webapp 0.1.0 , linked master branch git repo. see gulpfile.js here styles function: gulp.task('styles', function () { return gulp.src('app/styles/main.scss') .pipe($.plumber()) .pipe($.rubysass({ style: 'expanded', precision: 10 })) .pipe($.autoprefixer({browsers: ['last 1 version']})) .pipe(gulp.dest('.tmp/styles')); }); .sass

android - Get fields[].getName() as accessible String? -

i'm working on small function loads files 'raw' folder , then, based on prefix, determines wether or not should saved in vector. in preparation 'level-loading' mechanic want use game i'm making. function have works: public void loadraws(){ field[] fields=r.raw.class.getfields(); for(int count=0; count < fields.length; count++){ stringstorage.add(fields[count].getname()); } for(int = 0; < stringstorage.size(); i++){ log.i("asset", stringstorage.get(i)); } } the log.i(); function neatly prints filename logcat. however, when try like: for(int = 0; < stringstorage.size()-1; i++){ message(stringstorage.get(i)); } to push message-box containing string, nullpointerexception. here's log: 11-19 14:08:51.881: e/androidruntime(4161): fatal exception: main 11-19 14:08:51.881: e/androidruntime(4161): process: com.example.whoops, pid: 4161 11-19 14:08:51.881: e/androidruntime(4161): java.lang.runtim

javascript - AngularJS with ui-router lost the concept of SPA? -

my question conceptual. when use ui-router ( docs ) in application, have system built of multiple views. right? i thinking that, because looking @ network log of chrome, every change view, client-side makes request server html files. well, definition of spa might vary, has nothing making requests backend. matter if browser needs full page reload make request. traditionally fill out form, submit , browser redirected new url. full page request spa application makes ajax request in background. on response changes url manually , changes state of application. there no full page request, javascript running in background but right suspecting wrong when there lots of http requests templates. not want application these requests server. avoid have precompile templates using tool grunt or gulp. example: grunt-angular-templates . insert templates in javascript code , angular grabs them there, instead of making backend request. during development though no problem. with

r - Strange "No documentation" error in ESS -

Image
if enter , eval following lines in emacs+ess: x = list() x$a = 1 x$aa = 2 then type x$ and wait autocompletion, ess prompt: no documentation 'x$a' in specified packages , libraries: try '??x$a' and file locked, in fact whole content disappear, can see error message. here screenshots: i using emacs 24 + ess 14.11 is there way solve problem?

calling a php file in another php file jquery elevatezoom doesnt work -

i beginner please bear me. i using jquery.elevatezoom.js zoom on images. it working fine, problem when name file showimage.php in dashboard.php using php's include function, jquery function defined in showimage.php not executing, not getting zoom. i have dashboard. when click on button, bound javascript function loads page in dashboard, , page getting loaded php file includes showimage.php . jquery.min called @ dashboard's load event. the dashboard has button when clicked loads php file first loads showimage.php using php's include function. here code showimage.php : <!doctype html> <html> <head> <meta charset='utf-8'/> <title>jquery elevatezoom demo</title> <script src='jquery.elevatezoom.js'></script> </head> <body> <h1>basic zoom example</h1> <img id="zoom_01" src='images/large/image1.jpg' width="250px" height="

sql server - SQL Bulk insert numeric values -

hi have problem sql bulk insert. i have .csv file i'm trying bulk insert numeric column. my column looks this: energikwh (numeric(15,3), null) my values .csv file int number there occurs x,xxx values. my bulk insert looks this: bulk insert energi 'c:\1990.csv' ( fieldterminator =';', rowterminator = '\n' ); go my error comming on first x,xxx value. "msg 4864, level 16, state 1, line 1 bulk load data conversion error (type mismatch or invalid character specified codepage) row 544, column 3 (energikwh)." please me.

php - How to search data based on having value in comma in codeigniter? -

i can search data based on if value of row single not separated comma. view code as <form id="search" class="form-horizontal" action="" method="post"> <td colspan="2"> <div class="form-group"> <input name="job_posted_date" id="job_posted_date" class="form-control" type="text" placeholder="posted date" value="<?php echo set_value('job_posted_date'); ?>"> </div> </td> <td colspan="1"> <div class="form-group"> <input name="job_skills" id="job_skills" class="form-control" type="text" placeholder="skills" value="<?php echo set_value('job_skills'); ?>"> </div> </td> <td colspan="2">

Accessing an arbitrary action in rails -

i confused how access action in rails controller not associated 1 particular model. routing file, default, seems routing action name "id". if type, say, /user/login, end error says: "couldn't find user 'id'= login" what proper way access arbitrary action names in rails? make route it, obviously. request goes way: first hits route from there hits controllers' action [an action may invoke model] (optional, common) controller specified view , fetches data render view sent in response request resource , resources might not obvious do. in fact, shorthands corresponding collections of routes used quite often, this resources adds . , they're not monoliths, can customised fit needs. providing options start, can provide block define custom action routes resource so: resources :users :login end this add /users/login route maps userscontroller#login , following rails' conventions. see guide more details , don't

php - mysql_fetch_array()/mysql_fetch_assoc()/mysql_fetch_row() expects parameter 1 to be resource -

i trying select data mysql table, 1 of following error messages: mysql_fetch_array() expects parameter 1 resource, boolean given or mysqli_fetch_array() expects parameter 1 mysqli_result, boolean given or call member function fetch_array() on boolean / non-object this code: $username = $_post['username']; $password = $_post['password']; $result = mysql_query('select * users username $username'); while($row = mysql_fetch_array($result)) { echo $row['firstname']; } the same applies code $result = mysqli_query($mysqli, 'slect ...'); // mysqli_fetch_array() expects parameter 1 mysqli_result, boolean given while( $row=mysqli_fetch_array($result) ) { ... and $result = $mysqli->query($mysqli, 'selct ...'); // call member function fetch_assoc() on non-object while( $row=$result->fetch_assoc($result) ) { ... and $result = $pdo->query('slect ...', pdo::fetch_assoc); // invalid

javascript - Accessing JSON data that has no labels -

var listcompleteinjections = [ {"05-06-2014",0.5}, {"16-06-2014",0.5}, {"20-06-2014",0.5} ]; this fragment of data receiving device. has key , value no labels denote same. unable access keys , values due absence of labels. please help. p.s. data corresponds "date" , "dosage". given json invalid. check this jsonlint or jsonviewer given string not json can not read data. if have unknown key->value pair can access json: var p = { "p1": "value1", "p2": "value2", "p3": "value3" }; (var key in p) { if (p.hasownproperty(key)) { alert(key + " -> " + p[key]); } }

python - Reading Two Input Files -

i have following problem statement: write program that: reads 2 inputs files populates 2 dimensional table integers contained in each file check size of 2 tables make sure both have same number of rows , columns. if tables not same size print error message once have read data each file create third table the elements in third table result of multiplying each element in first table corresponding element in second table: thirdtable [i] [j] = firsttable[i] [j] * secondtable[i] [j] i need know how put second file in code far.and how write code table three. here code first input file: def main(): print("table one") (row, column, table) = readinput() return() def readinput(): table = [] inputfile = open("table 1.txt", "r") # read first line containing number of rows , columns line = inputfile.readline() # split line 2 strings (row, column) = line.split() # convert strings int

c# - iTextSharp sign PDF created in MemoryStream -

i need dynamically create pdf file, use memorystream , itextsharp editing pdf. want digitally sign pdf file before sending browser. i've seen in sample project itextsharp has pdfsigner class, work. i've seen it, works this: pdfsigner signer = new pdfsigner(inputfilename, outputfilename, certificate, metadata); signer.sign(......) but memorystream, can't provide physical file name input or output either. code below: memorystream memorystream = new memorystream(); var document = new document(itextsharp.text.pagesize.letter, 40, 40, 60, 40); pdfwriter.getinstance(document, memorystream).closestream = false; document.open(); populatepdf(document, someid); document.close(); byte[] bytearray = memorystream.toarray(); memorystream.write(bytearray, 0, bytearray.length); memorystream.position = 0; return new filestreamresult(memorystream, "application/pdf"); my question how can use pdfsigner object sign document, giving pdfsigner takes strings - filenames a