Posts

Showing posts from July, 2013

Android CardFlip animation to exchange Fragments -

i know answer tells how display cardflip between 2 layouts, displaying card flip animation on old android but how can display flip between 2 fragments added in oncreate method? thanks i used support library. bofredo :)

entity framework - MVC4 EF Database Creation and Seeding Issue -

i getting update error when trying seed database. not sure if structure correctly setup create casefile contains basic information, create more complex file creating ot or pt casefile linked casefile (i hope semi-understandable) i order make little easier view data i'm linking directory of code , stacktrace error getting. happens when add casefile code in seed method of configuration.cs file. somewhere hanging on old definition foreign key relationship between casefile , keywordid , settingid there in incarnation of class removed. i tried delete database , used package manager add-migration initial gave me file '201308191626305_initial.cs' has these foriegn keys created. tried manually remove these file before running 'update-database -verbose' still produces errors complaining keyword-keywordid in stack track. tables build correctly , populated except casefile table gets created correctly not populated. updating source files here. large files... na

python - Can't read line from html page -

i trying cut time format specific site. regex working (tried regex tester , worked), when try run code in python get: import urllib,re sock = urllib.urlopen("http://www.wolframalpha.com/input/?i=time") htmlsource = sock.read() sock.close() ips = re.findall( r'([01]?[0-9]{1}|2[0-3]{1}):[0-5]{1}[0-9]{1}:[0-5]{1}[0-9]{1}',htmlsource) print ips the result: >>> ['7', '4'] >>> the time on regextester.com marked red color want extract time in following format: xx:xx:xx (24h). why happening? thank you! you have redundant quantifiers in regexp (those {1} ). can remove them. another thing re.findall returning captures, hours. change first capture non-caturing group (?: ... ) , capture whole regex: ((?:[01]?[0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]) this should doing think.

Cleaning a CSV file using linux commands, while ignoring commas between quotes -

i've got rather large csv file need import postgresql database, virtually contains many errors import using sql copy command. i've managed fix issue quotation marks being in places shouldn't, using awk command: awk -f\" 'nf % 2 == 1 { print $0 }' ./db_downloaded.csv > ./db_sanitized.csv this drops line has odd number of quotation marks on it, , works quite well. other common problem run incorrect number of columns. current solution problem use following awk command drop line has wrong number of commas: awk -f"," 'nf == 40 { print $0 }' ./db_sanitized.csv > ./db_sanitized2.csv however, makes drop rows have commas between quotes, quite few rows. now, it's not critical every single row imported, i'd if had way count commas didn't appear between quotation marks on row. way can think have sort of boolean variable flips every time there's quotation mark in stream, turn off checking commas, i'm not s

linux - Awk between two patterns with pattern in the middle -

hi looking awk can find 2 patterns , print data between them file if in middle there third patterns in middle. example: start 1 2 middle 3 end start 1 2 end , output be: start 1 2 middle 3 end i found in web awk '/patterns1/, /patterns2/' path > text.txt need output third patterns in middle. and here solution without flags: $ awk 'begin{rs="end"}/middle/{printf "%s", $0; print rt}' file start 1 2 middle 3 end explanation: rs variable record separator , set "end", each record separated "end". then filter records contain "middle", /middle/ filter, , matched records print current record $0 , separator print rt

php - fnmatch() returning false with pure wildcard -

i have following code: echo "matching: ".$params['perm']." against: "; var_dump($perm); if (fnmatch($params['perm'], $perm)) { $x=true; } $this->code = 200; return $x; for asking if $perm contains start of $params['perm'] or * in case output is: matching: acl.adduser against: array(1) { [0]=> string(1) "*" } {"code":200,"data":false} shouldn't return true since * permission have, , allows me own acl.adduser ? $perm supposed string, while in example array. fnmatch not work correctly in case, , should have seen php warning this. also, order of arguments appears reversed. test works expected: var_dump(fnmatch('*', 'acl.adduser'));

dataset - BIRT Data set consisting of report parameters -

i rather new birt , reporting, , not sure whether there easy answer question have yet find one. i have 10 parameters want use consist of data within data set, unsure how approach this. the idea user enters list of names , numbers through parameters, numbers query xml data. then, xml data grouped within chart , table according names passed. i group data if names consisted of data set, separate parameters. i had image below, new community not have enough reputation post this, unfortunately. idea create report comparing total electrical consumption comparing different electrical meters, names drawn parameters , xml data consisting of values , timestamps. understanding, best way approach create data set consisting of parameters, unsure how this. advice appreciated.

loops - How to make matlab repeat a procedure independently? -

i have matrix this: a = 1 1 1 0 1 0 1 1 0 0 0 0 0 0 1 1 0 0 0 0 0 1 0 1 1 i want replace example 30% of 1 elements in matrix 0 randomly , repeat procedure independently 10 times instance, , @ end of work must have 10 independent matrices each 1 of them should has 30% of 1 elements less original matrix. here's code use this: for i=1:10 f=.3; a_ones=find(a); n = round(f*length(a_ones)); a_ones_change = randsample(a_ones,n); a(a_ones_change) = 0; end but thing matlab code takes original matrix @ begining , replaces 30% of 1 elements 0. second time takes resultant matrix previous step (not original matrix) , replaces 30% of remained 1 elements in matrix 0 , again , again 10 times , @ end gives me 1 matrix below: a = 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 how can solve problem , make ma

html5 - CSS -- two columns, one static, the other scrollable and maxed out to the first's height -

i've had trouble finding resources on how this. ( this , this didn't seem work in case). want 2 columns, side side, of equal height -- determined right column's height. both of heights should variable, , if contents of left taller of right, left column should scrollable. i've tried making left column absolutely positioned, overflows container, if overflow set scroll. i'd set max-height, want max height dynamically set right column. any ideas how this? default styles work right column. for left one: .left-column { overflow-x: hidden; overflow-y: auto; } and need little jquery snippet make work: $(document).ready(function() { var desiredheight = $('.right-column').height(); $('.left-column').css('max-height',desiredheight); $('.left-column').css('min-height',desiredheight); }); it works fine when page loads. if content change after page loaded, have bind code above event (which

