Posts

Showing posts from April, 2011

how to pass two dimensional array to another function javascript -

i want header function main headers , sub headers 2 dimensional array. , pass array function.because want check print value exact match main header under subheader. i declare 2 dimensional array below function. this, var code = [[]]; headers function main headers assign subcategory , sub headers code. call 2 dimensional array this, if (tmp === free['b'][y].subcategory) { html += '<td hidden="true">' + free['b'][y].code + '</td>'; html += '<td>' + free['b'][y].code + '</td>'; ------------------------------------- code= [ free['b'][y].code]; -------------------------------------- // alert(code [code]); [cryspy,mmnuts cryspy,mmjhf cryspy,bbghr bar,ffata bar,yjkou.....etc] } else { html += '<td></td>'; h

sql - Counting occurrences of an id in a database table -

Image
i'm having trouble oracle database query , related subqueries. @ it's core, problem count number of times id 1 table occurs in table. the problem: have 2 tables, orders table, stores information on ordered items web service. data table run through process (which have no control over) , result placed fulfilled table. order numbers not unique 1 item. each order can have large number of items, , each item stored on line . items, however, can combo/package , process handles. item, game_pack example, can come orders table , out on other end comes out game1, game2, game3 , associated order number. the problem is, these items don't come out of process correctly , line_item may not associated fulfilled item. way can, resources available, determine if there issue getting maximum line_number , comparing number of fulfilled_item groups. what i've tried: @ first thought simple do, using rownumber() or denserank() analytical function on partition order number, has

ios - UIImageView height not height of child image's height after autolayout constraints. -

Image
my goal: image's width == width of screen. aspect ratio stays in tact, height adjust automatically. the height of uiimageview == height of child image's height. (what not working see below) i using xcode 6, autolayout constraints storyboard complete this. look @ following 2 screenshots see (1) app looks , (2) need fixed. as can see on left side of screenshot, have storyboard imageview selected. the imageview's width covering screen's width i have set background color black can see how imageview stretches it's height. look on far right side of screenshot see 3 constraints have set far. first 2 fit imageview on screen , last make sure goes below navigation bar. pretty normal constraints. so far looking @ screenshot, first 2 goals satisfied. image's width width of screen (you can see on iphone 4 preview in screenshot) , aspect ratio stays in tact. now, issue having... how rid of black space above , below image? black coming ima

validation - Best method to compare data between 2 different databases on separate servers -

we migrating data db2 database hadoop. migration running select * table1 on db2, exporting delimited file, taking file , putting hadoop. db2 , hadoop reside on different servers, different network. need run validation steps make sure data extracted db2 has entirely been imported hadoop. so, running select count(1) table1 on both systems not since have cases column values not imported due specific character issue(e.x. newline etc). what best method programmatically test data identical on both systems? p.s: both hadoop , db2 running on rhel, if linux specific tools helpful in process can included. not sure if "best" way, approach be: as 1 of previous posters has suggested, export data hadoop delimited file , run diff against db2 import files. easiest method. write simple utility connects both databases simultaneously, fetches data 2 tables compare, , compares result set. having googled bit, seems there utilities out there - example http://www.dbsolo.com/

javascript - x-editable (jQuery UI build) throws Uncaught TypeError -

consider following code: inside jquery document.ready : $.fn.editable.defaults.mode = 'popup'; $("#username").editable({ send: 'never', success: function(response, newvalue) { usermodel.set('username', newvalue); //update backbone model } }); html: <div class="editable"> <a href="#" id="username" data-type="text" data-pk="1" data-url="/post" data-title="enter username">superuser</a> </div> this throws uncaught typeerror: this.tip(...).find not function @ jqueryui-editable.js:4727 . i assume because of incompatibilities jquery ui version. how can around it? update: adding full example: <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <script src="https://code.jquery.com/jquery-1.11.3.min.js"></script> <link rel="s

html - Using color selector with example text -

i using <input type='color'> control on internal website. ( note: aware control not available in internet explorer . internal website used firefox , chrome.) the colour selected used create highlighting background-color behind black text, , have words "example text" within control, can instantly see whether there going contrast issues. for example, if select green in picker, see "example text" in black selected green background. is there way this? i'm not aware of attribute on control allow it. at first thought float text on top of it, of course stops button being clicked! (obviously following snippet work if you're using browser supports control .) .colorselector { border:1px solid #000; padding:0; margin:0; width:120px; background-color:#fff; } #divouter{ position:relative; } #divexample{ position:absolute; top:1px; left:20px; } without text:<br/> <input c

guava - What is the difference between java.util.Objects.equals and com.google.common.base.Objects.equals? -

is there reason use guava 1 istead of java.util implementation? java.util.objects , equals method exist since java 7. guava version predates it. if using @ least java 7, there's no reason use guava version.

excel - VBA Go to the next filtered cell -

i using following code: sub sendemail() dim objoutlook object dim objmail object dim rowscount integer dim index integer dim recipients string dim category string dim cellreference integer set objoutlook = createobject("outlook.application") set objmail = objoutlook.createitem(0) if activesheet.filtermode = true rowscount = activesheet.autofilter.range.columns(1).specialcells(xlcelltypevisible).cells.count - 1 elseif activesheet.filtermode = false rowscount = application.counta(range("a2:a" & rows.count)) - 1 end if ' in range("i1") there job category user wants email category = range("i1") if category = range("s2") ' cellreference amount of columns right of column a, ie column 0 cellreference below j - column location of email address according category cellreference = 10 elseif category = range("s3")

console - How do I redraw something that moves off screen? c# -

so created 'rectangular graphic' holds alphabet. thought remain @ top of 'viewable console' (like. . . scroll down user put in more text, etc. guess term 'floating' header.? here's code it, code 'alphabet' private static void headerfile() { console.clear(); firstcolumn = console.cursorleft; firstrow = console.cursortop; int header_height = 6; int columnnumber = console.windowwidth - 1; var xcoord = 0; var ycoord = 0; (int = 0; < columnnumber; i++) { headerwindow("-", i, 0); headerwindow("-", i, header_height); } (int = 0; < header_height; i++) { headerwindow("|", 0, i); headerwindow("|", columnnumber, i); } headerwindow("+", xcoord = 0, ycoord = 0); headerwindow("+", xcoord = columnnumber, ycoord = 0); headerwindow("+", xcoord = 0, ycoord = 6); headerwindow("+&

regex - Java regular expression to get a portion of a string -

i want portion of string contains 1 of targeted words. example, following example string: ... def a: ... target1 ... def b: ... def c: ... i want part: def a: ... target1 ... here java code: s = "(def\\w(.*)\\w(target1|target2|target3)\\w(.*)def\\w)"; pattern p = pattern.compile(s); matcher m = p.matcher(sourcestring); while(m.find()){ system.out.println(m.group(0)); } the problem not find out anything. thanks help! you can use: pattern p = pattern.compile( "(\\bdef\\s((?!\\bdef\\b).)*?\\b(?:target1|target2|target3)\\b.*?(?=sdef))", pattern.dotall); regex demo

prestashop 1.6 - Template Prestahop, intalation local windows -

i installed prestashop locally easyphp. installed release prestashop_1.6.1.0 , works default theme " default-bootstrap ". i bought new theme on addons: mytheme.zip , want install locally bo have problem. when downloaded mytheme.zip error appears few seconds (page on white background): warning: post content-length of 8547237 bytes exceeds limit of 8388608 bytes in unknown on line 0 ... nothing happens. return backoffice , theme not added. i not understand .. have idea ? thank ! 8388608 bytes 8m - default limit in php. have update post_max_size in php.ini larger value. post_max_size sets max size of post data allowed. setting affects file upload. upload large files, value must larger upload_max_filesize http://php.net/manual/en/ini.core.php

visual c++ - Building Boost with VS2015 -

Image
i trying update vs2013->vs2015, , need rebuild boost library files using vs2015. grabbed latest boost (1.58). default boost trying build vs2013. tried invoke bjam toolset=msvc-14.0 did not work, keeps saying: 'cl' not recognized internal or external command i guess doesn't know vs2015 located? know need change boost build vs2015? bluego tool builds boost using visual studio 2010/12/13/15. have start application, select configuration , hit build button- else works automatically. application downloads library, extracts , builds it. can downloaded here . screenshot of bluego: you need install common tools visual c++ 2015 described here . prebuild boost libraries vs2015 can found here . seem maintained.

inversion of control - Castle Windsor, overriding convention-registered components -

i started using castle windsor ( 3.3.0 ) first time , got stuck on convention based registration. i register as possible name convention ( idummyservice -> dummyservice ): var container = new windsorcontainer(); container.register(types.fromthisassembly().pick().withservicedefaultinterfaces()); container.register(component.for<idummyservice>().implementedby<dummyservice>().lifestylesingleton()); // long, i'm throwing here... ... of course able change of registered components little bit (changing life time management, constructor parameters etc.) because want keep registration simple be, avoid complex conditions. solution found simple - move custom stuff above name convention: var container = new windsorcontainer(); container.register(component.for<idummyservice>().implementedby<dummyservice>().lifestylesingleton()); // custom stuff first... container.register(types.fromthisassembly().pick().withservicedefaultinterfaces()); // , convention @

javascript - SSRS report not displaying in some browsers -

i have deployed report , having trouble displaying in google chrome , firefox, yet works fine in ie. the report has trouble when drilling down report via tablix cell click. drilled down report blank , doesn't display in chrome or firefox. upon inspecting html chrome in blank report have found report displays after clicking "toggle device mode" button/changing window size. any suggestions helpful. a quick fix install ie t ie tab chrome . helps again has issues things such calendar datetime selections. there known compatibility issues chrome , ssrs since ssrs designed used microsoft's internet explorer. aside creating own custom ssrs modules compatible chrome , firefox in .net, isn't 100%, permanent, guaranteed fix.

google app engine - Cannot deploy GAE + Cloud Bigtable to Managed VM -

i'm trying deploy this example google cloud. i'm following exact instructions, , got error saying error: (gcloud.preview.app.deploy) not enough vms ready (0/1 ready, 1 still deploying). deployed version: 20150723t080450.385919969320427256 when go cloud console -> app engine -> versions, did see new version deployed, size of version 0, , going module url returns 503 server error after waited 30 minutes. error: server error service requested not available yet. please try again in 30 seconds. i didn't modify in example except project_id , cluster_unique_id , etc. problem here?

php - Tidy up controller in Laravel 5.1 -

i'm setting laravel 5.1 project , i've been making progress have run in i'm struggling figure out. basically, have been creating objects insert in database in controller methods. hasn't been bad because they're one-liners. however, i've run in more complex db entry , controller has become little muddied. let me show you: /** * store new ticket specified project. * * @param int $id * @param ticketsrequest $request * @return response */ public function store_ticket($id, ticketsrequest $request) { $user_id = auth::user()->id; $project_id = $id; $project_tickets = ticket::whereprojectid($id); $project_ticket_id = $project_tickets->count() + 1; $ticket = new ticket; $ticket->user_id = $user_id; $ticket->project_id = $project_id; $ticket->project_ticket_id = $project_ticket_id; $ticket->title = $request->title; $ticket->save(); $ticket_update = new ticketupdate; $ticket_upd

java - Maven: Fatal error compiling: invalid target release: 1.8 -

we upgraded project jdk 1.6 jdk 1.8 . while building project in machine, i'm getting following error. [error] failed execute goal org.apache.maven.plugins:maven-compiler-plugin:3.3:compile (default-compile) on project exception: fatal error compiling: invalid target release: 1.8 -> [help 1] here maven compiler plugin been used <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-compiler-plugin</artifactid> <version>3.3</version> <configuration> <source>1.8</source> <target>1.8</target> </configuration> </plugin> i looked @ many post , of them related not having correct version configured java_home. verified of these aspects , couldn't find of them alarming. java version - qadeersmsiphone:main pdubey$ java -version java version "1.8.0_51" java(tm) se runtime environment (build 1.8.0_51-b16) j

sql server - Conversion failed when converting from a character string to a uniqueidentifier while importing table? -

i'm trying import table navicat sql server , error: [err] [row1] [imp] 42000 - [sql server]conversion failed when converting character string uniqueidentifier. [err] [row1] [imp] insert [edfi].[studentschoolassociation] ([studentusi],[schoolid], [schoolyear],[entrydate], [entrygradeleveldescriptorid], [entrygradelevelreasontypeid], [entrytypedescriptorid], [repeatgradeindicator], [schoolchoicetransfer], [exitwithdrawdate], [exitwithdrawtypedescriptorid],[residencystatusdescriptorid], [primaryschool], [employedwhileenrolled], [classofschoolyear], [educationorganizationid], [graduationplantypedescriptorid], [graduationschoolyear], [id], [lastmodifieddate], [createdate]) values ('89', '2', '2014', '1913-9-9', '133', null, '2184038928404', null, null, null, null, null, null, null, null, null, null, '1776&#

Error 0x80070585 when running Fastcgi with IIS 8 + Python 3.4 + Django 1.8 + Windows Server 2012 -

i trying set iis 8 django 1.8.3 using fastcgi , python 3.4. followed tutorial following environment variables: django_settings_module -> value: firstsite.settings pythonpath -> value: c:\inetpub\wwwroot\django\firstsite wsgi_handler -> value: django.core.wsgi.get_wsgi_application() i changed wsgi handler value django.core.handlers.wsgi.wsgihandler() django.core.wsgi.get_wsgi_application() because tutorial talks previous django version. i followed in tutorial, , try open website on ie browser in windows server 2012 r2 following error: keep in mind 8003 port configured tutorial showed. http error 500.0 - internal server error scriptprocessor not found in application configuration most causes: •iis received request; however, internal error occurred during processing of request. root cause of error depends on module handles request , happening in worker process when error occurred. •iis not able

meteor - Accessing data from outside events callback -

<template name="sidenav"> <ul class='block-items white'> {{#each blocks}} <li class='block-item'> <i class="fa fa-fw fa-folder"></i> <i class="fa fa-fw fa-folder-open"></i> <a href='#' class='block-item-link'> {{name}} ... {{/each blocks}} </template> given this, can access each block-item's id when it's clicked doing template.sidenav.events({ "click .block-item": function (e, tem) { //var blockitemid = this._id; } }); how can borrow same feature other places, onrendered() ? take @ following example: template.sidenav.onrendered(function() { this.$('.block-items').sortable({ update: function (e, ui) { _.each($('.block-item'), function (blockitem) { // how blockid? }) console.log("block item rearranged");

java - How to update neo4j from 2.1.5 to 2.2.3 in Spring? -

i needed update neo4j community version 2.1.5 version 2.2.3 use it's new features. worked , create database in it. now, when i'm trying run spring project, i'm getting errors: caused by: org.neo4j.kernel.impl.storemigration.storeupgrader$unexpectedupgradingstoreversionexception: 'neostore.nodestore.db' has store version number cannot upgrade from. expected 'v0.a.1' file version 'nodestore v0.a.5'. @ org.neo4j.kernel.impl.storemigration.upgradabledatabase.checkupgradeable(upgradabledatabase.java:80) @ org.neo4j.kernel.impl.storemigration.storemigrator.needsmigration(storemigrator.java:135) @ org.neo4j.kernel.impl.storemigration.storeupgrader.getparticipantseagertomigrate(storeupgrader.java:268) @ org.neo4j.kernel.impl.storemigration.storeupgrader.migrateifneeded(storeupgrader.java:143) @ org.neo4j.kernel.impl.nioneo.xa.neostorexadatasource.start(neostorexadatasource.java:344) @ org.neo4j.kernel.lifecycle.lifesupport$lifecycleinstance.start(lifes

javascript - Getting the file extension without knowing it's name -

i need know if there way retrieve real file extension without parse filename. in code split file using function split(filename, ".") last element of array function returns. now, if create .pdf file called, example test_file.pdf , previous method works perfectly, if rename file test_file (without extension) cannot retrieve extension if know file pdf. for example, if rename test_file.pdf text_file.jpg how can recognize file still pdf , not image file .jpg extension? i know if there way obtain information, maybe using file metadata or other information related file. i'm looking javascript solution because have check extension when upload file using form (client side) java solution fine, can me? thank in advance! look @ post , marked answer: get real file extension -java code i guess it's need.

It can make a modal popup window with just HTML and CSS? -

i interested know if can make modal pop-up window using html , css without jquery. does know such simple example? thanks in advance! a modal html , css no jquery or javascript body { color: #333333; font-family: 'helvetica', arial; height: 80em; } .wrap { padding: 40px; text-align: center; } hr { clear: both; margin-top: 40px; margin-bottom: 40px; border: 0; border-top: 1px solid #aaaaaa; } h1 { font-size: 30px; margin-bottom: 40px; } p { margin-bottom: 20px; } .btn { background: #428bca; border: #357ebd solid 1px; border-radius: 3px; color: #fff; display: inline-block; font-size: 14px; padding: 8px 15px; text-decoration: none; text-align: center; min-width: 60px; position: relative; transition: color .1s ease; /* top: 40em;*/ } .btn:hover { background: #357ebd; } .btn.btn-big { font-size: 18px; padding: 15px 20px; min-width: 100px; } .btn-close { color: #aaaaaa; font-size: 30px; text-decoration: none; pos

c - Why signal handling is malfunctioning? -

i have signal handling snippet somehow malfunctioning on mac , virtual linux box @ koding.com on office linux pc working..can please tell me why.. #include <stdio.h> #include <signal.h> #include <unistd.h> void my_isr(int n){ printf("hello world"); signal(sigint, sig_dfl); } int main(){ signal(sigint, my_isr); printf("pid = %d\n", getpid()); while(1); return 0; } when pressing ctrl+c not printing hello world on first time re-modifying sigint signal action & hence exiting program when press ctrl+c second time. can explain me why? you not allowed call every function in signal handler. read signal(7) . only async signal safe functions can called (directly or indirectly) from signal handler , , printf not such function. if want reliably "print" inside signal handler (which don't recommend), can use low-level write(2) syscall (it async signal safe). so you've got undefined behavio

Excel External Data Connection crashing on other users -

i have tool.xlsx file uses external data connection access db (both on network drive, available users proper access rights). have vbscript (code below) refreshes connections in workbook. works charm when running script when colleague runs it, throws no errors not connections refreshed. ideas? dim xlapp dim xlwkb set xlapp = createobject("excel.application") xlapp.visible = false xlapp.workbooks.open "\\networkpath\tool.xlsx" xlapp.displayalerts = false set wr = xlapp.workbooks.open("\\networkpath\tool.xlsx") wr.refreshall xlapp.visible = false wr.save wr.close and here connection string tool.xlsx workbook: provider=microsoft.ace.oledb.12.0;user id=admin;data source=\\networkpath\db.accdb;mode=share deny write;extended properties="";jet oledb:system database="";jet oledb:registry path="";jet oledb:engine type=6;jet oledb:database locking mode=0;jet oledb:global partial bulk ops=2;jet oledb:global bulk transactions=1;j

java - Is javax.servlet.ServletContext set/getAttribute thread safe? -

having use setattribute() , getattribute(string) in javax.servlet.servletcontext , cannot find information on intended behavoir concurrent access. however, these operations may called different threads. the servlet specification 3.0 states: a servlet can bind object attribute context name. attribute bound context available other servlet part of same web application. however, there no information on concurrency behavior of these operations. source code of apache tomcat reveals implemented concurrenthashmap , making thread-safe. my question is, should treat these operations not thread-safe , have application handle synchronisation, or there piece of information missing? you can safely assume can call getattribute , setattribute without synchronizing on anything, should make objects store there threadsafe (the easiest way being store things immutable). question linked in comments storing mutable object in servletcontext, in case threads using need acquir

java - Android - ImageView - Black Images on Galaxy Tab 2 -

Image
my application working fine on every single device except on galaxy tab 2. this how looks on galaxy tab 2: i have tried every single solution , it's still same ;/. imageview.setimageresource(songslist.get(position).geticonid()); <--- adding right resource id here , shows black image. i duplicated graphic hdpi/xhdpi/xxhdpi/xxhdpi folders , it's same. anyone have idea on what's wrong here? ;s my adapter: @override public view getview(int position, view view, viewgroup parent) { if (view == null) { layoutinflater inflater = (layoutinflater) context .getsystemservice(context.layout_inflater_service); view = inflater.inflate(r.layout.view_row, parent, false); } imageview = (imageview) view.findviewbyid(r.id.list_image); imageview.setimageresource(songslist.get(position).geticonid()); log.i("songbox", "" + songslist.get(position).geticonid()); return view; } view_row: <

Google Map Services(Places) returning error message "You have exceeded your daily request quota for this API." But I've used it just for a while -

i using google maps service (places, directions). after using while receiving response : { "error_message" : "you have exceeded daily request quota api.", "predictions" : [], "status" : "over_query_limit"}. i found link usage limits services when used google maps javascript api v3 . in link mentioned "places api allows 1,000 or 100,000 (if you're verified) requests per 24 hours." have not requested 200 times. there other reason response or there alternative rid of problem. in advance. usage limits google maps api web services yes. there possible reason getting "over query" message. , it's common problem. if make subsequent query requests quickly, google respond on query limit message posted. from google api spec usage limits exceeded if exceed usage limits over_query_limit status code response. this means web service stop providing normal responses , switch returning status c

junit - Testing spring bean with post construct -

i have bean similar this: @service public class { @autowired private b b; @postconstruct public void setup() { b.call(param); } } @runwith(springjunit4classrunner.class) @springapplicationconfiguration(classes = { application.class, config.class }) @webintegrationtest(randomport = true) public class test { @autowired b b; @before public void setup() throws exception { when(b.call(any())).thenreturn("smth"); } @test public void test() throws exception { // test... } } the problem postconstruct called before setup when test run. if want write unit test of a , don't use spring. instead, instantiate a , pass stub/mock of b (either using constructor injection or reflectiontestutils set private field). for example: @service public class { private final b b; @autowired public a(b b) { this.b = b; } @postconstruct public void setup() {

mysql - PHP UPDATE DATABASE error -

i have problem code. have update, doesn't update db, , don't know why.. can me? please? $query = "update company set name, address, latitude, longitude, about, cui, time, date, phone name=$name, address=$address, latitude=$latitude, longitude=$longitude, about=$about, cui=$cui, time=$time, date=$date, phone=$phone"; $result = mysql_query($query); this not correct syntax of update. correct structure of update statement is: update [table_name] set field_one = '$field_one', field_two = '$field_two' field_name = '$field_value' also, need add single quotes field values not int defined in database. updated query: $query = "update company set name = '$name', address='$address', latitude='$latitude', longitude='$longitude', about='$about', cui='$cui', time='$time', date='$date', phone='$phone' [add_your_condition] "; note: don't

ruby on rails - Change HTTPI SSL default cert file location with environment variable -

according this page can see httpi looking ssl certificate based on openssl::x509::default_cert_file constant: 2.1.5 :008 > openssl::x509::default_cert_file => "/usr/lib/ssl/cert.pem" my certificates elsewhere page says can change path ruby looks @ using environment variable ssl_cert_file . did in .bashrc: export ssl_cert_file=/etc/ssl/certs/ca-certificates.crt rails finds environment variable: 2.1.5 :007 > env['ssl_cert_file'] => "/etc/ssl/certs/ca-certificates.crt" but has no effect on openssl constant: 2.1.5 :008 > openssl::x509::default_cert_file => "/usr/lib/ssl/cert.pem" is page wrong effect of setting ssl_cert_file ? or constant never change , affects other setting? ultimately, certificate not being found, need know how / how inspect / how set it. first prize similar approach default set environment variable because not want hardcode path certificate. i don't know ruby part, experience

java - JamonAdmin in Different Servlet Container -

i have web application running on weblogic. has com.jamonapi:jamon:2.81 maven dependency. i'm using org.springframework.aop.interceptor.jamonperformancemonitorinterceptor aop configuration. every service/dao method call, jamon interceptor calculates statistics , stores them in memory. i setup jetty base deploying jamon.war , started it. can access via http://localhost:3162/jamon/jamonadmin.jsp however, shows local statistics. doesn't show statistics web application running on weblogic. did not suprise me since didn't configuration this. question how can magic configuration make jamon.war see statistics collected in web application running on weblogic. thanks. you need define jamon provided scope dependency in webapp's pom.xml. <dependency> <groupid>com.jamonapi</groupid> <artifactid>jamon</artifactid> <version>2.81</version> <scope>provided</scope> </dependency> this ens

python - For loop with embedded if statement list index out of range -

i have following python code: raw_list = reminders_context['data']['reminder_list'] this statement works fine , gets required info want. the following code gives me error list index out of range inner workings of loop eg.[i substitute 'i' value number, first 10 characters of list item [:10]], work fine when set trace in pdb mode. raw_list[i]['created'][:10] == raw_list[i + 1]['created'][:10] code gives error: for in range(len(raw_list)): if raw_list[i]['created'][:10] == raw_list[i + 1]['created'][:10]: del raw_list[i + 1] else: pass how can change not error? i have seen how list gets reduced in loop when iterating not know how implement in code. the article i'm referring here: python : list index out of range error how changing: for in range(len(raw_list)): into: for in range(len(raw_list)-1):

c# - Cannot Save Data in my database using a DataGridView -

i have made application can add,view,update , delete data database using datagridview. have made separate forms each operation using dgv. in update form i'm not able update or edit data dgv , data not stored in database dgv. please tell me correct code. code public update() { initializecomponent(); } sqlconnection sql_con; sqlcommand sql_cmd; sqldataadapter sql_ad; sqlcommandbuilder sql_cb; datatable dt; dataset ds; string connect_string; private void update_load(object sender, eventargs e) { datagridview1.refresh(); connect_string = @"data source=.\sqlexpress;attachdbfilename=c:\users\administrator\desktop\form\form\employeedb.mdf;integrated security=true;user instance=true"; // todo: line of code loads data 'ds_employeedb.emp_info' table. can move, or remove it, needed. this.emp_infotableadapter.fill(this.ds_employeedb.emp_info); string select_cmd = &qu

javascript - How to create a simple slider? -

i have build following carousel when reach last image or first image want go want show image needs show. example when reach last image when click right arrow show first image. have idea how improve this? https://jsfiddle.net/6nhuk7vm/ jquery(document).ready(function ($) { var currentposition = 0; var slidewidth = 1200; var slides = $('.slide'); var numberofslides = slides.length; var slideshowinterval; var speed = 7000; slideshowinterval = setinterval(changeposition, speed); slides.wrapall('<div id="slidesholder"></div>') slides.css({ 'float' : 'left' }); $('#slidesholder').css('width', slidewidth * numberofslides); $('#slideshow') .append('<span class="nav" id="leftnav"></span>') .append('<span class="nav" id="rightnav"&

How should I deal with these SNMP mib file parsing errors? -

i trying use mib files supplied cisco make sense info obtainend polling switch via snmp. it's sg300-52p, files can found here . after placed files in 1 of netsnmp's default mib directories, there multiple errors when tried decode 1 of description numeric value verify mib files work. thought resolving issues, numerous, decided try , simplest of these files work netsnmp. placed snmpv2-smi file in 1 of netsnmp's default mib directories (because came in errors , short file no dependencies; i've appended content easy reference) , ran following command: snmptranslate -m snmpv2-smi zerodotzero however, returns following 2 erros: expected last-updated (smi): @ line 35 in /home/buildmanager/.snmp/mibs/snmpv2-smi.my zerodotzero: unknown object identifier (sub-id not found: (top) -> zerodotzero) after googling , guessing, went ahead , checked file online mib file validator here , objected that line 34: 2 `smi' should start lower case letter 1 syntax erro

checkbox - Calling a function on an element inside xeditable form -

i have x-editable form several fields in it. i've show checkbox field here brevity. there edit button opens of elements editing , when click submit of elements saved. while in edit mode want able call function when checkbox clicked before submitting form. validation make sure user wants uncheck box. want prevent default behavior of checkbox , display dialog confirmation. simple regular checkbox can figure out how x-editable . ng-click doesnt seem work. can see example e-onclick works built in functions alert() , console.log(). <form editable-form name="tableform" onaftersave="save()"oncancel="cancel()"> <table> <tr> <th>active:</th> <td> <span editable-checkbox="user.active" e-form="tableform" e-onclick="console.log('test')"> {{user.active)}} </span> </td>

php - Present on an insecure (http://) my local site -

Image
in wordpress local site generating error given below need fix. please suggest me should do? error password fields present on insecure (http://) page. security risk allows user login credentials stolen.

amazon web services - How to use webpack import aws-sdk -

i found issues in official, looks refused answer. can ask questions on so. here error&warning log: warning in ./~/aws-sdk/lib/util.js critical dependencies: 40:30-45 request of dependency expression 43:11-53 request of dependency expression @ ./~/aws-sdk/lib/util.js 40:30-45 43:11-53 warning in ./~/aws-sdk/lib ^\.\/.*$ module not found: error: cannot resolve directory '.' in /users/me/documents/sources/my-project/client/node_modules/aws-sdk/lib @ ./~/aws-sdk/lib ^\.\/.*$ warning in ./~/aws-sdk/lib/api_loader.js critical dependencies: 13:15-59 request of dependency expression 104:12-46 request of dependency expression 108:21-58 request of dependency expression 114:18-52 request of dependency expression @ ./~/aws-sdk/lib/api_loader.js 13:15-59 104:12-46 108:21-58 114:18-52 warning in ./~/aws-sdk/lib/region_config.json module parse failed: /users/me/documents/sources/my-project/client/node_modules/aws-sdk/lib/region_config.json line 2: unexpected token : may need

python - "WindowsError: access violation 000001" on DispatchMessageW in EventLoop -

i research python internals , write gui generic windows use windows api. # -*- coding: utf-8 -*- import time import threading import logging import uuid import ctypes import ctypes.wintypes import const int = ctypes.wintypes.c_int lpvoid = ctypes.wintypes.c_void_p hcursor = ctypes.wintypes.handle lresult = ctypes.wintypes.lparam colorref = ctypes.wintypes.dword pvoid = ctypes.wintypes.c_void_p wchar = ctypes.wintypes.c_wchar bchar = ctypes.wintypes.c_wchar lprect = ctypes.wintypes.pointer(ctypes.wintypes.rect) lppoint = ctypes.wintypes.pointer(ctypes.wintypes.point) lpmsg = ctypes.wintypes.pointer(ctypes.wintypes.msg) uint_ptr = ctypes.wintypes.handle long_ptr = ctypes.wintypes.handle #wndproc = ctypes.wintypes.winfunctype(ctypes.c_long, ctypes.wintypes.hwnd, ctypes.wintypes.uint, ctypes.wintypes.wparam, ctypes.wintypes.lparam) wndproc = ctypes.wintypes.winfunctype(ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_int) sw_shownormal = 1 sw_show = 5 cs_hre