Posts

Showing posts from February, 2010

proxy - IP addresses and detection of bot/spam traffic -

proxy - IP addresses and detection of bot/spam traffic - i trying observe bot traffic application using list of session ips. the simplistic solution find occurrences of identical ips , if number of these beyond threshold, that traffic coming bot. i got myself thinking , doing research , questioning: could traffic coming single ip coming multiple users hiding behind subnet or proxy? in case not beingness bot? (also dont understand how subnetting or proxies work, gentle.) there more visit ip, , possible different visitors same ip (especially if visitor using dial-up connection) the way grab bots process of elimination obvious probable if useragent empty if useragent short or not descriptive if useragent contains obvious signatures or rogue bots don't want accessing site if visitor's average pageview remain on page less 3 sec bot in case bounce hit and not obvious i record ip, timestamp , useragent of every visit 30 min. , compare every new vis

asp.net mvc - Cookie expires or session timeout too soon -

asp.net mvc - Cookie expires or session timeout too soon - i have code run when user authorized: formsauthenticationticket authticket = new formsauthenticationticket( 1, email, datetime.now, datetime.now.addminutes(120), true, userdata); string encticket = formsauthentication.encrypt(authticket); httpcookie facookie = new httpcookie(formsauthentication.formscookiename, encticket); facookie.expires = authticket.expiration; response.cookies.add(facookie); i redirect controller/action has authrize attribute: [authorize] public class productscontroller : controller { i have next in web.config: <authentication mode="forms"> <forms loginurl="~/home/unauthorized" timeout="2880" /> </authentication> <sessionstate timeout="120"></sessionstate> h

php - how to force magento to use my custom price -

php - how to force magento to use my custom price - hi , reading, i'm working on magento ee 1.13, here added new cost fields product edit page (offer cost , deal price) beside original cost , special cost fields. , here problem come: need create magento utilize deal cost or offer cost when set, find complicated , not easy find. think maybe can override addfinalprice method or override getfinalprice method, i'm not sure if it's right, need help guys in this. thought appreciated, in advance. update: there way save final cost in database after saving finishing editing product? you need add together observer on event catalog_product_get_final_price. please check below answer. magento : add together product cart custom price php magento

python - "Connection aborted" and "Cannot connect to proxy" -

python - "Connection aborted" and "Cannot connect to proxy" - when code bellow running import requests monitor_r = requests.get(monitor_url, proxies=proxies, timeout=60*4) i these exceptions: ('connection aborted.', badstatusline("''",)) # , ('cannot connect proxy.', error(32, 'broken pipe'))) what these errors , how prepare them? this link suggests caused @ httplib level. it may caused trying connect https url using http seek using https:// , see if works... double check url doesn't contain dodgy characters check proxy accepting headers python python-requests

list - WPF MVVM: View's ListBox with source deep in Model. How to implement? -

list - WPF MVVM: View's ListBox with source deep in Model. How to implement? - i'm new wpf. need bind ui's listbox source deep in model layer. app scheme on image below. desc: my mainwindowviewmodel class has scheduler property ( scheduler class in model layer). scheduler class has currentparser property ( parser class in model layer). parser class has result field ( parserresultmetadata class in model layer). parserresultmetadata class has log field ( log list(of string) ) log can changed programmatically model layer (parser adds lines during it's work). so question how can bind listbox list match mvvm pattern. now, viewmodel must have observablecollection(of string) witch re-create of list(of string) model layer. somehow need notify ui when line added collection. there multiple ways accomplish this, if collection modified within model layer, need mechanism communicating other layers in 1 way or another. use observablecolle

Java GradeCalculator - While loop not working correctly -

Java GradeCalculator - While loop not working correctly - i'm writing programme user enters number of students in class, number of exams taken in class, enters each student's names , exam scores. programme calculates student's grade , assigns them corresponding letter grade. finally, adds scores classsum, calculates average class score , displays it. this have far: public class gradecalculator { public static void main(string[] args) { int classsum = 0; // variable used hold sum of entire classes exams int classexams = 0; // variable used hold number of exams taken whole class scanner s = new scanner(system.in); system.out.println("welcome gradecalculator!"); system.out.println("please come in number of students:"); int students = s.nextint(); system.out.println("please come in number of exams:"); int exams = s.nextint(); int = 0;

python - Django __unicode__ still not work for me -

python - Django __unicode__ still not work for me - i utilize django1.6 , python2.7, have next in models.py. class recommend(models.model): id = models.integerfield(primary_key=true) master_id = models.integerfield() movie_id = models.integerfield() enable = models.textfield() # field type guess. class meta: managed = false db_table = 'recommend' def __unicode__(self): homecoming u'%s %s' % (self.id, self.master_id) however, result still >>> movies.models import recommend >>> recommend.objects.all() [<recommend: recommend object>] >>> i've checked django tutorial unicode not working , `__unicode__()` add-on not working in basic poll application in django tutorial, trouble _unicode() method in django, python 2.7__unicode__(self) not working. none did work me. use this from __future__ import absolute_import, partition django.db import models django.utils.en