ios - How do I drill down through a plist using UITableViews? -

i'm wanting drill down through plist using uitableviews specific school. drill down goes state->district->school. i've created plist, not 100% sure structure best. also, can first set of information active on first tableview, not sure how proceed there. need create tableview each drill down(stateview, districtview, schoolview) or can reuse generic tableview since simple lists? below have far. help. plist <plist version="1.0"> <array> <dict> <key>districts</key> <dict> <key>district 1</key> <array> <string>school 2</string> <string>school 1</string> </array> <key>district 2</key> <array> <string>school 3</string> <string>school 4</string> </array> </dict> <key>state</key> <string>south dako

sql server - How to write sql for this case? -

suppose have table(a relationship) like mytab(id1,id2,ismarked, data,....) the sample data maybe looks like: 1, 1, 1, ... 1, 2, 0, ... 1, 3, 0, ... 2, 34, 1, ... 3, 4, 0, ... 4, 546, 0, ... 4, 8, 0, ... only 1 marked each id1 . want data marked 1 entities id1 . if there no marked record, first 1 or 1 of them. for above sample data, result should be: 1, 1, 1, ... 2, 34, 1, ... 3, 4, 0, ... 4, 546, 0, ... union solution, long , may have bad performance. idea sort data id1 , ismarked desc, first 1 each id1 , how write sql case? for only 1 marked each id1 following should work: ;with cte ( select *, rn=row_number() on (partition id1 order ismarked desc) ) select * cte rn=1

asp.net - Adding multiple Web.config files in separate directories to WIX installer -

i creating wix installer package asp.net application, getting error when trying add multiple web.config files though located in different directories. the code have far looks this: <directory id="installlocation" name="site" > <component id="web.config" guid="f9d6c6e5-887e-4d90-bdeb-5d16aaa8f194"> <file diskid="1" keypath="yes" source="$(var.solutiondir)\publish\web.config" /> </component> <directory id="account.dir" name="account"> <component id="account.web.config" guid="53fc1820-3add-41c0-92d6-9a66348c33a4"> <file diskid="1" keypath="yes" source="$(var.solutiondir)\publish\account\web.config" /> </component> </directory> </directory> <feature id="defaultfeature" configurabledirectory="targetdir" level="1"> <comp

r - Passing parameters to with() via function -

there way pass parameter function with() ? like: dados <- data.frame(x=1:10, v1=rnorm(10), v2=rnorm(10)) with(dados, v1+v2) # works func <- function(data, funcao) { with(data, funcao) } func(dados, v1+v2) # fails func(dados, 'v1+v2') # fails i've tried eval() , fails :/ ok, think got it. need call eval inside func , pass expression : dados <- data.frame(x=1:10, v1=rnorm(10), v2=rnorm(10)) func <- function(data, funcao) { with(data, eval(funcao)) } func(dados, expression(v1+v2)) [1] -0.9950362 1.0934899 -0.9791810 -1.2420633 -1.0930204 0.8941630 -2.3307571 -1.5012386 3.2731584 0.2585419 to use string: x = "v1 + v2" func(dados, parse(text=x)) [1] -0.9950362 1.0934899 -0.9791810 -1.2420633 -1.0930204 0.8941630 -2.3307571 -1.5012386 3.2731584 0.2585419

php - search in mysql with utf8 encoding -

