Posts

Showing posts from June, 2011

php - How to add a value from a HTML form to a value in a database -

i trying create form allow user update data form existing amount in database. here have far appears double value. thinking needed pull value database , add data form. <?php $username = "username"; $password = "password"; $hostname = "localhost"; //connection database $dbhandle = mysql_connect($hostname, $username, $password) or die("unable connect mysql"); echo "<font face=tahoma color=#ff000><b>connected mysql</b></font><br><br>"; //select database work $selected = mysql_select_db("pdogclan_points",$dbhandle) or die("did change"); // formulate query $_post["filter"]; $memid = mysql_real_escape_string($_post["member_id"]); $query = sprintf("select member_id, bank, reward_1, reward_2, reward_3 points_rewards member_id = '$memid'") or die("could not formulate query"); //execute sql query , return records $result = mysql

c++ - How to convert a string to a series of integers? -

making rpg , want currency represented in platinum, gold, silver , copper. unfortunately, professor wants currency stored string (i.e. string class, not cstrings). example -- 0.1.23.15 0 platinum, 1 gold, 23 silver , 15 copper. i know big idea of how implement this. example -- use strtok (i.e. believe works on cstrings) or other c++ function accomplish this? here's 1 solution: #include <iostream> #include <sstream> #include <vector> using namespace std; int main() { string str="0.1.23.15",temp; stringstream s(str); vector<int> v; while(getline(s,temp,'.')) { v.push_back(stoi(temp)); } for(int i: v) cout << << endl;//c++11 style //for(int i=0; i<v.size(); i++) cout << v[i] << endl; //old school :d system("pause"); return 0; }

windows - Simple RequireJS in node -

i exclusively use requirejs node. i cannot seem run in same file when run "node r.js file.js": define('a', function () { console.log("loaded a"); return {}; }); require(['a'], function(a){ }); is there way override define , require strictly requirejs' definitions. also there way strictly r.js , not installing requirejs npm. you can use require.js in node! the require.js documentation includes section on installing require node.js . first, go console (assuming have npm should) , type: npm install requirejs after that, you're set up. first need require require (no pun intended), in top of main js file, need like: var requirejs = require('requirejs'); then, can configure it: requirejs.config({/*your config shims,etc goes here*/}); that's it! can use it: requirejs(["module1","module2"],function(mod1,mod2){ //whatever here }); there more detailed instructions o

ruby - How to make Rails app perform an action depending on if a checkbox is checked? (RoR) -

i have checkbox in view called post_form.html.erb uses post. here's full code of below: <%= form_for @post, :html => {:multipart => true} |f| %> <%= render 'shared/error_messages', object: @post %> <div class="field"> <%= f.text_area :content, :cols => 5, :rows => 5 %> </div> <div class="itemcontainer"> <div class="iteminput">add photo:<br> <%= f.file_field :image %> </div><div class="itemcheckbox"> <label for="a">run script?</label> <div class="itemcheckboxalign"><input type="checkbox" id="a"></div> </div></div><br> <%= f.submit "post", class: "btn btn-large btn-primary" %> <% end %> the above used post , use show.html.erb view. can see in above code, there's checkbox during posting process. want if checkbo

c# - Solrnet not finding SolrField attribute -

i trying integrate solrnet project working on , unable solrnet produce document populated poco. below example of pocos i'm using public class person : icustominterface { [solrfield("text")] public string contactnumber { get; set; } [solrfield("text")] public string contactfax { get; set; } [solrfield("text")] public string contactemail { get; set; } [solrfield("text")] public string familyname { get; set; } [solrfield("text")] public string givenname { get; set; } [solrfield("text")] public string middlename { get; set; } [solrfield("text")] public string title { get; set; } [solrfield("text")] public string gender { get; set; } [solrfield("text")] public string placeofbirth { get; set; } [solrfield("text")] public string countryofbirth { get; set; } [solruniquekey("id")] public

rest - What should my JSON response contain when I have an HTTPException? -