agile - Providing Estimates on Large/Complex Projects -

agile - Providing Estimates on Large/Complex Projects - are there standards/guidelines outline techniques estimating big scale projects? looking responses address big scale projects. big company experiences best. the book "software estimation: demystifying black art" steve mcconnel covers question , gives references many big companies , publications related experiences , approaches in area. agile estimation

Creating a CSV export from SQL Server 2012 (maybe with report builder) but none standard format -

Creating a CSV export from SQL Server 2012 (maybe with report builder) but none standard format - using illustration query need csv file has header info in line 1, body info in line(2) 2 onwards. salesid,custaccount,customerref,deliveryname,email linenum,itemid,name,salesqty,salesprice,createddatetime select st.salesid, st.custaccount, st.customerref, st.deliveryname, st.email, sl.linenum,sl.itemid,sl.name, sl.salesqty, sl.salesprice, sl.createddatetime salestable st inner bring together salesline sl on st.salesid = sl.salesid st.dataareaid 'fr' , st.salesid '%' , st.custaccount '%' , sl.itemid '%' sql csv reportbuilder

javascript - edit jquery-knob counter to display fraction of second -

javascript - edit jquery-knob counter to display fraction of second - i create time counter using knob: $(function($) { $(".knob").knob({ 'fgcolor': '#b9e672', 'thickness': 0.3, 'width':150, 'data-min': 0, 'data-max': 30, 'readonly': true }); var initval = 30; $({value: 0}).animate({value: initval},{ duration: 10000, easing:'swing', step: function() { $('.knob').val(this.value).trigger('change'); } }); }); i want display counter in milliseconds, picture: how this? thanks, you can utilize step alternative chose step update in knob value. there useful thing can do, set draw function. draw function deter

sql - How to compare row with a column? -

sql - How to compare row with a column? - create table table1( column1 varchar (100), column2 varchar (100) ) go create table table2( column_for_compare varchar (100) ) go insert table2 values ('column1') insert table2 values ('column2') go i want check if table1 columns name exists in table2 ,something this: --this should comparing row values in table2 column names in table1 if exists(select column_for_compare table2) , if exists(select column_name syscolumn key bring together systable table_name ='table1') begin print 'match found' end i hope can see im trying...if not...if seek explain better you can query user_tab_columns table collumn names select column_name user_tab_columns table_name = 'table1' and bring together result table2 select * table2, (select column_name user_tab_columns table_name = 'table1') cnames table2.column_for_compare=cnames.column_name this table

httprequest - Request line in HTTP request can be case sensitive? -

httprequest - Request line in HTTP request can be case sensitive? - what if give request request line in upper case & request request line in lower case, server respond same response in both instances. all parts of request line case-sensitive. lowercasing method name create different (unknown) method. lowercasing protocol name create request invalid. lowercasing url create request different resource. http httprequest httpresponse

How do I statically compile a C library into a Haskell module that I can later load with the GHC API? -

How do I statically compile a C library into a Haskell module that I can later load with the GHC API? - here desired utilize case: i have bundle single module reads hdf5 files , writes of info haskell records. work, library uses bindings-hdf5 package. here cabal's build-depends . reader-types module wrote defines types of haskell records contain read-in data. build-depends: base of operations >=4.7 && <4.8 , text , vector , containers , bindings-hdf5 , reader-types note cabal file not utilize extra-libraries or ghc-options . can load module, src/mabel.hs in ghci long specify required hdf5_hl library: ghci src/mabel.hs -lhdf5_hl -l/long/nixos/path/lib and within ghci, can run function fine. now, want compile library/module single, compiled file can later load ghc api in different haskell program. single file, mean needs

regex - C# regular expression for the string format. Examples: "400-900", "499-999,0-99" -

regex - C# regular expression for the string format. Examples: "400-900", "499-999,0-99" - this question has reply here: regex optional groups? 3 answers the regular expression: "^\d{1,3}-\d{1,3}$" works onetime pattern i.e. "400-900" regular look ? not working repetition i.e. "^\d{1,3}-\d{1,3}$?" not identifying string "499-999,0-99". any suggestions, regular look be? change pattern below match strings has repetation. @"^\d{1,3}-\d{1,3}(?:,\d{1,3}-\d{1,3})?$" demo c# regex

javascript - Store user data in CANNON.Body for later use? -

javascript - Store user data in CANNON.Body for later use? - is possible store user info in cannon.body object later use? example: var ballbody = new cannon.body({ mass: 1 }); ballbody.userdata = { name: 'tester' }; // ... world.add(ballbody); // ... player.addeventlistener('collide', function(e) { console.log(e.contact.bi.userdata.name); // ==> tester }); i figured out! info saved , kept in e.body.userdata in collide event. javascript cannon.js

c# - How to get Url from server side -