Image
im working on project in arabic language need search in database of utf-8 words table collation in ' utf8' , mysql connection type utf8 too. now when type word (for example 'ﺗﻮﺿﻴﺢ') in query string keyboard cant find of results when try copy , paste phpmyadmin find of results!! image 1 shown result when type keyborad and image 2 shown result in same database when copy , paste search term question problem , how can type search term find of results... ps: 1)i have attache both post content first copy , paste text , second when typing text i found differentiation between post queries when copy text : is_js_confirmed=0&db=digidoc&table=docs_pages&token=43847946c2deb1885e9c0f9ed97839a3&pos=0&goto=tbl_sql.php&message_to_show=your+sql+query+has+been+executed+successfully&prev_sql_query=select+*+from+%60docs_pages%60+where+%60page_content%60+like+'%25%ef%ba%97%ef%bb%ae%ef%ba%bf%ef%bb%b4%ef%ba%a2%25'&sql_query=select+

mysql - Liquibase refuses to create a database that doesn't exist -

i'm trying run liquibase update on database doesn't exist yet. expect create database me (i'm running root, shouldn't problem), instead i'm getting: /vagrant/liquibase$ ./liquibase update liquibase home not set. liquibase home: /vagrant/liquibase liquibase update failed: com.mysql.jdbc.exceptions.jdbc4.mysqlsyntaxerrorexception: unknown database 'test_project' connection url parameters rescue again! url: jdbc:mysql://localhost/dev_project?allowmultiqueries=true&createdatabaseifnotexist=true the createdatabaseifnotexist=true part did trick

qt - QML - How to know if a child has keyboard focus -

i think know how use focusscopes , how handle keyboard focus. but can't find clever way figure out if 1 of child items or theirs or below me has keyboard focus. the documentation focusscope says: when focus scope receives active focus, contained element focus set (if any) gets active focus. if element focusscope, proxying behavior continues. both focus scope , sub-focused item have activefocus property set. a focusscope therefore will have activefocus set false when focus given contained focusscope. there way figure out if case? how can know if @ least contained focusscope received focus? focus chain in qtquick. means ancestor focusscope down current active child active focus. focusscope used make more simple focus abstraction : tell custom component when root object gets active focus, has forward given child. in following example : import qtquick 2.0; rectangle { width: 400; height: 200; focus: true; focusscope { id:

HTML export into Excel, mso-data-placement: same-cell loses the line break -

i'm generating html document i'm serving excel spreadsheet. working fine except in first place, excel reading line breaks new cell. found workaround that, , that's add <style>br { mso-data-placement:same-cell; }</style> sure enough keeps data in same cell, i'm losing line breaks , keeps in same line. has else had problem? i can't figure out life of me why happening. here full code: <html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/tr/rec-html40"> <head> <meta http-equiv=content-type content="text/html;charset=windows-1252"> <meta name=progid content=excel.sheet/> <meta name=generator content="microsoft excel 11"> <!--[if gte mso 9]><xml> <x:excelworkbook><x:excelworksheets><x:excelworksheet> <x:name>sheet1</x:name>

inheritance - is it acceptable to provide an API that is undefined a large part of the time? -

given type follows: class thing { getinfo(); isremotething(); getremotelocation(); } the getremotelocation() method has defined result if isremotething() returns true. given thing s not remote, acceptable api? other option see provide remotething subclass, user needs way cast thing remotething if necessary, seems add level of indirection problem. having interface include members usable on objects implement interface not of them, , includes query method interface members useful, pattern in cases gained it. examples of reasons can useful: if it's interface member useful on objects not other instances of same type , pattern may 1 makes sense. if it's consumer may hold references variety of objects implementing interface, of support particular member , of not, , if it's such collection want use member on instances support it, such usage more convenient if objects implement interface including member, if , don't. especially true interface

Laravel 4 location of migrations and seeding folder -