i let users register application in following code: [system.web.http.httppost] [system.web.http.allowanonymous] //[validateantiforgerytoken] //public httpresponsemessage register(registermodel model, string returnurl) public userprofiledto register(registermodel model) { if (modelstate.isvalid) { if (websecurity.userexists(model.username)) { throw new httpresponseexception(httpstatuscode.conflict); } else { // attempt register user try { websecurity.createuserandaccount(model.username, model.password); websecurity.login(model.username, model.password); initiatedatabasefornewuser(model.username); formsauthentication.setauthcookie(model.username, createpersis

c# - Is it possible to have a REST url parameter with an ampersand? -

using system.servicemodel libraries routing, have rest service simple template looks "{searchterm}?opt={somesearchopt} so call like: http://myhost.contoso.com/searchapi/river%20expeditions to search phrase "river expeditions" no options. this accepts search phrase , returns results. works fine. however, if searching phrase contains literal ampersand, such "lewis&clark", tried obvious of url encoding ampersand lewis%26clark but request never routed, server returns 400 bad request. clear being interpreted query string delimiter, , makes request invalid since particular template expecting url parameter , has no preceeding '?' delimiter. since these search phrases may have other restricted characters, expected url encoded client, , when routed, rest api calls httputility.urldecode on parameter. question if there technique getting url encoded ampersand correctly routed rest url parameter , not pre-emptively interpreted , r

SQL Error: ORA-00904: : invalid identifier in creating table -

sql error: ora-00904 my code is: create table vintagewine ( wine_id varchar2(5) not null, wine_name varchar2(25) not null vintage_year varchar2(4) not null, employee_id varchar2(6) not null, constraint pk_vintagewine primary key(wine_id), constraint fk1-vintagewine foreign key(wine_name) references wine(wine_name), ); error: error @ command line:8 column:14 error report: sql error: ora-00904: : invalid identifier 00904. 00000 - "%s: invalid identifier" *cause: *action: i don't know what's wrong code. did dumb? either constraint fk1-vintagewine illegal, or fk1-vintagewine must quoted, think. use underscore instead of hyphen.

r - gridExtra tableGrob error of wrong sign when using grid.draw() -

the following code xta=t(rnorm(37,mean=400,sd=50)) xtb=tablegrob(xta,show.rownames=f,show.colnames=f,gpar.corefill=gpar(fill='white',col='black'),show.vlines=t,show.hlines=t) grid.draw(xtb) gives me error of error in seq.default(2, ncol, 1) : wrong sign in 'by' argument grid.table(t(xta)) edit (mnel) this can traced show.hline argument` grid.table(xta, show.hline = true) gives error in seq.default(2, ncol, 1) : wrong sign in 'by' argument while default grid.table(xta) works well. the same issue arises when pass d data.frame , (as function requires) xtdf <- as.data.frame(xta) grid.table(xtdf, show.hline = true) ## error in seq.default(2, nrow, 1) : wrong sign in 'by' argument ## grid.table(xtdf) ## works expected

reflection - Overriding or modifying a Java class constructor at runtime -

i have class being instantiated part of sequence (a method goes through random list of classes , creates 3 instances of each) i writing 1 of classes in list (note: classes exist in same package) i unable modify source files of of other classes , need either stop instantiation of classes following own or override constructor empty method. i have far tried using reflection, , have been looking @ classloader cant figure out how this i can gain reference constructor reflection far have been unable interfere it edit -> thought had (dynamically re-write , recompile target classes), code compiles im getting exception stops new class compiling private void rewrite(string name) {//throws ioexception { try{ file sourcefile = new file("/temp/" + "name" + ".java"); system.out.println("file defined"); filewriter writer = new filewriter(sourcefile); system.out.println("filewriter defined"); writer.write(&qu

Does a javascript function call run before the entire script is finished parsing? -

i know javascript executes code in sequential order. trying identify whether of code run instantly, "line after line", after each function compiled executed, or immediate functions calls in script wait entire script finish parsing before run. i'd better understanding of way javascript parses , execute code. external scripts, seem bit hard observe in console log. one applicable use, try , intercept 'interactive' document.readystate possible within external script, due fact "interactive" state can fire extremely @ times. per http://bugs.jquery.com/ticket/12282#comment:15 no. entire content of script tag (regardless of whether inline or external) must parsed before can evaluated. this because of way javascript 'hoists' variable , function declarations top of scope: http://elegantcode.com/2011/03/24/basic-javascript-part-12-function-hoisting/

vb.net - phone type in computed property -

in following code sample property type [mainswitchboardphone] "phone". when make computed clinichospitaladdress property summary property entity phone number show in data entry screen (555) 555-5555 format rather merely string. i.e. 5555555555. there way this? private sub clinichospitaladdress_compute(byref result string) ' set result desired field value result = [clinichospital] & " " & [streetaddress] & ", " & _ [city] & " " & [mainswitchboardphone] try: result = string.format("{0} {1}, {2} (###) ###-####" _ , [clinichospital] _ , [streetaddress] _ , [city] _ , convert.toint64([mainswitchboardphone]) _ ) edit: added convert.toint64

JavaFX adding custom item to Pane -

i have fxml file has pane 1 of it's entries, used output of our program. have pane contain htmleditor. i'm little bit confused @ accomplish this. class uses singleton pattern recommended, , can call controller pane. then find myself having create inner class, since htmleditor not node. extended rectangle this, , use getchildren.add(htmleditorwrapper) try , add node. of course, htmleditor not show when run program. the gist of question: how add htmleditor pane (which in fxml file)? import javafx.scene.layout.pane; import javafx.scene.shape.rectangle; import javafx.scene.web.htmleditor; /** * gets controller's outputpane (the console in gui) * @author matt * */ public class outputpanel{ private static pane pane; private static htmleditorwrap htmleditor = new htmleditorwrap(); private static final outputpanel outputpanel = new outputpanel(); private outputpanel(){} public static outputpanel getinstance(){ pane = controller.

mysql - Database design a simple database for a functional school -

so having little trouble in coming entity-relationships database have of design process done of minimum caliber. database created students can have many courses many many relationship (obvious know). database need keep track of homework , attendence daily. however, classes can 1 day of week or many days. advisors->(advisorid, firstname, lastname, phone , email) students->(studentid,firstname, lastname, phone, email) courses->(courseid, description, startdate, statetime, room) studentscourses->(studentid, courseid) here stuck, thinking of creating calendar table, how correlate data homework table , attendance. if suggestions great criticism welcome. you need create more entities achieve efficient database design. 1 solution be: attendance(id,student_id,course_id,date) homework(id, course_offering_id, date) -- course_offering_id: primary key of student courses -- since many many relation lies between homework , student homework_student(id, homewor

cocos2d iphone - CCEaseIn etc inside CCSequence -

how use easing inside ccsequence? related using cceaseout ccsequence? here example. brings mapnode left border, example when lhs menu popped out. move duration , acceleration computed function of expected displacement : - (void)setleftclamp:(float)leftclamp { _leftclamp = leftclamp; cgpoint currentposition = self.mapnode.position; if (currentposition.x > self.maxx) { // ease right in position cgpoint delta = ccp (self.maxx - currentposition.x, 0); id move = [ccmoveby actionwithduration:[self moveduration:delta] position:delta]; id ease = [cceasein actionwithaction:move rate:[self moveacceleration:delta]]; id delay = [ccdelaytime actionwithduration:.1f]; id easeandcenter = [ccsequence actions:ease, delay, [cccallfunc actionwithtarget:self selector:@selector(onmovecomplete)], nil]; [self.mapnode runaction:easeandcenter]; targetmaplocatio

ruby - rails accessing ActionDispatch error -

i trying change data on request before save request {"image"=>{"picture"=>[#<actiondispatch::http::uploadedfile:0x10c865af8 @tempfile=#<file:/var/folders/bx/6z1z5yks56j40v15n43tjh1c0000gn/t/rackmultipart20130404-53101-1p7gv92-0>, @headers="content-disposition: form-data; name=\"image[picture][]\"; filename=\"ata.png\"\r\ncontent-type: image/png\r\n", @content_type="image/png", @original_filename="ata.png">, #<actiondispatch::http::uploadedfile:0x10c865ad0 @tempfile=#<file:/var/folders/bx/6z1z5yks56j40v15n43tjh1c0000gn/t/rackmultipart20130404-53101-992qy5-0>, @headers="content-disposition: form-data; name=\"image[picture][]\"; filename=\"ata@2x.png\"\r\ncontent-type: image/png\r\n", @content_type="image/png", @original_filename="ata@2x.png">], "album_id"=>"10"}, "authenticity_token"=>&qu

jquery - Dropdown merged to an edit field (with autocomplete) -

i´m begginer excuse if it´s basic. here´s question: i´d have dropdown field. user click arrow see options , choose one. but same dropdown should allow user type , (like google does) options (already loaded dropdown) start suggested in poup below. for example....imagine dropdown have big list of professions (designer, teacher, director...) you use arrow expand list, navigate , select profession want...but..you start typing t...so profession starting t displayed in popup below...easily allowing select correct. i have no idea on how create such feature? have tip? would possible using css3 only? or jquery? thank much best regards gustavo. well, there excelente plugin called jquery choosen. using jquery can initialize way: <select data-placeholder="choose option..." class="my-chosen"></select> $(".my-chosen").chosen({no_results_text: "no results matched"}); take look: http://harvesthq.github.com/chosen/

r - Plot Vector of Points in Time Series Data Matrix -

Image
i have 100*8 data matrix each row vector of values @ 8 different time points. interested know how plot following matrix in r graph closely similar 1 below: here example of data matrix. 1 2 3 4 5 6 7 8 line1 0.22 0.075 0.35 0.89 0 0.35 0.42 2.34 line2 0 0.47 0.89 2.51 0 0.36 1.14 2.09 line3 1.22 0.075 0.35 0.89 0 0.35 0.42 1.34 line4 2.22 0.75 0.45 0.99 0 0.54 0.24 2.34 line5 3.22 0.275 0.55 0.819 0 0.25 0.34 2.34 any or advice highly appreciated. thanks. try matplot() . default treats columns series need transpose ( t() ) data frame before use. here example using subset of data supplied timeser <- read.table(text = " 1 2 3 4 5 6 7 8 line1 0.22 0.075 0.35 0.89 0 0.35 0.42 2.34 line2 0 0.47 0.89 2.51 0 0.36 1.14 2.09 line3 1.22 0.075 0.35 0.89 0 0.35 0.42 1.34 line4

haskell - Is there an issue with an Event and a Behavior having the same initial value? -

there's find unsatisfying below code. develop bgamestate , add more events. fact playerinpute (and imagine other events ) share same initial value lead problems? in other words, initial design sound enough build off of? also, there alternative using changes ? think meet criteria correct use, not sure. makenetworkdescription :: addhandler playercommand -> tchan gamestate -> io eventnetwork makenetworkdescription addcommandevent gschannel = compile $ einput <- fromaddhandler addcommandevent let playerinpute = accume initialgs $ updategs <$> einput bgamestate = stepper initialgs playerinpute egamestate <- changes bgamestate reactimate $ (\n -> (atomically $ writetchan gschannel n)) <$> egamestate i not quite understand trying do, can use accumb combinator defined as accumb x e = stepper x (accume x e) to remove definition of playerinpute . it appears me chang

Routing Polymorphic Requests Rails -

in rails 3, have several polymorphic models such image , comment , question is, when makes request create/update/destroy polymorphic object, should request go single controller polymorphic object commentcontroller , or should request routed controller of polymorphic accessor i.e. statuscontroller or imagecontroller ? the pros of single controller more dry , more restful, bad thing feels me couples application more, many things tied 1 single controller. have official answer question? edit: question not asking route goes, question asking where should route go? semantic solution? thanks clarification. you should let comment controller handle crud actions on comments. original argument correct way more dry , restful. logistics comment controller have handle isn't complex, should still left relatively thin comment controller. if still concerned actions in comment controller getting fat, can abstract away of logic writing methods in comment model handle of logic.

android - how to reset the zoom level of the image to original? -

i need set zoom level of image (in imageview ) original state i.e fits imageview , zoom-in has been removed. have tried store image matrix value @ time of opening image (when fit screen) , on 'reset' button click assign value imageview zoomed in (and might have modified matrix); not helping.. not sure if related matrix defines zoom level of image or there else need set. code snippet: ps. ' zoommatrix ' image matrix @ time when image has opened n fit screen. 'touch' object of class extending imageview . resetzoom.getitem().setonmenuitemclicklistener( new menuitem.onmenuitemclicklistener() { public boolean onmenuitemclick(menuitem item) { touch.setimagematrix(touch.zoommatrix); touch.setscaletype(scaletype.matrix); touch.invalidate(); return true; } }); you need is, implement simple code in reset button setcontentview(r.layout.activity_image); this reset activity origina

ios - Infinea Tab integration in Ipad -

in universal application, have integrated linea pro barcode scanner iphone working fine after integration of linea pro sdk. integrate infinea tab barcode scanner ipad. surfed, didn't proper. need known whether sdk available integrate infinea or not. please guide me. the same sdk used both linea pro , infinea tab. can find @ http://www.ipcprint.com/developer

ruby on rails - CSRF token authencity for sub controller -

i getting csrf warning (resetting session) in rails apps whenever post api_controller.rb. my app run on iframe in phonegap windows phone 8 , in application_controller, have p3p header solve problem. doesn't seem work in case. p3p not there...? has encountered this? class applicationcontroller < actioncontroller::base protect_from_forgery before_filter :header_fix protected def header_fix headers['p3p'] = 'cp="all dsp cor cura adma deva our ind com nav"' end end class api::apicontroller < applicationcontroller before_filter :login_required skip_before_filter :detect_device skip_before_filter :detect_browser skip_before_filter :record_log skip_before_filter :assign_packages skip_before_filter :assign_daily_bonus end [2646 - 2013/04/05 13:04:23] (info) started post "/api/chests" 60.50.19.249 @ 2013-04-05 13:04:23 +0800 [2646 - 2013/04/05 13:04:23] (info) processing api::chestscontroller#create */* [2646 - 2013/04

cordova - Local Database development in cross platform applications windows phone 7 in particular. (develop using javascript) -

i developing application windows phone 7 uses offline database. have seen of solutions follows sqlite db http://sqlitewindowsphone.codeplex.com/ mango db http://www.kunal-chowdhury.com/2011/06/windows-phone-7-mango-tutorial-24-local.html my question these databases using native code i.e development in c#. develop local database either phonegap or javascript or else other uses cross platform applications (windows phone in particular). in advance. you should check web sql, here resources: phonegap storage documentation, including working code web sql database tutorial also, consider integrating sqlite: related question stack overflow working example using sqlite good luck, hope helped.

android - Working Sound/Vibrate/LED of notification until i cancel it? -

noti code : notificationcompat.builder noti = new notificationcompat.builder(context) .setsmallicon(r.drawable.work_alarm_icon) .setcontenttitle("alarm") .setcontenttext(w.tostring()) .setcontentintent(pintent) .setsound(uri.parse("android.resource://com.google.app.workalarm/" + r.raw.alarm)) .setstyle(new notificationcompat.bigtextstyle().bigtext("...")); noti.build().flags |= notification.flag_insistent; noti.setlights(color.white, 1000, 500); noti.setvibrate(new long[]{0,500,250,500}); i want listen sound/vibrate , led until cancel it. (when click button cancel in new activity). me ! thank ! you cannot notification's features. if need, shall open activity , sound/vibrate there

Limited ListField items are drawn instead of complete list in Blackberry -

i trying draw list of contacts saved in device. fine when select contacts, contacts drawn on screen. in other words, list drawing contacts visible on screen. remaining contacts have scroll list. here code: public class checkboxlistfield extends verticalfieldmanager implements listfieldcallback, fieldchangelistener { private static vector selectedcontacts ; private checklistdata[] mlistdata = new checklistdata[] {}; private listfield mlistfield; private static vector mcontacts; private contactlist contactlist; private enumeration allcontacts; private sendemail sendemail; private boolean ischecked=false; private blackberrycontact contactitem; private verticalfieldmanager _mainvfm = new verticalfieldmanager(); private int i; private int j=0; private string emails=""; private buttonfield _invitebutton; private horizontalfieldmanager selectallhfm; private custombuttonfield selectallbutton; private bitm

javascript - Increasing jCarousel visible image not working -

i tried increasing number of visible images 5 still carousel shows 3 images. have increased width in css jcarousel-container-horizontal , jcarousel-container-horizontal classes still shows 3 images default. can me out overwrite default parameter show 5 images on page load on scrolling carousel i believe size attribute have set... so... jquery('#mycarousel').jcarousel({ size: 5, visible: 5 }); i think may have set these too... .jcarousel-skin-ie7 .jcarousel-container-horizontal{ width:750px;//whatever width need} .jcarousel-skin-ie7 .jcarousel-clip-horizontal { width:740px;//whatever width need } it looks may have tried though? browser using?

My django project can't runserver on my own pc -

hi , taking time see question. i newbie on python. i'm want start site on pc. when use "django-admin.py" make project,all things good. when use "python manage.py runserver",it notices me that: importerror: not import settings 'test.settings' (is on sys.path?): no module named settings i check code, things right. manage.py writes: #!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("django_settings_module", "mysite.settings") django.core.management import execute_from_command_line execute_from_command_line(sys.argv) my folder this: hua@sun-rev-1-0:~/hua/mydjango/mysite$ ls manage.py mysite and project right; hua@sun-rev-1-0:~/hua/mydjango/mysite$ tree mysite/ mysite/ ├── __init__.py ├── settings.py ├── urls.py └── wsgi.py now use python see os.path: hua@sun-rev-1-0:~/hua/mydjango/mysite$ python python 2.7.3 (default, sep 26 2012, 21:53:58) [gcc 4.7.2] on linu

c# - A Windows Service should load a form at startup -

how can load 'login form' in onstart event of windows service?! know windows service incompatible ui. need without using windows startup.. possible? , how? lot. how can load 'login form' in onstart event of windows service? you cannot this, because windows services cannot display user interface. i know windows service incompatible ui. oh. knew that. good. but need without using windows startup.. this not change fact not supported , not work. is possible? , how? no, because: windows service incompatible ui. so do!?! the real answer here design wrong. if need log in application, should not creating service. just make standard windows application (e.g., using windows forms or wpf) , set start automatically when user logs on computer. can accomplished adding shortcut users "startup" folder. then, when app runs, can display whatever ui need to, without limitations of service.

How to destroy sprite with body by tag COCOS2D Box2D -

ccsprite* sprite = (ccsprite*)[self getchildbytag:5]; [self removechildbytag:5 cleanup:yes]; the code in question used remove sprite tag:5, need check - (void)cctouchesended:(nsset *)touches withevent:(uievent *)event { //getting touch locations uitouch *touch = [touches anyobject]; cgpoint location = [touch locationinview: [touch view]]; location = [[ccdirector shareddirector] converttogl: location]; //converting cocos2d positioning b2vec2 locationworld = b2vec2(location.x/ptm_ratio, location.y/ptm_ratio); //getting body list world (b2body* b = world->getbodylist(); b; b = b->getnext()) { //getting fixture bodies b2fixture *bf1 = b->getfixturelist(); //checking whether fixture contains touch location! if (bf1->testpoint(locationworld)) { //if yes assigning user data sprite tempsprite ccsprite *tempsprite = (ccsprite *) b->getuserdata(); //checking whether user data sprite tag 5 if (tempsprite .tag==5) { //if yes remove spr

sql - What can justify a long running EXPLAIN on query (postgres)? -

i'm opposed today new kind of query optimising problem. my query : select * sanrss left join sanrum on sanrum.sanrum___rforefide = sanrss.sanrss___rforefide , sanrum.sanrum___rfovsnide = sanrss.sanrss___rfovsnide , sanrum.sanrum___sanrsside = sanrss.sanrsside left join sanact on sanact.sanact___rforefide = sanrum.sanrum___rforefide , sanact.sanact___rfovsnide = sanrum.sanrum___rfovsnide , sanact.sanact___sanrsside = sanrum.sanrum___sanrsside , sanact.sanact___sanrumide = sanrum.sanrumide , sanact.sanact___sanrumide not null , sanact.sanact___rsanopide='ccam' inner join saneds on sanrss.sanrss___rforefide = saneds.saneds___rforefide , sanrss.sanrss___rfovsnide = saneds.saneds___rfovsnide , sanrss.sanrss___sanedside = saneds.sanedside inner join sandia on (sandia___rforefide, sandia___rfovsnide, sandia___sanrsside, sandia___sanrumide, sandiasig) = (sanrum___rforefide, sanrum___rfovsnide, sanrum___sanrsside, sanrumide, 1) inner join rsaidp on saneds.saneds_

android - unable to resume activity after random selection between pick from gallery and pick from camera -

i unable find root cause of problem unable resume activity. doing wrong app goes crash once random selection between pick gallery , pick camera :( edit: full logcat: 04-05 12:30:07.479: w/iinputconnectionwrapper(17228): showstatusicon on inactive inputconnection 04-05 12:30:17.109: i/rotateimage(17228): exif orientation: 6 04-05 12:30:17.109: i/rotateimage(17228): rotate value: 90 04-05 12:30:20.139: e/swiss insignia(17228): width=1920 04-05 12:30:20.139: e/swiss insignia(17228): height=2560 04-05 12:30:21.609: i/system.out(17228): str1=l@** 04-05 12:30:31.229: i/rotateimage(17228): exif orientation: 6 04-05 12:30:31.229: i/rotateimage(17228): rotate value: 90 04-05 12:30:33.949: e/swiss insignia(17228): width=1920 04-05 12:30:33.949: e/swiss insignia(17228): height=2560 04-05 12:30:35.089: i/system.out(17228): str2=l@** 04-05 12:30:37.909: w/iinputconnectionwrapper(17228): showstatusicon on inactive inputconnection 04-05 12:30:45.829: i/swiss insignia(17456): trying load openc

php mail attachment fails in wordpress -

i'm using wordpress create site. can me figure out why php mail attachment fails attach files other locations other wordpress folder??? here code : $subject="enquiry"; $to = "veena@phenomtec.com"; $from = $_post['email']; $url=$_post['resume']; $attachment = chunk_split(base64_encode(file_get_contents($url))); $filename = basename($url); $parts=explode("?",$filename); $filename = $parts[0]; $boundary =md5(date('r', time())); $headers = "from: $from\r\nreply-to: $from"; $headers .= "\r\nmime-version: 1.0\r\ncontent-type: multipart/mixed; boundary=\"_1_$boundary\""; $message="this multi-part message in mime format. --_1_$boundary content-type: multipart/alternative; boundary=\"_2_$boundary\" --_2_$boundary content-type: text/html; charset=\"iso-8859-1\" content-transfer-encoding: 7bit $message --_2_$boundary-- --_1_$boundary content-ty

iphone - How can I get SEL (@selector()) from object file (Mach-o)? how SEL stored in Mach-o? -

Image
from objc sources can see sel defined typedef struct objc_selector *sel; i have disassembly dylib idaq , , did finde call of _mshookmessageex function, linked libsubstrate.dylib _mshookmessageex has following signature void mshookmessageex(class class, sel selector, imp replacement, imp *result); so can assume in source code there @selector(somemethod:) second parameter in data section of object file can see cfstrings used in source code but there not selector string here, can see @selector() not converted static cfstring i interested find string representations of selector , class passed _mshookmessageex function. how can sel (@selector()) object file (mach-o)? how sel stored in mach-o? thank you! update: i did finde there strings in ida method representation before calling methods i guess there selectors passed in functions. right? selector names stored in __objc_methname section of __text segment: :; otool -v -s __text __objc_methn

.net - How to parse continuous stream of text -

i have task write application controls openvpn using management interface , text stream. i thought using lexer , parser generator lex , yacc job. since there asynchronous lines beginning ">", don't know if possible. should parse text myself or can lex , yacc (actually, fslex , fsyacc, since should use f#) deal sort of thing? thanks. it's feasible. can best handle asynchronous lines overruling input of lexer , take asynchronous lines out @ earliest stage. should lines injected somehow steady stream of tokens or can/will handled separately? injecting steady stream going more difficult unless have easy detect points inject them.

XSLT text for certain child XML -

is possible test of xml not content , attributes belonges xml node? for example: <a> <node/> <node> <node attr="attr1"> <d>test</d> </node> </node> <node> <c attr="attr2"> <d>test</d> </c> </node> </a> here need select <node> nodes child content <node> <c attr="attr1"> <d>test</d> </c> </node> node[c[@attr = 'attr1'][d = 'test']] would select nodes contain at least content, you'd have add further constraints if want only content, e.g. node[count(@*) = 0][count(node()) = 1] [c[count(@*) = 1][count(node()) = 1][@attr = 'attr1'][d[. = 'test'][not(*)]] (this assumes stylesheet has <xsl:strip-space elements="*"/> whitespace-only text nodes can ignored)

Comment box same as facebook but in asp.net -

i have created web application , have created page showing post same facebook comment box not working in asp.net. [webmethod] public static string loadimages( int skip, int take ) { // string image; system.threading.thread.sleep( 2000 ); stringbuilder getimages = new stringbuilder(); // string imagespath = httpcontext.current.server.mappath("~/networking/image/"); // string sitepath = httpcontext.current.server.mappath("~/networking"); //var files = (from file in directory.getfiles(imagespath) select new { image = file.replace(sitepath, "") }).skip(skip).take(take); int records = 0; var files = productdatamanager.getrequiredpost( 1, 100, ref records ).skip( skip ).take( take ); foreach( var file in files ) { string postimage = null; if( file.postimage != "" ) { postimage = file.postimage.replace( "\\", "/" ).substring( 13 ); } string image

3d - iOS Game Engine Choice -

i'm new ios game development i've worked bit on ios apps , had fair share of objective-c. have concept game planned out i'm not sure if i'll need 2d engine or 3d engine. closest example can give how possibly-3d part of gameplay clash of clans, there buildings 3d, never turn around them or anything, see people or character walking between them possibility of zooming in , out , panning. i'm kind of inclined use cocos2d since seems easy , documented want worth @ end, won't limit me someday if want create proper game or expand 1 i'm working on. so should go 3d or 2d development , engine or development environment should go if so? if don't know if you'll need 2d or 3d engine, definition game concept not planned out. ;) whether need 2d or 3d you. if worry limited game engine, pick 1 that's open source. way can make changes yourself. though should not overestimate time , effort required make changes engine, because requires intimate k

iphone - Get duration of Matt Gallagher's AudioStreamer from http url? -

i'm using matt gallagher's audiostreamer stream mp3 files url. need know stream duration can't find how?! i tried use duration property of audiostreamer object, returns 0 perhaps because stream url. help please! audiostreamer = [[audiostreamer alloc] initwithurl:[nsurl urlwithstring:@"http://ia701509.us.archive.org/25/items/tvquran.com__maher/001.mp3"]]; [audiostreamer start]; after starting stream want duration? i found great solution using id3 tags , avasset nsurl *url = [nsurl urlwithstring:@"your url here"]; avasset *asset = [avurlasset urlassetwithurl:url options:nil]; nslog(@"> duration = %.2f seconds", cmtimegetseconds(asset.duration));

actionscript 3 - SecureSocket.isSupported == false -

i try use securesocket securesocket.issupported == false. when use simple socket ok. did use securesocket? here code: security.allowdomain(' '); security.allowinsecuredomain(" "); security.loadpolicyfile("xmlsocket://" + host + ':' + port + "/crossdomain.xml"); if(securesocket.issupported) { c = new securesocket(); receivebuffer = new bytearray(); receivebuffer.endian = endian.little_endian; c.addeventlistener(event.close, closehandler); c.addeventlistener(ioerrorevent.io_error, ioerrorhandler); c.addeventlistener(securityerrorevent.security_error, securityerrorhandler); c.addeventlistener(event.connect, connecthandler); } else { try { c = new securesocket();