c# - How to get Url from server side - this question has reply here: how url hash (#) server side 6 answers is there way on getting current url in mvc same in code in window.location.href, can manage content?, problem i have url https://mylink.com/data?#address=ph want address value. problem is, when tried url doing request in controller, https://mylink.com/data get, querystring empty. my codes: public string data() { var url = request.url; var addr = url.indexof('#') > -1 ? url.substring(url.indexof('#'),url.length): ""; homecoming addr; } any suggestion accepted, give thanks 1 time again in advance the problem querystring is empty. # , after known fragment , clientside thing. in general not sent server. if need info here on server chances should in querystring instead of fragment. c# asp

sql - MySQL Compare start and finish time -

sql - MySQL Compare start and finish time - i trying create booking system, mysql table has row class="lang-none prettyprint-override"> room id | start (datetime) | | finish(datetime) 13 2014-10-20 08:30 | 2014-10-20 18:30 and want block entries between these start , finish class="lang-none prettyprint-override"> eg: room id: 13 start: 2014-10-20 10:30 finish: 2014-10-20 12:30 to have wrote mysql query, is sql correct? class="lang-sql prettyprint-override"> select * rooms room_id='13' , ('2014-10-20 12:30:00' <= start_time or '2014-10-20 10:30:00'>=finish_time) in here tried skip between result, please advise me. you want between start time , finish time means didn't test 1 time can seek this..i hope works select * rooms room_id='13' , ('2014-10-20 12:30:00' >= start_time , '2014-10-20 10:30:00'<=finish_time) mysq

go - Reduce array length -

go - Reduce array length - am trying merge 2 string array one. resulting array should have duplicates element removed. func mergearrays(str1, str2 []string) []string { c := make([]string, len(str1)+len(str2), cap(str1)+cap(str2)) k := make(map[string]bool) i, s := range str1 { if _, ok := k[s]; !ok { c[i] = s k[s] = true } } j, s := range str2 { if _, ok := k[s]; !ok { c[j+len(str1)] = s k[s] = true } } homecoming c } test data str1 := []string{"a", "b"} str2 := []string{"c", "d", "a"} output: "a", "b", "c", "d" length of array "5" am getting output want, length of array should 4 , not 5 . can understand why prints 5 , want output array of length 4 . there other way merge 2 arrays. start length of 0 , add together 1 when append element. example, pa

c - My program segfaults -

c - My program segfaults - i've been working on programming assignment seems forever now, , have yet figure out error. every time compile programme input file segmentation fault (core dumped) error. i'm assuming 1 of pointers pointing unallocated space, have no thought one. steer me in right direction? #include <stdio.h> #include <stdlib.h> #include <strings.h> #include <sys/time.h> #define false 0 #define true !false int problem_size; int merge (long long int *numbers, int first, int last, int firstone, int lastone) { long long int arrayone[problem_size]; long long int arraytwo[problem_size]; int x,y; (x=0; x<last; x++) arrayone[x] = numbers[x + first]; (y= last; y< lastone; y++) arraytwo[y - firstone]; int = 0; int j = 0; int k = first; while ((i< last-first) && (j< lastone - firstone)) { if (arrayone[i] <= arraytwo[j]) { numbers[k]

javascript - Use Camera in Cordova? -

javascript - Use Camera in Cordova? - i building cordova app. supports 2 platform (ios , android). in have show photographic camera in given frame of app. below frame of camera, there button named "click". when click button, showing things in photographic camera should captured , saved gallery. there should slide bar on left of camera. using slider, 1 can zoom in or zoom out camera. currently have tried "org.apache.cordova.camera" http://plugins.cordova.io/#/package/org.apache.cordova.camera. but, don't know how nowadays photographic camera in given frame. invoking default photographic camera app , photographic camera opening in total screen. please suggest me plugin or method. thanks. i'm not sure displaying in frame, typically when utilize photographic camera plugin fires native photographic camera leaving you're app until user either exits or takes picture. @ stage can handle response data. so example, have button, link or

go - How can I get unique record from mongodb? -

