Posts

Showing posts from March, 2010

reporting services - RowNumber for group in SSRS 2005 -

Image
i have table in ssrs report displaying group, not table details. want find out row number items being displayed can use color banding. tried using "rowcount(nothing)", instead row number of detail table. my underlying data rowid team fan 1 yankees john 2 yankees russ 3 red socks mark 4 red socks mary ... 8 orioles elliot ... 29 dodgers jim ... 43 giants harry my table showing groups looks this: rowid team 2 yankees 3 red socks 8 orioles 29 dodgers 43 giants i want like rowid team 1 yankees 2 red socks 3 orioles 4 dodgers 5 giants you can runningvalue expression, like: =runningvalue(fields!team.value, countdistinct, "dataset1") dataset1 being name of underlying dataset. consider data: creating simple report , comparing rownumber , runningvalue approaches shows runningvalue gi

Are Twitter Bootstrap themes interchangeable with Wordpress themes? -

are twitter bootstrap themes interchangeable wordpress themes? how install twitter bootstrap theme onto wordpress website? no, twitter bootstrap framework used make development time of websites faster , easier starting off stylesheets grids, buttons, tabs, etc. the twitter bootstrap can used make wordpress theme, not directly one.

objective c - iOS: Zoom in/out animation for showing an UIView -

i have 1 view controller, have 2 buttons. clicking on 1 button, i'll show uiview (size: 900 * 600) programmatically. right now, view comes clicking on button action. but, want have view coming if kind of "zoom in" animation , show user, , when user closes view, go "zoom out" , removed parent view. could please suggest me, how can achieve animation? thanks. the property transform animatable. create cgaffinetransformmakescale destination scale factor, , set view.transform = scaletransform; inside animation block.

asp.net mvc 4 - .Net MVC - Display "session expired" only for private pages -

i'm developing .net mvc 4 application needs show message "session expiration" user if performs action after session timeout. i'm using forms authentication long timeout , sesion shorter timeout, can know if session expired or it's new visitor. web.config section that: <authentication mode="forms"> <forms loginurl="~/login" timeout="10080" defaulturl="~/index" /> </authentication> <sessionstate mode="inproc" timeout="20" /> as said, that's differentiate new visitor session timeout, , not necessary application itself. can changed if same result can achieved else. with in web.config, can following in global.asax: protected void session_start(object sender, eventargs e) { //if it's new session , user authenticated, it's session timeout if (request.isauthenticated) { if (request.requestcontext.httpcontext.request.isajaxrequest()) {

xcode - iOS SDK - Correct methodology in making connections with an outlet? -

i know if use @interface tpn : uiviewcontroller{ iboutlet uiview *testview; } @property (strong, nonatomic) iboutlet uiview *testview; i know first 1 private variable accessed within class. , second 1 "@property" able accessed instantiated object. find odd in tutorials people tend set properties when changing outlet within class itself. there guideline should following? you no longer need specify ivar @ all. nor there need use @synthesize. use property, make sure weak, not strong @interface tpn : uiviewcontroller @property (weak, nonatomic) iboutlet uiview *testview; in implementation can access ivar _testview. for private property (above public) instead put @property within category in implementation file: #import "tpn.h" @interface tpn () @property (weak, nonatomic) iboutlet uiview *testview; @end @implementation tpn ....

Webkit: CSS3 2D transform Scale + cubic bezier issue (when argument > 1) -

i wanted create "bouncy" animation element using: div{ -webkit-transform:scale(0); -moz-transform:scale(0); -ms-transform:scale(0); -webkit-transition:all 0.4s cubic-bezier(0.57, 0.07, 0.44, 2); -moz-transition:all 0.4s cubic-bezier(0.57, 0.07, 0.44, 2); -ms-transition:all 0.4s cubic-bezier(0.57, 0.07, 0.44, 2); } div.fire{ -webkit-transform:scale(1); -moz-transform:scale(1); -ms-transform:scale(1); } fairly simple. using scale transform, hide element (or scale down whatever want). assign transition property using cubic-bezier last argument 2 (see curve here: http://cubic-bezier.com/#.57,.07,.44,2 ) then, on second stage (could on hover or activated else, 'fired' class) scale 100%. the expected behaviour using cubic-bezier() scale() property grows past 1 , comes 1, creating "bounce" effect. works other properties (such padding , left , margin ) not scale transform. this doesn't happen on chrome (28.0.1500.71 m, windo

jquery - HTML5 datalist - simulate a click event to expose all options -

i trying automatically show options of datalist html5 element user when button clicked bringing input element focus. normally, options shown when user clicks on associated text input element twice. programmatically simulate behavior user can see options before start typing. i have tried simulating clicks , double clicks getting focus using $('#text-input').focus(); (this works) , using jquery .click() (once , twice), .dblclick() , .trigger('click') , using jquery.simulate.js. of these trigger $('#text-input').click(function() {...}); not affect state of visible input element in browser. here html: <!doctype html> <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script> <script type="text/javascript" src="test.js"></script> </head> <body> <div id="main"> <form> <d

css - Web app: something wrong with paths? -

for reasons seems web app has wrong paths. i've following path web-inf in eclipse: project --src -- main --webapp --web-inf --jsp --css i created project using spring, hibernate , maven. but example doesn't work , doesn't load styles jsp pages: <link href="css/style.css" rel="stylesheet" type="text/css"> the welcome page , error page web.xml not work too: <welcome-file-list> <welcome-file>/students</welcome-file> </welcome-file-list> <error-page> <exception-type>java.lang.exception</exception-type> <location>/web-inf/jsp/error.jsp</location> </error-page> the result error page message "the website cannot display page" browser. if remove error-page configuration stacktrace, means in way configuration used, wrong in interpreting paths. what may wrong? the welcome file wrong. not

Android add fragments to end of FragmentStatePagerAdapter -

i want adapter add page each time reaches last page. here code tried using: static int items = 2; public static class myadapter extends fragmentstatepageradapter implements onpagechangelistener{ public myadapter(fragmentmanager fragmentmanager) { super(fragmentmanager); } @override public int getcount() { return items; } @override public fragment getitem(int position) { if (position >= items-1) { items++; notifydatasetchanged(); } fragment f = reviewfragment.init(position); return f; } i suggest this: public static class myadapter extends fragmentstatepageradapter implements onpagechangelistener{ public myadapter(fragmentmanager fragmentmanager) { super(fragmentmanager); } @override public int getcount() { return integer.max_value;; } @override public fragment getitem(int position) {

java - ConcurrentModificationException when invoking putAll -

i have difficulties in understanding following error. suppose have class in implement following method: map<double,integer> get_friends(double user){ map<double,integer> friends = user_to_user.row(user); //friends.putall(user_to_user.column(user)); return friends;} then in main following: a obj = new a(); map<double,integer> temp = obj.get_friends(6); well works fine. when uncomment follwing line in class a: friends.putall(user_to_user.column(user)); and run again program, crashes , throws me concurrentmodificationexception. noted, creating table user_to_user follows: private hashbasedtable<double,double,integer> user_to_user;// user_to_user = hashbasedtable.create(); what further surprising when interchange way filling friends, mean in way: map<double,integer> friends = user_to_user.column(user); friends.putall(user_to_user.row(user)); then everyting work fine. idea ? the issue hashbasedtable internally implemented ma

C++ with curl using netbeans -

i need write c++ code download webpage, know need curl, im using mac osx have libcurl in /usr/include/curl. when compile code error : #include <stdio.h> #include <curl/curl.h> int main(void) { curl *curl; curlcode res; curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, curlopt_url, "http://example.com"); /* example.com redirected, tell libcurl follow redirection */ curl_easy_setopt(curl, curlopt_followlocation, 1l); /* perform request, res return code */ res = curl_easy_perform(curl); /* check errors */ if(res != curle_ok) fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res)); /* cleanup */ curl_easy_cleanup(curl); } return 0; } here error: "/usr/bin/make" -f nbproject/makefile-debug.mk qmake= subprojects= .clean-conf rm -f -r build/debug rm -f dist/debug/gnu-macosx/cppapplication clean successful (total time: 54ms) undefined symbols ar

.net - C# TLS 1.1 Implementation -

for time i've been bit desperately trying implement tls 1.1 in application. reason behind usage of sockettype.raw sockets, no sslstream or other higher-level classes available me. so far i'm stuck @ finished message in tls handshake protocol - keep on receiving bad_record_mac(20) in server response. cipher suite 0x0005 - tls_rsa_with_rc4_128_sha. here's sample code on what's happening: byte[] client_random, server_random = new byte[28]; byte[] pre_master_secret, master_secret; byte[] client_write_mac_secret, server_write_mac_secret, client_write_key, server_write_key; byte[] handshake_messages, verify_data; rsacryptoserviceprovider rsa; list<x509certificate2> certificates = new list<x509certificate2>(); //certificates added rsa = (rsacryptoserviceprovider)certificates.first().publickey.key; private byte[] clientkeyexchange() { pre_master_secret = new byte[48]; (new random()).nextbytes(pre_m

JBOSS 5 SQL Server nested Exception -

this situation. have application running on 2 servers 24/7 in client side: application server: tomcat + jboss 5 database server: sql server 2008 r2 lately encounter error whereby every thursday morning 6am jboss hit error: com.microsoft.sqlserver.jdbc.sqlserverexception: connection reset peer: socket write error @ com.microsoft.sqlserver.jdbc.sqlserverconnection.terminate(sqlserverconnection.java:1368) @ com.microsoft.sqlserver.jdbc.sqlserverconnection.terminate(sqlserverconnection.java:1355) @ com.microsoft.sqlserver.jdbc.tdschannel.write(iobuffer.java:1548) @ com.microsoft.sqlserver.jdbc.tdswriter.flush(iobuffer.java:2368) @ com.microsoft.sqlserver.jdbc.tdswriter.writepacket(iobuffer.java:2270) @ com.microsoft.sqlserver.jdbc.tdswriter.endmessage(iobuffer.java:1877) @ com.microsoft.sqlserver.jdbc.tdscommand.startresponse(iobuffer.java:4403) @ com.microsoft.sqlserver.jdbc.sqlserverpreparedstatement.doexecutepreparedstatement(sqlserverpreparedstatement.java:386) @ com.microsof

mysql - Delete from 'table2' where column = 'value' IF column in 'table1' = 'value' -

i trying execute mysql query delete rows 'table2' column = 'value' if column in 'table1' = 'value' i have 2 tables... table 1 called 'accounts' table 2 called 'inventoryitems' the column in question 'accounts' called 'banned' column in question 'inventoryitems' called 'itemid' i delete inventoryitems itemid = 2340000 if... column banned in accounts has value of 1 extra information: you can join table accounts inventoryitems 3rd table called characters . table accounts has columns: id (primary key) , banned . table characters has columns: characterid , accountid ( accountid links id in table accounts ). table inventoryitems has columns itemid , characterid ( characterid links characterid in table characters ) hope helps. delete inventoryitems characterid in (select id characters accountid in (select id accounts ba

javascript - How can I find the width and height of a specific word within a string? -

i'm trying replace specific class-less word, not entire string, form of same height (or font-size) , width. want work if change css. here code: var magicword = "abracadabra"; var width = $('#words').width(); var height = $('#words').height(); var x = width + "px"; var y = height + "px"; $('html').append("<form><input type='text' style='width: "+x+"; height: "+y+"; font-family: courier;'></form>") here updated fiddlicious . figured out myself using replace(). more efficient awarded coveted green check mark. you have have dom identifier word. can change :- <span id ="words">here bunch of <span> abracadabra </span> </span> and javascript var magicword = "abracadabra"; var width = $('#words span').width(); var height = $('#words span').height(); var x = width + "px";

How to generate 256 color palette for Linux terminal in HTML/jquery -

i wish generate color palette used linux terminal on website. i've seen few examples of palette used linux terminal, demonstrated website - http://bitmote.com/index.php?post/2012/11/19/using-ansi-color-codes-to-colorize-your-bash-prompt-on-linux#256%20%288-bit%29%20colors were these colors arbitrarily chosen? or there way me replicate palette. have created jquery function generates rectangles of palette, need know how set color of each rectangle match linux terminal palette. for future reference, here's mapping table. taken micahelliott/colortrans.py # primary 3-bit # equivalent "bright" versions 00 = 000000 08 = 808080 01 = 800000 09 = ff0000 02 = 008000 10 = 00ff00 03 = 808000 11 = ffff00 04 = 000080 12 = 0000ff 05 = 800080 13 = ff00ff 06 = 008080 14 = 00ffff 07 = c0c0c0 15 = ffffff # extended color palette 16 = 000

java - Android Facebook Graph API JSON returns no email -

i'm having issues trying obtain user's email via graphuser api object. i managed obtain firstname, lastname , else not email . i've done research you'll need add permission obtain user's email (login email facebook, not xxx@facebook.com). i'm stuck! how do in android? private class facebooklogindelegateimpl extends facebooklogindelegate { /* * optional callback method */ protected void oncompletedprogress(graphuser user, response response) { log.d("fb userid:", user.getid()); log.d("fb firstname:", user.getfirstname()); log.d("fb lastname:", user.getlastname()); log.d("object:", user.tostring()); log.d("response:", response.tostring()); //log.d("fb email:", (string) user.asmap().get("email")); string userid = user.getid(); string firstname = user.getfirstname(); string lastna

javascript - What is wrong with the handlebar code? -

hey trying switch underscore handlebar, nothing rendering model, templates changing correctly. also, when edittemplate shows clicking edit button #{firstname} , others show undefined. in layout jade file include appropriate files, jquery, underscore,backbone , handlebar. here main.js file (function () { window.app = { models: {}, collections: {}, views: {}, // templates: {}, router: {} }; // model app.models.user = backbone.model.extend({ defaults: { firstname: 'first', lastname: 'last', email: 'email', phone: '222', birthday: 'date' }, validate: function (attrs) { if (!attrs.firstname) { return 'you must enter real first name.'; } if (!attrs.lastname) { return 'you must enter real last name.'; }

java - Make javah ignore inner classes when generating JNI headers? -

exactly title says. i have class declares native methods, has couple of inner classes. javah utility insists on generating separate headers inner classes even though don't have native method declarations . there way force javah stop doing (annotations, secret command-line switches, anything)? i don't know way that. (i use oracle jdk.) i understand annoyance problem limited unnecessary files , unnecessary regeneration (outer class changes result in rewriting useless header files inner classes). to solve problem, delete empty header files. use ant, since available generic project builder step in eclipse. <?xml version="1.0" encoding="utf-8"?> <project name="javah"> <mkdir dir="javah" /> <javah classpath="bin" destdir="javah"> <!-- list classes here --> <class name="com.example.outer" /> <class name="com.example

javascript - jQuery input forms issue -

i'm working on input forms in javascript, , i've edited script once user enters number of forces problem, new input text fields show per number, there button added @ end of that. issue when try , click button, try , use .map function start text field values , nothing happening. function forcerecording(numofforces,$this){ var addrows='<tr id=newrows>'; for(var =1; i<=numofforces;i++) { var neartr=$this.closest('tr'); addrows=addrows + "<td>force " +i+": </td><td><form><input type='text' name='forceitem' id='newr'/></form></td>"; } addrows=addrows+"<td><div class='button' id='forcebutton'> add! </div></td></tr>"; neartr.after(addrows); }; $('#forcebutton').click(function(){ forces=$("input[id='newr']").map(function(){ return $(this).v

google glass quickstart for python -

Image
i having trouble getting quickstart working properly. new python , gae , not full-time programmmer, have developed before. however, have python 2.7 , gae installed (win7), quickstart not tell me in app directory put generated "session.secret" file. put in app root "mirror-quickstart-python" folder. when try run app on dev webserver via gae launcher, throws errors (log shown below). i have deployed sample app (guestbook), here: http://smlqadtest.appspot.com/ think close. far in python, had learn jinja2, pip, distribute_setup.py, , bunch of other stuff. looks needs pil, too, on win64 there seems issues witch lead me down rathole. not sure need that. anyway, i'd love on getting going! thanks! scott =========gae launcher log console output=========== 2013-07-07 22:47:50 running command: "['c:\\python27\\python.exe', 'c:\\program files (x86)\\google\\google_appengine\\dev_appserver.py'​, '--skip_sdk_update_check=yes', '--por

java - Get unique integer value from string -

i have different unique strings in same format. string looks axf25!j&809>-11~dc , want unique integer value string. each time value must same , depends on string. i've tried convert each char of string int , sum chars each other. in case if have 2 strings same set of symbols, return integer values equal each other. doesn't suit me. how can generate unique integer value unique string? update: having considered given solutions decided create function generate unique integer values. hope excludes collisions. public int getuniqueinteger(string name){ string plaintext = name; int hash = name.hashcode(); messagedigest m; try { m = messagedigest.getinstance("md5"); m.reset(); m.update(plaintext.getbytes()); byte[] digest = m.digest(); biginteger bigint = new biginteger(1,digest); string hashtext = bigint.tostring(10); // need 0 pad if want full 32 chars. while(hashtext.length()

What command means "do nothing" in a conditional in BASH? -

sometimes when making conditionals, need code nothing, e.g., here, want bash nothing when $a greater "10", print "1" if $a less "5", otherwise, print "2": if [ "$a" -ge 10 ] elif [ "$a" -le 5 ] echo "1" else echo "2" fi this makes error though. there command nothing , not slow down script? the no-op command in shell : (colon). if [ "$a" -ge 10 ] : elif [ "$a" -le 5 ] echo "1" else echo "2" fi from bash manual : : (a colon) nothing beyond expanding arguments , performing redirections. return status zero.

Sending strings and File from Android Client to C# server -

i trying send files bunch of strings android client c# server. strings, among other things, contain details regards file being sent eg: file size, file name, etc. issue having file bytes not received original file cannot reconstructed @ destination though can retrieve strings. my c# server code while (true) { socket socket = listener.acceptsocket(); setstatus(socket.remoteendpoint + " connected"); try { // open stream networkstream stream = new networkstream(socket); system.io.streamreader sr = new streamreader(stream); //get string data //******************************************** teststr = sr.readline(); setstatus(teststr); filesize = sr.readline(); long filesizelong = convert.toint64(filesize); int length = (int)filesizelon

c++ - How to WriteConsoleInput to the a child app waiting at ReadConsoleInput? -

so have been attempting read , write pianobar (console pandora player) stdin , stdout control within application. however, when reading stdout blocks @ last line (where displays time of song). i thought doing wrong (probably still am) downloaded demo project sending/receiving input applications stdin/stdout via couple handles. so dove pianobar code, , put in printf commands on place trace block occurring (is block right word this?) anyways section of code appears loop extremely when created child process, , blocks stdout. from pianobar, ui_readline.c barreadline replacement /* readline replacement * @param buffer * @param buffer size * @param accept these characters * @param input fds * @param flags * @param timeout (seconds) or -1 (no timeout) * @return number of bytes read stdin */ size_t barreadline (char *buf, const size_t bufsize, const char *mask, barreadlinefds_t *input, const barreadlineflags_t flags, int timeout) { // took out code here .

c++ - Why doesn't need to malloc struct tm pointer before call localtime() function? -

my code is #include <iostream> #include <ctime> using namespace std; void main() { time_t nowtime; struct tm *nowstruct; time(&nowtime); nowstruct = localtime(&nowtime); cout << nowstruct->tm_hour << ":" << nowstruct->tm_min << endl; } i suspect address of memory used store struct tm. localtime uses internal, global buffer (or perhaps thread-local), address returns. practice of keeping global state around similar how strtok , rand work. note makes function inherently non-rentrant, , perhaps thread-unsafe.

SignalR Method Calls - Faster than Conventional AJAX Calls? -

if web application has number of regular ajax methods in it, i've introduced always-on signalr connection, worth refactoring make regular ajax methods hub methods instead? faster since it's using already-there connection? imho misuse of signalr. would faster? depends on several factors. first of which transport ends being used. if it's web sockets, then, yes, because message sent on connection that's guaranteed established, if it's sse or longpolling you're still doing plain old http post every time send messages. second factor if server allowing keep-alive connections, browsers keep open tcp connections server period of time between requests anyway there no overhead in terms of establishing connection anyway. also, let's not forget our powerful friend verb , goodness brings in terms of 1 of important features of web: caching. if have lot of cacheable data, wouldn't want sending real-time messages on web sockets fetch , retrieve becau

iphone - IOS: Clear Previous content in Modal viewcontroller -

in application, have used 1 modal viewcontroller contains 1 tableview multiple textfields. say main viewcontroller called sridharviewcontroller , modal viewcontroller called resultsviewcontroller there 1 button in sridharviewcontroller , touching button open modal(resultsviewcontroller) [self presentmodalviewcontroller:resultsviewcontroller animated:yes]; and in results view controller , there many text fields aligned in tableview. , 1 'ok' button . pressing 'ok' button dismiss modal [self dismissmodalviewcontrolleranimated:yes]; - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { nslog(@"cellforrowatindexpath called"); static nsstring *cellidentifier = @"cell"; uitableviewcell *cell = [tableview dequeuereusablecellwithidentifier:cellidentifier]; if (cell == nil) { cell = [[[uitableviewcell alloc] initwithstyle:uitableviewcellstyledefault reuseidentifier:cell

Query result in codeigniter save in session display different results when used in controller functions using var_dump -

i have used codeigniter session save result database query in model, first time have used var_dump function view result save in session variable , it's okay used thesame session display result other function in controller display last row of result not results save in session. **students controller** function get_student(some parameters) { $print_result= $this->course_booking_model->get_student_ajax($config["per_page"],$page,$result,$tennant_id,$sort_by,$sort_order); $this->session->set_userdata('print_result',$print_result); $data['data_student'] = $this->session->userdata('print_result'); var_dump($this->session->userdata('print_result')); } another function within thesame controller function export_students() { $data['data_print']=$this->session->userdata('print_result'); $this->load->view('view_students_pdf',$data); var_dump($this->session->userdata('prin

java - How to redraw opengl renderer after clicking button? -

i'm trying update glulookat() main ui thread of opengl renderer i've tryed requestrenderer() methode @ end of code button eclipes gives me sme errors wondering best possible way main ui thread? heres mainactivity class: public class mainactivity extends activity implements onclicklistener { glsurfaceview oursurface; glrenderer call; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); oursurface = new surfaceview(this); setcontentview(r.layout.activity_main); framelayout v = (framelayout) findviewbyid(r.id.canvas); v.addview(oursurface); } @override public void onclick(view v) { // todo auto-generated method stub switch (v.getid()){ case r.id.pluseyex: break; case r.id.minuseyex: break; case r.id.pluseyey: break; case r.id.minuseyey: break; case r.id.pluseyez: float z =call.geteyez()+1; call.seteyez(z); break; case

Application doesn't work in some Android Devices -

i have samsung galaxy s2 , app works in phone , others else, doesn't work fine on devices galaxy s3 , nexus 4 or nexus 7 , don't know if problem compatibility or resolution, don't know. this android manifest: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.package.name" android:versioncode="4" android:versionname="1.5.2" > <uses-sdk android:minsdkversion="8" android:targetsdkversion="17" /> <uses-permission android:name="android.permission.set_wallpaper"/> <uses-permission android:name="android.permission.wake_lock"/> <uses-permission android:name="android.permission.internet"/> <uses-permission android:name="android.permission.write_external_storage"/> <uses-permission android:name="android.permission.access_network

html5 - How to embedded twitter widget into android phonegap -

i have tried embed twitter widget android apps, timeline not show. blank page when run on android devices. there configuration need make. fyi, using jquerymobile , phonegap make android apps. thank you. edit : this code. copied on official twitter website. paste code inside body tag using html5 make android apps. !function(d,s,id){var js,fjs=d.getelementsbytagname(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getelementbyid(id)){js=d.createelement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentnode.insertbefore(js,fjs);}}(document,"script","twitter-wjs"); there few things may need do. i having issues twitter embedded timeline in phonegap build when on android , ios. in config.xml whitelisted few different domains. <access origin="https://twitter.com" subdomains="true" /&

How to obtain facebook written permission for API usage? -

i'd fetch public facebook events store them in search engine , display them on website (with links towards event on facebook website). i've tried @ t&c see if usage allowed , find passage : "12. must not include data obtained in search engine or directory without our written permission." then, i'd know how obtain facebook written permission store events , include them in our search engine. any clues ? thx,

mysql_num_rows() supplied argument is not a valid mysql result resource in php -

i want insert values usertable in database , if emailid exist don't want details entered in database , return error client side. code inserts values table if emailid exist. my code is <?php $con=mysqli_connect("localhost","username","password","databasename"); // check connection if (mysqli_connect_errno()) { echo "failed connect mysql: " . mysqli_connect_error(); } $result = mysqli_query($con,"select * usertable useremail='name@gmail.com'"); $number_of_rows = mysql_num_rows($result); if ($number_of_rows > 0) { die('this email exists in database'); } else { $sql="insert usertable(username, useremail, usertype) values ('newname', 'name@gmail.com', 'usertypeval' )"; if (!mysqli_query($con,$sql)) { die('error: ' . mysqli_error($con)); } echo "1 record added"; } mysqli_close($con); ?> error: warning