i'm working on package hosted on private satis repo. when i'm starting new laravel 4 project require package repo , gets installed correctly. after installing want perform migrations , seeding, not function. according laravel manual can perform migration package: php artisan --env=dev migrate --package="kordaat/admin" but not work, have run so: php artisan --env=dev --path="vendor/kordaat/admin/src/database/migrations" the above option works, not intended. inside package composer.json looks like: { "name": "kordaat/admin", "description": "admin area created kordaat.", "keywords": ["laravel", "framework"], "license": "bsd-2-clause", "authors": [ { "name": "kordaat", "email": "xxx@xxxx.xxxx" } ], "require": { "php"

2 Week View FullCalendar not displaying correctly -

Image
i trying follow this post , not sure if because running newer version of fullcalendar or did wrong. i figured out. this line in code renderbasic(2, 2, weekends ? 7 : 5, true); should of been renderbasic(2, 7, weekends ? 7 : 5, true) instead of 2 second parameter should 7 show 7 days in week.

sql server - Correcting a "Subquery returned more than 1 value error" when -

i have idea what's wrong query, seems sql has disassociated converted date (i have 3 fields needed combined make date) product table. question how fix it? can't check if current date > greater 3 separate columns, needed combine them single date. select productid ctbo.dbo.product (getdate() > (select convert(date,cast([expyear] varchar(10))+'-'+ cast([expmonth] varchar(10))+'-'+ cast([expday] varchar(10))) product expyear not '0' , expday not '0' , expmonth not '0') ) since subquery returns multiple values need use either any keyword (to make condition applied of subquery result) or all (to applicable results) e.g.: select productid ctbo.dbo.product (getdate() > any(select convert(date,cast([expyear] varchar(10))+'-'+ cast([expmonth] varchar(10))+'-'+ cast([expday] varchar(10)))

code smell - More idiomatic line-by-line handling of a file in Clojure -

i'm trying read file (may or may not) have yaml frontmatter line-by-line using clojure, , return hashmap 2 vectors, 1 containing frontmatter lines , 1 containing else (i.e., body). and example input file this: --- key1: value1 key2: value2 --- body text paragraph 1 body text paragraph 2 body text paragraph 3 i have functioning code this, (admittedly inexperienced clojure) nose, reeks of code smell. (defn process-file [f] (with-open [rdr (java.io.bufferedreader. (java.io.filereader. f))] (loop [lines (line-seq rdr) in-fm 0 frontmatter [] body []] (if-not (empty? lines) (let [line (string/trim (first lines))] (cond (zero? (count line)) (recur (rest lines) in-fm frontmatter body) (and (< in-fm 2) (= line "---")) (recur (rest lines) (inc in-fm) frontmatter body) (= in-fm 1) (recur (rest lines) in-fm (conj frontmatter line) body) :else

css3 - Display text in a div only when a CSS transition kicks in? -

i have following: http://jsfiddle.net/zf5am/579/ i'm trying display text when hover effect (transparency) kicks in. text should full-opacity, readable, on hover, on top of opaque image. can done using css? <div class="image"> <img class="fade" src="http://www.newyorker.com/online/blogs/photobooth/nasaearth-01.jpg" alt="" /> <div class="text">test</div> </div> .image img { width:200px; height:200px; } .fade { opacity: 1; transition: opacity .25s ease-in-out; -moz-transition: opacity .25s ease-in-out; -webkit-transition: opacity .25s ease-in-out; } .fade:hover { opacity: 0.4; } .image{ background-color: black; width: 300px; } .text{ color: red; position: absolute; top: 10px; left: 100px; visibility: hidden; width: 100%; height: 100%; } .text:hover{ visibility: visible; } } instead of triggering on hover of child element, use nested sele

windows - vagrant package creates a copy of the original box with no changes I have made -

this may noob question, after making changes image vagrant up , installing something, call vagrant package --box [name] --output [new.box] . after create new vagrant init new.box , doesn't have new things installed on box packaged. anyone know doing wrong? the reason used same box name. as described, you've done this: created vagrantfile : vagrant.configure(vagrantfile_api_version) |config| config.vm.box = 'base' config.vm.box_url = 'http://the-url-of-box-you-used-as-base.com/precise.box' end vagrant up vagrant ssh => there you've made changes vagrant package --box [name] --output [new.box] edit original vagrant file (or create new one) load new box: vagrant.configure(vagrantfile_api_version) |config| config.vm.box = 'base' config.vm.box_url = 'my-new.box' end and here i'm assuming kept config.vm.box same, means vagrant didn't use box, original previous box there's downloaded box nam

facebook graph api - Failed Test Payment does not call client-side javascript callback in new local currency payment system(local currency breaking change) -

i transferring our game new local currency payment system. works fine successful test payments when wanted test failed payment test user not behave expected to. according facebook documentation here send javascript object looks this: { "payment_id": 375225169259274, "quantity": 1, "status": "completed", "signed_request": "bjyedxddlrj..." } when test payment setting always succeed , javascript object sent. however, when test payment setting always fail , javascript object not sent. the facebook payment dialog shows: " this expected failure test credential ." , receive realtime update on server payment dialog stays open options retry , cancel . when click cancel, game receives javascript object error code user canceling not 1 of failed payment. the facebook documentation states the status of order returned js callback can initiated , completed or failed . developers should fulfi

c# 2.0 - How to use an object across winforms -

so have list of custom object class code looks follow var itemlist = new list<item>(); so item simple class inherits defaults, , has 3 private fields called private double price; private string @url; private string name; public double setprice(string price) { this.price = price; } my question since 1 answered on how remove lists how can access created item object list , edit fields separate windows form. i.e. list<item> items = new list<item>(); private void itemlistbox_doubleclick(object sender, eventargs e) { if (itemlistbox.selecteditem != null) { var editor = new form2(); editor.show(); //creating new winform } } how can edit item variable in edit form. if went second form. how access name property item in collection? if have reference item , can use remove : itemlist.remove(someitem); or remove item @ particular index, use removeat : itemlist.removeat(5); now, access itemlist across differen

c# - XNA - Copies of Same Source Model -

if this: model test1 = content.load<model>(@"models/floortile"); model test2 = content.load<model>(@"models/floortile"); model test3 = content.load<model>(@"models/floortile"); foreach (modelmesh mesh in test1.meshes) foreach (effect effect in mesh.effects) ((basiceffect)effect).diffusecolor = color.red.tovector3(); all 3 models assigned color red, not test1. this simplified version of problem, in real version, using actual hlsl effect, , while know how clone single effect work on multiple unique fbxs, not sure how create more 1 instance of 3dmodel , assign each it's own texture, instead of them referencing 1 texture/effect , therefore every "floortile" in scene same. the workaround can think of create different floortile fbx model each model, have lot of tiles, far ideal. the solution can think this: foreach (var mesh in model.meshes) { foreach (basiceffect effect in mesh.effects) {

Passing variables to the MYSQL Query from Command line -

i don't want burden people whole code, i'm going try parts answer question i need add date range input python call python query2.py -v --start_date='2013-08-12' --finish_date='2013-08-15' > output.txt but when try add concatenation string sql_query variable in query subroutine error: sql_query += """ having sm.created >= '2013-08-12' , sm.created <= '2013-0 8-15' """ unboundlocalerror: local variable 'sql_query' referenced before assignment killed signal 2. so im guessing cant add variable in manner, sql_query += " having sm.created >= " + options.db_start + " , sm.created <= " + options.db_finish could tell me wrong? thanks import sys import os import time import optparse import getpass import subprocess contextlib import contextmanager import mysqldb # todo: modify columns, course_id make sense sql_query = """ select au.email, sm.

binary - How to perform operation on specific bits in perl -

lets assume have hexadecimal value 0x78. need add 1 first 4 bits ie 3:0 , add 2 last 4 bits ie. [7:4]. further when add 1 0xf should not roll on next value , should stay 0xf. same applies subtraction. approach have tried far is: $byte=0x78; $byte2 = unpack('b4', $byte); print "byte2 = $byte2 \n"; --> here output 1000 have tried extract first 4 bits, , can right shift , extract last 4 bits , perform operation. perform addition or subtraction, wanted convert 1000 hex format can 0x8 +/- 1. tried: $hex2 = sprintf('%02x', $byte2); print "hex2 = $hex2 \n"; --> output 3e8. not understand why 3e8 instead of 8 or 08, since supposed print 2 values in hex format. in above command when manually enter $hex2 = sprintf('%02x', 0b1000); correct result. perl taking string rather numeric value. there way can convert string binary number? other easier method or approach helpful. we can each byte anding , shifting: $byte1 = $byte

Django - manage.py sql APPNAME not generating model SQL -

i have relatively large flat application i'm working on. maintain separation of concerns, i've split model , view files auth_models , dashboard_models , taxonomy_models , more. these have been placed in folder structure as appname/ app/ models/ __init__.py auth_models.py dashboard_models.py taxonomy_models.py ... views/ __init__.py dashboard_views.py taxonomy_views.py ... my app/models/__init__.py has following: from auth_models import * dashboard_models import * taxonomy_models import * however, when run ./manage.py sql app , no output whatsoever. no warnings, nothing @ all. the reason question i'm implementing database modification , migration in south cannot handle several aspects. i'm starting on fresh schema , later implement data conversion script migrate existing dataset. this, need schema create model tables. see this answer. django makes assumptions app name path i

file get contents - How to make synchronous file_get_contents() GET request in PHP -

on site, needed way share session data between 2 domains (one using shared ssl certificate, , other 1 on plain http) redirect user secure domain normal 1 after logging in, while preserving session data. so came with: the user enters credentials in secure login page , submits form. when form submitted, page refreshes. upon refresh, user authenticated, session started , session variables set. then, sid of user on secure domain gets sent data page on non-secure domain, secure sid set session variable. the user gets redirected main non-secure page, session started, secure sid read, , finally, session on non-secure domain restarted secure sid. way, same session preserved across domains. there 1 problem approach, file_get_contents() make gets canceled code reaches redirect header. in code: //the following line never completes file_get_contents('http://nonsecuresite.com/cookie.php?sid=session_id()'); header('location: http://nonsecuresite.com'); o

mongodb - Easiest way to copy/clone a mongoose document instance? -

my approach document instance, , create new 1 instance fields. sure there better way it. can clarify mean "copy/clone"? going trying create duplicate document in database? or trying have 2 var s in program have duplicate data? if do: model.findbyid(yourid).exec( function(err, doc) { var x = doc; model.findbyid(yourid).exec( function(err, doc2) { var y = doc2; // right now, x.name , y.name same x.name = "name_x"; y.name = "name_y"; console.log(x.name); // prints "name_x" console.log(y.name); // prints "name_y" }); }); in case, x , y 2 "copies" of same document within program. alternatively, if wanted insert new copy of doc database (though different _id assume), this: model.findbyid(yourid).exec( function(err, doc) { var d1 = doc; d1._id

ajax - Javascript - best way to parse custom tags -

this question has answer here: xml parsing of variable string in javascript 11 answers i wrote api returns following <location><lat>41.47033705</lat><lon>-81.93612862</lon></location> <location><lat>41.470320224762</lat><lon>-81.9364535808563</lon></location> <location><lat>41.4704650640488</lat><lon>-81.9449239969254</lon></location> <location><lat>41.4780235290527</lat><lon>-81.8454140424728</lon></location> <location><lat>41.48597253</lat><lon>-81.82579113</lon></location> i have ajax call gets , need use in javascript. ultimately , 2d array [lat,lon] what least amount of code this? assuming response valid xml, can use getelementsbytagname , push array: var arr =

php - mongodb querying sub array -

i have array multiple sub-arrays: > db.alumnos111.findone({curp:'aelj951211mascpn04'}) { "_id" : objectid("520d5440bee9577c283542c3"), "nocontrol" : "10301051680201", "nombre" : "janette araceli", "paterno" : "acero", "materno" : "lopez", "curp" : "aelj951211mascpn04", "generacion" : "2010-2013", "carrera" : "informÁtica", "clv_centro" : "01dct0001f", "estado" : "aguascalientes", "plantel" : "cbtis no. 168", "id_plantel" : "513", "materias" : [ { "semestre" : "4", "nombre_asignatra" : "ecologÍa",

route codeigniter not load the page -

my problem route of codeigniter, i'm working , each function wrote route. when put last route, 1 not working , give me 404 error. don't know why? maybe i'm doing mistake order of route think right. route: //match share // route not working $routes['upload_image/upload_photo'] = "upload_image/upload_photo"; //all route working //votation// $route['auth_social/fblogin'] = "auth_social/fblogin"; $route['votation/user_plus/(:any)'] = "votation/user_plus"; $route['votation/user_minum/(:any)'] = "votation/user_minum"; $route['finish_registration/(:any)/(:any)'] = "auth/activate"; // activate e-mail $route['auth'] = "auth"; // index auth $route['register'] = "auth/register"; $route['login'] = "auth/login"; // login $route['logout'] = "auth/logout"; $route['defau

ios - How do I access a button in a subview -

i want implement fade in/out in horizontal scroll have, can't figure out how access button in subview of uiscrollview. i'm trying implement fade in/out stackoverflow . this code... game *game = (game *)[_schedule.games objectatindex:i]; uibutton *button = [[uibutton alloc] initwithframe:cgrectmake(x, 20, 150, 100)]; [button setbackgroundimage:[uiimage imagenamed:game.opponent] forstate:uicontrolstatenormal]; //[button settitle:game.opponent forstate:uicontrolstatenormal]; [_gamescrolllist addsubview:button]; how can add observer button, can done? [self.scrollview addobserver:[self.contentviews objectatindex:i] forkeypath:@"contentoffset" options:nskeyvalueobservingoptionnew context:@selector(updatealpha:)]; to access reference of button added subview, can: use button ivar, saving reference use later; similarly,

git - A local repository to update games? -

i have computer cafe. updating , maintaining files (particularly games) has been hassle me , employees. in addition, not willing pay g-cafe management program. familiar programming languages c, php, java, neither aware of logic , algorithm use objective nor familiar networking my friend suggested use local repository, researched topics regarding same matter. turns out have question not answered discussions i've read. this how view how update going work: i plan on updating games through flow: [(internet -> server) -> (server -> client]. if there game updates, local server download through internet; then, client copy or download these files local server. seeing games have autoupdaters, plan on placing of games inside repository (in server) , client stations connect repository. again, svn works revisions, right? are there suggestions or ideas whether how able update client games through svn / git (of course server)? or if there other ways? i playing dumb.. :(

A PHP Error was encountered in CodeIgniter -

help: i have error: a php error encountered severity: warning message: illegal string offset 'periode' filename: models/k3m.php line number: 32 a php error encountered severity: warning message: illegal string offset 'bulan' filename: models/k3m.php line number: 33 fatal error: call member function row() on non-object in c:\laporbos\htdocs\laporbos3\application\modules\laporan_k3\models\k3m.php on line 39 function saldo_bank($param) { $periode = $param['periode']; $bulan = $param['bulan']; $bulan = $this->get_bulan2($periode,$bulan); $sql="select ifnull( sum(ifnull(jumlah_debet,0) ),0) - ifnull( sum(ifnull(jumlah_kredit,0) ),0) saldo buku_bank year(tanggal) =".$this->session->userdata("tahun_anggaran")." , month(tanggal) < $bulan"; $data = $this->db->query($sql)->row(); return $data->saldo; } this o

How to get Video path in android 4.3 -

yesterday got nexus 7 , try run app on it,and found after finish recordding video , return activity,i can't path of video,which throw nullpointer exception.here code: private static string[] filepathcolumn = { mediastore.video.media.data }; public static string getpathfromuri(context context, uri uri){ cursor cursor = context.getcontentresolver().query(uri, filepathcolumn, null, null, null); cursor.movetofirst(); string path = cursor.getstring(cursor.getcolumnindex(filepathcolumn[0])); cursor.close(); return path; } now run fail on nexus7, don't know whether there api change or not, hope me.

iphone - How to convert itunes music files in to a low bandwidth PCM for uploading -

i convert itunes music files in low bandwidth pcm uploading. how convert m4a file aac adts file in xcode? real-time converting pcm buffer aac data ios using remote io , audio convert service ios: create mp3 on device i saw few threads not sure how go it. provide me tutorial link please ? any comment appreciated. the easiest way convert audio files using extaudiofileconvert api apple. tutorial on using extaudiofileconvert can found at: easy aac compressed audio conversion on ios .

javascript - Why this in onDeviceReady is not this as usual? -

below code index.js generated phonegap 3.0, question why not designed allow use this.receivedevent usual (and event object parameter). // scope of 'this' event. in order call 'receivedevent' // function, must explicity call 'app.receivedevent(...);' ondeviceready: function() { app.receivedevent('deviceready'); }, thanks, its usual call: document.addeventlistener("deviceready", ondeviceready, false); function ondeviceready() { // safe use device apis } refer official site: http://docs.phonegap.com/en/3.0.0/cordova_events_events.md.html#deviceready

javascript - How to remove cloned elements -

with jquery, trying make function similar filtering system used in website( example ) if click 1 of filter elements, displayed in area. can remove selected filter clicking it. my code works cloning filter element , displaying in area having trouble removing it. i did hours of research not find solution appreciated! here code ---html--- <div id="filter-selected> <ul> <!--selected element comes here --> </ul> </div> <div id="filter-options"> <ul> <li> <!--clicking list clone above area--> <span>value1</span> </li> <li> <!--clicking list clone above area--> <span>value2</span> </li> </ul> </div> ---jquery--- $('#filter-options > ul > li').click(function(event){ var $

c++ - Make a wrapper for cout? -

so here's interesting question, how make kinda wrapper cout? want able add dll can throw programs. basic syntax of should be mything::mesage << "i'm text" << im_an_int << someclass << mything::endl; or mything::mesageandlog << "i'm going print console, , file!" << mything::endl; i can handle of internal logic should put this. kinda stumped. possibly make static stream member in class called message, have event fire when written runs through method? idk, looked around , found sorta similar, throwing dll i'm @ loss. ( how write function wrapper cout allows expressive syntax? ) because requires me use extern , variable, how make static can straight call without creating variable? bit of clarification, this: mydll.h #include <iostream> namespace mynamespace { extern struct logmessage{}; template <typename t> logmessage& operator<< (logmessage &s, cons

Split Java String -

title seems simple. don't idea. situation i have string in java program string scz="3282e81wht-22/24"; i want split above string 3 strings, such first string value should 3282e81 , next string should wht (ie, string part of above string , this part of 3 characters ), next string value should 22/24 ( which occur after - ) in short string first= /* expression on scz , value should "3282e81" */; string second= /* expression on scz , value should "wht" */; string third= /* expression on scz , value should "22/24" */; input can like scz="324p25blk-12"; so 324p25 first string, blk second ( of 3 characters ). 12 third ( after - symbol ) how solve this? if string's second part (wht) etc of 3 characters following code surely you string scz = "3282e81wht-22/24"; string third[] = scz.split("-"); string rev = new stringbuilder(third[0]).reverse().t

asp.net - Avoid website garb programs -

i found several program on internet can grab website , download whole website on pc. how 1 can secure website these programs? link: http://www.makeuseof.com/tag/save-and-backup-websites-with-httrack/ you have tell whether visitor human or bot in first place. no easy task, see e. g. : tell bots apart human visitors stats? then, if detected bot is, can decide wether want give website content or not. legitimate bots (like googlebot) conveniently provide own useragent id; malicious bots / web crawlers may disguise common browser programs. there no 100% solution, anyway. if content sensitive, may want add captcha, or user authentication.

Switch Case in php Multiple Case run in function? -

switch(n){ case "badge01": case "badge02": case "badge03": case "badge04": case "badge05": //dosomething break; } hi above's switch case statement, use function run multiple loop generate case's name, can know how generate function on switch case statement this? switch(n){ case badgenameloop(): //dosomething break; } and possible that? thanks , sorry bad english. according php manual the case expression may expression evaluates simple type, is, integer or floating-point numbers , strings. arrays or objects cannot used here unless dereferenced simple type. i'm afraid can not have loop case statement, hence waste of time trying.

sharepointfoundation2010 - SPSiteDataQuery and Look-up column -

i have requirement of iterating multiple tasks list under sharepoint sites , sub-sites. using spsitedataquery achieving this. having issue in fetching data when column of type look-up. using following code: query.viewfields +=fieldref name=\"predecessors\" type=\"lookup\" nullable=\"true\" /; (have removed < , " symbol blocking code) this fetches other columns in datatable value of column predecessors blank rows. any pointers in regard highly helpful. cheers chitranshi | sharepoint consultant| mindfire solutions spsitedataquery not support multiple value columns. however, 1 can filter results using spsitedataquery on column. in order values of column use spquery iterate through each , every lists can through spsitedataquery. in approach got list ids of various lists in sites , sub-sites using spsitedataquery , using list ids fetched list , corresponding values look-up column using spquery. cheers chitranshi | sharepoint

html - why html5 is used necessarily? -

this question has answer here: is there advantage of new html5 elements? 2 answers i'm surprisingly amazed @ following codes found in joomla2.5 template: beez5 <?php if(!$templateparams->get('html5', 0)): ?> <div id="header"> <?php else: ?> <header id="header"> <?php endif; ?> yeah! it's age of html5 code asking if browser supports html5 add <header id="header"> tag otherwise add <div id="header"> . why template not using <div id="header"> instead of both? question: difference between old markup <div id="header"> , new markup <header id="header"> ? if browsers supports html5, behaves differently <div id="header"> when using <header id="header"

java - how to write first servlet class in Eclipsed -

package com.example; import java.io.ioexception; import javax.servlet.servletexception; import javax.servlet.annotation.webservlet; import javax.servlet.http.httpservlet; import javax.servlet.http.httpservletrequest; import javax.servlet.http.httpservletresponse; /** * servlet implementation class helloworld */ @webservlet("/helloworld") public class helloworld extends httpservlet { private static final long serialversionuid = 1l; /** * @see httpservlet#httpservlet() */ public helloworld() { super(); // todo auto-generated constructor stub } /** * @see httpservlet#doget(httpservletrequest request, httpservletresponse response) */ protected void doget(httpservletrequest request, httpservletresponse response) throws servletexception, ioexception { // todo auto-generated method stub } /** * @see httpservlet#dopost(httpservletrequest request, httpservletresponse response) */ prot

php - Rickshaw : data for multiple series not working -

i'm trying create charts using rickshaw , importing data ajax generated in php. if use static datas, chart displays; if copy/paste data generated in php (from console/log()), chart displays; if try put datas variable, , use var in js, doesnt' work. :( this console log of .php : (as said, if copy paste block of code .js substituting "dataoutevo" var, graph displays should. so, don't think data problem. [ { name: "ligne", data: [{x:0,y:35},{x:1,y:34},{x:2,y:36},{x:3,y:35},{x:4,y:40},{x:5,y:35},{x:6,y:37},{x:7,y:40},{x:8,y:45},{x:9,y:46},{x:10,y:55},{x:11,y:63},{x:12,y:61},{x:13,y:45},{x:14,y:48},{x:15,y:49},{x:16,y:45},{x:17,y:44},{x:18,y:52},{x:19,y:43},{x:20,y:37},{x:21,y:36},{x:22,y:37},{x:23,y:34}], color: palette.color() }, { name: "ligne", data: [{x:0,y:10},{x:1,y:15},{x:2,y:13},{x:3,y:15},{x:4,y:14},{x:5,y:16},{x:6,y:17},{x:7,y:25},{x:8,y:23},{x:9

jsf - <f:ajax> doesn't work on PrimeFaces component -

i trying use onchange event of selectonemenu , doesn't work , component not displayed when add onchange attribue. can tell me how can handle onchange event of <p:selectonemenu> ? here view: <p:selectonemenu id="service" filtermatchmode="startswith"> <f:selectitem itemlabel="selectionner un service : " /> <f:selectitems value="#{newopprogramme.listesevice}" var="service" itemvalue="#{service.serviceid}" itemlabel="#{service.servicenom}"/> <f:ajax event="change" execute="@this" listener="#{newopprogramme.servicechange()}" render="nomcdp"/> </p:selectonemenu> and here <f:ajax listener> method in request scoped bean: public void servicechange() { system.out.println("change"); } when change menu, however, nothing been printed. how caused , how can solve it? first of all, onch