go - How can I get unique record from mongodb? - i have collection named 'myplace'. has next fields: place_name, latitude, longitude, city, country. i want cities start letter "a". tried following: type place struct{ city string `bson: "city"` } for retrieving result db: var city_name []place err = coll.find(bson.m{"city": bson.m{"$regex":"^a", "$options":"si"}}).all(&city_name) it's getting results. problem of 'myplace' documents have same city, it's returning duplicate city names. let's have 5 myplaces, 3 city name "baton rouge" , remaining having "trivandrum, kochi". when seek city starting "b", it's returning "baton rouge" 3 times. how can ensure each city_name unique? thanks in advance you can utilize distinct method, in shell : db.foo.distinct( "city", { "city" : { "$re

JavaScript native Promise execute callback on both results -

JavaScript native Promise execute callback on both results - is there way execute callback on both results of promise object? for illustration want create cleanup logic after execution of xhr request. need this: var cleanup = function() { something.here(); } mylib.makexhr().then(cleanup,cleanup); in jquery defered illustration can utilize method always(): mylib.makexhr().always(function() { something.here(); }); does promise back upwards this? no, there none. discussed spec minimal. doesn't include bunch of other functionality. it's designed interoperate library promises , provide simple functionality. here right polyfill of proposal made stefpanner. moreover, disagree current deleted answers adding because they're doing wrong (as enumerable property - no fun). if ignore homecoming values , error state of returned promise. intended way extend native promises subclassing them, sadly, no browsers back upwards yet we'll have wait.

asp.net mvc - How create different cookies for one application that runs in iframe in different websites for every website -

asp.net mvc - How create different cookies for one application that runs in iframe in different websites for every website - my mvc 4 web application running in iframe , run in different websites, have problem when open application in different client websites in same browser same info because app has cookie of app created on first open . need have different cookies app different clients , don't want utilize cookieless=true because causes other issues asp.net-mvc asp.net-mvc-4 iis web-config

HTML/XSL/CSS counter(pages) not working -

HTML/XSL/CSS counter(pages) not working - i have read lot how utilize pages counter css in footer page. demand build 'printing' (scuse english) document displays current , total count of pages in footer of every page. early answers using: /* page configuration */ @page { counter-reset: page; } /* da footer */ .class_name:before { counter-increment: page; content: "page " counter(page) " of " counter(pages); } will automatically load pages counter preset in css. in fact, 'page' counter working total 'pages' isn't. in bunch of forums , etcetera have read, ensures 'pages' predefined in css not me. somebody knows why? additionally create test using 2 different classes <span class="page-number"/><span class="page_count"/> as described in w3c explanation pages count works in first page thanks! html css xml xslt

installation - Ubuntu OpenVZ Kernel panic error when booting -

installation - Ubuntu OpenVZ Kernel panic error when booting - i want utilize openvz on ubuntu 14.04 trusty platform. installed rhel6 2.6.32 kernel (vzkernel_2.6.32-042stab093.5_amd64 kernel) next instructions given in installing , using openvz on ubuntu 13.04 (amd64) when machine booted vzkernel_2.6.32, next error: "kernel panic - not sysncing: fatal exception" and boot freezes. however, can interrupt booting , select original ubuntu kernel , machine boots fine. please see attached screen shots. screen shot of kernel panic boot error boot menu: imgur.com/5vjbzuj hardware: dell poweredge t105 (quad core cpu, 8 gb ram) os: ubuntu 14:04 (trusty) 64-bit uname -r: 3.13.0-39-generic i have installed next components openvz: ploop-1.12.1-1.x86_64.rpm vzctl-core-4.8-1.x86_64.rpm ploop-lib-1.12.1-1.x86_64.rpm vzkernel-2.6.32-042stab093.5.x86_64.rpm vzctl-4.8-1.x86_64.rpm vzquota-3.1-1.x86_64.rpm i used next steps installation: $ sudo dpkg -i vz*.

python - Make list of unicode words that are in a file -

python - Make list of unicode words that are in a file - my code is f = codecs.open(r'c:\users\admin\desktop\nepali.txt', 'r', 'utf-8') nepali = f.read().split() in nepali: print display words in file: यो किताब टेबुल मा छ यो एक किताब हो केटा but when seek create list of words code: file=codecs.open(r'c:\users\admin\desktop\nepali.txt', 'r', 'utf-8') nepali = list(file.read().split()) print nepali the output displayed this [u'\ufeff\u092f\u094b', u'\u0915\u093f\u0924\u093e\u092c', u'\u091f\u0947\u092c\u0941\u0932', u'\u092e\u093e', u'\u091b', u'\u092f\u094b', u'\u090f\u0915', u'\u0915\u093f\u0924\u093e\u092c', u'\u0939\u094b',] the output should like: [यो, किताब, टेबुल, मा, छ,यो, एक, किताब, हो] you looking @ output of repr() function, used displaying contents of containers. output meant debugging, not end-user displays. y

hover image effect with angularjs directive -

hover image effect with angularjs directive - i seek utilize client jquery.hover create background effect when hovering news item. set in directive index.html <!doctype html> <html xmlns="http://www.w3.org/1999/xhtml" ng-app="myapp"> <head> <title></title> <base href="/"> <script src="//cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.0/angular.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.11.0/jquery.js"></script> <script src="jquery.hoverdir.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/modernizr/2.8.3/modernizr.js"></script> <style> .da-thumbs { list-style: none; position: relative; margin: 30px auto; padding: 0; } .da-thumbs li { float: left; position: relative; width: 320px; height: 320px;

javascript - jquery and a value of a var -

javascript - jquery and a value of a var - i wrote code in jquery, it's working perfectly, need index value begin @ 1. how can this? code: $( "span.text" ).each(function( index ) { console.log( index + ": " + $( ).attr('name') ); var micaracter= $(this).attr('name'); $( "span.lista a#caracter_" + index).append(micaracter); }); then native programming method, add together 1 0 based index, $( "span.lista a#caracter_" + (index + 1)).append(micaracter); javascript jquery

generics - c# how can I compare type of template type to builtin type on runtime -

generics - c# how can I compare type of template type to builtin type on runtime - that code doesn't compile, has thought how write logic correctly? public void filbuff<t>(t p_tinput) { if(typeid(p_tinput )== typeof(string)) { m_bbuff = system.text.encoding.ascii.getbytes((string)p_tinput); } } use typeof(t) . this: public void filbuff<t>(t p_tinput) { if(typeof(t) == typeof(string)) { m_bbuff = system.text.encoding.ascii.getbytes((string)p_tinput); } } as aside, doing generics (not templates) little odd. might improve utilize overloaded method in case. c# generics runtime

Print specific string 123456789 to a specific format 12xxxxx89 in PHP -

Print specific string 123456789 to a specific format 12xxxxx89 in PHP - i want print string in specific format : <?php $var = "123456789"; echo $var; //expected output 12xxxxx89; ?> want show first 2 , lastly 2 characters string , show others in x format.how can ? easy echo substr_replace($var, str_repeat('x', max(strlen($var) - 4, 0)), 2, -2); this should handle strings @ or below 4 characters in length too. demo ~ eval.in links functions: substr_replace() str_repeat() strlen() max() php string

c - What would be a good protocol for concurrently accessing a file in linux/unix -

c - What would be a good protocol for concurrently accessing a file in linux/unix - given fact want create service allow multiple clients access , modify file @ same time, suggest protocol doing this? i've searched on google didn't found looking for. forgot. want implement server , clients utilize in linux/unix environment. c linux sockets unix protocols

Run application script in .bat file in task scheduler is not working -

Run application script in .bat file in task scheduler is not working - what missing in script below not create run needed application?? runas /env /user:administrator "manager.exe" when double click .bat file requests password, how embed admin password in above command ?? any thought ?? you don't need run admin . configure task utilize administrator business relationship below. in task scheduler -> double click on task -> in opened task window left pane select properties . open below window. there, click on change user or group button , select admin account. batch-file scheduled-tasks

php - switch xampp version from 1.6.8 to xampp 1.8.3 error -

php - switch xampp version from 1.6.8 to xampp 1.8.3 error - i made website using xampp version 1.6.8 , install new version of xampp 1.8.3 login code worked on 1.6.8 doesnt work on 1.8.3. the error parse error: syntax error, unexpected end of file in c:\xampp\htdocs\karimunjawa\admin\ceklogin.php on line 61 the line 61 is </html> ceklogin.php <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>login</title> <?php //session_start(); include "../include/koneksi.inc"; if(isset($_post['login'])) { $username = $_post['username']; $password = $_post

javascript - Karma Coverage + RequireJS: Misleading coverage reports -

javascript - Karma Coverage + RequireJS: Misleading coverage reports - today i've integrated karma coverage existing requirejs application. added karma-requirejs plugin , able coverage reports. initially study good, 100% coverage. when analyzed results noticed lot of missing files "src" folder led extremely report. it turns out coverage applying analysis "src" files have corresponding spec (because utilize require('somefilefromsrcfolder') within spec). question: there way coverage analyze files "src" folder? karma-conf.js module.exports = function (config) { config.set({ basepath: '../', autowatch: true, singlerun: false, frameworks: ['jasmine', 'requirejs'], browsers: ['phantomjs', 'chrome'], loglevel: config.log_error, files: [ {pattern: 'vendor/**/*.js', included: false}, {pattern: 'vendor

python generate ip's to selected files number -

python generate ip's to selected files number - i want generate whole ip range , write many files user want this how many files : 9 ip range : 100 i want split ip range 100.0.0.0 - 100.255.0.0 9 files 1.txt , 2.txt ... etc , write result files ... , remainder want write them in lastly file result :- file1: 100.0.0.0 100.1.0.0 100.2.0.0 100.3.0.0 ... 100.27.0.0 file2: 100.28.0.0 ... 100.55.0.0 , finish 9 files i'm writing code process don't know how generate ip numbers iprange = int(raw_input("ip range : ")) count = int(raw_input("how much files want create ? \n")) ipnum = 256 / count extra=256%count ipnum [-1]=ipnum [-1]+extra i,g in enumerate(ipnum): open('ip{0}_{1}'.format(iprange,(i+1)), 'w') fout: fout.writelines(?????) any help your schema want split not create total sense me. maybe can provide improve example. also, python's netaddr module help you. python file text ip

selenium - Element is not clickable when another element covers it -

selenium - Element is not clickable when another element covers it - i writing test @ point navigates page. first thing page run javascript pops span message. after seconds, span dissapear. i trying click link go below span , chromedriver not seem allow that. system.invalidoperationexception: unknown error: element not clickable @ point (165, 177). other element receive click: ... this expected behavior , bit impresssive. can click link without waiting span dissapear? i have no suggestion how click element long massage displayed skip waiting disappear removing on own using javascript , webdriver.executescript: how create div visible , invisible javascript selenium selenium-webdriver webdriver selenium-chromedriver

XML deserialization in actionscript -

XML deserialization in actionscript - i making adobe premiere cc extension in actionscript3, loads xml file file dialog. and want deserialize xml file custom object, using simplexmldecoder // loads info input xml file chosen file dialog var xmldoc:xmldocument = new xmldocument(loadfile.data.tostring()); var decoder:simplexmldecoder = new simplexmldecoder(true); //decode input file var data:object = decoder.decodexml(xmldoc); (1) i have little test xml file: <?xml version="1.0" encoding="utf-8"?> <p> <data> (first data) <name>video1</name> <duration>250</duration> <fps>24</fps> <files> <cfile> <filename>file 1</filename> <meta>1</meta> </cfile> </files> </data> <data> (second data) <name

c++ - Makefile in the Root Directory of a Project "no Input Files" -

c++ - Makefile in the Root Directory of a Project "no Input Files" - i'm having issues getting makefile work simple c++ project. error getting is "fatal-error: no input files" here project structure: root | |___makefile | |___bin | |___src | | | |___main.cpp | |___include | |___gl | | | |___glew.h | |___glfw3.h | |___glm | |___glm.hpp and here makefile: cc = g++ inc_dir1 = include/gl inc_dir2 = include/glm src_dir = src obj_dir = bin cflags = -c -wall -i srcs = $(src_dir)/main.cpp objs = $(obj_dir)/main.o deps = $(inc_dir1)/glew.h $(inc_dir1)/glfw3.h $(inc_dir2)/glm.hpp executable = game all: $(objs) $(executable) $(obj_dir)/%.o : $(src_dir)/%.cpp $(cc) $(cflags) $< -o $@ $(executable): $(objs) $(cc) $(objs) -o $@ $(obj_dir)/main.o: $(deps) i'm not sure if trying find .ccp files header files or if set makefile incorrectly. i'm pretty new makefiles insight m

postgresql - Check Postgres access for a user -

postgresql - Check Postgres access for a user - i have looked documentation grant found here , trying see if there built-in function can allow me @ level of accessibility have in databases. of course of study there is: \dp , \dp mytablename but not show business relationship has access to. see tables have access to. can tell me if there command can check level of access in postgres (whether have select , insert , delete , update privileges)? , if so, command be? you query table_privileges table in info schema: select table_catalog, table_schema, table_name, privilege_type information_schema.table_privileges grantee='my_user' postgresql privileges

php - Keep a value from a dropdown list after posting -

php - Keep a value from a dropdown list after posting - i trying write 3-part drop downwards list selection menu. sec drop downwards list dependent on info first list , 3rd drop downwards dependent on info second. have tried using post this, each time form submitted blanks out info previous downwards box , if seek utilize session variable store data, reset when form submit. here code: //get list of course of study subjects database $subjects = mysqli_query($con,"select subject db.course;"); echo "<select name='getsubject' onchange='this.form.submit()'>"; echo '<option value="" style="display:none;" ></option>'; while ($row=mysqli_fetch_array($subjects) ) { echo "<option value='" . $row['subject'] . "' >". $row['subject'] ."</option>"; //creates drop downwards list of subjects } echo "</select> &a

git - What branch does gitlab CI checkouts? -

git - What branch does gitlab CI checkouts? - how lab ci determines git revision check out? far can tell, info not included in hook creates build in gitlab ci. likewise, how determines branch checkout? when create project gitlab ci, mention " default_ref " default_ref (optional) the branch run on (default master) gitlab ci fetch branch, , run build script time new commits detected. git gitlab-ci

mysql - How to reset all ID AUTO Increment to sequencial value on each INSERT Or DELETE Query Execution..! -

mysql - How to reset all ID AUTO Increment to sequencial value on each INSERT Or DELETE Query Execution..! - i have table name listings , within there have column namely when rows deleted auto incrmementation columns namely "id" goes soemthing bad values..like missing values in between don't , don't suit professional way..so hence want please if people can guide me how reset id columns values in rows on each insert or delete query exeution please..! if want find lowest unused key value, don't utilize auto_increment @ all, , manage keys manually. however, not recommended practice. as explained @ mysql - auto increment after delete primary autoincrement keys in database used uniquely identify given row , shouldn't given business meaning. leave primary key , add together column called illustration courseorder. when delete record database may want send additional update statement in order decrement courseorder column of rows have

javascript - Logic Flow Flaw in custom html builder -

javascript - Logic Flow Flaw in custom html builder - i set out create simple html builder myself works this: my syntax follows: id1,id2 <- comma separated produce 2 div groups <div id="id1"> <div id="id1inner"></div> </div> <div id="id2"> <div id="id2inner"></div> </div> you can inner classes clearfix added inner parent such: (* denotes class, ! denotes id) id1*class1*class2,id2!id1!id2 <div id="id1"> <div id="id1inner" class="clearfix"> <div class="class1"></div> <div class="class2"></div> </div> </div> <div id="id2"> <div id="id2inner" class="clearfix"> <div id="id1"></div> <div id="id2"></div> </div> </div> the problem h

jaxb - Where can @XmlElement be placed? -

jaxb - Where can @XmlElement be placed? - i have seen jaxb annotation in project used on setter. know own experience @xmlelement can used on attributes , getters. i'm not sure if annotation can , should used on setters, googled , couldn't find clear answer. please advise. from section "8.9 property & field" of jaxb 2.2 specification (see: https://jcp.org/aboutjava/communityprocess/mrel/jsr222/index2.html) for property, given annotation can applied either read or write property not both. in other words annotation can set on either or set method. experience bulk of people set annotation on method. jaxb annotations setter

xml - Minidom on Python: memory issue -

xml - Minidom on Python: memory issue - i'm using minidom on python parse xml file. understand it's slow process , takes substantial amount of memory. i'm using for-next loop. files happen large, i'm fine time takes parse first one. first 1 takes couple of minutes when looping , running same parse function, took 30 minutes so. must memory issue. there dump memory subsequent files don't take much longer? example in python (excluding other things variable xmldoc 1 time it's parsed): for filename in filelist: file = open(filename,'r') xmldoc = minidom.parse(file) python xml minidom

Speedup / Faster terminology when benchmarking -

Speedup / Faster terminology when benchmarking - although not programming question, came when writing paper. while comparing performance of 2 threading implementations, implementation a had execution time of 1500ms , implementation b took 2000ms. the ratio of timeb timea 2000/1500 = 1.33. it right state b requires 133% time of a. it may right a has 133% performance of b. but: more right state a 133% faster b, or a 33% faster b ? is there reason why of 2 latter statements blatantly incorrect? matter of convention? benchmarking

jsf 2 - Render Primefaces component in JSF -

jsf 2 - Render Primefaces component in JSF - jsf 2.2 + primefaces 5.0 + managed bean i want simple thing: i want render primefaces component in jsf site using managed bean. jsf: <?xml version='1.0' encoding='utf-8' ?> <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://xmlns.jcp.org/jsf/html" xmlns:p="http://primefaces.org/ui"> <h:head> <title>beantest</title> </h:head> <h:body> #{testbean.output} </h:body> </html> the managed bean: public class testbean { /** * creates new instance of testbean */ public testbean() { } private string output = "<p:calendar mode=\"inline\"/>"; /** * value of output *

html - resize children elements according to the length -

html - resize children elements according to the length - i have next html structure <div class="wrapper"> <ul class="list"></ul> </div> which ul element dynamically filled li elements, when several (more 5) exceed height of wrapper element, know if there way adjust these elements container or viceversa. so have 2 cases here: case a adjust objects width of container can use: li { display:table-cell; width:1%; } you can check demo here case b adjus container size of elements can use: ul { white-space:nowrap; display:inline-block; } li { display:inline-block; } you can check demo here also options can have other variations depens on needs contents. html css

Android MultiSelectListPreference with priority order -

Android MultiSelectListPreference with priority order - i'm new android. want utilize multiselectlistpreference case. but encounter problem: list need maintain order of element. assume there're 5 elements: 0 - tom 1 - david 2 - bob 3 - mary 4 - chris and user take 0, 2, 3. list must in order below: tom, bob, mary but multiselectlistpreference stores setting in set<string> , not arraylist<string> , it's not sure order because of set . how can create sure order? give thanks you. camdaochemgio, understood question before edit. since talking set (that stores unique values) , getvalues() function needs fed own revertvalues function translates values indexes - based on preset of data. asked code express myself writing solution in own style/terminology. the solution: i noticed in docs of multiselectlistpreference next method : int findindexofvalue(string value) but not store such reference object, created class extend mult

javascript - Error in OBJLoader of THREE.JS lilbrary -

javascript - Error in OBJLoader of THREE.JS lilbrary - i'm trying follow examples in book in order larn three.js library "learning three.js: javascript 3d library webgl" , have illustration sets downloaded github link https://github.com/josdirksen/learning-threejs. of examples runing fine of them raises error 1 loads wavefront objects objloader.js file. raises next error in run time uncaught typeerror: undefined not function vm12649 objloader.js:66 corresponding portion of objloader.js function meshn( meshname, materialname ) { if ( geometry.vertices.length > 0 ) { geometry.mergevertices(); geometry.computecentroids(); //exception rased here !!!!! geometry.computefacenormals(); geometry.computeboundingsphere(); object.add( mesh ); geometry = new three.geometry(); mesh = new three.mesh( geometry, material ); verticescount = 0; }

Select word from MS Word through VB.NET -

Select word from MS Word through VB.NET - i want select specific word ms word through vb.net (microsoft.office.interop.word). any thought how it? edited: problem can not find/replace string more 255 symbols. that's why i'm trying find solution issue. your question seems quite vague beginning, may proceed follows; dim objword new word.application dim wordtofind string = "test" objword.visible = true 'open existing document. dim objdoc word.document = objword.documents.open("c:\folder\mydoc.doc") objdoc = objword.activedocument 'find word objdoc.content.find.execute(findtext:=wordtofind) ' perform process searched text 'close document objdoc.close() objdoc = nil objword.quit() objword= nil hope helps! vb.net ms-word office-interop

html - How do I collapse the gaps in my table style? -

html - How do I collapse the gaps in my table style? - i have table have build via code, because it's representing grouped info query based on person's name. person xyz has 4 rows of data... question how style each grouping alternating in color? here's have far , works, there's gaps on sides, top , bottom of each cell, want color groups solid.... no gaps... i've given table rows , td class name of alternate ones colored..alternate tr.alternate{background-color:#aaa;} td.alternate{background-color:#aaa} you can utilize border-collapse: collapse in table. the border-collapse css property selects table's border model. has big influence on , style of table cells. the separated model traditional html table border model. adjacent cells each have own distinct borders. distance between them given border-spacing property. in collapsed border model, adjacent table cells share borders. in model, border-style value of inset

linux - Handshake failure while trying to send mail using openssl -

linux - Handshake failure while trying to send mail using openssl - i trying send mail service terminal using openssl connecting gmail's server using ssl on port 465. things fine until come in address , authenticate. when come in rcpt to, next error. rcpt to: <abc@gmail.com> renegotiating 139815845389984:error:1409e0e5:ssl routines:ssl3_write_bytes:ssl handshakefailure:s3_pkt.c:59 i can guess out problem might due missing security certificates. can please help me solve problem? i stumbled upon same issue , found reply here. quoting in in case people won't find original answer: the "renegotiating" happens typing rcpt "r" in caps. how s_client behaving. may seek entering "rcpt to" instead of "rcpt to". i tried "rcpt to" , worked charm. linux terminal openssl smtp

winapi - DrawText draws Segoe UI font texts incorrectly -

winapi - DrawText draws Segoe UI font texts incorrectly - i encountered 1 problem drawing texts using windows api drawtext phone call segoe ui font: this image demonstrates problem: specified text shifted little bit right in specified rectangle lastly character clipped (the best illustration 0 digit). our drawing routine works other fonts, , problem occurs segoe ui. what , how solve it? doing in vb6 ocx project on windows 8 pro 64-bit if matters. the corresponding code source snippet following: ' draws or measure text (if dt_calcrect specified) ' using native winapi flags: public sub gpinternaldrawtext( _ byval lhdc long, _ byref stext string, _ byref tr rect, _ byval lflags long _ ) ' allows unicode rendering of text under nt/2000/xp if (g_bisnt) ' nt4 crashes ptr = 0 if strptr(stext) <> 0 drawtextw lhdc, strptr(stext), -1, tr, lflags end if else drawtexta lhdc, stext, -1, tr, lflags

c - Using fscanf() to skip a string -

c - Using fscanf() to skip a string - the input file such has string followed integer on first line , sec line has string followed 2 integers. below code works there way skip string ? scanning character array char sink[30]. don't need value how can utilize fscanf() skip string , read integers. #include<stdio.h> #include<stdlib.h> int main() { int v,i=0,f=1; static int *p,*q; file *fp; char sink[30]; fp = fopen("some.txt","r"); while(!feof(fp)) { if(f) { fscanf(fp,"%s %d",sink,&v); p = (int *)malloc(sizeof(int)*v); q = (int *)malloc(sizeof(int)*v); f=0; } else { fscanf(fp,"%s %d %d",sink,&p[i],&q[i]); i++; } } fclose(fp); printf("the input vertices are\n"); for(i=0;i<v;i++) printf("%d %d\n",p[i]

"TLD skipped" in tomcat logs -

"TLD skipped" in tomcat logs - i have next errors in tomcat logs. doesn't impact how web applications run, fill logs. how prepare this? info: tld skipped. uri: http://java.sun.com/jstl/core_rt defined oct 24, 2014 8:53:02 org.apache.catalina.startup.tagliburirule body info: tld skipped. uri: http://java.sun.com/jstl/core defined oct 24, 2014 8:53:02 org.apache.catalina.startup.tagliburirule body info: tld skipped. uri: http://java.sun.com/jsp/jstl/core defined oct 24, 2014 8:53:02 org.apache.catalina.startup.tagliburirule body info: tld skipped. uri: http://java.sun.com/jstl/fmt_rt defined oct 24, 2014 8:53:02 org.apache.catalina.startup.tagliburirule body info: tld skipped. uri: http://java.sun.com/jstl/fmt defined oct 24, 2014 8:53:02 org.apache.catalina.startup.tagliburirule body info: tld skipped. uri: http://java.sun.com/jsp/jstl/fmt defined oct 24, 2014 8:53:02 org.apache.catalina.startup.tagliburirule body info: tld skipped. uri: http://java.sun.com/jsp/

json - Keyerror in python code -

json - Keyerror in python code - import csv import json,httplib,os connection = httplib.httpsconnection('api.parse.com', 443) connection.connect() connection.request('get', '/1/classes/studentrecord', '',{ "x-parse-application-id": "keys", "x-parse-rest-api-key": "keys", }) result = json.loads(connection.getresponse().read()) varlen=len(result["results"]) open('student_record.csv') f: reader = csv.reader(f, delimiter=' ' , quotechar='|') x in reader: info in x: flag=0 in range(0,varlen): if(result["results"][i]["stufname"]==data[:data.index(',')]): print "value"+str(i) flag=1 m getting keyerror in line if(result["results"][i]["stufname"]==data[:data.index(',')]): keyerror: