Posts

Showing posts from September, 2010

implement web crawler service for ios app -

i want develop ios app on xcode provide web crawler service user. want implement server , implement php web crawler in server backend of app. had installed ubuntu server on pc, possible implement web crawler service on that. if not server can use , how can connect ios app. you missing question mark , sentence can figure out question wether or not possible, therefore: yes

PL/SQL error in Oracle Application Express -

i trying make package in oae, function, procedure , cursor. when trying run it, have following error error @ line 21: pls-00103: encountered symbol "cursor" when expecting 1 of following: end not pragma final instantiable order overriding static member constructor map this si code: create or replace package packageproiect procedure del_banca ( p_banid.id_banca%type) begin delete banci_pnu id_banca=p_banid; if sql%notfound raise_application_error(-20203, 'nicio banca nu fost stearsa din baza de date'); end if; end del_banca; begin packageproiect.creste_credit(1,20,'ipotecar'); end; function formatnume (p_nume in varchar, p_prenume in varchar) return varchar begin return p_nume || ' ' || p_prenume; end; cursor c_toticlientii select nume,prenume clienti v_formatarenume varchar(70); begin v_clientrecord in c_toticlientii loop v_formatarenume := formatnume(v_clientrecord.nume, v_clientrecord.pr

javascript - How do I wrap all text nodes with <p> in a div that also may contain other <p> tags and tags such as <strong> using jQuery? -

i have below example html: <div> wrap text p includes <strong>this</strong> , <a href="">this</a>. <h1>heading 1</h1> <p>some other text</p> wrap text p includes <strong>this</strong> , <a href="">this</a>. </div> the desired result using jquery: <div> <p>wrap text p includes <strong>this</strong> , <a href="">this</a>.</p> <h1>heading 1</h1> <p>some other text</p> <p>wrap text p includes <strong>this</strong> , <a href="">this</a>.</p> </div> i think iterate on contents of div , create group of items wrapped given below var $group = $(); $('div').contents().each(function () { if (this.nodetype == 3 || !$(this).is(':header, div, p')) { if (this.nodetype != 3 || this.nodevalue.trim()) { $group = $g

r - t.test on data formatted for boxplot -

i have data formatted in way. says algorithm had result 1 on input1 , other had result 0.6 on input1. label input1 input2 mine 1 0.9 mine 0.9 0.7 mine 0.5 0.2 other 0.6 0.7 other 0.8 0.3 other 0.3 0.1 after searching lot on internet, succeeded plot nice boxplot: library(reshape2) library(lattice) dataset <- read.table("sample.txt", header=true, sep="", na.strings="na", dec=".", strip.white=true) dat.m <- melt(dataset,id.vars='label') bwplot(value~label | paste0(variable), data=dat.m, main="mine vs other", layout=c(2,1), par.settings = list(box.rectangle = list(fill= rep(c('blue','red'),2)))) how can perform paired t.test comparing mine vs other ? i guess whole problem due new format , melt not used to. way used before putting mine in 1 colunm , other in column , call this: t.test(dataset$mine,dataset$other,paired=t) . thanks i found 2 options of

javascript - Cordova add android error -

i trying add cordova android app , getting json parsing error. i think cordova error, because can create , test projects ionic , phonegap @ android emulator. c:\>cordova create hello hello.cd.cm helloworld creating new cordova project name "helloworld" , id "hello.cd.cm" @ lo cation "c:\hello" c:\>cd hello c:\hello>cordova platform add android -verbose no version supplied. retrieving version config.xml... cordovaerror: unable fetch platform android: error: failed parse json unexpected token @ c:\users\user\appdata\roaming\npm\node_modules\cordova\node_modules\cordo va-lib\src\cordova\platform.js:194:15 @ _rejected (c:\users\user\appdata\roaming\npm\node_modules\cordova\node_mo dules\q\q.js:797:24) @ c:\users\user\appdata\roaming\npm\node_modules\cordova\node_modules\q\q.j s:823:30 @ promise.when (c:\users\user\appdata\roaming\npm\node_modules\cordova\node _modules\q\q.js:1035:31) @ promise.promise.promisedispatch (c:

asp.net - WebConfig URL Rewrites in IIS -

have asp.net solution , want achieve 2 things: - redirect www.mydomain.com mydomain.com have friendly urls so ... here have added system.webserver section of webconfig... <rewrite> <rules> <rule name="remove www prefix" > <match url="(.*)" ignorecase="true" /> <conditions trackallcaptures="false"> <add input="{http_host}" pattern="^www\.mydomain\.com" /> </conditions> <action type="redirect" url="{mapprotocol:{https}}://mydomain.com/{r:1}" redirecttype="permanent" /> </rule> <rule name="homepage" stopprocessing="true" > <match url="^/wwwzone/homepage.aspx$"/> <action type="redirect" url="/"/> </rule> <rule name="homepagereal" stopp

android - The activity is not restored after back from system camera -

i have activity call system camera take photo , returned photo. activity not restored. printed log , found onpause() called onsaveinstancestate() , onstop() not called after calling system camera. suspend activity killed system because of low memory. onsaveinstancestate() should called if system kills activity, isn't it? does reasons cause onsaveinstancestate() not called? has workaround problem? have no idea come here. i know android camera (the garbage collector) 'kills' other applications in case there not enough memory. activities in background, , activity started camera! might have problem? see phonegap camera android kills cordova , phonegap camera restarts application this might heandy: http://developer.android.com/reference/android/app/activity.html can check ondestroy() ... not sure can this..

parse.com - Swift fit annotations -

Image
i have few locations in parse i'm query-ing. shows annotations zoom last one. how can find max , min latitudes , longitudes , make them fit ? there plenty of these on stackoverflow they're in objective-c. the examples in objective-c still valid since underlying sdk/api still same -- being called using different language (and there's documentation). to show annotations, there 2 ways it: use convenient showannotations method. pass array of annotations , automatically calculate reasonable region display. call after adding annotations (after for loop). in fact, showannotations add annotations if aren't on map. show annotations on map, pass map's own annotations array. example: self.mapview.showannotations(self.mapview.annotations, animated: true) if not happy default region calculated showannotations , can calculate 1 yourself. instead of calculating minimum/maximum latitudes , longitudes, etc, prefer use built-in mkmaprectunion funct

java - Canvas.drawText not drawing in exact position -

this gist of android app does: 1. user selects picture gallery or default pictures in app 2. picture displayed in imageview 3. user clicks anywhere on picture 4. user types text , clicks 'done' button 5. text drawn on bitmap using canvas.drawtext the problem: text not drawn user clicks. noticed problem occurs pictures bigger can fit in imageview. this code retrieves coordinates user clicked: mimageview.setontouchlistener(new ontouchlistener() { @override public boolean ontouch(view v, motionevent event) { // todo auto-generated method stub if (event.getactionmasked() == motionevent.action_up) { xcoord = event.getx(); ycoord = event.gety(); medittext.settext(""); toast.maketext(getapplicationcontext(), xcoord + ", " + ycoord, toast.length_long).show(); } return true; } }); and code draws text on bitmap: string text = medittext.gettext().tostring(); paint textpaint = new textpaint(paint.anti_alias_flag); textpaint.setc

Generate random questions in swift -

can help? have true or false game, however, want questions shuffled/random. know there previous shuffle answers can't head around it. example, questions in append section should appear @ random. have been trying different things days. had @ arc4random had hard time implementing it. don't want spoon fed decent answer looking for. here swift code // viewcontroller.swift // trueorfalse // // // import uikit class viewcontroller: uiviewcontroller { // classes class newlabel:uilabel { convenience required init(width:cgfloat, height:cgfloat, framewidth: cgfloat, frameheight: cgfloat) { self.init(frame: cgrectmake(0, 0, framewidth, frameheight)) self.center = cgpointmake(width, height) self.font = uifont(name: "helveticaneue-medium", size: 18) } } class newbutton:uibutton { var button:uibutton! convenience required init(width:c

c++ - hardcoded address in disassembly -

i'm writing optimized windows based shellcode in c++ , have problem avoiding hardcoded addresses in c++ while passing function. e.g: my_createthread(null, null, (lpthread_start_routine)&thread_callback, null, null, null); dword winapi thread_callback(lpvoid lpparam) { // stuff.. } in disassembly, shows createthread(..., cardcoded_address, ..); instead, want pass address "from location thread_callback" is there way avoid it? (because shellcode should address independent?) regards. anyways, searching/doing stuff , final thing i've done can solve delta offset. explanation: @ first function of code, there should function this: dword delta; __asm { call getbasepointer getbasepointer: pop eax sub eax, getbasepointer mov [delta], eax } you can google delta offset more details. afterwards, can this: my_createthread(null, null, (lpthread_start_routine)((dword)thread_callback + (dword)delta), null, null, null); dword

firefox addon - Is it possible to allow a content function to run in browser scope? -

is possible (how) addon allow specific function in document/page/content scope run in browser scope? (i aware of security implications , specific , specific purpose.) as general example, xmlhttprequest in content script has content scope. gm_xmlhttprequest via greasemonkey has browser scope. imagine having gm_xmlhttprequest in content script , wanting addon allow gm_xmlhttprequest run in browser scope. there 3 separate security scopes (called principals ) involved when scripting page. the system principal (full access everything, including operating system apis) the expanded principal of sandbox may scoped 1 or more origin domains. when scoped single domain it's still considered more privileged content itself the content principal of page itself so if want run addon-script performs cross-origin xhr you not need grant privilege page content itself . you need grant sandbox in addon-script runs, separated xray-wrappers untrusted page-content. if you

c# - Exceptions - What really happens? -

i've seen number of articles, , questions of focus on cost of exceptions, performance benchmarks, , so. but nothing seems explain why slow. happens under-the-hood magnitudes slower when 1 thrown. articles stack unwinding makes slow. don't understand why makes magnitudes slower. from brief understanding of seh, every time thread enters try block, has add say, kind of marker location onto exception chain in tib. has costs, while trying walk stack. understand part. doubt that's half story considering magnitude of performance loss. also, why have unwind stack if exception being caught in same function. why case still equally slow? could please explain going on in simple terms?

I cannot use string And CString class in MFC -

i wanted use cstring class in mfc but couldn't i don't know why cstring undefined i'm using visual studio 2015 please me http://i.imgur.com/mewjznd.png?1 here code you have typo: should use cstring not cstring

Lg 3g saving audio file as video (android 5.1) -

trying save audio file in lg g3 running android 5.1 results in saving video file instead of audio file. appreciate if can solve issue me. private void startrecording() { mrecorder = new mediarecorder(); mrecorder.setaudiosource(mediarecorder.audiosource.mic); mrecorder.setoutputformat(mediarecorder.outputformat.three_gpp); mrecorder.setoutputfile(audiofilepath); mrecorder.setaudioencoder(mediarecorder.audioencoder.amr_nb); try { mrecorder.prepare(); } catch (ioexception e) { log.e("record", "prepare() failed"); } mrecorder.start(); } you can visit links problem, link1 or link2 . and if want audio in actual mp3 codec need use 3rd party lib link3 .

javascript - Intance and prototype in one line of code -

sample code set situation: function parent() { //code } function child() { //code } child.prototype = object.create(parent.prototype); var objchild = new child(); is possible write last 2 lines in one? edit: came mind while writing kind of code repeteadly. i'm not after specific thing here. wanted know if possible. you wrap in function , pass parent class. function parent() { //code } function child(parentclass) { function childobj() { } childobj.prototype = object.create(parentclass.prototype); return new childobj(); } var objchild = child(parent);

django - Form Wizard: Redirecting back to a previous step when validation fails -

i have implemented wizard consist of 4 forms.however need put check on variable true go next step else go previous step. inside process step:- def process_step(self, form): """ can save form here, since it's guaranteed valid """ guest_user = false if self.steps.current == "step1": step1_data = self.get_form_step_data(form) if self.steps.current == "step2": step2_data = self.get_form_step_data(form) if self.steps.current == "step3": step3_data = self.get_form_step_data(form) if self.steps.current == "step4": step4_data = self.get_form_step_data(form) inv_data = check_inventory_for_cart_items(self.request) # @ point want redirect step3 if not inv_data[0] == true: messages

json - Get 403 error message when using Google custom search API -

i'm getting message when using google custom search api. got both api key (server , browser) , search id . why says usagelimits? constraints 100 queries per day, ran program way less 100 times.... where going wrong... please help!! "error": { "errors": [ { "domain": "usagelimits", "reason": "iprefererblocked", "message": "there per-ip or per-referer restriction configured on api key , request not match these restrictions. please use google developers console update api key configuration if request ip or referer should allowed.", "extendedhelp": "https://console.developers.google.com" } ], "code": 403, "message": "there per-ip or per-referer restriction configured on api key , request not match these restrictions. please use google developers console update api key configuration if request ip or referer should allowed.&

javascript - Angular-google-maps passing information from info window to parent scope -

is possible? having poured on documentation, there extremely few, if any, work arounds call functions outside of scope of marker. hope add ng-click features, given div inside infowindow ng-non-bindable, prevents implementing directives. if there isn't work around, know if can use standard javascript google maps package inside angular application , support jquery? p.s. if has figured out way stylize info window, please let me know. has been frustrating. my goal like: <ui-gmap-google-map center="map.center" zoom="map.zoom" options="map.options"> <ui-gmap-markers models="appfact.getlist()" coords="'self'" icon="'icon'" click="'onclick'" options="'options'"> <ui-gmap-windows show="show"> <div ng-non-bindable> <h5><strong>{{name}}</strong></h5> <h5><strong>{{address}}<

javascript - Sails.js Increment Attribute -

i'm using sails.js, , trying increment attribute in model 1 when function called. works , increments , return json value 1, never saves database, when make request later, value still 0. function: addvote: function (req, res, next) { nomination.findone(req.param('id'), function foundnomination(err, nom) { if(err) return next(err); if(!nom) return next(); nomination.update(req.param('id'), { votes: nom.votes++ }) return res.json({ votes : nom.votes }); }); }, edit: now weird. must scoping issue. when change code this, console outputs 0 1. if take out second console.log, outputs 1... addvote: function (req, res, next) { var newvotes = 0; nomination.findone(req.param('id'), function foundnomination(err, nom) { if(err) return next(err); if(!nom) return next(); nom.votes++; newvotes = nom.votes; console.log(newvotes); }); console.log(newv

html5 - How to create a static website in Indian(Marathi) language using Devnagri script? -

to start want create 3-4 pages in marathi language. not want use dynamic content using java/php. need sample code , tell me libraries use. many news websites created in marathi/hindi(indian) languages. idea use , how create webpages in indian language? please help. you can use marathi font downloading in net , create css: @font-face { font-family:tamil_font; src:url('font/thenmoli.ttf'); } and use font-family in style element

css - jQuery(document).ready(function(){ isn't waiting for Background Image to load first before Fadein -

i'm having trouble jquery(document).ready(function(){ - issue it's not waiting background image load first before fading in when clear cache. happens there's delay before wrapper fades in image visibly scaling down screen loads. i'm building headway themes on wordpress. it's making me go insane :) css: @-webkit-keyframes fade-in { 0% { opacity: 0; } 100% { opacity: 1; } } .background-image { background: url('http://www.aliceandowl.com/wp-content/uploads/2015/03/purity-london-homepage-banner.jpg') no-repeat center center fixed; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover; position: absolute; top: 0; right: 0; bottom: 0; left: 0; opacity: 0; -webkit-animation-name: fade-in; -webkit-animation-duration: 1s; -webkit-animation-timing-function: ease-in; -webkit-animation-iteration-count: 1; -webkit-animation-delay: 2s; -webkit-animation-fill-

Use AngularJS Variable, where another AngularJS Variable matches its ID -

i have ng-repeat statement want show image. image however, should chosen ng-repeat's id matches image object's id. i unsure of how properly, here psuedo code of trying do. <tr ng-repeat="user in rosterdata | orderby:'name'"> <img ng-src="{{champion.imagename user.id = champion.id}} /> </tr> remember champion.id object of champions, want make sure right champion.name match right champion.id when matches current ng-repeat user.id it better if check logic inside controller: <tr ng-repeat="user in rosterdata | orderby:'name'"> <img ng-src="{{getimage(user.id)}} /> </tr> in controller: $scope.getimage = function(userid) { var image = "defaultimage"; $scope.champions.foreach(function(champion) { if(champion.id===userid) { image = champion.image; } }); return image; }

email - send data grid view data in an e-mail using vb.net -

i'm trying send datagridview (or data in grid) e-mail receive blank e-mail when it's sent, got ideas how fix it? code im using this: try smtp.usedefaultcredentials = false smtp.credentials = new net.networkcredential("[e-mail address im sending from]", "[password e-mail]") smtp.port = 25 smtp.enablessl = true mail = new mailmessage mail.from = new mailaddress("[e-mail im sending from]") mail.to.add(useremail.text) mail.body = datatab.tostring mail.subject = "biology quiz highscores" smtp.deliverymethod = smtpdeliverymethod.network smtp.send(mail) msgbox("e-mail sent to: " & useremail.text & "") catch ex exception msgbox("unable send e-mail. please try again later.") end try im getting data 2003 access database using mydataadpter sql statement, data table variable called datatab.

php - Use of ' in SQL statement -

i doing php; found following code works function get_total_urls() { $total = mysql_query('select count(`url_key`) `urls`'); return (int)mysql_result($total, 0); } get_total_urls(); but following code shows warning function get_total_urls() { $total = mysql_query("select count('url_key') 'urls'"); return (int)mysql_result($total, 0); } get_total_urls(); shows following warning: warning : mysql_num_rows() expects parameter 1 resource, boolean given. please help; why 2nd code shows warning 1st code ok? 2nd code fails count of 'url_key' database table. is there anyway write first code without back-tick , work perfectly? this statement: $total = mysql_query('select count(`url_key`) `urls`'); in mysql, backticks used delimit identifiers -- when conflict reserved words or contain unseemly characters (such spaces, periods, commas, , on). because idea have identifiers not conflict reserve

Why is bluetooth not supported in Android TV SDK? -

what rationale bluetooth not being supported on android tv? nexus tv has bluetooth 4.1 radio. connects accessories via bluetooth. according "unsupported tv features" section in "handling tv hardware" documentation bluetooth listed not supported. https://developer.android.com/training/tv/start/hardware.html i'd build app allows end user synchronize iot device android tv. 1 of challenges of iot systems making synchronization of data friction-less possible. using android tv device that's in living room, user need have iot device in living room synchronize. for current (2017) android tv, bluetooth supported, stated page linked above. apparently, page used state bluetooth not supported incorrect , fixed in 2015; ref: https://github.com/aosp-exynos4/android_frameworks_base/commit/c283670669b9510638ef4089eded8597576c1e44 please note not link 'official' change log linked website source not publicly available afaik , there's no wa

Can I mix MySQL APIs in PHP? -

i have searched net , far have seen can use mysql_ , mysqli_ meaning: <?php $con=mysqli_connect("localhost", "root" ,"" ,"mysql"); if( mysqli_connect_errno( $con ) ) { echo "failed connect"; }else{ echo "connected"; } mysql_close($con); echo "done"; ?> or <?php $con=mysql_connect("localhost", "root" ,"" ,"mysql"); if( mysqli_connect_errno( $con ) ) { echo "failed connect"; }else{ echo "connected"; } mysqli_close($con); echo "done"; ?> are valid when use code is: connected warning: mysql_close() expects parameter 1 resource, object given in d:\************.php on line 9 done for first , same except mysqli_close() . second one. what problem? can't use mysql_ , mysqli together? or normal? way can check if connections valid @ all? (the if(mysq...) ) no, can't use mysql , mysqli toget

html - Creating a button that links to the host root -

i have config page (/config) couple of inputs, , want "back"-arrow @ bottom, points startpage i found out can wrap button in a-tag create link (it works on startpage as <a href="/config" class="link"><button class="control link">conf</button></a> ) but inside config page, <a href="/" class="link"><button class="control backlink">back</button></a> doesn't work, , don't know why. statusbar shows link correctly, when click, nothing happens. if click on outermost edge of element (just 1px outside button-image), work, guess there's wrong wrapping button a. strangely work on startpage. can explain please? you can try below like <a href="www.yoursite.com" class="link"><button class="control backlink">back</button></a> replace / page link. may www.yoursite.com/index.html

java - Is it possible to selectively style the contents of a TableCell in JavaFx? -

Image
i've tableview contents needs styled using different colors, possible achieve same in javafx. here example program import javafx.application.application; import javafx.beans.property.simplestringproperty; import javafx.collections.fxcollections; import javafx.collections.observablelist; import javafx.geometry.insets; import javafx.scene.group; import javafx.scene.scene; import javafx.scene.control.label; import javafx.scene.control.tablecolumn; import javafx.scene.control.tableview; import javafx.scene.control.cell.propertyvaluefactory; import javafx.scene.layout.vbox; import javafx.scene.text.font; import javafx.stage.stage; public class tableviewsample extends application { private final tableview<person> table = new tableview<>(); private final observablelist<person> data = fxcollections.observablearraylist(new person("jacob smith", "jacob.smith@example.com"), new person( "isabella johnson", "isabella

sql - Stored procedure to insert a list of different types of items in to a table -

i have following 2 tables create table orders ( orderid int identity not null, staffid int not null, totalprice money not null, orderdatetime datetime not null primary key (orderid), foreign key (staffid) references staff(staffid) ) create table orderdetails ( orderdetailid int identity not null, orderid int not null, itemid int, extrasid int, itemquantity int, extrasquantity int primary key (orderdetailid) foreign key (orderid) references orders(orderid), foreign key (extrasid) references extras(extrasid), foreign key (itemid) references item(itemid) ) i create stored procedure create new order inserting data in both tables. procedure should take parameters staffid, totalprice , bought products. products can many items, many extras or both. is there way can have list of itemid's , list of extrasid's parameters inserted in orderdetails table correctly? create type first create type dbo.ty_product_orders table ( itemid int ,extrasid int ,i

php - Is this function vulnerable to SQL injection? -

i built function check if table exists on database using pdo, i'm not sure if i've secured properly. public function tableexists($table){ try{ $this->query('select 1 `'.str_replace('`', '', $table).'` limit 1'); }catch(\pdoexception $e){ if($e->errorinfo[1] == 1146){ return false; } throw $e; } return true; } is possible attacker compromise query if $table provided directly user input? (extreme case) no, code not vulnerable sql injection attack however, perhaps more fluke else. to handle user-provided values correctly, 1 wish escape characters have special meaning (rather remove them). documented under schema object names : identifier quote characters can included within identifier if quote identifier. if character included within identifier same used quote identifier itself, need double character. following statement creates table named a`b contains c

java - What is a NullPointerException, and how do I fix it? -

what null pointer exceptions ( java.lang.nullpointerexception ) , causes them? what methods/tools can used determine cause stop exception causing program terminate prematurely? when declare reference variable (i.e. object) creating pointer object. consider following code declare variable of primitive type int : int x; x = 10; in example variable x int , java initialize 0 you. when assign 10 in second line value 10 written memory location pointed x. but, when try declare reference type different happens. take following code: integer num; num = new integer(10); the first line declares variable named num , but, not contain primitive value. instead contains pointer (because type integer reference type). since did not yet point java sets null, meaning "i pointing @ nothing". in second line, new keyword used instantiate (or create) object of type integer , pointer variable num assigned object. can reference object using dereferencing operator . (a dot

c++ - Using overloaded operator+ without assingment -

i have simple(not simple) question: possibility overloaded operator+ working not want when won't use assingment overloaded operator? example: object a, b, c; //here code add numbers object , b; c=a+b; cout << c; and thing is: when i'm using overloaded assingment operator, fine. without this, elements in c gets random numbers. why? and question: why can't overloaded << , + operators: cout << a+b; edit: here code: #include <iostream> #include <cstdio> using namespace std; class list; class element{ private: int number; element* next; friend class list; friend ostream & operator<<(ostream &, list &); public: element(int data){ number=data; } int getdata(){ return number; } }; class list{ private: element* head; int size; friend ostream & operator<<(ostream &, list &am

sql server - use outer apply to find for each row have a record based on first result from detail table -

i have 2 tables; problem problem (as master) group of problem , problem_log (as detail) problem problem_id problem pgroup 1 line down network 2 node down network 3 hardware error hardware 4 pm hardware 5 disk error hardware problem_log term problem down_date s1dip0314 service 15-03-26 s1dip0314 pm 15-01-01 s1dip0314 service 15-01-02 s1dip0314 disk error 15-01-06 s1dip0314 hardware error 15-01-28 at first find term have problem = 'pm' (in case use dateadd+7 days) select term,problem,down_date [problem_log] problem = 'pm' but problem when find problem = 'pm' date have pm + 7 days have other pgroup = 'hardware' or not example there more 1 problem within 7 days there 'disk error' result should this term problem d

jquery - Animate.css issue: The page becomes super large -

i'm using animate.css animate elements, , class fadeinright , fadeinleft , second before animation completed bottom scroll bar appears (just fraction of second). i have been using stylesheet while , first time happens. tried function: $(function(){ var width = window.innerwidth $(body).css('max-width',width)}); but doesn't fix anything. you can use body { overflow-x:hidden;} you can use {position:relative; overflow-x:hidden} on parent element contains animations work around issue described above.

ruby on rails - My forum is not updating the table? -

i trying update table using fourm :- <div class="row"> <div class="col-md-6 col-md-offset-3"> <%= form_for message.new |f| %> <%= f.label :to %> <%= f.email_field :to, class: 'form-control' %> <%= f.label :subject %> <%= f.text_field :subject, class: 'form-control' %> <%= f.label :content %> <%= f.text_area :content, class: 'form-control' %> <%= f.submit "log in", class: "btn btn-primary" %> <% end %> </div> </div> and in controller have done :- def create @message = message.new(user_params) redirect_to root_url end def user_params params.require(:message).permit(:to, :subject, :content) end but when check table, there no update . where going wrong ? table have 2 more attributes , not filling them forum . .new builds new object, nee

linux - Which section does objdump disassemble by default -

i building bare metal executeable, contains special sections containing code. however, when objdump -d code .text , .init.text sections. manpage objdump says "only disassembles sections expected contain instructions" when using -d option. sections these, , how objdump tell sections decode? know can use -d option full decoding of sections, more need. objdump internally uses libbfd section information. objdump passes callback bfd_map_over_sections() calls callback on each section. when called, libbfd passes asection * callback, has member type . if type contains flags sec_contents | sec_code gets disassembled objdump when -d option passed. getting libbfd quite harder, expect type detection depends on architecture, hope gave @ least right pointer. (probably when having more time i'll dig more , extend answer).. btw, if need script filter out sections of interest objdump -d might use sed , this: # ------------place section names here ---

sql - Group by query advise -

in sql server, having table product below manf prod id desc audi a1 1 tyre tye 1 audi a1 2 tyre type 2 audi a1 3 tyre type 3 bmw b1 4 tyre tye 1 bmw b1 5 tyre type 2 bmw b1 6 tyre type 3 toyota t1 7 tyre type 1 i want output group columns of manf , prod id should of values.. kindly advise query.. manf prod id audi a1 1 bmw b1 4 toyota t1 7 select manf, prod, min(id) id your_table group manf, prod

c - Excevp into array to be used later -

i using execvp find files. code using: char *argv1[] = {"find", "-name", "*.jpg", null}; execvp("find",argv1); i wondering there way store/hold results execvp array later user? there way can desired file instead of whole path? this readdir() functoin. static void list_dir (const char * dir_name) { char *arrayfiles[100]; dir * d; /* open directory specified "dir_name". */ int = 0; d = opendir (dir_name); /* check opened. */ if (!d) { fprintf (stderr, "cannot open directory '%s': %s\n", dir_name, strerror (errno)); exit (exit_failure); } while (1) { struct dirent * entry; const char * d_name; /* "readdir" gets subsequent entries "d". */ entry = readdir (d); if (! entry) { /* there no more entries in directory, break out of while loop. */ break; } d_name = entry->d_name; if ((strstr(

xcode swift am/pm time to 24 hour format -

i trying convert am/pm format time 24 hour format time 6:35 pm 18:35 i tried piece of code on playground doesnt seem work if put time alone let dateasstring = "02/12/15, 6:35 pm" let dateformatter = nsdateformatter() dateformatter.dateformat = "hh" let date = dateformatter.datefromstring(dateasstring) //returns nil does know how accomplish this? thank you. just convert date using nsdateformatter , "h:mm a" format , convert string using "hh:mm" format. check out date formatting guide familiarize material. let dateasstring = "6:35 pm" let dateformatter = nsdateformatter() dateformatter.dateformat = "h:mm a" let date = dateformatter.datefromstring(dateasstring) dateformatter.dateformat = "hh:mm" let date24 = dateformatter.stringfromdate(date!)